[m-dev.] Re: changes to string module
Julien Fischer
juliensf at csse.unimelb.edu.au
Fri Jan 30 13:01:12 AEDT 2009
On Fri, 30 Jan 2009, Ralph Becket wrote:
> Zoltan Somogyi, Friday, 30 January 2009:
>> On 30-Jan-2009, Ralph Becket <rafe at csse.unimelb.edu.au> wrote:
>>> Hmm. That constants in question are 0xfe3dbe7f and 0xffffffff. To get
>>> around the overflow check these should be -0x1c24181 and -0x1, but
>>> that feels rather unnatural. Maybe the overflow check should only apply
>>> to base 10 numbers?
>>
>> Yes, it should. In C's printf, using %x treats the argument as unsigned.
>
> The 0xffffffff constant makes me concerned about 64 bit cleanliness if
> the intention is to say "all bits in the word are 1".
The comment above that section of code explains this; the use of the
constant is to ensure that the behaviour is the same on 32- and 64-bit
systems.
Julien.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to: mercury-developers at csse.unimelb.edu.au
Administrative Queries: owner-mercury-developers at csse.unimelb.edu.au
Subscriptions: mercury-developers-request at csse.unimelb.edu.au
--------------------------------------------------------------------------
More information about the developers
mailing list