The variable name "xor" leads to an error in the internal segmentation of the compiler "segmentation fault"!

Compilation of this code

int main(int argc, char **argv) { int xor = 0; } 

through

 g++ main.cpp 

leads to:

 internal compiler error: Segmentation fault 

from

 i686-apple-darwin10-g++-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5659). 

Renaming a variable removes the error.

Q: Is Apple's gcc shit?

+6
gcc compiler-construction macos
source share
2 answers

Whenever your segfaults compiler is a mistake. Your already shortened test case is the perfect candidate to tell the GCC .

+3
source share

and_eq, bitand, bitor, compl, not, not_eq or, or_eq, xor and xor_eq are keywords that are included with the names -ansi or -foperator

Do you have one of these switches turned on?

check also: this

+3
source share

All Articles