I wrote a C program that consists of three files in one directory
main.c
#include<stdio.h>
#include "test.h"
int main()
{
int b=0;
b = test_add(3,2);
printf("Added: b=%d\n\n",b);
return 0;
}
test.h
int test_add(int a, int b);
test.c
int test_add(int a, int b, int c)
{
return a+b+c;
}
I compile the program using the following command:
$gcc -Wall -Wextra main.c test.c
It compiles successfully. I see that there is a discrepancy in the number of arguments of the calling function and its actual definition. The compiler does not give any warnings / errors for such a problem. How to report this type of error to the compiler?
source
share