<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE message PUBLIC
  "-//MLarc//DTD MLarc output files//EN"
  "../../mlarc.dtd"[
  <!ATTLIST message
    listname CDATA #REQUIRED
    title CDATA #REQUIRED
  >
]>

  <?xml-stylesheet href="../../mlarc.xsl" type="text/xsl"?>


<message 
  url="2003/12/40b3de4cc54ef3b2aa6aed7de32917f8"
  from="John Carr &lt;jfc@M...&gt;"
  author="John Carr"
  date="2003-12-20T16:45:25"
  subject="Re: [Caml-list] Re: Marshalling tests fail on AMD x86_64 (Opteron). (PR#1979)"
  prev="2003/12/c10ab6a933e861837cc05d835f33990a"
  next="2003/12/1e21db54a184690899c1c313b0a8de85"
  prev-in-thread="2003/12/c10ab6a933e861837cc05d835f33990a"
  next-in-thread="2003/12/950b260ab356953ff0e1e925df4dc156"
  prev-thread="2003/12/a48335fa2b3c2417a19068249002ab12"
  next-thread="2003/12/558c3ea8590ceaa0759c13dbe9214a62"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="[Caml-list] Re: Marshalling tests fail on AMD x86_64 (Opteron). (PR#1979)">
<msg 
  url="2003/12/59c29f4d5f2da28e2310ec5d53a052cb"
  from="Xavier Leroy &lt;xavier.leroy@i...&gt;"
  author="Xavier Leroy"
  date="2003-12-20T11:30:08"
  subject="[Caml-list] Re: Marshalling tests fail on AMD x86_64 (Opteron). (PR#1979)">
<msg 
  url="2003/12/c10ab6a933e861837cc05d835f33990a"
  from="skaller &lt;skaller@o...&gt;"
  author="skaller"
  date="2003-12-20T14:59:02"
  subject="Re: [Caml-list] Re: Marshalling tests fail on AMD x86_64 (Opteron). (PR#1979)">
</msg>
<msg 
  url="2003/12/40b3de4cc54ef3b2aa6aed7de32917f8"
  from="John Carr &lt;jfc@M...&gt;"
  author="John Carr"
  date="2003-12-20T16:45:25"
  subject="Re: [Caml-list] Re: Marshalling tests fail on AMD x86_64 (Opteron). (PR#1979)">
</msg>
<msg 
  url="2003/12/950b260ab356953ff0e1e925df4dc156"
  from="Aleksey Nogin &lt;nogin@c...&gt;"
  author="Aleksey Nogin"
  date="2003-12-22T08:42:22"
  subject="[Caml-list] Re: Marshalling tests fail on AMD x86_64 (Opteron). (PR#1979)">
</msg>
</msg>
</thread>

<contents>

&gt; The first test failure is either a bug in gcc or an unspecified
&gt; behavior of C that I wasn't aware of.  Basically, some stuff is
&gt; computed with type 'unsigned int', stored in an 'unsigned long'
&gt; 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] &lt;&lt; 24) + (src[-3] &lt;&lt; 16) + (src[-2] &lt;&lt; 8) + src[-1])

Try adding a cast:

#define read32u() \
  (src += 4, \
   (unsigned int)((src[-4] &lt;&lt; 24) + (src[-3] &lt;&lt; 16) + (src[-2] &lt;&lt; 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

</contents>

</message>

