delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/10/17/11:25:56

From: "Anthony.Appleyard" <MCLSSAA2 AT fs2 DOT mt DOT umist DOT ac DOT uk>
Organization: Materials Science Centre
To: DJGPP AT delorie DOT com
Date: Fri, 17 Oct 1997 16:24:12 GMT-1
Subject: Clobbering
Reply-to: Anthony DOT Appleyard AT umist DOT ac DOT uk
Message-ID: <F8259F6C2D@fs2.mt.umist.ac.uk>

  I have a big djgpp C++ program (a text editor) on several files. When
compiling it in -O2 mode I get varions moans like this:-

  main.cc: In function `int main(int, char **)':
  main.cc:41: warning: variable `char * T' might be clobbered by `longjmp' or
`vfork'

  and I believe the remedy is to declare the offending variables volatile.
e..g. `volatile char*T;'. OK. But in a class member function how on earth do I
declare `this*' as volatile!?

  macros.cc:395: warning: variable `class val * this' might be clobbered by
`longjmp' or `vfork'

  Confusingly, this line is in a function `void buffer::translate()', and I
would have thought that the current `this*' would be a `class buffer*' not a
`class val*'! The offending line is:-
    if(T1.n>0) namemacro(val(1,0),T1,val(Record)); *K=*Record;}
  where val() is a constructor for a `class val' that I declared.

- Raw text -


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