Re: [Boost-bugs] [Boost C++ Libraries] #4946: Uninitialized variable warning in lexical_cast.hpp

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #4946: Uninitialized variable warning in lexical_cast.hpp
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2016-11-29 02:25:44


#4946: Uninitialized variable warning in lexical_cast.hpp
---------------------------------------------+--------------------------
  Reporter: Rich McKeever <richmckeever@…> | Owner: apolukhin
      Type: Bugs | Status: reopened
 Milestone: To Be Determined | Component: lexical_cast
   Version: Boost 1.55.0 | Severity: Problem
Resolution: | Keywords:
---------------------------------------------+--------------------------

Comment (by martin.braun@…):

 Can still confirm with gcc 5.4.0 and Boost 1.58:

 {{{
 #include <boost/lexical_cast.hpp>
 #include <iostream>
 #include <vector>
 #include <string>

 int main(void)
 {
     std::vector<int> v;
     std::string s("5");
     v.push_back(boost::lexical_cast<int>(s));
     return 0;
 }
 }}}

 {{{
 $ g++ -Og -Wall warning.cpp
 warning.cpp: In function ‘int main()’:
 warning.cpp:10:16: warning: ‘result’ may be used uninitialized in this
 function [-Wmaybe-uninitialized]
      v.push_back(boost::lexical_cast<int>(s));

 }}}

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/4946#comment:11>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:20 UTC