This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: long unsigned int vs. uint32_t again
- From: Andy Koppe <andy dot koppe at gmail dot com>
- To: cygwin at cygwin dot com
- Date: Sun, 15 Mar 2009 08:32:33 +0000
- Subject: Re: long unsigned int vs. uint32_t again
- References: <49BC958D.2080306@cwilson.fastmail.fm>
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/