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. The following listing shows an example.

Listing: Redefining 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