public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/54554] New: Undetected use of uninitialized variable
@ 2012-09-12  9:16 dpapavas at gmail dot com
  2012-09-12  9:47 ` [Bug c/54554] " rguenth at gcc dot gnu.org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: dpapavas at gmail dot com @ 2012-09-12  9:16 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54554

             Bug #: 54554
           Summary: Undetected use of uninitialized variable
    Classification: Unclassified
           Product: gcc
           Version: 4.7.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: dpapavas@gmail.com


Created attachment 28176
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=28176
The output of the command line used to compile the snippet to stderr.

When compiling the snippet below:

---8<------8<------8<------8<------8<------8<------8<------8<---

extern int printf (__const char *__restrict __format, ...);

int main()
{
    int j;

    for (j = 0 ; j < 10 ; j += 1) {
        int i;

        printf ("%d\n", i);
        i = 1;
    }

    return 0;
}

---8<------8<------8<------8<------8<------8<------8<------8<---

GCC fails to detect the use of an uninitialized variable.  The command line
used to compile it is:

gcc -v -save-temps -Wall -Wextra -O0 -g -ansi -pedantic foo.c

Output to stderr has been attached.  I won't attach the .i file as it simply
seems to contain a copy of the source.  Let me know if you need it.

Bug 52523 seems to be related if not identical but I'm still submitting this as
this is C code not C++.


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2022-08-29 13:46 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-12  9:16 [Bug c/54554] New: Undetected use of uninitialized variable dpapavas at gmail dot com
2012-09-12  9:47 ` [Bug c/54554] " rguenth at gcc dot gnu.org
2012-09-12 10:19 ` dpapavas at gmail dot com
2013-01-04 10:28 ` manu at gcc dot gnu.org
2013-01-04 12:41 ` dpapavas at gmail dot com
2013-01-04 12:50 ` manu at gcc dot gnu.org
2013-01-04 14:50 ` dpapavas at gmail dot com
2014-04-09 10:49 ` mpolacek at gcc dot gnu.org
2014-04-09 11:04 ` manu at gcc dot gnu.org
2014-04-10  7:12 ` dominik.muth at gmx dot de
2022-08-29 13:46 ` [Bug tree-optimization/54554] fails to warn for uninitialized var within loop always taken at -O0 rguenth at gcc dot gnu.org

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).