public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/51740] New: warning "is used uninitialized in this function" is missing if the variable initialized later
@ 2012-01-03 14:28 szo at szo dot hu
2012-01-03 15:18 ` [Bug c/51740] " rguenth at gcc dot gnu.org
2012-01-03 19:26 ` szo at szo dot hu
0 siblings, 2 replies; 3+ messages in thread
From: szo at szo dot hu @ 2012-01-03 14:28 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51740
Bug #: 51740
Summary: warning "is used uninitialized in this function" is
missing if the variable initialized later
Classification: Unclassified
Product: gcc
Version: 4.6.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: szo@szo.hu
Created attachment 26231
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=26231
Code that should warn
gcc fails to emit the "is used uninitialized in this function" warning, if the
offending variable is initialized via a function later on.
See attachment. If compiled with
gcc -Wall bug.c
gcc issues no warning. If line 13 is commented out, the correct
bug.c:11:9: warning: ‘offender’ is used uninitialized in this function
[-Wuninitialized]
is emitted.
I think it's not the same as #18501, because replacing line 13 with
offencer = 0;
still produces the warning correctly.
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug c/51740] warning "is used uninitialized in this function" is missing if the variable initialized later
2012-01-03 14:28 [Bug c/51740] New: warning "is used uninitialized in this function" is missing if the variable initialized later szo at szo dot hu
@ 2012-01-03 15:18 ` rguenth at gcc dot gnu.org
2012-01-03 19:26 ` szo at szo dot hu
1 sibling, 0 replies; 3+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-01-03 15:18 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51740
Richard Guenther <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |DUPLICATE
--- Comment #1 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-01-03 15:16:57 UTC ---
This is a dup of PR50040, fixed for GCC 4.7. Note that you need to enable
optimization to get the warning there.
*** This bug has been marked as a duplicate of bug 50040 ***
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug c/51740] warning "is used uninitialized in this function" is missing if the variable initialized later
2012-01-03 14:28 [Bug c/51740] New: warning "is used uninitialized in this function" is missing if the variable initialized later szo at szo dot hu
2012-01-03 15:18 ` [Bug c/51740] " rguenth at gcc dot gnu.org
@ 2012-01-03 19:26 ` szo at szo dot hu
1 sibling, 0 replies; 3+ messages in thread
From: szo at szo dot hu @ 2012-01-03 19:26 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51740
Szókovács Róbert <szo at szo dot hu> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |CLOSED
--- Comment #2 from Szókovács Róbert <szo at szo dot hu> 2012-01-03 19:26:18 UTC ---
confirmed it's fixed in 4.7
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-01-03 19:26 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-03 14:28 [Bug c/51740] New: warning "is used uninitialized in this function" is missing if the variable initialized later szo at szo dot hu
2012-01-03 15:18 ` [Bug c/51740] " rguenth at gcc dot gnu.org
2012-01-03 19:26 ` szo at szo dot hu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).