From 799d738bc7404b5bda4fe3c544a4fc24e6580f46 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 4 Nov 2019 23:17:06 -0800 Subject: [PATCH] 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 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. */ -- 2.39.5