Summary: | The message "variable might be used uninitialised" does not tell the location | ||
---|---|---|---|
Product: | gcc | Reporter: | schnetter |
Component: | c | Assignee: | Not yet assigned to anyone <unassigned> |
Status: | RESOLVED FIXED | ||
Severity: | enhancement | CC: | bangerth, gcc-bugs, manu |
Priority: | P3 | Keywords: | diagnostic |
Version: | 2.95.3 | ||
Target Milestone: | 4.0.0 | ||
Host: | Target: | ||
Build: | Known to work: | ||
Known to fail: | 2.97 3.0 3.0.1 3.0.2 3.0.3 3.0.4 3.1 3.1.1 3.1.2 3.2 3.2.1 3.2.2 3.2.3 3.3 3.3.1 3.3.2 3.3.3 3.4.0 4.0.0 | Last reconfirmed: | 2004-02-09 03:50:47 |
Bug Depends on: | |||
Bug Blocks: | 24639 |
Description
schnetter
2002-07-10 02:36:01 UTC
State-Changed-From-To: open->analyzed State-Changed-Why: Confirmed. Use the following, as an example: ----------------------- void g (); void f() { int i; if (i) g(); }; ---------------------- The message is tmp/g> /home/bangerth/bin/gcc-3.3-pre/bin/gcc -W -Wall -Wuninitialized -O -c x.c x.c: In function `f': x.c:4: warning: `i' might be used uninitialized in this function From: Wolfgang Bangerth <bangerth@ticam.utexas.edu> To: gcc-gnats@gcc.gnu.org, <gcc-bugs@gcc.gnu.org> Cc: Subject: Re: c/7258: The message "variable might be used uninitialised" does not tell the location Date: Tue, 3 Dec 2002 17:02:06 -0600 (CST) Regarding my confirmation message for this report: Too bad I deleted the line between functions g() and f() upon pasting, but not updating the compiler output. With the given code, the warning is for line _3_, which is the declaration, not the use of 'i'. W. ------------------------------------------------------------------------- Wolfgang Bangerth email: bangerth@ticam.utexas.edu www: http://www.ticam.utexas.edu/~bangerth still happens on the mainline (20030526) and this would be nice: pr7258.c: In function `f': pr7258.c:3: warning: `i' might be used uninitialized in this function Suspending as this is fixed on the tree-ssa: pr7258.c: In function `f': pr7258.c:4: warning: 'i' is used uninitialized in this function Line 4 contains: if (i) Also note for the "reduced" source it says "is" and not "might". Fixed for 3.5.0 by the merge of the tree-ssa. I am not so sure this is fixed. I need to double check this. |