This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
compile/20011114-1.c, any clues?
- From: Zack Weinberg <zack at codesourcery dot com>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 16 Dec 2001 12:24:08 -0800
- Subject: compile/20011114-1.c, any clues?
I'm getting
FAIL: gcc.c-torture/compile/20011114-1.c, -O0
FAIL: gcc.c-torture/compile/20011114-1.c, -O1
FAIL: gcc.c-torture/compile/20011114-1.c, -O2
FAIL: gcc.c-torture/compile/20011114-1.c, -O3 -fomit-frame-pointer
FAIL: gcc.c-torture/compile/20011114-1.c, -O3 -g
FAIL: gcc.c-torture/compile/20011114-1.c, -Os
on i386. The error message in all cases is
20011114-1.c:2: initializer element is not computable at load time
The source code after preprocessing is
extern void _text;
static unsigned int x = (unsigned int) &_text - 0x10000000L - 1;
The very similar 20010327-1.c
extern void _text;
static unsigned long x = (unsigned long) &_text - 0x10000000L - 1;
gets no complaints at all. This is a 32-bit architecture,
sizeof(int) == sizeof(long) == sizeof (void *).
[Incidentally, why is
extern void _text;
accepted by the compiler even with -pedantic? void all by itself is
an incomplete type.]
zw