Open dilyanpalauzov opened 2 years ago
@llvm/issue-subscribers-clang-static-analyzer
Hmm yeah this looks like a bug. I'm surprised that such simple case is missed.
Note that we often suppress warnings about dead zero-initialization. It's often better to have a = 0
dead store that the optimizer would optimize away anyway, than to have a security hole if the rest of the code suddenly fails to assign the actual value. However, the warning in this example is missed even if the initializer is changed to be non-zero.
For
a.c
:the static analyzer shall report on
int i = 0;
- Dead initialization, the value stored here ini
is never read, but it does not. I use clang 15.0.1 and then call: