public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* -Wconversion not right (<32 bit problem)
@ 1997-10-02 18:48 J. Kean Johnston
  1997-10-02 22:03 ` Jim Wilson
  0 siblings, 1 reply; 3+ messages in thread
From: J. Kean Johnston @ 1997-10-02 18:48 UTC (permalink / raw)
  To: EGCS Mailing List, GCC2 Mailing List

Hi all.

In both GCC2 and egcs, this simple (and to my eyes valid) case produces
the warning:
bw.c: In function `test':
bw.c:13: warning: passing arg 1 of `foo' with different width due to prototype

<snip>
typedef unsigned short u_short;

extern u_short foo(u_short);
extern void test(void);

u_short foo(u_short bar) {
  return bar;
}

void test(void)
{
  u_short x,y=0;
  x = foo(y);
}
<snip>

This is wrong. The function is declared to take a u_short, and a u_short
is passed. The same warning is emitted for u_char too. It seems to be for
any entity < 32 bits. Does this imply that even though I am passing a
16 bit quantity, a 32-bit quantity is pushed on the stack? If so this is
BAD news.

JKJ



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

end of thread, other threads:[~1997-10-03 12:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-10-02 18:48 -Wconversion not right (<32 bit problem) J. Kean Johnston
1997-10-02 22:03 ` Jim Wilson
1997-10-03 12:45   ` J. Kean Johnston

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).