Bug 42079

Summary: missing unitialized warning on simple testcase
Product: gcc Reporter: Maarten Lankhorst <m.b.lankhorst>
Component: cAssignee: Not yet assigned to anyone <unassigned>
Status: RESOLVED DUPLICATE    
Severity: normal CC: burnus, christian.joensson, debian-gcc, gcc-bugs, m.b.lankhorst, manu, marcus, P.Schaffnit, wine.msi
Priority: P3    
Version: 4.4.2   
Target Milestone: ---   
Host: Target:
Build: Known to work:
Known to fail: Last reconfirmed:

Description Maarten Lankhorst 2009-11-17 12:55:57 UTC
This code should warn that foo is used uninitialized, but it doesn't.. gcc 4.3 and gcc 4.4 both fail to report a warning

extern void do_something(void **foo);
extern int cond(void);

int main(int argc, char *argv[])
{
void *foo;
if (cond())
    do_something(&foo);
*argv = foo;
return 0;
}
Comment 1 Richard Biener 2009-11-17 16:18:51 UTC
It would give too many false positives.  Also we do not warn for non-registers
very consistently (due to the same reason).
Comment 2 Manuel López-Ibáñez 2009-11-19 12:00:51 UTC
Taking address of var causes missing may be uninitialized.

*** This bug has been marked as a duplicate of 19430 ***