[LLVMbugs] [Bug 17290] -Wsometimes-uninitialized and -Wconditional-uninitialized give suboptimal fixit with 'bool' variables

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Sep 19 17:29:18 PDT 2013


http://llvm.org/bugs/show_bug.cgi?id=17290

Richard Smith <richard-llvm at metafoo.co.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #5 from Richard Smith <richard-llvm at metafoo.co.uk> ---
Fixed in r191057.


test.c:8:7: warning: variable 'foo' is used uninitialized whenever 'if'
condition is false
      [-Wsometimes-uninitialized]
  if (random() % 2)
      ^~~~~~~~~~~~
test.c:13:7: note: uninitialized use occurs here
  if (foo)
      ^~~
test.c:8:3: note: remove the 'if' if its condition is always true
  if (random() % 2)
  ^~~~~~~~~~~~~~~~~
test.c:7:11: note: initialize the variable 'foo' to silence this warning
  bool foo;
          ^
           = false

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20130920/caa1a693/attachment.html>


More information about the llvm-bugs mailing list