warn_extracomma

Controls the recognition of superfluous commas in enumerations.

Syntax
#pragma warn_extracomma on | off | reset
  
Remarks

If you enable this pragma, the compiler issues a warning message when it encounters a trailing comma in enumerations. For example, Warning about extra commas is acceptable source code but generates a warning message when you enable this setting.

Listing 1. Warning about extra commas
#pragma warn_extracomma on
enum { mouse, cat, dog, }; 
/* WARNING: compiler expects an identifier after final comma. */

The compiler ignores terminating commas in enumerations when compiling source code that conforms to the ISO/IEC 9899-1999 ("C99") standard.

By default, this pragma is disabled.

Related information
extended_errorcheck
maxerrorcount
message
showmessagenumber
show_error_filestack
suppress_warnings
sym
unused
warning
warning_errors
warn_any_ptr_int_conv
warn_emptydecl
warn_filenamecaps
warn_filenamecaps_system
warn_hiddenlocals
warn_illpragma
warn_illtokenpasting
warn_illunionmembers
warn_impl_f2i_conv
warn_impl_i2f_conv
warn_impl_s2u_conv
warn_implicitconv
warn_largeargs
warn_missingreturn
warn_no_side_effect
warn_padding
warn_pch_portability
warn_possunwant
warn_ptr_int_conv
warn_resultnotused
warn_undefmacro
warn_uninitializedvar
warn_unusedarg
warn_unusedvar