Sami Tolvanen 1aad641c79 [Clang][Sema] Add -Wcast-function-type-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 would help developers avoid function
type casts that lead to runtime CFI failures. -Wcast-function-type,
while helpful, only warns about ABI incompatibility, which isn't
sufficient with CFI.

Add -Wcast-function-type-strict, which checks for a strict type
compatibility in function type casts and helps warn about casts that
can potentially lead to CFI failures.

Reviewed By: nickdesaulniers, aaron.ballman

Differential Revision: https://reviews.llvm.org/D134831
2022-10-26 20:38:37 +00:00
..
2022-07-29 21:18:41 -07:00
2022-09-28 09:50:19 -07:00
2022-07-22 11:27:19 -04:00
2022-10-24 18:10:43 +02:00