Test case (prog.c): int main(void) { typedef void f(int); typedef void f(const int); } Compilation command line: gcc prog.c -Wall -Wextra -std=c11 -pedantic-errors Observed behaviour: No error messages outputed. Question: The function types in the two typedefs are compatible, but are they distinct? The standard is not very clear on this. If the two function types are distinct the expected behaviour is to get an error message about redeclaring the typedef name f with a different type. Else the observed behaviour is expected and there is no bug.
Although the wording is different in the two cases (and the rule for return types is newer), I think qualifiers on function parameters should be considered as not part of the type just as with qualifiers on return types. (Qualifiers on parameters *in the function definition* do affect uses of those parameters within the function definition.) I think the introduction of the concept of types being the same simply failed to consider this issue.
Yes, that's consistent with how C++ handles top-level cv-qualifiers in function parameters.
Ok. Thanks for the answers.