According to the g++ man page, optimization is required for the compiler to be able to notice uninitialized variables.
I tried compiling with -O1 and without any -O, in neither case do I get a warning about "ptr may be used initialized".
According to the g++ man page, optimization is required for the compiler to be able to notice uninitialized variables.
I tried compiling with -O1 and without any -O, in neither case do I get a warning about "ptr may be used initialized".
There seems to be a lively discussion about how to handle uninitialized variables: http://gcc.gnu.org/wiki/Better_Uninitialized_Warnings
Bookmarks