wrong "maybe-uninitialized" warning with -O3 (when building goplay)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
gcc-5 (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
goplay FTBFS on ppc64el with:
g++ -DHAVE_CONFIG_H -I. -I.. -I.. -I/usr/
XDGDesktopEntry
XDGDesktopEntry
if (value[i] == 'i') {
^
cc1plus: all warnings being treated as errors
full build log: https:/
This does not make much sense to me. The code:
// Now run the desktop file
getEntry(
// XXX: For now, just remove the field codes...
std::string commandString;
for(unsigned int i = 0; value[i] != '\0'; i++) {
if (value[i] == '%') {
i++;
if (value[i] == 'i') {
value is a "const char*" and gets initialized in the getEntry(). Even *if* there was a reason to argue that value might be uninitialized, then the complaint should already be for the "for" loop. There is no reason why value should be valid in the "for" loop and for the "value[i] == '%'" check, but after incrementing just "i" it would suddenly not be any more.
It builds fine on Debian ppc64el (https:/
ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: gcc-5 5.2.1-26ubuntu1
ProcVersionSign
Uname: Linux 4.2.0-19-generic x86_64
ApportVersion: 2.19.2-0ubuntu8
Architecture: amd64
CurrentDesktop: Unity
Date: Mon Nov 30 08:19:47 2015
EcryptfsInUse: Yes
SourcePackage: gcc-5
UpgradeStatus: No upgrade log present (probably fresh install)
The previous version still built on ppc64el, and the affected code did not change there: https:/ /launchpad. net/ubuntu/ +source/ goplay/ 0.9ubuntu1/ +build/ 7778372 . That was with gcc-5 5.2.1-15ubuntu1.