public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: "J. Kean Johnston" <jkj@sco.com>
To: EGCS Mailing List <egcs@cygnus.com>, GCC2 Mailing List <gcc2@cygnus.com>
Subject: -Wconversion not right (<32 bit problem)
Date: Thu, 02 Oct 1997 18:48:00 -0000	[thread overview]
Message-ID: <Pine.SCO.3.96.971002184539.22691A-100000@hyperion.pdev.sco.com> (raw)

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



             reply	other threads:[~1997-10-02 18:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-10-02 18:48 J. Kean Johnston [this message]
1997-10-02 22:03 ` Jim Wilson
1997-10-03 12:45   ` J. Kean Johnston

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.SCO.3.96.971002184539.22691A-100000@hyperion.pdev.sco.com \
    --to=jkj@sco.com \
    --cc=egcs@cygnus.com \
    --cc=gcc2@cygnus.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).