Bugzilla – Bug 144848
gcc doesn't detect uninitialized read from array
Last modified: 2008-04-28 15:21:00 UTC
michael.matz@novell.com wrote: Short testprogram: --------------------------- extern unsigned long slen(const unsigned char *); int f (unsigned char *input) { unsigned char buffer[100]; unsigned char *pos; pos = input; if (*pos == '"') pos++; return buffer[slen(pos)] == 'a'; } -------------------------------------- This doesn't warn. Replacing the slen(pos) call with a constant like 2 does warn that buffer[2] isn't initialized. So this is a possible enhancement for GCC.
Forwarded to http://gcc.gnu.org/PR27120
We will take this from upstream once it'S fixed for future releases. WONTFIX for 10.1.