Is adding additional const specifiers to function arguments allowed by the standard, like in the following?
foo.h:
int foo(int x, char * data);
foo.c:
// does this match the prototype?
int foo(const int x, char * const data) {
// this implementation promises not to change x or move data inside the function
}
GCC accepts it with -std=c99 -Wpedantic -Wall -Werror, but that's not necessarily the same as standard-compliant.
This answer shows that the C++ standard allows this - does the C (99) standard allow this too?
There's another question here and a good answer here for C++