News for hackers. Stuff that matters.
Re:Const and Optimization in C by heinrich5991 on Monday July 25, 2016 @06:47AM (#12157740)
Where do you see this confusion? I don't think it's there.

The author points out that it is not necessarily undefined behavior to take your second prototype, cast the const away and modify the pointed-to object if you ensure that it is only called with non-constant objects.

Re:Const and Optimization in C by peeyek on Monday July 25, 2016 @07:16AM (#12157844)
In 2nd paragraph, the author states:

    void foo(const int *);
    ...
> The function foo takes a const pointer, which is a promise from the author of foo that it won’t modify the value of x. Given this information, it would seem the compiler may assume x is always zero, and therefore y is always zero.
Re:Const and Optimization in C by Sharlin on Monday July 25, 2016 @07:34AM (#12157915)
It is clear that the author means "pointer to const" there.