0010-Don-t-use-IN_FLOAT-when-calling-fabs-since-it-may-cl.patch 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. From 169fccc1684c52566c52d8bdb3549d919ae43a0b Mon Sep 17 00:00:00 2001
  2. From: Paul Eggert <eggert@cs.ucla.edu>
  3. Date: Mon, 16 Jul 2012 19:56:00 -0700
  4. Subject: Don't use IN_FLOAT() when calling fabs() since it may clobber errno.
  5. The emacs build shouldn't fail sometimes with an "Arithmetic error:".
  6. Previously Emacs assumed that fabs() would not modify errno
  7. unless there was an error, but that isn't guaranteed since fabs()
  8. has no error conditions.
  9. Origin: upstream, commit: 8e0e7a92f5ae99ce2461fc0f0b606d4cec3efb81
  10. Added-by: Rob Browning <rlb@defaultvalue.org>
  11. Provided-By: Paul Eggert <eggert@cs.ucla.edu>
  12. Bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11913
  13. ---
  14. src/ChangeLog | 6 ++++++
  15. src/floatfns.c | 2 +-
  16. 2 files changed, 7 insertions(+), 1 deletion(-)
  17. diff --git a/src/ChangeLog b/src/ChangeLog
  18. index 45d9cea..a0fa940 100644
  19. --- a/src/ChangeLog
  20. +++ b/src/ChangeLog
  21. @@ -64,6 +64,12 @@
  22. (Fdelete_other_windows_internal): Signal an error if the window is
  23. on a dead frame (Bug#11984).
  24. +2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
  25. +
  26. + * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
  27. + Unlike the other wrapped functions, fabs has an unspecified
  28. + effect on errno.
  29. +
  30. 2012-07-14 Eli Zaretskii <eliz@gnu.org>
  31. Remove FILE_SYSTEM_CASE.
  32. diff --git a/src/floatfns.c b/src/floatfns.c
  33. index 305c78c..fa672c7 100644
  34. --- a/src/floatfns.c
  35. +++ b/src/floatfns.c
  36. @@ -676,7 +676,7 @@ DEFUN ("abs", Fabs, Sabs, 1, 1, 0,
  37. CHECK_NUMBER_OR_FLOAT (arg);
  38. if (FLOATP (arg))
  39. - IN_FLOAT (arg = make_float (fabs (XFLOAT_DATA (arg))), "abs", arg);
  40. + arg = make_float (fabs (XFLOAT_DATA (arg)));
  41. else if (XINT (arg) < 0)
  42. XSETINT (arg, - XINT (arg));