lexical_cast: even more warnings now

, std::allocator<char> >]' /cygdrive/c/data/boost/develop/boost/boost/lexical_cast.hpp:256: instantiated from `Target boost::lexical_cast(const Source&) [with Target = int, Source = std ::basic_string<char, std::char_traits<char>, std::allocator<char> >]' /cygdrive/c/data/boost/develop/boost/boost/program_options/detail/value_semantic .hpp:83: instantiated from `void boost::program_options::validate(boost::any&, const std::vector<std::basic_string<charT, std::char_traits<_CharT>, std::alloc ator<_T2> >, std::allocator<std::basic_string<charT, std::char_traits<_CharT>, s
We seem to have acquired even more intrusive warnings from lexical_cast now, for example a quickbook build yields: /cygdrive/c/data/boost/develop/boost/boost/lexical_cast.hpp: In constructor `boo st::detail::lexical_stream<Target, Source>::lexical_stream() [with Target = int, Source = std::basic_string<char, std::char_traits<char>, std::allocator<char> > ]': /cygdrive/c/data/boost/develop/boost/boost/lexical_cast.hpp:230: instantiated from `Target boost::detail::lexical_cast(typename boost::call_traits<T2>::value_ type) [with Target = int, Source = std::basic_string<char, std::char_traits<char td::allocator<_T2> > > >&, T*, long int) [with T = int, charT = char]' /cygdrive/c/data/boost/develop/boost/boost/program_options/detail/value_semantic .hpp:151: instantiated from `void boost::program_options::typed_value<T, charT
::xparse(boost::any&, const std::vector<std::basic_string<charT, std::char_trai ts<_CharT>, std::allocator<_T2> >, std::allocator<std::basic_string<charT, std:: char_traits<_CharT>, std::allocator<_T2> > > >&) const [with T = int, charT = ch ar]' /cygdrive/c/data/boost/develop/boost/tools/quickbook/detail/quickbook.cpp:521: instantiated from here /cygdrive/c/data/boost/develop/boost/boost/lexical_cast.hpp:150: warning: statem ent has no effect
which is pretty unpleasant :-( At least previously the warning only struct at level 4 in MSVC, now they seem to hit everything unfortunately. Of course there may not be a solution that suites everyone! John.

On Sat, 5 Aug 2006 16:46:29 +0100, "John Maddock" <john@johnmaddock.co.uk> wrote:
We seem to have acquired even more intrusive warnings from lexical_cast now, for example a quickbook build yields:
[42 lines warning message snipped]
Just to reassure the onlookers this was *1* message :-s
which is pretty unpleasant :-(
Don't be sad, John. Fixed at 0.45am. Specially for you O:-) PS: I've used _MSC_VER rather than BOOST_MSVC; is that ok? The idea is that VC-compatible compilers will (should?) behave the same as VC, also with regard to the warning. -- [ Gennaro Prota, C++ developer for hire ]

Gennaro Prota wrote:
On Sat, 5 Aug 2006 16:46:29 +0100, "John Maddock" <john@johnmaddock.co.uk> wrote:
We seem to have acquired even more intrusive warnings from lexical_cast now, for example a quickbook build yields:
[42 lines warning message snipped]
Just to reassure the onlookers this was *1* message :-s
which is pretty unpleasant :-(
Don't be sad, John. Fixed at 0.45am. Specially for you O:-)
PS: I've used _MSC_VER rather than BOOST_MSVC; is that ok? The idea is that VC-compatible compilers will (should?) behave the same as VC, also with regard to the warning.
Yep, thanks Gennaro, that kills the warnings very nicely! John.

Gennaro Prota wrote:
On Sat, 5 Aug 2006 16:46:29 +0100, "John Maddock" <john@johnmaddock.co.uk> wrote:
We seem to have acquired even more intrusive warnings from lexical_cast now, for example a quickbook build yields:
[42 lines warning message snipped]
Just to reassure the onlookers this was *1* message :-s
which is pretty unpleasant :-(
Don't be sad, John. Fixed at 0.45am. Specially for you O:-)
Even worse. The test now fails. Your #ifdef excluded code for compilers other then MSVC. Please, decide about BOOST_MSVC vs _MSC_VER and fix the bug. Index: boost/lexical_cast.hpp =================================================================== RCS file: /cvsroot/boost/boost/boost/lexical_cast.hpp,v retrieving revision 1.23 diff -u -r1.23 lexical_cast.hpp --- boost/lexical_cast.hpp 5 Aug 2006 22:45:53 -0000 1.23 +++ boost/lexical_cast.hpp 6 Aug 2006 11:56:19 -0000 @@ -140,6 +140,7 @@ # pragma warning( push ) // conditional expression is constant # pragma warning( disable : 4127 ) +#endif typedef std::numeric_limits<Target> t; typedef std::numeric_limits<Source> s; @@ -149,6 +150,7 @@ else if(s::is_specialized) stream.precision(1 + s::digits10); +#if (defined _MSC_VER) # pragma warning( pop ) #endif BTW, look at these lines in boost/config/select_compiler_config.hpp: // Must remain the last #elif since some other vendors (Metrowerks, for // example) also #define _MSC_VER # define BOOST_COMPILER_CONFIG "boost/config/compiler/visualc.hpp" -- Alexander Nasonov Project Manager at Akmosoft ( http://www.akmosoft.com ) Blog: http://nasonov.blogspot.com Email: $(FirstName) dot $(LastName) at gmail dot com
participants (3)
-
Alexander Nasonov
-
Gennaro Prota
-
John Maddock