gcc/clang "error: too few arguments to function" in CI
The call site supplies fewer arguments than the function declares with no defaults to fill the gap. A signature change or a stale call site is the usual cause.
What this error means
A call fails with "too few arguments" and a note showing the declaration, typically after a parameter was added to the function.
gcc
app.c:18:3: error: too few arguments to function 'connect'
app.c:4:5: note: declared here
4 | int connect(const char* host, int port);Common causes
How to fix it
Pass all required arguments
- Read the "declared here" note for the full parameter list.
- Update every call site to supply the missing argument(s).
gcc
connect("localhost", 8080); // both host and portHow to prevent it
- When changing a function signature, search for every call site and update them in the same change so arity stays consistent.
Related guides
gcc/clang "error: no matching function for call to" in CIFix gcc/clang "error: no matching function for call to" in CI - no overload matches the argument types you pa…
gcc "error: conflicting types for 'X'" in CIFix gcc "error: conflicting types for 'X'" in CI - a function's definition or later declaration disagrees wit…