[4.5 C] Provide <stdint.h> (bug 448)

Joseph S. Myers joseph@codesourcery.com
Sun Apr 26 11:20:00 GMT 2009


On Sun, 26 Apr 2009, Eric Botcazou wrote:

> /nile.build/botcazou/gcc-head/src/gcc/testsuite/gcc.dg/c99-stdint-1.c: In 
> funct\
> ion 'test_exact':^M
> /nile.build/botcazou/gcc-head/src/gcc/testsuite/gcc.dg/c99-stdint-1.c:108: 
> erro\
> r: pointer targets in initialization differ in signedness^M

You should make fixincludes fix the definition (in sys/int_limits.h)

#define UINT8_MAX       (255U)

so it expands to a signed value, since uint8_t promotes to signed int, as 
well as reporting this header bug to Sun.

> /nile.build/botcazou/gcc-head/src/gcc/testsuite/gcc.dg/c99-stdint-1.c:114: 
> erro\
> r: pointer targets in initialization differ in signedness^M

Likewise.

#define UINT16_MAX      (65535U)

> /nile.build/botcazou/gcc-head/src/gcc/testsuite/gcc.dg/c99-stdint-1.c: In 
> funct\
> ion 'test_least':^M
> /nile.build/botcazou/gcc-head/src/gcc/testsuite/gcc.dg/c99-stdint-1.c:149: 
> erro\
> r: pointer targets in initialization differ in signedness^M
> /nile.build/botcazou/gcc-head/src/gcc/testsuite/gcc.dg/c99-stdint-1.c:152: 
> erro\
> r: pointer targets in initialization differ in signedness^M

Since these limits are defined to UINT8_MAX and UINT16_MAX, no separate 
fixes are needed for them.

> /nile.build/botcazou/gcc-head/src/gcc/testsuite/gcc.dg/c99-stdint-7.c:140: 
> erro\
> r: #error "INT_FAST16_MIN not usable in #if or wrong value"^M
> /nile.build/botcazou/gcc-head/src/gcc/testsuite/gcc.dg/c99-stdint-7.c:143: 
> erro\
> r: #error "INT_FAST16_MAX not usable in #if or wrong value"^M
> /nile.build/botcazou/gcc-head/src/gcc/testsuite/gcc.dg/c99-stdint-7.c:146: 
> erro\
> r: #error "UINT_FAST16_MAX not usable in #if or wrong value"^M

sys/int_types.h defines int_fast16_t to int and uint_fast16_t to unsigned 
int, and GCC knows this, but sys/int_limits.h wrongly defines the limits 
to INT16_MAX, INT16_MIN, UINT16_MAX.  You should make fixincludes fix 
sys/int_limits.h and report the bug to Sun.

-- 
Joseph S. Myers
joseph@codesourcery.com



More information about the Gcc-patches mailing list