Summary: | Not warning anymore about usage of uninitialized variables | ||
---|---|---|---|
Product: | gcc | Reporter: | Sebastian Dröge <slomo> |
Component: | middle-end | Assignee: | Not yet assigned to anyone <unassigned> |
Status: | RESOLVED DUPLICATE | ||
Severity: | normal | ||
Priority: | P3 | ||
Version: | 7.0.1 | ||
Target Milestone: | --- | ||
Host: | Target: | ||
Build: | Known to work: | ||
Known to fail: | Last reconfirmed: | ||
Bug Depends on: | |||
Bug Blocks: | 24639 |
Description
Sebastian Dröge
2017-03-22 14:35:03 UTC
I think this is a commonly reported bug, conditional constant propagation optimizes away the conditional uninitialized use (substituting 1 for foo) and thus there is nothing to warn about left. The warning code before any optimization happened does not warn about conditional uninitializations because of too many false positives. Dup. *** This bug has been marked as a duplicate of bug 18501 *** But even after optimization, there would be the argc!=1 code path left, which uses the uninitialized foo. (In reply to Sebastian Dröge from comment #3) > But even after optimization, there would be the argc!=1 code path left, > which uses the uninitialized foo. No, the optimization sets foo to 1 always, and argc is not tested anymore. Because the value of uninitialized variables is implementation-defined, and as such gcc can freely set it to anything that it wants? That would explain it then, yes. Thanks |