emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 799d738 2/3: Overflow errors are range errors


From: Paul Eggert
Subject: master 799d738 2/3: Overflow errors are range errors
Date: Tue, 5 Nov 2019 02:40:03 -0500 (EST)

branch: master
commit 799d738bc7404b5bda4fe3c544a4fc24e6580f46
Author: Paul Eggert <address@hidden>
Commit: Paul Eggert <address@hidden>

    Overflow errors are range errors
    
    * etc/NEWS: Mention this.
    * doc/lispref/errors.texi (Standard Errors):
    Document overflow-error, which was formerly undocumented.
    It is a range error, not a domain error.
    * src/data.c (syms_of_data): overflow-error and (undocumented)
    underflow-error are subtypes range-error, not domain-error.
    This fixes bugs in timezone-time-from-absolute and in
    erc-ctcp-reply-PING.
---
 doc/lispref/errors.texi | 8 ++++----
 etc/NEWS                | 5 +++++
 src/data.c              | 4 ++--
 3 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/doc/lispref/errors.texi b/doc/lispref/errors.texi
index cf9b67c..dc9089a 100644
--- a/doc/lispref/errors.texi
+++ b/doc/lispref/errors.texi
@@ -163,6 +163,10 @@ The message is @samp{Attempt to modify a protected file}.
 
 @item range-error
 The message is @code{Arithmetic range error}.
+
+@item overflow-error
+The message is @samp{Arithmetic overflow error}.  This is a subcategory
+of @code{range-error}.
 This can happen with integers exceeding the @code{integer-width} limit.
 @xref{Integer Basics}.
 
@@ -229,10 +233,6 @@ mathematical functions.  @xref{Math Functions}.
 @item domain-error
 The message is @samp{Arithmetic domain error}.
 
-@item overflow-error
-The message is @samp{Arithmetic overflow error}.  This is a subcategory
-of @code{domain-error}.
-
 @item singularity-error
 The message is @samp{Arithmetic singularity error}.  This is a
 subcategory of @code{domain-error}.
diff --git a/etc/NEWS b/etc/NEWS
index e897fe0..7ff9df6 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -2617,6 +2617,11 @@ like 'file-attributes' that compute file sizes and other 
attributes,
 functions like 'process-id' that compute process IDs, and functions like
 'user-uid' and 'group-gid' that compute user and group IDs.
 
++++
+** overflow-error is now documented as a subcategory of range-error.
+Formerly it was undocumented, and was (incorrectly) a subcategory
+of domain-error.
+
 ** Time values
 
 +++
diff --git a/src/data.c b/src/data.c
index a338dad..d968ac9 100644
--- a/src/data.c
+++ b/src/data.c
@@ -3935,9 +3935,9 @@ syms_of_data (void)
   PUT_ERROR (Qsingularity_error, Fcons (Qdomain_error, arith_tail),
             "Arithmetic singularity error");
 
-  PUT_ERROR (Qoverflow_error, Fcons (Qdomain_error, arith_tail),
+  PUT_ERROR (Qoverflow_error, Fcons (Qrange_error, arith_tail),
             "Arithmetic overflow error");
-  PUT_ERROR (Qunderflow_error, Fcons (Qdomain_error, arith_tail),
+  PUT_ERROR (Qunderflow_error, Fcons (Qrange_error, arith_tail),
             "Arithmetic underflow error");
 
   /* Types that type-of returns.  */



reply via email to

[Prev in Thread] Current Thread [Next in Thread]