From: "Anthony.Appleyard" 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: Precedence: bulk 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.