public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: John Love-Jensen <eljay@adobe.com>
To: <gcc@wiesinger.com>, <gcc-help@gcc.gnu.org>
Subject: Re: GCC compile problem ...
Date: Fri, 27 Sep 2002 09:35:00 -0000	[thread overview]
Message-ID: <B9B9F22C.4AB1%eljay@adobe.com> (raw)
In-Reply-To: <Pine.LNX.4.44.0209271805510.7519-100000@bbs.intern>

Hi Gerhard,

The TEMPORARY from test.getString is being set to a REFERENCE.

The TEMPORARY is destructed, more-or-less, after the semicolon that set the
string reference to the temporary.

The cout << s << "\n"; is operating on the s string that has been
destructed, which is very dangerous.  Who knows what state that freed STACK
memory and HEAP memory will be in, especially during the machinations of the
ostream processing.

Borland C++ 5.5 and Microsoft Visual C++ 6.0 should be ashamed.  Shame.
Shame.

--Eljay

  parent reply	other threads:[~2002-09-27 16:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-27  9:09 gcc
2002-09-27  9:30 ` Sebastian Huber
2002-09-27  9:35 ` John Love-Jensen [this message]
2002-09-27 15:52   ` Sebastian Huber
2002-09-30  4:49     ` John Love-Jensen
  -- strict thread matches above, loose matches on Subject: below --
2000-01-26  6:51 gcc " Brian J. Dent
2000-01-26 12:10 ` Alexandre Oliva
2000-04-01  0:00   ` Alexandre Oliva
2000-04-01  0:00 ` Brian J. Dent

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=B9B9F22C.4AB1%eljay@adobe.com \
    --to=eljay@adobe.com \
    --cc=gcc-help@gcc.gnu.org \
    --cc=gcc@wiesinger.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).