u_int32_t vs uint32_t

Torrey Lyons torrey at mrcla.com
Mon Aug 23 21:36:22 PDT 2004


At 11:45 PM -0400 8/23/04, Keith Packard wrote:
>Around 16 o'clock on Aug 23, Alan Coopersmith wrote:
>
>>  So what about just using CARD32 as the rest of the X code does to define
>>  this portably?
>
>That sounds like where we are at this point with the limited abilities of
>imake to accomodate system variance.
>
>I wonder what the US version of this code did; it seems like it built and
>ran nicely on all of the standard platforms...

I think we can have our cake and eat it to. The problem is just that 
we are using a non-standard <sys/types.h> header file for standards 
compliance.

At 10:04 AM -0700 8/23/04, Stuart Kreitman wrote:
>Here is a reference to the C99 standard that uint32_t is preferred:
>
>
>http://www.oreillynet.com/pub/a/network/2003/10/07/michael_barr.html
>
>
>With that I'm putting back the update to Wraphelp.c

If you read the O'Reilly publication to the end you will find, "The 
new C99 standard has made a number of minor improvements to the C 
programming language. Among these, the most important for embedded 
programmers to understand are the contents of the new stdint.h header 
file."

The <stdint.h> header file is where the uint32_t needs to be defined 
according to the standard. On many platforms <stdint.h> will just 
include the same OS specific types in <sys/types.h>, but this is not 
required. What is required to be C99 compliant is that <stdint.h> 
defines these types. Are there any supported platforms where 
<stdint.h> does not work?

--Torrey


More information about the release-wranglers mailing list