On Sun, Jul 28, 2013 at 8:01 PM, Joakim Hove <joaho@statoil.com> wrote:

As you can see I have a very old version of g++ (4.1.2). I am in a corporate environment and it is quite painful to get a newer version do you think this can be the problem?

i don't know if this will help, but a quick google reveals several people complaining of buggy gcc 4.1 behaviours at specific optimization levels. Maybe try with, e.g. -O0 and -O2?


that thread has a bit about "the optimizing away of a function which provably has no side effect":

'Das "wegoptimieren von Funktionen, die gemaess ihrer Spezifikation keine
Nebenwirkungen haben" ist kein Fehler.'

(sorry, didn't find a decent english one.)

which might be what's happening to you? That shouldn't cause a segfault, but it might be related.

----- stephan beal