This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Missing warning about uninitialized variable.


Hi J.C.,

In your ishootyou.c, if your objective is to have the compiler display the
warning, ala...

gcc -O -Wuninitialized -lm -Wall ishootyou.c -o ishootyou

ishootyou.c:12: warning: 'uninitialized_var_gurka' may be used uninitialized
in this function

...how come you are not enabling the warning, as I've done above?

Or even more so, as indicated by the comment in the code, treating it as an
error?

gcc -Werror -O -Wuninitialized -lm -Wall ishootyou.c -o ishootyou

On my version of GCC, I realize that -Wall enables -Wuninitialized ... but
ONLY if optimizations are enabled.  Which has already been mentioned by
someone else in this discussion thread.

Sincerely,
--Eljay


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]