[using gcc book] 5.20 compound literals
Chris Devers
cdevers@pobox.com
Tue Aug 26 01:24:00 GMT 2003
On Sat, 23 Aug 2003, Chris Devers wrote:
> On Sat, 23 Aug 2003, Stephan T. Lavavej wrote:
>
> > [Chris Devers]
> > > The following passage appears in chapter five,
> > > section 5.20 (Compound Literals).
> > >
> > > I'm considering clarifying this paragraph as follows:
> >
> > I've looked over the two paragraphs several times and they look
> > character-for-character identical to me. Copy-and-paste error?
>
> Nuts... yeah, probably a cut & paste think-o, the paragraphs
> are much different. Sorry about that. Let's try again.
>
> Original:
>
> As a GNU extension, GCC allows initialization of objects
> with static storage duration by compound literals (which is
> not possible in ISO C99, because the initializer is not a
> constant). It is handled as if the object was initialized
> only with the bracket enclosed list if compound literal's
> and object types match. The initializer list of the compound
> literal must be constant. If the object being initialized
> has array type of unknown size, the size is determined by
> compound literal size.
>
> Edited:
>
> As a GNU extension, GCC allows initialization of objects
> with static storage duration by compound literals. This is
> not possible in ISO C99, because the initializer is not a
> constant. If the type of the compound literal matches that
> of the object, this behaves as if the object was initialized
> only with the brace enclosed list. The initializer list
> of the compound literal must be constant. If the object
> being initialized has array type of unknown size, the size
> is determined by compound literal size.
>
>
> Now do they look different, does the revised one look cleaner, etc?
>
> Thanks, and sorry again about the mis-paste :)
So.... does anyone have an opinion on this change?
Going once...
Going twice...
--
Chris Devers cdevers@pobox.com
undocumented, adj.
(Of a feature) essential.
-- from _The Computer Contradictionary_, Stan Kelly-Bootle, 1995
More information about the Gcc
mailing list