how to make gcc warn about arithmetic signed overflow

Jędrzej Dudkiewicz jedrzej.dudkiewicz@gmail.com
Sat Sep 21 19:55:00 GMT 2013


>> No, that's not true. You can't change the value of a const object in a
>> valid program.
>
> I think I can but it may cause an undefined behavior:

Note, that Jonathan wrote "in a valid program". Your program is not
valid, as it contains undefined behaviour - you change const int via
pointer to non-const int.



More information about the Gcc-help mailing list