[Clang][Sema] Add -Wincompatible-function-pointer-types-strict
Clang supports indirect call Control-Flow Integrity (CFI) sanitizers (e.g. -fsanitize=cfi-icall), which enforce an exact type match between a function pointer and the target function. Unfortunately, Clang doesn't provide diagnostics that help developers avoid function pointer assignments that can lead to runtime CFI failures. -Wincompatible-function-pointer-types doesn't warn about enum to integer mismatches if the types are otherwise compatible, for example, which isn't sufficient with CFI. Add -Wincompatible-function-pointer-types-strict, which checks for a stricter function type compatibility in assignments and helps warn about assignments that can potentially lead to CFI failures. Reviewed By: aaron.ballman, nickdesaulniers Differential Revision: https://reviews.llvm.org/D136790
Loading
Please sign in to comment