Re:Wikileaks To Leak 5000 Open Source Java Projects
by shasta on Thursday July 29, 2010 @08:39AM
(#1557358)
There's a rule in the preprocessor to prevent infinite recursion: only replace each symbol once. The first time it encounters 'true', it's replaced with 'false'. The first time it encounters 'false, it's replace with 'true'. It's already seen 'true', so it throws up its hands.
The consequence of this rule is that cycles of #defines don't do anything. Edit: Well, that's only true if there aren't other symbols introduced during expansion. Here's a counterexample that prints 3:
#include <stdio.h>
int x = 1;
#define x 1 + y
#define y 1 + x
int main(int argc, char *argv[])
{
printf("%d\n",x);
return 0;
}
The consequence of this rule is that cycles of #defines don't do anything. Edit: Well, that's only true if there aren't other symbols introduced during expansion. Here's a counterexample that prints 3: