https://bugs.llvm.org/show_bug.cgi?id=52296
Bug ID: 52296
Summary: alpha.core.BoolAssignment does not work (at least for
C and C++)
Product: clang
Version: trunk
Hardware: PC
OS: All
Status: NEW
Severity: enhancement
Priority: P
Component: Static Analyzer
Assignee: dcough...@apple.com
Reporter: nok.ra...@gmail.com
CC: dcough...@apple.com, llvm-bugs@lists.llvm.org
I am not sure whether alpha.core.BoolAssignment is supposed to work with C and
C++ code
(https://clang-analyzer.llvm.org/alpha_checks.html#alpha.core.BoolAssignment
suggests it is only for ObjC?) though source code
(https://github.com/llvm/llvm-project/blob/e356027016c6365b3d8924f54c33e2c63d931492/clang/lib/StaticAnalyzer/Checkers/BoolAssignmentChecker.cpp#L43-L53)
might indicate it should, but the next code (derived from the documentation
example) does not produce a warning:
#include <stdbool.h>
typedef int BOOL;
void test() {
BOOL foo = -1;
_Bool bar = -1;
bool qaz = -1;
}
https://godbolt.org/z/MMTzcYz65
See also
https://stackoverflow.com/questions/69592513/scan-build-for-clang-13-not-showing-errors
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs