On 07/04/2012 05:50 PM, arcarlini at
iee.org wrote:
Dave McGuire [mcguire at
neurotica.com] wrote:
I work all day, every day, with network
protocols and
binary file formats. On every platform I work on, and indeed every
platform I've *ever* worked on, unsigned short has been 16 bits, and
unsigned int has been 32. That includes the 8-bitters as
well. The idea is good, but the syntactic sugar of excessive
typedefs where they just aren't needed (and portability to
95% of architectures isn't impacted) is just pointless
overcomplexification.
I expect that every platform I've been on "unsigned int" has been
32-bits too,
but uint32_t is pretty intention-revealing: it's not just a random
integer, it's
unsigned and intended to be 32 bits (not just "it happens to be").
Similarly
uint16_t and uint8_t.
Very true; and if K&R had originally specified C's native data types
to explicitly include their size, I'd have no problem with it. My issue
is that I started with C long before these typedefs came into being, and
I just don't like 'em. ;)
-Dave
--
Dave McGuire, AK4HZ
New Kensington, PA