| name | autofix-signature-mismatch |
| description | Fixes function call errors with wrong number or type of arguments. |
Signature Mismatch Skill
Fixes errors where function calls don't match their declarations.
Detection Patterns
no matching function for call to 'X'
too many arguments to function 'X'
too few arguments to function 'X'
candidate function not viable
Strategy
- Identify Function: Extract the function name and call location.
- Find Declaration: Locate the function's declaration/definition.
- Compare Signatures: Match call arguments against expected parameters.
- Fix Mismatch: Adjust the call site or (rarely) the declaration.
Instructions
Step 1: Parse the Error
Extract:
- Function name
- Expected vs. provided argument count/types
- Location of the call
Step 2: Find Function Declaration
grep -r "returnType functionName(" --include="*.h"
Step 3: Analyze and Fix
Case: Too many arguments
Case: Too few arguments
Case: Wrong type
Step 4: Verify
Ensure the fix compiles and maintains intended behavior.