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: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to