This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: Question regarding bizarre ','
On Tue, 6 Aug 2002 16:14:58 -0700, Kevin Buettner <kevinb@redhat.com> said:
> I am unable to find anything in Harbison and Steele which indicates
> that a trailing comma is acceptable in an array initializer. (They
> don't seem to mention it one way or another.)
K&R (second edition, of course) section A8.7 says:
The initializer is preceded by =, and is either an expression, or a
list of initializers nested in braces. A list may end with a comma,
a nicety for neat formatting.
It seems to be talking about a general enough context to include
arrays and structs, though it's not _entirely_ clear to me; the second
example on the top of p. 220 is an array with an extra comma at the
end.
David Carlton
carlton@math.stanford.edu