I think I have observed a bug in the reporting of uninitialized
variables using -Wall .
As an example, this small program does not report any warnings:
#include
int main(int argc, char *argv[])
{
int v1[1];
int *v2 = new int;
printf("%d\n", v1[0]);
*v2 = 1;
}
Why not?
An almost identic
--- Comment #4 from rguenth at gcc dot gnu dot org 2008-04-07 10:10 ---
It's all optimized away before the may-be-used-uninitialized warning is emitted
(we only execute warn_uninitialized_phi in the late pass).
--
rguenth at gcc dot gnu dot org changed:
What|Removed
--- Comment #3 from xinliangli at gmail dot com 2008-04-07 07:39 ---
It is debatable whether the const prop should happen in the presence of
unitilaized variable, but a warning should be given.
--
xinliangli at gmail dot com changed:
What|Removed |