Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] Re: Marshalling tests fail on AMD x86_64 (Opteron). (PR#1979)
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2003-12-20 (14:59)
From: skaller <skaller@o...>
Subject: Re: [Caml-list] Re: Marshalling tests fail on AMD x86_64 (Opteron). (PR#1979)
On Sat, 2003-12-20 at 22:30, Xavier Leroy wrote:
> > I am having problems with the marshaller (I am getting a segfault in the 

> 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.  The
> gcc-generated code performs a sign extension 32 -> 64 bits on the
> unsigned int, causing the test to fail.  This behavior also occurs
> with older versions of gcc on the Alpha.  Digital Unix's Alpha cc
> compiler (the only other 64-bit C compiler I have at hand) doesn't do
> sign extension.  A small example that reproduces the behavior is
> attached.  I'll let the C language lawyers argue what the correct
> behavior is.

Here is the rule for promotion of two values prior
to a binary operation, from ISO 'C99' Standard: Usual arithmetic conversions
Otherwise, if both operands have signed integer types or 
both have unsigned integer types, the operand with 
the type of lesser integer conversion rank is
converted to the type of the operand with greater rank.

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: