Spurious warning: ‘r’ may be used uninitialized in this function [-Wmaybe-uninitialized]
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_
shadow.c:16:28: warning: ‘r’ may be used uninitialized in this function [-Wmaybe-
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:/
ProblemType: Bug
DistroRelease: Ubuntu 17.10
Package: gcc-7 7.2.0-3ubuntu1
ProcVersionSign
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)
Seems to be a recurring problem:
https:/ /gcc.gnu. org/bugzilla/ buglist. cgi?quicksearch =may%20be% 20used% 20uninitialized