-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 According to POSIX, UINT{8,16}_C should result in an integer constant with "the same type as would an expression that is an object of the corresponding type converted according to the integer promotions." And according to C, unsigned char promotes to signed int, when int is wider than char. Gnulib now tests for bugs in stdint.h, and these are the remaining two issues that makes cygwin's version non-compliant:
2006-07-02 Eric Blake <[EMAIL PROTECTED]> * include/stdint.h (UINT8_C, UINT16_C): Unsigned types smaller than int promote to signed int. - -- Life is short - so eat dessert first! Eric Blake [EMAIL PROTECTED] -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.1 (Cygwin) Comment: Public key at home.comcast.net/~ericblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFEqDR/84KuGfSFAYARAnkuAJ9oKW4FEnOVPythNkGLs0Mw0+QQsgCbBwTy VCM75i+6nr3jYZXs3qrhLZw= =iYl2 -----END PGP SIGNATURE-----
Index: cygwin/include/stdint.h =================================================================== RCS file: /cvs/src/src/winsup/cygwin/include/stdint.h,v retrieving revision 1.6 diff -u -p -r1.6 stdint.h --- cygwin/include/stdint.h 23 May 2005 13:13:00 -0000 1.6 +++ cygwin/include/stdint.h 2 Jul 2006 21:01:39 -0000 @@ -1,6 +1,6 @@ /* stdint.h - integer types - Copyright 2003 Red Hat, Inc. + Copyright 2003, 2006 Red Hat, Inc. This file is part of Cygwin. @@ -169,8 +169,8 @@ typedef unsigned long long uintmax_t; #define INT32_C(x) x ## L #define INT64_C(x) x ## LL -#define UINT8_C(x) x ## U -#define UINT16_C(x) x ## U +#define UINT8_C(x) x +#define UINT16_C(x) x #define UINT32_C(x) x ## UL #define UINT64_C(x) x ## ULL