[Libevent-users] [Patch] Install autoconf header file as evconfig.h

Steven Grimm sgrimm at facebook.com
Fri Feb 16 19:40:28 EST 2007


Dave Gotwisner wrote:
> I personally hate the proliferation of typedefs.  I have seen u8, U8, 
> u_int8, uint8, and many others that all express the same thing. 
> (similarly for 16, 32, and 64 bit sizes).

The lack of a common standard is the problem, IMO, not the existence of 
typedefs per se. The underlying problem is that C doesn't provide any 
built-in portable way of saying you want a data type exactly THIS big, 
short of resorting to structs with bit-counted fields. None of the 
built-in types are required to be a particular size, even if they happen 
to have settled down on particular sizes on present-day architectures. I 
would much rather waste one line of header file somewhere doing a 
seemingly redundant typedef than have my code break on some future 
128-bit machine whose "long" is 64 bits and "long long" is 128. (Heck, 
forget "future" -- such machines exist today!) That would be perfectly 
legal for a C compiler to do. "uint32_t" is much more precise and 
unambiguous than "unsigned long" -- I read that and have no doubt how 
big the author expected the data type to be.

-Steve



More information about the Libevent-users mailing list