From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32354 invoked by alias); 27 Sep 2002 16:35:08 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 32346 invoked from network); 27 Sep 2002 16:35:08 -0000 Received: from unknown (HELO smtp-relay-1.adobe.com) (192.150.11.1) by sources.redhat.com with SMTP; 27 Sep 2002 16:35:08 -0000 Received: from inner-relay-2.corp.adobe.com (inner-relay-2 [153.32.1.52]) by smtp-relay-1.adobe.com (8.12.3/8.12.3) with ESMTP id g8RGbbVN009655 for ; Fri, 27 Sep 2002 09:37:37 -0700 (PDT) Received: from iplan-mn.corp.adobe.com (iplan-mn.corp.adobe.com [130.248.25.5]) by inner-relay-2.corp.adobe.com (8.12.3/8.12.3) with ESMTP id g8RGWVvW005252 for ; Fri, 27 Sep 2002 09:32:32 -0700 (PDT) Received: from [130.248.25.159] ([192.150.11.13]) by iplan-mn.corp.adobe.com (Netscape Messaging Server 4.15 mn Jul 11 2001 16:32:57) with ESMTP id H33VEC00.T3B; Fri, 27 Sep 2002 11:35:00 -0500 User-Agent: Microsoft-Entourage/10.0.0.1331 Date: Fri, 27 Sep 2002 09:35:00 -0000 Subject: Re: GCC compile problem ... From: John Love-Jensen To: , Message-ID: In-Reply-To: Mime-version: 1.0 Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit X-SW-Source: 2002-09/txt/msg00216.txt.bz2 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