This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Is the GCC optimizer too smart?


On 12/10/2009 01:03 PM, sergio borghese wrote:
> 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?
>   
I think you are missing that the compiler is not "enforcing" anything,
just doing what it likes best depending on the circumstances, since you
are triggering an undefined behavior and anything can happen, in principle.

By the way, this kind of question is more suited for gcc-help.

Paolo.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]