https://llvm.org/bugs/show_bug.cgi?id=28187
Bug ID: 28187 Summary: False positive error in scan-build: bit logic Product: clang Version: 3.8 Hardware: PC OS: Linux Status: NEW Severity: normal Priority: P Component: Static Analyzer Assignee: kreme...@apple.com Reporter: socketp...@gmail.com CC: llvm-bugs@lists.llvm.org Classification: Unclassified #define F1 1 #define F2 2 int main (int argc, char **argv) { const char *space; int flags = argc; if (flags & (F1 | F2)) space = "qwe"; if (flags & F1) return *space; return 0; } ========================= $ scan-build-3.8 gcc qwe.c scan-build: Using '/usr/lib/llvm-3.8/bin/clang' for static analysis qwe.c:17:12: warning: Dereference of undefined pointer value return *space; ^~~~~~ 1 warning generated. scan-build: 1 bug found. ========================= Using constants 0, 1, 2 and 3 instead of `argc` will not trigger that bug. ========================= -- 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