https://llvm.org/bugs/show_bug.cgi?id=26451
Bug ID: 26451 Summary: Spurious use after free warning when using %p Product: clang Version: 3.8 Hardware: PC OS: All Status: NEW Severity: normal Priority: P Component: Static Analyzer Assignee: kreme...@apple.com Reporter: sits...@yahoo.com CC: llvm-bugs@lists.llvm.org Depends on: 26221 Classification: Unclassified Created attachment 15814 --> https://llvm.org/bugs/attachment.cgi?id=15814&action=edit C program that demonstrates spurious use after free warning Description of the problem: Code that prints the address of a pointer after the memory has been freed triggers a "Use of memory after it is freed" warning even though the pointer itself is not dereferenced. Steps to reproduce: 1. Compile the attached C program using scan-build cc -O1 spurious-printf-use-after-free.c -c Expected results: No warnings. Actual results: # scan-build: Using '/usr/bin/clang' for static analysis spurious-printf-use-after-free.c:11:2: warning: Use of memory after it is freed printf("%p\n", (void *)p); ^~~~~~~~~~~~~~~~~~~~~~~~~ 1 warning generated. Additional information: This problem was identified by Barry Davis of StorMagic. Version information: llvm-3.7.0-3.fc23.x86_64 clang version 3.7.0 (tags/RELEASE_370/final) Target: x86_64-redhat-linux-gnu Thread model: posix -- You are receiving this mail because: You are on the CC list for the bug.
_______________________________________________ llvm-bugs mailing list llvm-bugs@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs