This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Trying to find a gcc warning to detect different parameter names
- From: Jon Grant <jg at jguk dot org>
- To: gcc at gcc dot gnu dot org
- Date: Sun, 25 Sep 2011 23:49:21 +0100
- Subject: Trying to find a gcc warning to detect different parameter names
Hello
I am looking for a gcc option to give a warning when parameter names
don't match between the prototype in C, and the definition. Could
someone point me to the option if there is one please.
Example provided below, where "offset" miss-spelt "offest". (I found
-Wstrict-prototypes, but that only warns if types are not specified.).
Would be quite handy to have this ability to check parameter names are
consistent.
Please include my email address in any replies.
Best regards, Jon
gcc (Ubuntu/Linaro 4.5.2-8ubuntu4) 4.5.2
// gcc -Wall -o main main.c
#include <stdio.h>
void test_func(int offest);
void test_func(int offset)
{
printf("%d\n", offset);
}
int main(void)
{
test_func(1);
return 0;
}