Redefining Macros

When the GCC extensions setting is on, macros may be redefined with the #define directive without first undefining them with the #undef directive. Redefining a macro without undefining first shows an example.

Listing 1. Redefining a macro without undefining first
#define SOCK_MAXCOLOR 100
#undef SOCK_MAXCOLOR
#define SOCK_MAXCOLOR 200 /* OK: this macro is previously undefined. */


#define SOCK_MAXCOLOR 300