This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/50171] New: False positive -Wuninitialized warning


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

             Bug #: 50171
           Summary: False positive -Wuninitialized warning
    Classification: Unclassified
           Product: gcc
           Version: 4.6.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: kirill@shutemov.name


Created attachment 25085
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25085
test case

$ cat test.i 
int baz(char **, const char *);
int quux(char *);

static int bar(char **out, const char *in)
{
        char *t;

        if (!baz(&t, in))
                return -1;

        *out = t;

        return 0;
}

int foo(const char *a)
{
        char *b;

        if (!bar(&b, a))
                return -1;

        return quux(b);
}
$ gcc -c -O -Wuninitialized test.i
test.i: In function âfooâ:
test.i:23:9: warning: âbâ may be used uninitialized in this function
[-Wuninitialized]


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]