Comment by _kst_
10 hours ago
It's not even possible to pass too few arguments to a function in C unless you go out of your way to write bad code.
You can write a function declaration that's inconsistent with its definition in another translation unit. Declaring the function in a shared header file avoids this.
You can use an old-style declaration that doesn't specify what parameters a function expects. Don't do that. Use prototypes.
You can use a cast to convert a function pointer to an incompatible type, and call through the resulting pointer. Don't do that.
You can call a function with no visible declaration if your compiler overly permissive or is operating in pre-C99 mode. Don't do that.
> It's not even possible to pass too few arguments to a function in C unless you go out of your way to write bad code.
This article is exclusively about undefined behaviour. "Bad code" is already baked into the assumptions of the article.
This is a site for intellectual curiosity, not pedantic dissmisal.
Seriously?
I discussed some of the technical issues behind the article. If you disagree with anything I wrote, please say so.
I'm not even saying that the issues discussed in the article aren't useful, just going into how likely they're likely to be encountered in practice.
You could also use inline assembly.