boost/type_traits/config.hpp
My compiler issues the following warning message (boost v1.29.0, G++ 3.2 with warning level high): boost_1_29_0/boost/type_traits/config.hpp:90:55: warning: "BOOST_MSVC" is not defined boost/type_traits/config.hpp: line 90 is: # if (........ || BOOST_MSVC > 1301 || ........) Shouldn't it be as follows? # if (........ || #defined(BOOST_MSVC) && BOOST_MSVC > 1301 || ........) H. Morishima
"H. Morishima"
My compiler issues the following warning message (boost v1.29.0, G++ 3.2 with warning level high):
boost_1_29_0/boost/type_traits/config.hpp:90:55: warning: "BOOST_MSVC" is not defined
boost/type_traits/config.hpp: line 90 is:
# if (........ || BOOST_MSVC > 1301 || ........)
It should work fine as is.
Shouldn't it be as follows?
# if (........ || #defined(BOOST_MSVC) && BOOST_MSVC > 1301 || ........)
If an identifier is not defined, it should expand to 0 on a #if (or #elif) directive line. The only reason you sometimes see what you have above (minus the extra # before 'defined') is that sometimes the macro actually expands to 0. This should be fine: #if BOOST_MSVC Provided that either BOOST_MSVC is *not* defined, or it expands to a numeric expression that the preprocessor can handle.
H. Morishima
Paul Mensonides
Thanks, Paul I got a new knowledge on preprocessor macro expansion. H. Morishima
In article
This should be fine:
#if BOOST_MSVC
Provided that either BOOST_MSVC is *not* defined, or it expands to a numeric expression that the preprocessor can handle.
Even better, a test on BOOST_MSVC+0 works even if the definition of BOOST_MSVC is blank. This technique is used in a few places in Boost.
Fixed thanks. John Maddock http://ourworld.compuserve.com/homepages/john_maddock/index.htm
My compiler issues the following warning message (boost v1.29.0, G++ 3.2 with warning level high):
boost_1_29_0/boost/type_traits/config.hpp:90:55: warning: "BOOST_MSVC" is not defined
boost/type_traits/config.hpp: line 90 is:
# if (........ || BOOST_MSVC > 1301 || ........)
Shouldn't it be as follows?
# if (........ || #defined(BOOST_MSVC) && BOOST_MSVC > 1301 || ........)
H. Morishima
Info: http://www.boost.org Wiki: http://www.crystalclearsoftware.com/cgi-bin/boost_wiki/wiki.pl Unsubscribe: mailto:boost-users-unsubscribe@yahoogroups.com
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
Thanks, John Though it was not an error actually (pointed out by Paul Mensonides), by your fix, I won't be bothered by warning messages in the next release. H. Morishima
participants (4)
-
Ben Hutchings
-
H. Morishima
-
John Maddock
-
Paul Mensonides