[clang] fix kcfi doesn't take effect when callee function has no input parameter (PR #106677)

Fangrui Song via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 30 18:45:08 PDT 2024


MaskRay wrote:

> If a function is declared without a prototype (pre-C23), it doesn't mean it has a void argument list; it means the argument list is undeclared. So you can't just assume the argument list is void; you have to compute the argument types from the actual arguments passed to the call.

+1. I don't think we have take this patch.
 
> Or you could just forbid unprototyped functions in KCFI mode, If you don't want to deal with the edge cases here (i.e. -Werror=strict-prototypes).

Seems fine. 

https://github.com/llvm/llvm-project/pull/106677


More information about the cfe-commits mailing list