Boost logo

Boost Users :

From: Kevin Wheatley (hxpro_at_[hidden])
Date: 2005-08-15 05:41:31


I had some code that with 1.32 compiled fine when compiled with
warnings as errors, but now with 1.33 I get:

cc1plus: warnings being treated as errors
boost_1_33_0_gcc_3.2.3/include/boost-1_33/boost/range/detail/implementation_help.hpp:
In
   function `Char* boost::range_detail::str_end(Char*) [with Char =
char]':
boost_1_33_0_gcc_3.2.3/include/boost-1_33/boost/range/end.hpp:96:
instantiated from here
boost_1_33_0_gcc_3.2.3/include/boost-1_33/boost/range/detail/implementation_help.hpp:57:
warning: cast
   from `const char*' to `char*' discards qualifiers from pointer
target type
boost_1_33_0_gcc_3.2.3/include/boost-1_33/boost/range/detail/implementation_help.hpp:
In
   function `Char* boost::range_detail::str_end(Char*) [with Char =
wchar_t]':
boost_1_33_0_gcc_3.2.3/include/boost-1_33/boost/range/end.hpp:101:
instantiated from here
boost_1_33_0_gcc_3.2.3/include/boost-1_33/boost/range/detail/implementation_help.hpp:57:
warning: cast
   from `const wchar_t*' to `wchar_t*' discards qualifiers from
pointer target
   type

Compiled with gcc 3.2.3 under Linux,

perhaps something like this is needed?

Thanks

Kevin

--- boost_1_33_0/boost/range/detail/implementation_help.hpp
2005-05-05 13:58:51.000000000 +0100
+++
boost_1_33_0_gcc_3.2.3/include/boost-1_33/boost/range/detail/implementation_help.hpp
2005-08-15 11:33:59.000000000 +0100
@@ -54,7 +54,7 @@
         template< class Char >
         inline Char* str_end( Char* s )
         {
- return (Char*)str_end( s, s );
+ return const_cast<Char*>(str_end( s, s ));
         }
 
         template< class T, std::size_t sz >

-- 
| Kevin Wheatley, Cinesite (Europe) Ltd | Nobody thinks this      |
| Senior Technology                     | My employer for certain |
| And Network Systems Architect         | Not even myself         |

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net