Re: Is the GCC optimazer too smart?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thomas Martitz wrote:
> Am 10.12.2009 15:22, schrieb Andrew Haley:
>> Thomas Martitz wrote:
>>    
>>> Am 10.12.2009 13:10, schrieb Andrew Haley:
>>>
>>>      
>>>>> Now my question is: is it correct that the compiler enforces the
>>>>> constantness of the variable, even tought it states in the warning
>>>>> that the const qualifier has been discarded?
>>>>>
>>>>>          
>>>> Yes.
>>>>
>>>>        
>>> and
>>>      
>>>>    behavior is undefined. ...
>>>>
>>>>
>>>>        
>>> doesn't really match though. The standard doesn't give the answer.
>>>      
>> Sure it does.  The behaviour is undefined, so the compiler can do
>> anything it likes.  Demons may fly out of your nose.
> 
> But he was asking for specific behavior. GCC may do that, but citing the 
> standard doesn't answer it.

Yes, it does.  He asked "is it correct that the compiler enforces the
constantness?"  They answer is yes.  If he'd asked "is it correct that
the compiler causes my computer to pogo round the room whistling the
star spangled banner when I do this?" the answer would also have been
yes.

Andrew.

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux