How to disable warnings on gcc?
Dear boost users On FreeBSD 8.1 with boost 1.43 and gcc 4.2.1 we have lots of warnings like: ... /usr/local/include/boost/type_traits/is_unsigned.hpp: In instantiation of 'boost::detail::is_ununsigned_helper<short int>': /usr/local/include/boost/type_traits/is_unsigned.hpp:73: instantiated from 'boost::detail::is_unsigned_imp<short int>' /usr/local/include/boost/type_traits/is_unsigned.hpp:123: instantiated from 'boost::is_unsigned<short int>' /usr/local/include/boost/type_traits/make_unsigned.hpp:110: instantiated from 'boost::detail::make_unsigned_imp<short int>' /usr/local/include/boost/type_traits/make_unsigned.hpp:130: instantiated from 'boost::make_unsigned<short int>' /usr/local/include/boost/lexical_cast.hpp:846: instantiated from here /usr/local/include/boost/type_traits/is_unsigned.hpp:40: warning: comparison between 'enum boost::detail::is_unsigned_values<short int>::<anonymous>' and 'enum boost::detail::is_unsigned_values<short int>::<anonymous>' ... Similar warnings about "comparison between ..." pop up in the serialization library as well. What is the easiest way to suppress these warnings? I tried using the switches "-Wno-sign-compare" and "-Wno-conversion", but the warnings don't go away. Thanks for your help James
On FreeBSD 8.1 with boost 1.43 and gcc 4.2.1 we have lots of warnings like:
... /usr/local/include/boost/type_traits/is_unsigned.hpp: In instantiation of 'boost::detail::is_ununsigned_helper<short int>': /usr/local/include/boost/type_traits/is_unsigned.hpp:73: instantiated from 'boost::detail::is_unsigned_imp<short int>' /usr/local/include/boost/type_traits/is_unsigned.hpp:123: instantiated from 'boost::is_unsigned<short int>' /usr/local/include/boost/type_traits/make_unsigned.hpp:110: instantiated from 'boost::detail::make_unsigned_imp<short int>' /usr/local/include/boost/type_traits/make_unsigned.hpp:130: instantiated from 'boost::make_unsigned<short int>' /usr/local/include/boost/lexical_cast.hpp:846: instantiated from here /usr/local/include/boost/type_traits/is_unsigned.hpp:40: warning: comparison between 'enum boost::detail::is_unsigned_values<short int>::<anonymous>' and 'enum boost::detail::is_unsigned_values<short int>::<anonymous>'
I'm not able to reproduce that with cygwin-gcc-4.3.4 and -Wall -Wextra -pedantic and either Boost-1.44 or 1.43, do you have a minimal test case? It also looks to me that maybe BOOST_NO_INCLASS_MEMBER_INITIALIZATION is defined given that the warning talks about enum's - however this should never be the case with gcc. Confused yours, John.
Hello
Am 24.08.2010, 19:05 Uhr, schrieb John Maddock
On FreeBSD 8.1 with boost 1.43 and gcc 4.2.1 we have lots of warnings like:
... /usr/local/include/boost/type_traits/is_unsigned.hpp: In instantiation of 'boost::detail::is_ununsigned_helper<short int>': /usr/local/include/boost/type_traits/is_unsigned.hpp:73: instantiated from 'boost::detail::is_unsigned_imp<short int>' /usr/local/include/boost/type_traits/is_unsigned.hpp:123: instantiated from 'boost::is_unsigned<short int>' /usr/local/include/boost/type_traits/make_unsigned.hpp:110: instantiated from 'boost::detail::make_unsigned_imp<short int>' /usr/local/include/boost/type_traits/make_unsigned.hpp:130: instantiated from 'boost::make_unsigned<short int>' /usr/local/include/boost/lexical_cast.hpp:846: instantiated from here /usr/local/include/boost/type_traits/is_unsigned.hpp:40: warning: comparison between 'enum boost::detail::is_unsigned_values<short int>::<anonymous>' and 'enum boost::detail::is_unsigned_values<short int>::<anonymous>'
I'm not able to reproduce that with cygwin-gcc-4.3.4 and -Wall -Wextra -pedantic and either Boost-1.44 or 1.43, do you have a minimal test case?
It also looks to me that maybe BOOST_NO_INCLASS_MEMBER_INITIALIZATION is defined given that the warning talks about enum's - however this should never be the case with gcc.
These warnings appear by just including lexical_cast.hpp (see below). Any
ideas where the warnings come from?
Tomorrow I'll try to use another gcc version and/or another boost version.
Regards
James
[james@build-amd64-81 ~]$ cat warnings.cpp
#include
Am 25.08.2010, 11:06 Uhr, schrieb John Maddock
These warnings appear by just including lexical_cast.hpp (see below). Any ideas where the warnings come from?
Nope, tried on Ubuntu-Linux with
gcc-4.2.4, 4.4.3 and 4.5.0, all with -Wall -Wextra -pedantic and no warnings.
When using boost 1.39 instead of 1.43 on FreeBSD 8.1, there are no warnings. We can live with using the older boost version for now. But it's still strange that these warnings pop up, esp. because exactly this configuration (FreeBSD with GCC 4.2.1) is listed as the "Boost's primary test compilers". Regards James
participants (2)
-
Jean-Pierre Bergamin
-
John Maddock