a nifty feature for c preprocessor

Ruben Safir ruben@mrbrklyn.com
Sun Jan 1 16:46:00 GMT 2012


On 01/01/2012 12:42 AM, Robert Dewar wrote:
> On 12/31/2011 4:44 AM, R A wrote:
>>
>> alright, here's another example why eval is a good idea:
>>
>> #define A           17
>> #define B           153
>> #define N1          ((A + B)/2)  /* intended was (17 + 153)/2 */
>>
>> #undef  A
>> #define A           230
>> #define N2          ((A + B)/2) /* intended was (230 + 153)/2 */
>
> Bad example, this is a misuse of the preprocessor in any case!
>
>


why?



More information about the Gcc mailing list