
John Maddock wrote:
If you have a program that simply includes boost/integer_traits.hpp and is compiled with g++ -pedantic you get a bunch of warnings:
./boost/integer_traits.hpp:164:57: warning: use of C99 long long integer constant ./boost/integer_traits.hpp:164:73: warning: use of C99 long long integer constant ./boost/integer_traits.hpp:170:62: warning: use of C99 long long integer constant ./boost/integer_traits.hpp:170:62: warning: use of C99 long long integer constant
And no matter where I insert __extension__ I can't seem to get gcc to suppress these:-(
Any ideas?
BTW I'm asking because this came to me as a - somewhat misplaced - bug report: https://svn.boost.org/trac/boost/ticket/1451.
Thanks, John.
gcc has a pragma to do just that #pragma GCC diagnostic ignored "-Wlong-long" dgoncharov@localhost /root/testsrc/diag $ cat main.cpp #include <boost/integer_traits.hpp> //#pragma GCC diagnostic ignored "-Wlong-long" int main() { typedef boost::integer_traits<long long> traits; bool const a = traits::is_integer; (void) a; return 0; } dgoncharov@localhost /root/testsrc/diag $ g++ main.cpp -Wall -Wextra -pedantic main.cpp: In function 'int main()': main.cpp:8: warning: ISO C++ 1998 does not support 'long long' dgoncharov@localhost /root/testsrc/diag $ vim main.cpp dgoncharov@localhost /root/testsrc/diag $ cat main.cpp #include <boost/integer_traits.hpp> #pragma GCC diagnostic ignored "-Wlong-long" int main() { typedef boost::integer_traits<long long> traits; bool const a = traits::is_integer; (void) a; return 0; } dgoncharov@localhost /root/testsrc/diag $ g++ main.cpp -Wall -Wextra -pedantic dgoncharov@localhost /root/testsrc/diag $ BR, Dmitry