This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: mutable members in global const objects
- To: Tim Hollebeek <tim at wagner dot princeton dot edu>
- Subject: Re: mutable members in global const objects
- From: Jamie Lokier <jamie at imbolc dot ucc dot ie>
- Date: Wed, 5 Aug 1998 00:22:12 +0100
- Cc: egcs at cygnus dot com
- References: <19980804004210.B8324@tantalophile.demon.co.uk> <199808041434.KAA14677@wagner.Princeton.EDU>
On Tue, Aug 04, 1998 at 10:34:29AM -0400, Tim Hollebeek wrote:
> wagner:~:104> g++ -v
> Reading specs from /usr/local/lib/gcc-lib/mips-sgi-irix5.3/egcs-2.90.27/specs
> gcc version egcs-2.90.27 980315 (egcs-1.0.2 release)
> wagner:~:105> g++ -O4 foo.C
> wagner:~:106> ./a.out
> This code is fine.
It varies between targets then.
tantalophile:~/t$ g++ -v -O t.cc
Reading specs from /usr/lib/gcc-lib/i386-linux/egcs-2.90.27/specs
gcc version egcs-2.90.27 980315 (egcs-1.0.2 release)
tantalophile:~/t$ ./a.out
Segmentation fault (core dumped)
tantalophile:~/t$ perl -pi.bak -e 's/s =/s __attribute__((section(".data"))) =/;' t.cc
tantalophile:~/t$ g++ -v -O t.cc
Reading specs from /usr/lib/gcc-lib/i386-linux/egcs-2.90.27/specs
gcc version egcs-2.90.27 980315 (egcs-1.0.2 release)
tantalophile:~/t$ ./a.out
This code is wrong.
-- Jamie