[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Now that SCM type is a union...
From: |
Andy Wingo |
Subject: |
Re: Now that SCM type is a union... |
Date: |
Sat, 13 Aug 2011 14:23:39 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) |
On Sat 13 Aug 2011 07:26, Ken Raeburn <address@hidden> writes:
> That syntax -- the parenthesized type followed by a list of initializers
> in braces -- is called a "compound literal" (technically not a cast
> expression) and was added in C99. The value of a compound literal is an
> anonymous object with a value given by the initializer elements. (It's
> an lvalue, and can even have its address taken.) That means it's not a
> "constant expression" and cannot be used for static initialization,
> under C99 rules.
I only have a draft copy of C99, from 7 September 2007, but it does
permit constant expressions to appear outside function bodies. How
could that happen except for in initializers? I do see the language in
the GCC docs though; it's confusing. I was under the impression that
they would be constant expressions, but perhaps I was mistaken.
I will take a look at this issue soonish, but your help (and Cedric's)
in debugging it is most appreciated :) I would love to keep the union
as the "normal" SCM definition, but that might not be possible.
Regards,
Andy
--
http://wingolog.org/