Skip to content
Latchkey

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

  1. Read the "declared here" note for the full parameter list.
  2. Update every call site to supply the missing argument(s).
gcc
connect("localhost", 8080);   // both host and port

How 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

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →