GNU bug report logs -
#12381
Assume C89 or later for math functions.
Previous Next
Reported by: Paul Eggert <eggert <at> cs.ucla.edu>
Date: Fri, 7 Sep 2012 20:24:01 UTC
Severity: normal
Tags: patch
Done: Paul Eggert <eggert <at> cs.ucla.edu>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
> Date: Sat, 08 Sep 2012 08:31:21 -0700
> From: Paul Eggert <eggert <at> cs.ucla.edu>
> CC: 12381 <at> debbugs.gnu.org
>
> The IEEE model is different. It provides exceptional values for
> overflow and the like, instead of traps or signals. This is true even
> for floating point exceptions in library functions. There is a
> run-time option that causes exceptions to trap instead, but that
> option is off by default, and it's not always supported, and almost
> nobody uses it even when it is supported because it's a pain to use
> and it's rarely exercised and it tends to be buggy.
AFAIK, Posix and the latest C standards provide fenv.h header and
several functions there, which are in a way a return to the exceptions
model. So maybe we should use those facilities, where available, to
optionally signal an error, instead of wiping this feature out
completely.
> > . Do we really want to remove a possibility of signaling an error on
> > EDOM and ERANGE?
>
> Yes we do. Nobody configures Emacs that way (it's not documented
> anywhere), and there's a good reason: it hasn't been needed for
> decades.
But couldn't this be a useful debugging option, like -DGLYPH_DEBUG=1 ?
> > . The pieces related to 'matherr' might still be needed on platforms
> > which provide that function.... AFAIR the default version of that
> > function may print an error message, which I think we need to prevent.
>
> matherr was a problem back in the 1980s, but it's been obsolete for
> decades. Platforms that still provide it have it as an SVID option
> that is disabled by default, because it was clearly a mistake.
I'm not sure this is so universally correct. E.g., what about Cygwin?
Ken, can you tell? AFAIR, Cygwin uses fdlibm, which used to invoke
matherr by default.
> SVID has been supplanted by POSIX, which does not allow the matherr
> behavior. Emacs does not enable the obsolete SVID option on any
> platform, so it's fine.
Perhaps you forget that Emacs supports a few non-Posix or marginally
Posix platforms. E.g., in the MS-Windows and MS-DOS ports, I can
cause FP exception to trigger SIGFPE at run time with a single
function call. I'm sure glibc has a similar facility as well.
This bug report was last modified 12 years and 259 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.