This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/59970] Bogus warnings at low optimization levels
- From: "mac at mcrowe dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 22 Apr 2015 13:39:05 +0000
- Subject: [Bug tree-optimization/59970] Bogus warnings at low optimization levels
- Auto-submitted: auto-generated
- References: <bug-59970-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59970
Mike Crowe <mac at mcrowe dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |mac at mcrowe dot com
--- Comment #3 from Mike Crowe <mac at mcrowe dot com> ---
Created attachment 35384
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35384&action=edit
Preprocessed source for boost::lexical_cast case
I can reproduce the same problem with Debian Jessie's gcc 4.9.2 and a
self-compiled gcc 4.9.1 when compiling:
#include <boost/lexical_cast.hpp>
int wibble()
{
return boost::lexical_cast<int>("1");
}
Preprocessed source attached (compressed to avoid file size limit.)
$ g++ -Wall -Werror -Og -save-temps test.cpp
test.cpp: In function âint wibble()â:
test.cpp:5:40: error: âresultâ may be used uninitialized in this function
[-Werror=maybe-uninitialized]
return boost::lexical_cast<int>("1");
^
cc1plus: all warnings being treated as errors
Oddly the warning is not reported when the function is named "main"!