From: Paul Eggert Date: Tue, 5 Nov 2019 07:17:06 +0000 (-0800) Subject: Overflow errors are range errors X-Git-Tag: emacs-27.0.90~740 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=799d738bc7404b5bda4fe3c544a4fc24e6580f46;p=emacs.git 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. --- diff --git a/doc/lispref/errors.texi b/doc/lispref/errors.texi index cf9b67c80d8..dc9089ad1e3 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 e897fe06c99..7ff9df6e0fa 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 a338dadfb69..d968ac9e3a9 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. */