This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: libc/sysdeps/generic stdint.h
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: drepper at sourceware dot org
- Cc: libc-alpha at sourceware dot org
- Date: Sat, 25 Apr 2009 10:04:01 +0000 (UTC)
- Subject: Re: libc/sysdeps/generic stdint.h
- References: <20090425071127.2998.qmail@sourceware.org>
On Sat, 25 Apr 2009, drepper@sourceware.org wrote:
> CVSROOT: /cvs/glibc
> Module name: libc
> Changes by: drepper@sourceware.org 2009-04-25 07:11:27
>
> Modified files:
> sysdeps/generic: stdint.h
>
> Log message:
> (WINT_MAX): Define as 2147483647 since this is the maximum UCS4 value.
This is incorrect (the previous r1.8 change was correct; this one reverts
that but also causes the macro to expand to an expression with the wrong
type); all the limits in stdint.h are limits of integer types rather than
of values with particular semantics that may be stored in them. This will
cause the GCC 4.5 test for C99-conforming stdint.h to fail. The maximum
value wint_t can store is 4294967295u (which also happens to be the value
WEOF).
Note that C99 specifies that if wint_t is a signed type then WINT_MIN
shall be no greater than -32767. This would obviously be nonsense if it
referred to limits of valid characters rather than of the underlying
integer type, since negative values are not valid characters.
--
Joseph S. Myers
joseph@codesourcery.com