Bug 42079 - missing unitialized warning on simple testcase
Summary: missing unitialized warning on simple testcase
Status: RESOLVED DUPLICATE of bug 19430
Alias: None
Product: gcc
Classification: Unclassified
Component: c (show other bugs)
Version: 4.4.2
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-11-17 12:55 UTC by Maarten Lankhorst
Modified: 2009-11-19 12:00 UTC (History)
9 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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 ***