This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/50171] False positive -Wuninitialized warning
- From: "kirill at shutemov dot name" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 24 Aug 2011 10:57:30 +0000
- Subject: [Bug c/50171] False positive -Wuninitialized warning
- Auto-submitted: auto-generated
- References: <bug-50171-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50171
--- Comment #3 from Kirill A. Shutemov <kirill at shutemov dot name> 2011-08-24 10:57:30 UTC ---
Sorry, I've made mistake trying to simplify the test case.
Is it still correct to generate warning for the code below?
int error(void);
int baz(char **, const char *);
int quux(char *);
static int bar(char **out, const char *in)
{
char *t;
int err;
err = baz(&t, in);
if (err < 0)
return error();
*out = t;
return 0;
}
int foo(const char *a)
{
int err;
char *b;
err = bar(&b, a);
if (err < 0)
return error();
return quux(b);
}