GCC problem (Was: Re: [bugs] Problem compiling the kernel)
Joseph S. Myers
jsm28@cam.ac.uk
Mon Dec 10 07:47:00 GMT 2001
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
More information about the Gcc
mailing list