GNU bug report logs - #11913
Unusual Emacs 24.1 arithmetic error (abs) on i386 machine

Previous Next

Package: emacs;

Reported by: Rob Browning <rlb <at> defaultvalue.org>

Date: Wed, 11 Jul 2012 18:00:02 UTC

Severity: important

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


Message #71 received at 11913 <at> debbugs.gnu.org (full text, mbox):

From: Rob Browning <rlb <at> defaultvalue.org>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 11913 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>
Subject: Re: bug#11913: Unusual Emacs 24.1 arithmetic error (abs) on i386
	machine
Date: Mon, 16 Jul 2012 21:33:58 -0500
Rob Browning <rlb <at> defaultvalue.org> writes:

> Glenn Morris <rgm <at> gnu.org> writes:
>
>> But why does (abs 8.0) return an arithmetic error at all...?
>
> OK, at the moment, I believe the short answer is because fabs() is
> changing errno which triggers the default clause in IN_FLOAT() here:
>
>     default: arith_error (float_error_fn_name, float_error_arg);
>
> I've been told that this should be considered an Emacs bug because the
> effect of fabs() on errno is strictly undefined, and so fabs() is within
> its rights to do whatever it wants to the value.

For now, I'm going to deploy a patch in the Debian package that just
adds a DEB_IN_FLOAT_NOERRNO() that omits the errno checking, and then
uses that macro for the fabs() call.

Doing something with a similar result would probably be advisable.

Thanks for the help.
-- 
Rob Browning
rlb @defaultvalue.org and @debian.org
GPG as of 2002-11-03 14DD 432F AE39 534D B592 F9A0 25C8 D377 8C7E 73A4




This bug report was last modified 12 years and 307 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.