This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

new warnings from basic_string


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]