mutable members in global const objects
Jamie Lokier
jamie@imbolc.ucc.ie
Tue Aug 4 20:53:00 GMT 1998
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
More information about the Gcc
mailing list