> 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.
The following is a foo function that take a constant pointer:
void foo(int *const x);
If you point x to another adress inside foo function, it will not compiled.
The author seems think that
void foo(cont int *x);
is function that takes a constant pointer which is wrong, it is a function that takes pointer to constant object. In this case, it is legal if you point x to another address in memory inside foo function.
Is it open source? I want to learn on how to create it