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/38037] false uninitialized warnings when using a pointer as a guard



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


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