This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: GCC problem (Was: Re: [bugs] Problem compiling the kernel)
- From: "Joseph S. Myers" <jsm28 at cam dot ac dot uk>
- To: Bo Thorsen <bo at sonofthor dot dk>
- Cc: <bugs at x86-64 dot org>, <gcc at gcc dot gnu dot org>, <aj at suse dot de>
- Date: Mon, 10 Dec 2001 15:38:10 +0000 (GMT)
- Subject: Re: GCC problem (Was: Re: [bugs] Problem compiling the kernel)
On Mon, 10 Dec 2001, Bo Thorsen wrote:
> typedef struct { } spinlock_t;
> spinlock_t runqueue_lock
> __attribute__((__aligned__((1 << ((6)))),
> __section__(".data.cacheline_aligned"))) = (spinlock_t) { };
>
> ----- problem.c -----
>
> > ../crossbuild/x86-64/bin/x86_64-unknown-linux-gcc problem.c
> problem.c:4: initializer element is not constant
>
> ia32 gcc works fine.
>
> Ideas on how this has come to be?
No-one spoke up in favour of this extension (treating compound literals as
if they were the brace-enclosed lists they contain) when I asked
<URL:http://gcc.gnu.org/ml/gcc/2001-11/msg01161.html>, so I killed it when
implementing proper C99 semantics for compound literals. A compound
literal, as an expression here of structure type, is not a valid
initializer for an object of static storage duration.
--
Joseph S. Myers
jsm28@cam.ac.uk