ampl / mp

An open-source library for mathematical programming
https://mp.ampl.com
Other
229 stars 42 forks source link

expected unqualified-id before numeric constant #116

Open staticfloat opened 6 years ago

staticfloat commented 6 years ago

When cross-compiling on powerpc64le, gcc is unhappy about this line, stating:

In file included from /opt/powerpc64le-linux-gnu/lib/gcc/powerpc64le-linux-gnu/7.2.0/include-fixed/limits.h:194:0,
                 from /opt/powerpc64le-linux-gnu/lib/gcc/powerpc64le-linux-gnu/7.2.0/include-fixed/syslimits.h:7,
                 from /opt/powerpc64le-linux-gnu/lib/gcc/powerpc64le-linux-gnu/7.2.0/include-fixed/limits.h:34,
                 from /workspace/srcdir/mp-3.1.0/test/../thirdparty/gmock/gmock.h:2024,
                 from /workspace/srcdir/mp-3.1.0/test/option-test.cc:23:
/workspace/srcdir/mp-3.1.0/include/mp/format.h: In member function ‘void fmt::internal::ArgFormatterBase<Impl, Char>::visit_char(int)’:
/workspace/srcdir/mp-3.1.0/include/mp/format.h:1750:20: error: expected unqualified-id before numeric constant
     const unsigned CHAR_WIDTH = 1;

Sounds like this may be due to something else defining CHAR_WIDTH on this system, which does in fact exist within limits.h in my compiler toolchain. My guess is that this variable just needs to be renamed.

abelsiqueira commented 6 years ago

Manually renaming CHAR_WIDTH worked for me.