From: John Carr <jfc@MIT.EDU>
To: Xavier Leroy <xavier.leroy@inria.fr>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Re: Marshalling tests fail on AMD x86_64 (Opteron). (PR#1979)
Date: Sat, 20 Dec 2003 11:45:21 -0500 [thread overview]
Message-ID: <200312201645.hBKGjLEo029371@psi-phi.mit.edu> (raw)
In-Reply-To: Your message of "Sat, 20 Dec 2003 12:30:04 +0100." <20031220123004.A9913@pauillac.inria.fr>
> The first test failure is either a bug in gcc or an unspecified
> behavior of C that I wasn't aware of. Basically, some stuff is
> computed with type 'unsigned int', stored in an 'unsigned long'
> variable, and compared against an 'unsigned int' constant.
It isn't generated with type unsigned int. The read32u macro
in the attached file yields an int, not an unsigned int, because
(unsigned char) promotes to (signed int). If I change "long" to
"long long" in the attached file and compile with gcc on x86 the
program prints "Bug".
This is your macro definition:
#define read32u() \
(src += 4, \
(src[-4] << 24) + (src[-3] << 16) + (src[-2] << 8) + src[-1])
Try adding a cast:
#define read32u() \
(src += 4, \
(unsigned int)((src[-4] << 24) + (src[-3] << 16) + (src[-2] << 8) + src[-1]))
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
next prev parent reply other threads:[~2003-12-20 16:45 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <200312160316.EAA00843@pauillac.inria.fr>
2003-12-20 11:30 ` Xavier Leroy
2003-12-20 14:58 ` skaller
2003-12-20 16:45 ` John Carr [this message]
2003-12-22 6:44 ` Aleksey Nogin
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=200312201645.hBKGjLEo029371@psi-phi.mit.edu \
--to=jfc@mit.edu \
--cc=caml-list@inria.fr \
--cc=xavier.leroy@inria.fr \
/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