This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/5747] C99: Incorrect PRIu8 and PRIu16 in GNU <inttypes.h>


------- Additional Comments From ebb9 at byu dot net  2008-02-15 20:07 -------
The compiler is technically right in warning, but the 'solution' proposed by the
OP is not correct.

When passed through ..., unsigned char promotes to 'int', not 'unsigned int'. 
Likewise for unsigned short, when int is larger than short.  If it were to
matter whether va_arg were handed 'int' vs. 'unsigned int', then PRIu8 and
PRIu16 should technically be "d" rather than "u" to match the type of the
argument promotion being used.  But for all practical implementations, 'int' and
'unsigned int' are the same width (or put another way, calling printf("%u",int)
works just fine on the platforms that glibc target).

In short, I agree with Ulrich's decision to not change the current code base.


-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=5747

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]