www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/03/21/09:47:53

From: "A.Appleyard" <A DOT APPLEYARD AT fs2 DOT mt DOT umist DOT ac DOT uk>
To: DJGPP AT DELORIE DOT COM
Date: Thu, 21 Mar 1996 14:41:47 GMT
Subject: When and how does longjmp() `clobber' variables?
Message-ID: <A8BE871245@fs2.mt.umist.ac.uk>

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:-

C:\AM>gcc main.cc -g -O3 -c -Wall
main.cc: In function `int main(int, char **)':
main.cc:33: warning: variable `class buffer * C' might be clobbered by
  `longjmp' or `vfork'
main.cc:33: warning: variable `char * T' might be clobbered by
  `longjmp' or `vfork'

  (1) A text search through the FAQ found no mention of `longjmp' or
`clobber'. When and how does longjmp clobber a variable?
  (2) djgpp\docs\djgpp\libc.tex says that `vfork' is used in UNIX systems:
what does `vfork' do in them, and how can it affect variables to cause the
above complaints?

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019