This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
c99 stdint.h question
- From: Steve Ellcey <sje at cup dot hp dot com>
- To: gcc at gcc dot gnu dot org
- Cc: joseph at codesourcery dot com
- Date: Fri, 10 Apr 2009 10:23:39 -0700 (PDT)
- Subject: c99 stdint.h question
- Reply-to: sje at cup dot hp dot com
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
sje@cup.hp.com