u_int32_t vs uint32_t

Stuart Kreitman Stuart.Kreitman at Sun.COM
Mon Aug 23 10:04:03 PDT 2004


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

skk
Matthieu Herrb wrote:

> Stuart Kreitman wrote:
>
>> Matthieu:
>> The editor "fgsch" made the change to u_int32_t in OpenBSD sources
>> in April 2002 with your review.  Jim Gettys picked it up this weekend
>> for the X.ORG next release.
>>
>> We need to explain how the typedefs "u_int32_t" vs "uint32_t" conform 
>> to various
>> standards in ANSI or ISO.  I do not have access to the OpenBSD files, 
>> but include
>> the relevent statements from Solaris:
>
>
> the u_ variants are the traditional types used on BSD systems and 
> defined by including <sys/types.h>.
>
> There is some (limited) previous art of using the u_ types in the X 
> tree, that's why it looked right to me.
>
> Defining a fixed width type in a portable manner can be tricky.
> I'd suggest include the relevant X header and use CARD32 instead of 
> u_int32_t / uint32_t. (Even though CARD32 is normally reserved for the 
> on the wire protocol iirc).
>



More information about the release-wranglers mailing list