From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tobias Ringstrom To: egcs@cygnus.com Subject: Strange warning (variable might be clobbered by `longjmp' or `vfork') Date: Tue, 26 Aug 1997 13:14:47 -0000 Message-id: X-SW-Source: 1997-08/0500.html The following code gives a strange warning. class ios { public: virtual ~ios(); }; class istream : virtual public ios { public: istream() { } }; class ifstream : public istream { public: ifstream() { } }; void f() { int maxrows=20; ifstream file; while (maxrows < 100) maxrows *= 2; } When compiling using egcs-2.90.02 (970825), I get: ~/Prog> g++ -Wall -O -c egcs-feature2.cc egcs-feature2.cc: In function `void f()': egcs-feature2.cc:15: warning: variable `int maxrows' might be clobbered by `longjmp' or `vfork' Is that correct? If yes, I would appreciate is anyone could explain why. The warning disappears if I move the line 'ifstream file;' before the line 'int maxrows=20;'. / Tobias