a nifty feature for c preprocessor

Richard Kenner kenner@vlsi1.ultra.nyu.edu
Sun Jan 1 12:38:00 GMT 2012


> i don't know if you're trying to be funny...
> 
> but what's between the definition of N1 and the undef of A may be a very
> complex. it's just simplified for demonstration.

It's not good programming practice to have a macro (in this case A) have
two different values, with an #undef between then.    There are very
few good reasons to use #undef, but that's not one of them.

The reason is that when you look at the usage of the macro and want to
find how it's defined, a search for the definition may come up with the
wrong one.



More information about the Gcc mailing list