Bizarre warning about width of argument
Trevor Jenkins
trevor.jenkins@suneidesis.com
Fri Dec 27 03:31:00 GMT 2002
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!
More information about the Gcc
mailing list