C Compiler Logo

Incompatible Function Arguments

Incompatible Function Arguments

semantic

warning: passing argument 1 of 'function' makes pointer from integer without a cast

Description

Passing arguments to a function that don't match the function's parameter types.

Common Causes

Example of Error

Error Code

void processString(char *str) {
    // Process the string
}

int main() {
    int value = 42;
    processString(value);
    return 0;
}

Solution

Pass arguments of the correct type to the function.

Corrected Code

void processString(char *str) {
    // Process the string
}

int main() {
    char *text = "Hello";
    processString(text);
    return 0;
}

Additional Tips