This is the mail archive of the
mailing list for the GCC project.
#elseif and #ifdef funnies
- To: Mailing List - GCC <gcc at gcc dot gnu dot org>
- Subject: #elseif and #ifdef funnies
- From: Alex Buell <alex dot buell at tahallah dot demon dot co dot uk>
- Date: Thu, 1 Nov 2001 00:59:42 +0000 (GMT)
- Reply-To: <alex dot buell at tahallah dot demon dot co dot uk>
I just stumbled across something strange with the #elseif and #elif
pragmas tonight. Here's a program snippet:
/* #define one */
#define two 1
int main(int argc, char *argv)
printf("One and two not found\n");
This works, produces the expected output 'Two found'. However, if I do a
s/elif/elseif, and compile it, the output is wrong, it prints 'One and two
I was under the impression that #elseif and #elif were functionally the
same. Is this not true?
Gcc is 2.95.3, on sparc32-linux, with binutils 2.10.1.
Come the revolution, humourless gits'll be first up against the wall.