Re: Is the GCC optimazer too smart?

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

 



Revectored to gcc-help.

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?

Yes.

Section 6.7.3, Type qualifiers

... If an attempt is made to modify an object defined with a
const-qualified type through use of an lvalue with non-const-qualified
type, the behavior is undefined. ...

The best way to answer questions like this is always to check the standard.

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