Magnus Olsson wrote:
When I try to compile a program from one of our supplies I get
following error message:
g++ -I../../../include -Wno-deprecated -c DataList.cc
I fil includerad från ../../../include/CMS/DataList.h:11,
från DataList.cc:12:
../../../include/Tools/string.h:50: syntaxfel före "__extension__"
On row 50 in ../../../include/Tools/string.h is following:
const int INFINITY = -1;"
If I comment this row the compile go throw width no problem. Whey is
it so and how do I solve the problem without changing the code?
You cannot change the code without changing the code :-)
If something like that happens (an error message that refers to something
that doesn't seem to have anything to do with the actual code), it's
probably due to the identifier already being defined as a macro, so I guess
that one of the headers your file includes defines INFINITY as a macro,
part of what it gets repaced by is __extension__.
Btw: Now you know one of the reasons why it's a good idea use names with all
uppercase letters only for macros.