I am working on changing GCC for HP-UX to use the 'wrap' method for stdint
and doing the fixincludes work to make the system header more c99 compliant
and see if I can get the various c99-stdint-*.c tests to pass.

I have made some good progress but am currently running into this problem
cutdown from c99-stdint-1.c.  The header files seem OK and the test seems
like it should work but I get an error even when I don't use the header
files and make everthing explicitly unsigned.

$ cat x.c
typedef unsigned char uint8_t;
void test_exact (void)
{
  __typeof__(((255u))) a;
  __typeof__((uint8_t)0 + 0) *b = &a;
}

$ gcc -std=iso9899:1999 -pedantic-errors -fhosted -c x.c
x.c: In function 'test_exact':
x.c:5: error: pointer targets in initialization differ in signedness

The 255 constant has the u suffix on it like it should and uint8_t
is defined as 'unsigned char' like it should be but I still get an error.
Why?   Is there some type promotion going on under the covers?

Steve Ellcey
s...@cup.hp.com

Reply via email to