This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Bizarre warning about width of argument
- From: Trevor Jenkins <trevor dot jenkins at suneidesis dot com>
- To: Gnu Compiler Collection Hackers <gcc at gcc dot gnu dot org>
- Date: Fri, 27 Dec 2002 02:42:33 +0000 (GMT)
- Subject: Bizarre warning about width of argument
When the following example is compiled we get a warning:
foo.c: In function `foo':
foo.c:8: warning: passing arg 1 of `bar' with different width due to prototype
This test case is extracted from a large system where these "errors" are
being reported all over the place. The gcc comand being used is
gcc -c -ansi -fno-nonansi-builtins -Wshadow -Wconversion foo.c
Here's the real gcc command taken from the system make file:
gcc -c -Wall -Wpointer-arith -Wshadow -Wcast-qual -Wcast-align \
-Wconversion -Wid-clash-32 -Winline -Woverloaded-virtual \
-Wmissing-prototypes -Wstrict-prototypes -Waggregate-return -Wno-implicit \
foo.c
and here's the simplest test case we can find as foo.c:
#include <string.h>
void foo(unsigned short);
void bar(unsigned short);
void foo(unsigned short zindex)
{
bar(zindex);
}
void bar(unsigned short a)
{
}
Regards, Trevor
British Sign Language is not inarticulate handwaving; it's a living language.
Support the campaign for formal recognition by the British government now!
Details at http://www.fdp.org.uk/
--
<>< Re: deemed!