[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: spurious comma in sys/chown-core.c

From: Daniel Reed
Subject: Re: spurious comma in sys/chown-core.c
Date: Mon, 21 Feb 2005 13:17:23 -0500 (EST)

On 2005-02-21T18:13+0100, Andreas Schwab wrote:
) Daniel Reed <address@hidden> writes:
) > On 2005-02-20T23:10-0800, Paul Eggert wrote:
) > ) -    RC_error,
) > ) +    RC_error
) > The comma is unnecessary but not illegal in C89 (confirmed by compiling
) > using gcc -std=c89).
) Try -pedantic.  The trailing comma is a C99 addition.

I only harp on this because I allow the presence of trailing commas in
generated code, code that I trust is valid in traditional compilers.

-pedantic adds a warning, but not an error:
test.c:4: warning: comma at end of enumerator list

Adding a // comment, on the other hand, causes a parse error:
test.c:5: error: parse error before '/' token

(Both with and without -pedantic, but with -std=c89. -std=c89 is a synonym
for -ansi.)

Daniel Reed <address@hidden>    http://people.redhat.com/djr/   
A common mistake that people make when trying to design something
completely foolproof is to underestimate the ingenuity of complete
fools. -- Douglas Adams, Novelist

reply via email to

[Prev in Thread] Current Thread [Next in Thread]