https://bugs.llvm.org/show_bug.cgi?id=50645
Bug ID: 50645
Summary: Access to uninitialized volatile stack variable
generates warning
Product: clang
Version: 12.0
Hardware: Macintosh
OS: MacOS X
Status: NEW
Severity: normal
Priority: P
Component: Static Analyzer
Assignee: dcough...@apple.com
Reporter: ilya.v.gladys...@gmail.com
CC: dcough...@apple.com, llvm-bugs@lists.llvm.org
Running 'clang-check -analyze' on this simplified example:
#include <stdbool.h>
bool test(void)
{
volatile int var;
return var != 0;
}
gives me:
sample.c:6:14: warning: The left operand of '!=' is a garbage value
[core.UndefinedBinaryOperatorResult]
To me this looks like a false positive. var is declared as volatile and is
expected to be initialized externally. I have only encountered this problem
with stack variables.
--
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