{ initializer-list , }

Erik Martin martin at kuling.UUCP
Thu Mar 17 01:08:21 AEST 1988


In article <25526 at cca.CCA.COM> g-rh at CCA.CCA.COM.UUCP (Richard Harter) writes:
>[...]  Again, suppose that your table of initializers is machine
>generated;  the generator code will be simpler if the last item is not a
>special case.  Indeed, if you think about it, the specification is simpler
>if the comma is a terminator rather than a separator because all items in
>the specification list have the same format, instead of the last one having
>a special format.

Then, why isn't an 'optional' comma allowed after the last constant in an
enumeration list? I bumbed into this fact when I needed to generate both
an initialized array and an enumeration declaration from a file of symbols,
and found that I had to give special treatment to the last item in the
enumeration. *Very* frustrating.
-- 
((Per-Erik Martin, Computing Science Dept., Uppsala University,    )
 (Box 520, S-751 20 Uppsala, Sweden                                )
 (UUCP: martin at kuling.UUCP  (...!{seismo,mcvax}!enea!kuling!martin)))



More information about the Comp.lang.c mailing list