new warnings from basic_string
Lars Gullik Bjønnes
larsbj@gullik.net
Thu Jan 27 10:31:00 GMT 2005
I am not sure if this is known, or if it is something others see as
well.
I recently began getting messages about "control may reach end of
non-void function". Is this known or should I put it in bugzilla?
Code:
#include <boost/lexical_cast.hpp>
#include <string>
std::string convert(int f)
{
return boost::lexical_cast<std::string>(f);
}
Compiled with:
g++ -W -Wall -O -c -o convert convert.C
Gives:
/opt/gcc-head/lib/gcc/i686-pc-linux-gnu/4.0.0/../../../../include/c++/4.0.0/bits/basic_string.h:
In function #Target boost::lexical_cast(Source) [with Target =
std::string, Source = int]#:
/opt/gcc-head/lib/gcc/i686-pc-linux-gnu/4.0.0/../../../../include/c++/4.0.0/bits/basic_string.h:2029:
warning: control may reach end of non-void function #_CharT*
std::basic_string<_CharT, _Traits, _Alloc>::_Rep::_M_refdata() [with
_CharT = char, _Traits = std::char_traits<char>, _Alloc =
std::allocator<char>]# being inlined
--
Lgb
More information about the Libstdc++
mailing list