This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]