From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8205 invoked by alias); 12 Sep 2002 08:46:07 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 8185 invoked by uid 71); 12 Sep 2002 08:46:06 -0000 Date: Thu, 12 Sep 2002 01:46:00 -0000 Message-ID: <20020912084606.8183.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: arnez@de.ibm.com Subject: Re: c++/7884: code compiled with optimization flag causes segmentation violation Reply-To: arnez@de.ibm.com X-SW-Source: 2002-09/txt/msg00202.txt.bz2 List-Id: The following reply was made to PR c++/7884; it has been noted by GNATS. From: arnez@de.ibm.com To: aloeff@de.ibm.com, gcc-gnats@gcc.gnu.org, gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org, nobody@gcc.gnu.org Cc: Subject: Re: c++/7884: code compiled with optimization flag causes segmentation violation Date: Thu, 12 Sep 2002 10:44:10 +0200 I don't quite understand why (char *)foo is an rvalue. Using a cast as an lvalue is listed as one of GCC's extensions. In particular GCC allows me to write: extern int do_stuff(void *bar); int f(char *str) { void *foo; (char *) foo = str+1; return do_stuff(foo); } I can compile this both in C or C++ mode, even with -ansi and -pedantic. http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=7884