public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "amodra at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/43249] unsigned int arg with no prototype gets full 64-bit reg
Date: Wed, 26 May 2010 13:23:00 -0000	[thread overview]
Message-ID: <20100526132249.27391.qmail@sourceware.org> (raw)
In-Reply-To: <bug-43249-4503@http.gcc.gnu.org/bugzilla/>



------- Comment #2 from amodra at gmail dot com  2010-05-26 13:22 -------
I think this testcase may invoke undefined behaviour.  Section 6.5.2.2 of the
ISO C spec says of function calls without a prototype that if "the types of the
arguments after promotion are not compatible with those of the parameters after
promotion, the behavior is undefined, except for the following cases" and the
relevant case is "one promoted type is a signed integer type, the other
promoted type is the corresponding unsigned integer type, and the value is
representable in both types".

The value you are passing, (int)4294967259U, is a negative number so not
representable as an unsigned int.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43249


  parent reply	other threads:[~2010-05-26 13:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-03 19:11 [Bug target/43249] New: " janis at gcc dot gnu dot org
2010-03-10 18:35 ` [Bug target/43249] " janis at gcc dot gnu dot org
2010-05-26 13:23 ` amodra at gmail dot com [this message]
     [not found] <bug-43249-4@http.gcc.gnu.org/bugzilla/>
2012-04-20 14:46 ` wschmidt at gcc dot gnu.org

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=20100526132249.27391.qmail@sourceware.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /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).