Hi all,
I have to work with a lot of terrible old code which is full of old
style c makros.
There I found something like:
#define M1 yyy
...
#if M1 == xxx
do something
#endif
I am wondering why "do something" is allways in the compiled code. The
"#if M1 == xxx" is always true, only if M1 is assigned to a number like
"#define M1 6".
Can you give me a link to a full description of the c preprocessor syntax?
Thanks
--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
It's not always in the compiled code - I just tried it. Specifically,
this fails to compile:
#define M1 5
#if M1 == 6
void f() {}
#endif
int main()
{
f();
return 0;
}
> Can you give me a link to a full description of the c preprocessor syntax?
http://lmgtfy.com/?q=c+preprocessor+syntax
(I'd observe in passing that there's an == example under 4.2.5 in the
first link which came up for me.)
Regards,
Stu