Test of Equality for String Macro - Invalid?
I'm trying to understand the problem here, and I've reduced it to a minimal test-case, main.c:
Code:
#define FOO "foo"
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char** argv) {
#if FOO == 7
/* ... */
#else
/* ... */
#endif
printf("Done\n");
return (EXIT_SUCCESS);
}
I get this when compiling it:
Code:
$ gcc main.c
main.c:7:5: error: token ""foo"" is not valid in preprocessor expressions
??? Am I using an incorrect operator?
EDIT: Oh, I should also note that "Done" is never printed, even if no errors or warning are encountered. Not sure if that's related...