public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c++/7884: code compiled with optimization flag causes segmentation   violation
@ 2002-09-12  4:16 Gabriel Dos Reis
  0 siblings, 0 replies; 3+ messages in thread
From: Gabriel Dos Reis @ 2002-09-12  4:16 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

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

From: Gabriel Dos Reis <gdr@integrable-solutions.net>
To: arnez@de.ibm.com
Cc: gcc-gnats@gcc.gnu.org
Subject: Re: c++/7884: code compiled with optimization flag causes segmentation   violation
Date: 12 Sep 2002 13:03:44 +0200

 arnez@de.ibm.com writes:
 
 | 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.
 
 Because the C++ definition says so.
 
 |  Using a cast as an lvalue is listed as one of GCC's extensions.  
 
 That particular extension doesn't play well with the rest of the
 language and is causing more troubles than it solves any real
 problems. It may disappear in some future releases of GCC.
 
 -- Gaby
 
 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: c++/7884: code compiled with optimization flag causes segmentation  violation
@ 2002-09-12  5:36 Gabriel Dos Reis
  0 siblings, 0 replies; 3+ messages in thread
From: Gabriel Dos Reis @ 2002-09-12  5:36 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

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

From: Gabriel Dos Reis <gdr@integrable-solutions.net>
To: "Andreas Arnez" <ARNEZ@de.ibm.com>
Cc: gcc-gnats@gcc.gnu.org
Subject: Re: c++/7884: code compiled with optimization flag causes segmentation  violation
Date: 12 Sep 2002 14:22:23 +0200

 "Andreas Arnez" <ARNEZ@de.ibm.com> writes:
 
 | [1  <text/plain; us-ascii (7bit)>]
 | > That particular extension doesn't play well with the rest of the
 | > language and is causing more troubles than it solves any real
 | > problems. It may disappear in some future releases of GCC.
 | 
 | Then is there any way to instruct the compiler to yield a
 | diagnostic for this?
 
 None currently exists.  But recent patches and discussions about that
 extension (and its unexpected implications) may cause such a siwtch to
 happen. 
 
 | I tried -ansi, -pedantic, and -Wall.
 | I would have expected -ansi to consider casts as rvalues.
 
 So would I.
 
 -- Gaby


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: c++/7884: code compiled with optimization flag causes segmentation  violation
@ 2002-09-12  1:46 arnez
  0 siblings, 0 replies; 3+ messages in thread
From: arnez @ 2002-09-12  1:46 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

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
 
 
 


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2002-09-12 12:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-09-12  4:16 c++/7884: code compiled with optimization flag causes segmentation violation Gabriel Dos Reis
  -- strict thread matches above, loose matches on Subject: below --
2002-09-12  5:36 Gabriel Dos Reis
2002-09-12  1:46 arnez

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).