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

Sami Tolvanen via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 30 12:00:11 PDT 2024


samitolvanen 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.

Agreed, that would the best solution here.

> 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).

I'm fine with this option too. However, I assume the author has a use case for KCFI in an existing code base, which uses unprototyped functions.

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


More information about the cfe-commits mailing list