While reviewing code, I occasionally see function prototypes with constant pointers like:
void Foo(int * const bar);
Often a programmer using such a function does not understand what he actually sees and the function is later used like this:
const int bla = 0;
Foo((int* const) &bla);
which, as far as I understand, results in undefined behavior. In this case, the constant pointer caused confusion.
My question is: When is a constant pointer (not a pointer to a constant) in a function prototype required for the code to be correct?