From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Martin v. Loewis" To: jls@sco.com Cc: egcs@egcs.cygnus.com, robertl@sco.com, martin@mira.isdn.cs.tu-berlin.de Subject: Re: incorrect C++ EH tests in egcs tree Date: Mon, 22 Mar 1999 12:44:00 -0000 Message-id: <199903222039.VAA07030@mira.isdn.cs.tu-berlin.de> In-reply-to: < 199903221606.LAA23180@kauai.newjersey.sco.com > (jls@sco.com) References: <199903221606.LAA23180@kauai.newjersey.sco.com> <199903221606.LAA23180@kauai.newjersey.sco.com> X-SW-Source: 1999-03/msg00726.html > This test uses global replacements of operator new and operator delete > to detect whether the storage acquired in main() is released. But by > using *global* replacements, it picks up possible new's done by the system > startup library that are not (yet) delete'd by the time the return > statement in main() is evaluated. Thus this test may get a spurious failure > on some platforms. I agree that the test case is bogus. Your modification test a slightly different feature, though, so I propose a different fix. Just initialize newed after main enters. int main () { newed = created = 0; try { foo (new B (A ())); } catch (...) { } return !(!newed && !created); } Would this work as well? regards, Martin From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Martin v. Loewis" To: jls@sco.com Cc: egcs@egcs.cygnus.com, robertl@sco.com, martin@mira.isdn.cs.tu-berlin.de Subject: Re: incorrect C++ EH tests in egcs tree Date: Wed, 31 Mar 1999 23:46:00 -0000 Message-ID: <199903222039.VAA07030@mira.isdn.cs.tu-berlin.de> References: <199903221606.LAA23180@kauai.newjersey.sco.com> X-SW-Source: 1999-03n/msg00731.html Message-ID: <19990331234600.61HQU1L9pAjvqU-66kxiW2OHAWz0SpW1jFtP9GuAukY@z> > This test uses global replacements of operator new and operator delete > to detect whether the storage acquired in main() is released. But by > using *global* replacements, it picks up possible new's done by the system > startup library that are not (yet) delete'd by the time the return > statement in main() is evaluated. Thus this test may get a spurious failure > on some platforms. I agree that the test case is bogus. Your modification test a slightly different feature, though, so I propose a different fix. Just initialize newed after main enters. int main () { newed = created = 0; try { foo (new B (A ())); } catch (...) { } return !(!newed && !created); } Would this work as well? regards, Martin