Error with __extension__

M

Magnus Olsson

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?
 
R

Rolf Magnus

Magnus said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,202
Messages
2,571,055
Members
47,659
Latest member
salragu

Latest Threads

Top