Mail Archives: djgpp/1996/03/21/10:33:23
On Thu, 21 Mar 1996, A.Appleyard wrote:
> I have a big Gnu C++ program (an Emacs-type text editor) in several files,
> which I compile with `gcc <filename> -c -g -Wall', getting no fault remarks or
> cautions or warnings. But today I compiled it with `gcc <filename> -c -g -O3',
> and got a mass of warnings of this type:-
If you don't tell gcc to optimize (even just -O) it doesn't invoke some
of the code that checks for certain potential problems. For instance,
you will never see warnings about unused variables unless you compile
with -O. It is advisable to include -O at least once just to gain the
extra safety net. As in gcc -O and -g don't contradict, you should IMHO
always do that.
> main.cc: In function `int main(int, char **)':
> main.cc:33: warning: variable `class buffer * C' might be clobbered by
> `longjmp' or `vfork'
I'd imagine that if you use longjmp in certain circumstances, some of the
destructors for variables that are on the parts of the stack which longjmp
unwinds aren't called. That's why the exceptions were introduced into
C++, right?
- Raw text -