long unsigned int vs. uint32_t again

Andy Koppe andy.koppe@gmail.com
Sun Mar 15 08:32:00 GMT 2009


Chuck wrote:
> cygwin's <inttypes.h> has:
> #define PRIu32 "lu"
>
> and <stdint.h> has
> typedef unsigned int uint32_t;
>
> Is it possible that our inttypes.h should be changed, to use "u" for 8, 16, and 32 bits?

Yep, I'd say so.

> Or is gcc's -Wformat=2 in 3.4.4 just too strict here -- and should be checking
> the actual bitwidths of types against the formats, before assuming that
> "lu" doesn't match uint32_t?

No. "long" and "int" are different types, and ignoring this would just
store up trouble for when code is ported to platforms with 64-bit
longs.

Andy

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/



More information about the Cygwin mailing list