[LLVMbugs] [Bug 16750] New: double assignment generates wrong warning

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Jul 30 09:35:17 PDT 2013


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

            Bug ID: 16750
           Summary: double assignment generates wrong warning
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Static Analyzer
          Assignee: kremenek at apple.com
          Reporter: chang.im at watchguard.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Source file:

  1 #include <stdio.h>
  2 #include <stdlib.h>
  3 
  4 int main(int argc, char **argv) {
  5  char *xx, *yy;
  6 
  7  xx = yy = NULL;
  8  /* xx = NULL; */
  9 
 10  xx = calloc(1, 20);
 11 
 12  if (xx != NULL)
 13     free(xx);
 14 
 15  return 0;
 16 }

Following warning which is not correct.

xx.c:7:2: warning: Value stored to 'xx' is never read
 xx = yy = NULL;
 ^    ~~~~~~~~~
1 warning generated.

-- 
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/20130730/431a6f22/attachment.html>


More information about the llvm-bugs mailing list