public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: Petter Reinholdtsen <pere@hungry.com>
To: nobody@gcc.gnu.org
Cc: gcc-prs@gcc.gnu.org
Subject: Re: libstdc++/1072: Exception-unsafe code in locale
Date: Sun, 27 May 2001 04:26:00 -0000	[thread overview]
Message-ID: <20010527112600.9819.qmail@sourceware.cygnus.com> (raw)

The following reply was made to PR libstdc++/1072; it has been noted by GNATS.

From: Petter Reinholdtsen <pere@hungry.com>
To: peturr@usa.net
Cc: gcc-gnats@gcc.gnu.org
Subject: Re: libstdc++/1072: Exception-unsafe code in locale
Date: Sun, 27 May 2001 13:19:26 +0200

 Here are a few comments from a simple gcc user.
 
 I checked the current source in CVS and compared it to the code in
 your bug report, and the code is different now.
 
 > These catch blocks are useless since the target pointers are never
 > modified if either operator new or the constructors throw an
 > exception.
 
 I believe this is correct.  The try/catch block is completely useless,
 and it would be better to use auto_ptr.
 
 > In fact, they will probably cause a crash since the pointers are not
 > initialized before the try block.
 
 This seem to be correct with gcc 2.95.2, but the C++ standard
 specifies the pointer member variables should be initialized to
 0. (Read clause 12.6.2, 8.5 and 3.9 to learn more).
 
 > Also, if an exception is thrown from the second try block, the
 > object allocated in the first one is leaked.
 
 This is correct, but seem to have been fixed.
 -- 
 ##>  Petter Reinholdtsen  <##  |  pere@hungry.com


             reply	other threads:[~2001-05-27  4:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-05-27  4:26 Petter Reinholdtsen [this message]
2002-04-09 14:06 bkoz

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=20010527112600.9819.qmail@sourceware.cygnus.com \
    --to=pere@hungry.com \
    --cc=gcc-prs@gcc.gnu.org \
    --cc=nobody@gcc.gnu.org \
    /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).