Re: const + optimizations [WAS: Need C optimization help]

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

 



Modifying a const object via a non-const lvalue is undefined behaviour.

Is there a flag to forbid that ?

It's always forbidden, but it cannot always be detected

It's not forbidden, it's undefined behaviour, duh.

The compiler warns for this; the warning cannot be turned off.  Also,
the only way to turn it into an error is -Werror it seems, which will
turn _all_ warnings into errors.


Segher



[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