[OCLUG-devel] ICFP Contest 2004

Stephen Crane scrane at cornerkitchenpeddler.com
Wed Jun 9 15:17:08 PDT 2004


On Wednesday, June 09, 2004 02:01 pm, you wrote:
> On Wed, 2004-06-09 at 14:02, Stephen Crane wrote:
> > I'm trying to understand something in the g++ compiler. If I turn on the
> > optimization (-O1) I get a SEGFAULT almost immediatly! Any clue why this
> > would happen? (I'm using the code attached to my original post)
>
> Is it your code that is SEGFAULTing, or the compiler?

Well, I tried it again and surprise, it worked. My code was segfaulting. For 
some reason when I used the compiler in eclipse/CDT which used:
g++ -O3 -Wall -c -o simulator.o ../simulator.cpp
g++  -o ant_simulator     simulator.o  
Or:
g++ -O0 -Wall -c -o simulator.o ../simulator.cpp
g++  -o ant_simulator     simulator.o  
it wouldn't work, but if I used:
g++ -Wall -o ant_simulator simulator
It would work. Both commands apparently work now, don't know why. Any reason 
why?

Thanks,
Stephen



More information about the OCLUG-devel mailing list