This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
-Wuninitialized and DoS
- To: gcc at gcc dot gnu dot org
- Subject: -Wuninitialized and DoS
- From: toon at moene dot indiv dot nluug dot nl
- Date: 20 Jan 2000
Lectoribus Salutem,
I thought - apparently incorrectly - that RTH's removal of
stupid.c and the accompanying changes to run (parts of)
flow and life-analysis would mean that uninitialized variables
could be warned for even when not optimizing.
Unfortunately, when compiling the following with -Wuninitialized -O:
main()
{
int i;
printf("%d",i);
}
I get:
d.c: In function `main':
d.c:3: warning: `i' might be used uninitialized in this function
However, when using -Wuninitialid.c: In function `main':
d.c:3: warning: `i' might be used uninitialized in this function
Sorry, again:
However, when using -Wuninitialized, I get just:
cc1: warning: -Wuninitialized is not supported without -O
Does that mean that the flow and life analysis done without
optimization is simply not enough to determine this, or is
something else going wrong ?
Another interesting example, using Fortran, is:
SUBROUTINE AAP
RECIEVED = 0.0
C ...
C ... Other stuff, not involving RECIEVED ...
C ...
RECEIVED = RECEIVED + 1.0
PRINT*,RECEIVED
END
if I issue /usr/snp/bin/g77 -c -Wuninitialized -O d.f I don't
even get a warning, let alone without -O.
I'd be interested in pointers, as much as ways to determine
this myself ...
Thanks in advance,
Toon.