View Bug Activity | Format For Printing
C99 7.18.4.1 (as revised by ISO/IEC 9899:1999/Cor.1:2001) says that UINT8_C and UINT16_C return values corresponding to uint_least8_t and uint_least16_t. They therefore must promote the same way. But glibc appends 'U', which causes UINT8_C and UINT16_C to promote to 'unsigned int', not 'int'. Here is a test program illustrating the bug: it strictly conforms to the C99 but GCC + glibc reject it. I'll attach the obvious patch. #include <stdint.h> char test1[(-1 < UINT8_C (0)) == (-1 < (uint_least8_t) 0) ? 1 : -1]; char test2[(-1 < UINT16_C (0)) == (-1 < (uint_least16_t) 0) ? 1 : -1];
Created an attachment (id=1121) UINT8_C and UINT16_C should not append U
The specificaiton is broken one way or another so I don't really care. The patch is in cvs.