Bug 87365 - Uninitiliazed variable detection
Summary: Uninitiliazed variable detection
Status: RESOLVED DUPLICATE of bug 18501
Alias: None
Product: gcc
Classification: Unclassified
Component: c (show other bugs)
Version: 9.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-09-19 14:01 UTC by gcc
Modified: 2018-09-19 20:25 UTC (History)
1 user (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 gcc 2018-09-19 14:01:24 UTC
The following snippet does not detect the unitilialized variable

<pre>
int foo(volatile int cond) {
    int a;
    if (cond){
        a = 0;
    } else {
        while (cond) {
            a++;
        }
    }
    return a;
}
</pre>
Comment 1 gcc 2018-09-19 14:28:57 UTC
The volatile doesn't Change anything. I guess the combination of if and Else-while confuses him
Comment 2 Manuel López-Ibáñez 2018-09-19 20:25:44 UTC
Duplicated

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