Skip to contentSkip to conversation

pedantic code cleanup - am I wasting my time with this?

PATCH Stephen Satchell 1 participant 1 message Apr 24, 2001

lore
Share & tools
lore
#0 lore raw
Quoted 6 lines · you
Quoted 4 lines · Jesper Juhl
Quoted 1 line

last entry should not have a trailing comma.

Sadly not. This isn't a gcc thing: ANSI says that trailing comma is ok (K&R Second edition, A8.7 - pg 218 &219 in my copy)

You are right, I just consulted my own copy, and nothing strictly forbids the comma... Sorry about that, I should have been more thorough before reporting that one...

From the X3J11 Rationale document, paraphrase: The inclusion of optional trailing commas is to ease the task of generating code by automatic programs such as LEX and YACC.

Satch