Many warnings when optimizing
Dave Steffen
steffend@glitch.physics.colostate.edu
Mon Jan 12 16:36:00 GMT 1998
Hi Folks,
First of all, for the record, I'm using EGCS 1.0.1 on a HP-UX 9.05
machine.
So, an interesting thing just happened. When compiling my numerical
code without any optimizations, everything was fine. However, I
turn on optimization with -O, and I get several pages of warnings
about things in the standard headers:
c++ -ansi -Wall -O -I/dsk2/opt/lib/TNT -I/dsk2/opt/lib/C++ -I/dsk2/opt/lib/C++/libg++ -c init.C
/dsk2/opt/include/g++/stl_vector.h: In function `void Initialize(int, char **)':
/dsk2/opt/include/g++/stl_vector.h:146: warning: `double * p' might be used uninitialized in this function
/dsk2/opt/include/g++/stl_construct.h:45: warning: `void * place' might be used uninitialized in this function
init.C: In function `class vector<double,__default_alloc_template<false,0> > Parse_Etas(const char *)':
init.C:245: warning: `class vector<double,__default_alloc_template<false,0> > * this' might be used uninitialized in this function
init.C:245: warning: `const class vector<double,__default_alloc_template<false,0> > & x' might be used uninitialized in this function
/dsk2/opt/include/g++/stl_vector.h:104: warning: `const class vector<double,__default_alloc_template<false,0> > * this' might be used uninitialized in this function
/dsk2/opt/include/g++/stl_vector.h:104: warning: `const class vector<double,__default_alloc_template<false,0> > * this' might be used uninitialized in this function
/dsk2/opt/include/g++/stl_vector.h:104: warning: `const class vector<double,__default_alloc_template<false,0> > * this' might be used uninitialized in this function
/dsk2/opt/include/g++/stl_vector.h:104: warning: `const class vector<double,__default_alloc_template<false,0> > * this' might be used uninitialized in this function
/dsk2/opt/include/g++/stl_vector.h:104: warning: `const double * last' might be used uninitialized in this function
/dsk2/opt/include/g++/stl_vector.h:104: warning: `const double * first' might be used uninitialized in this function
... and so on for a page or two.
The code compiled just fine, but having all these warnings is
annoying -- particularly because there might be something in there
that really _should_ trigger a warning, but I'd never see it in the
midst of all the spurious warnings.
Thought you might like to know.
BTW, nice compiler! I'll post a few informal, but illuminating,
test results to the egcs list in a few minutes.
--------------------------------------------------------------------------
Dave Steffen Wave after wave will flow with the tide
Dept. of Physics And bury the world as it does
Colorado State University Tide after tide will flow and recede
steffend@lamar.colostate.edu Leaving life to go on as it was...
- Peart / RUSH
"The reason that our people suffer in this way....
is that our ancestors failed to rule wisely". -General Choi, Hong Hi
More information about the Gcc-bugs
mailing list