On Sun, 25 May 2008, Dmitry Timoshkov wrote:
"Kai Blin" kai.blin@gmail.com wrote: [...]
MAP_OPTION( IPPROTO_IGMP ), MAP_OPTION( IPPROTO_RAW ),
- {FROM_PROTOCOL_INFO, FROM_PROTOCOL_INFO},
};
Although it was the case before, it's a mistake to have a comma after the last struct member initializer. [...]
Placing a comma should be OK if there are chances the struct or enum will ever grow. This prevents later patching the line to add the comma, possibly creating confusion about who is the author of that line.
On the other hand, no comma at the end of an enum or struct memeber that we want to always be the last one (COUNT_OF_WHATEVER_OPTIONS, custom_data_area[], etc.) helps avoiding trivial errors as it forces one to add that comma to compile the code.
Paul Chitescu