This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/38037] false uninitialized warnings when using a pointer as a guard
- From: "edwintorok at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 6 Nov 2008 20:58:55 -0000
- Subject: [Bug c/38037] false uninitialized warnings when using a pointer as a guard
- References: <bug-38037-15165@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from edwintorok at gmail dot com 2008-11-06 20:58 -------
/* testcase
gcc -O2 -Wall -c foo.c */
char *get(void);
int use(const char *);
void foo(const char *bar)
{
char *foobar;
if(!bar)
foobar = get();
if(use(bar))
return;
if(!bar)
free(foobar);
}
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38037