bug: missing warning

Han-Wen Nienhuys hanwen@cs.uu.nl
Fri Jun 18 03:03:00 GMT 1999


In the below fragment, no warning is issued for the lack of a return
statement in func(). Removing the declaration of Foo::~Foo() brings
back the warning.  This is with egcs-2.91.66 19990314/Linux
(egcs-1.1.2 release).

The absent warning is especially vicious, because the resulting stack
corruption happens in the function calling func (), not in func()
itself.



	struct Foo
	{
	  int i;
	  ~Foo ();
	};

	void
	g (Foo *f)
	{
	}

	Foo
	func (Foo f)
	{
	  for (int i=0; i < 6; i++)
	    g(&f);
	}

-- 

Han-Wen Nienhuys, hanwen@cs.uu.nl ** GNU LilyPond - The Music Typesetter 
      http://www.cs.uu.nl/people/hanwen/lilypond/index.html 



More information about the Gcc-bugs mailing list