[m-dev.] for review: string__fmt
Fergus Henderson
fjh at cs.mu.OZ.AU
Mon Aug 21 16:19:28 AEST 2000
On 16-Aug-2000, Peter Ross <peter.ross at miscrit.be> wrote:
> Fergus could you please review this diff. It should fix the failure of
> tests/general/string_format_test on the alpha.
...
> Avoid the cast to long before printing integers.
That diff was fine, and fixes a problem that we would encounter on Win64,
but I'm afraid it didn't actually fix the problem that you were trying
to fix.
> This cast is
> problematic when printing negative integers with the format string "%x".
> For instance on the alpha a long is 64 bits and a MR_integer is 32 bits,
> so printing -31 is printed as ffffffffffffffe1 instead of ffffffe1.
On the Alpha, an MR_Integer is 64 bits too. So after your change,
-31 is still printed out as ffffffffffffffe1.
Indeed, this seems to me to be the correct behaviour.
So I think the right thing to do is just to change the test case
so that it allows this output, e.g. by adding an appropriate `.exp2'
file.
--
Fergus Henderson <fjh at cs.mu.oz.au> | "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh> | of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3 | -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to: mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions: mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------
More information about the developers
mailing list