This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [bugs] Re: GCC problem (Was: Re: [bugs] Problem compiling thekernel)
- From: Andreas Jaeger <aj at suse dot de>
- To: "Joseph S. Myers" <jsm28 at cam dot ac dot uk>
- Cc: Bo Thorsen <bo at sonofthor dot dk>, <bugs at x86-64 dot org>,<gcc at gcc dot gnu dot org>
- Date: Mon, 10 Dec 2001 16:47:08 +0100
- Subject: Re: [bugs] Re: GCC problem (Was: Re: [bugs] Problem compiling thekernel)
- References: <Pine.LNX.4.33.0112101533570.26979-100000@kern.srcf.societies.cam.ac.uk>
"Joseph S. Myers" <jsm28@cam.ac.uk> writes:
> 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
Seems that nobody noticed this.:-( The Linux kernel relies on this
(that's where the example is from) and it seems to work with GCC
2.95.x and GCC 3.0 also.
> 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.
Andreas
--
Andreas Jaeger
SuSE Labs aj@suse.de
private aj@arthur.inka.de
http://www.suse.de/~aj