public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Bizarre warning about width of argument
@ 2002-12-27  3:31 Trevor Jenkins
  2002-12-27  3:37 ` Russ Allbery
  0 siblings, 1 reply; 4+ messages in thread
From: Trevor Jenkins @ 2002-12-27  3:31 UTC (permalink / raw)
  To: Gnu Compiler Collection Hackers

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!

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2002-12-29  0:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-12-27  3:31 Bizarre warning about width of argument Trevor Jenkins
2002-12-27  3:37 ` Russ Allbery
2002-12-28 19:50   ` [GCC] " Trevor Jenkins
2002-12-28 20:30     ` Russ Allbery

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).