[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[Bug middle-end/19430] V_MAY_DEF (taking address of var) causes missing uninitialized warning


--- Comment #20 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
(In reply to Manuel López-Ibáñez from comment #19)
> (In reply to Vincent Lefèvre from comment #18)
> > This seems to be fixed in the trunk.
> Is there an XPASS for gcc.dg/uninit-pr19430.c ?
> Also, the testcase from bug 42079?

Clang warns for this in the FE without any optimization:

gcc.dg/uninit-pr19430.c:10:7: warning: variable 'j' is used uninitialized
whenever 'if' condition is false [-Wsometimes-uninitialized]
  if (bar (i)) { 
gcc.dg/uninit-pr19430.c:15:10: note: uninitialized use occurs here
  return j;
gcc.dg/uninit-pr19430.c:10:3: note: remove the 'if' if its condition is always
  if (bar (i)) { 
gcc.dg/uninit-pr19430.c:8:8: note: initialize the variable 'j' to silence this
  int j; /* { dg-warning "'j' may be used uninitialized in this function"
"uninitialized" { xfail *-*-* } 8 } */
        = 0

You are receiving this mail because:
You are on the CC list for the bug.

Reply to: