Package segfaults when built with -O2 but not with -O0

Kevin Kofler kevin.kofler at chello.at
Sat Nov 19 18:16:44 UTC 2011


Ralf Corsepius wrote:

> On 11/19/2011 06:23 AM, Gregory Maxwell wrote:
>> On Fri, Nov 18, 2011 at 11:27 PM, Ralf Corsepius<rc040203 at freenet.de> 
>> wrote:
>>> If GCC is sure something is wrong, it is supposed to raise errors.
>>
>> This isn't true. E.g. you can write code which reads and uses
>> uninitialized memory
>> where the compiler is _absolutely sure_ of it. You still just get a
>> warning.
> Well, ... this would qualify as a bug in GCC, IMHO.

Unfortunately, that's what the standard requires. It requires the compiler 
to accept the code, but it allows it to compile it to anything, even to 
something deleting all your data.

        Kevin Kofler



More information about the devel mailing list