This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/42643] "may be used uninitialized" compiled with "-Wall -O"
- From: "mi+gcc at aldan dot algebra.com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 06 Jan 2012 20:08:54 +0000
- Subject: [Bug c/42643] "may be used uninitialized" compiled with "-Wall -O"
- Auto-submitted: auto-generated
- References: <bug-42643-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42643
--- Comment #2 from mi+gcc at aldan dot algebra.com 2012-01-06 20:08:54 UTC ---
Created attachment 26259
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=26259
Live test case (file from Mozilla's NSS package)
Even when using gcc-4.6 (more specifically gcc version 4.6.3 20111104
(prerelease) (FreeBSD Ports Collection)), I still get a bogus warning on the
attached file, unless the optimization level is at -O3 AND the -fPIC is not
specified:
mi@narawntapu:nss/lib/util (1778) gcc46 -Wall -O3 -c nssb64e.i
mi@narawntapu:nss/lib/util (1779) gcc46 -Wall -O2 -c nssb64e.i
nssb64e.i: In function 'NSSBase64_EncodeItem_Util':
nssb64e.i:3239:15: warning: 'out_len' may be used uninitialized in this
function [-Wuninitialized]
mi@narawntapu:nss/lib/util (1780) gcc46 -Wall -O3 -fPIC -c nssb64e.i
nssb64e.i: In function 'NSSBase64_EncodeItem_Util':
nssb64e.i:3239:15: warning: 'out_len' may be used uninitialized in this
function [-Wuninitialized]