Spurious warning: ‘r’ may be used uninitialized in this function [-Wmaybe-uninitialized]

Bug #1717433 reported by Daniel van Vugt
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gcc-7 (Ubuntu)
New
Undecided
Unassigned

Bug Description

gcc is giving an apparently spurious warning:

shadow.c: In function ‘create_shadowed_pixbuf’:
shadow.c:16:28: warning: ‘r’ may be used uninitialized in this function [-Wmaybe-uninitialized]
     return ((1 / (2 * M_PI * r)) *
                  ~~~~~~~~~~^~~~
shadow.c:14:1: note: ‘r’ was declared here
 gaussian (double x, double y, double r)
 ^~~~~~~~

It looks like that's impossible to me. The relevant source file is:

https://git.gnome.org/browse/gtk+/tree/docs/tools/shadow.c?h=gtk-3-22

ProblemType: Bug
DistroRelease: Ubuntu 17.10
Package: gcc-7 7.2.0-3ubuntu1
ProcVersionSignature: Ubuntu 4.12.0-13.14-generic 4.12.10
Uname: Linux 4.12.0-13-generic x86_64
ApportVersion: 2.20.7-0ubuntu1
Architecture: amd64
Date: Fri Sep 15 14:06:45 2017
InstallationDate: Installed on 2017-05-03 (135 days ago)
InstallationMedia: Ubuntu 17.10 "Artful Aardvark" - Alpha amd64 (20170502)
SourcePackage: gcc-7
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Daniel van Vugt (vanvugt) wrote :
Revision history for this message
Daniel van Vugt (vanvugt) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.