- Skip diagnosing all pointer-like parameters.
- Replace Context.hasSameUnqualifiedType with Context.hasSimilarType.
- Add corresponding tests.
After some thoughts, I think we could add the following extension in the
future (probably under an additional flag such as `-Wcast-function-type=2)
according to user feedbacks for the reasons: 1) users could use
void(*)(void) to explicitly override checks (for example:
https://trac.webkit.org/changeset/231565/webkit); 2) these checks could
hide real bugs that users may want to catch; 3) using void(*)(void)
makes following extension worthwhile only when a codebase uses these
patterns on a large scale which seems unlikely.
(GCC does not do the following)
- allow integer promotion (void(int) -> void(char))
- allow arbitrary pointer-to-member conversion
- allow parameter counts mismatch The use pattern is "passing an extra (unwanted) parameter to callbacks" https://bugs.freedesktop.org/show_bug.cgi?id=107349#c0
Thoughts?