public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Martin v. Loewis" <martin@mira.isdn.cs.tu-berlin.de>
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	[thread overview]
Message-ID: <199903222039.VAA07030@mira.isdn.cs.tu-berlin.de> (raw)
In-Reply-To: < 199903221606.LAA23180@kauai.newjersey.sco.com > (jls@sco.com)

> 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

WARNING: multiple messages have this Message-ID
From: "Martin v. Loewis" <martin@mira.isdn.cs.tu-berlin.de>
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	[thread overview]
Message-ID: <199903222039.VAA07030@mira.isdn.cs.tu-berlin.de> (raw)
Message-ID: <19990331234600.61HQU1L9pAjvqU-66kxiW2OHAWz0SpW1jFtP9GuAukY@z> (raw)
In-Reply-To: <199903221606.LAA23180@kauai.newjersey.sco.com>

> 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

  parent reply	other threads:[~1999-03-22 12:44 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-03-22  8:21 Jonathan Schilling
     [not found] ` < 199903221606.LAA23180@kauai.newjersey.sco.com >
1999-03-22 12:44   ` Martin v. Loewis [this message]
1999-03-31 23:46     ` Martin v. Loewis
1999-03-31 23:46 ` Jonathan Schilling
1999-03-22 14:08 Jonathan Schilling
1999-03-31 23:46 ` Jonathan Schilling
     [not found] <199903221606.LAA23180.cygnus.egcs@kauai.newjersey.sco.com>
1999-03-22 22:37 ` Jason Merrill
1999-03-31 23:46   ` Jason Merrill

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=199903222039.VAA07030@mira.isdn.cs.tu-berlin.de \
    --to=martin@mira.isdn.cs.tu-berlin.de \
    --cc=egcs@egcs.cygnus.com \
    --cc=jls@sco.com \
    --cc=robertl@sco.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).