[Bug analyzer/94714] New: Analyzer: no warning on access of an uninitialized variable of automatic storage duration
vincent-gcc at vinc17 dot net
gcc-bugzilla@gcc.gnu.org
Wed Apr 22 13:21:53 GMT 2020
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94714
Bug ID: 94714
Summary: Analyzer: no warning on access of an uninitialized
variable of automatic storage duration
Product: gcc
Version: 10.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: analyzer
Assignee: dmalcolm at gcc dot gnu.org
Reporter: vincent-gcc at vinc17 dot net
Target Milestone: ---
Test with: gcc-10 (Debian 10-20200418-1) 10.0.1 20200418 (experimental) [master
revision 27c171775ab:4c277008be0:c5bac7d127f288fd2f8a1f15c3f30da5903141c6]
Consider:
#include <stdio.h>
int main (void)
{
int *p;
int i;
p = &i;
printf ("%d\n", p[0]);
return 0;
}
With "gcc-10 tst.c -o tst -O3 -fanalyzer", I do not get any warning from the
analyzer, though p[0] is uninitialized. Ditto without optimizations (in which
case, running the program really shows that i is uninitialized).
More information about the Gcc-bugs
mailing list