Trailing Commas in Enumerations

When the C99 extensions setting is on, the compiler allows a comma after the final item in a list of enumerations. The following listing shows an example.

Listing: Trailing comma in enumeration example

enum

{

    violet,

    blue

    green,

    yellow,

    orange,

    red, /* OK: accepted if C99 extensions setting is on. */

};