Summary: | Missed trivial uninitialized use warning | ||
---|---|---|---|
Product: | gcc | Reporter: | Steven Bosscher <steven> |
Component: | middle-end | Assignee: | Not yet assigned to anyone <unassigned> |
Status: | RESOLVED WONTFIX | ||
Severity: | normal | CC: | manu |
Priority: | P3 | Keywords: | diagnostic |
Version: | 4.8.0 | ||
Target Milestone: | --- | ||
Host: | Target: | ||
Build: | Known to work: | ||
Known to fail: | 4.6.3, 4.8.0 | Last reconfirmed: |
Description
Steven Bosscher
2013-01-04 11:37:58 UTC
It's conditionally uninitialized and thus only warned in late uninit pass. This is a known issue of optimistic constant propagation. Duplicate of PRxyz. Never going to be fixed. PR18501, the most frequently reported Wuninitialized bug. PR18501, the most frequently reported Wuninitialized bug. Of course, it is possible to fix it. Clang does warn: pr18501.c:5:7: warning: variable 'res' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized] if (c) ^ pr18501.c:7:10: note: uninitialized use occurs here return res; ^~~ pr18501.c:5:3: note: remove the 'if' if its condition is always true if (c) ^~~~~~ pr18501.c:4:10: note: initialize the variable 'res' to silence this warning int res; ^ = 0 1 warning generated. It is just that it probably needs some serious amount of work. |