diff options
| author | Paul Eggert | 2019-11-04 23:17:06 -0800 |
|---|---|---|
| committer | Paul Eggert | 2019-11-04 23:39:55 -0800 |
| commit | 799d738bc7404b5bda4fe3c544a4fc24e6580f46 (patch) | |
| tree | abd39a5ad8751314f31a4c34a362a2b2eb04a0fb | |
| parent | 5ab29400a4e9b29928aaf63d1f89a0b059491b29 (diff) | |
| download | emacs-799d738bc7404b5bda4fe3c544a4fc24e6580f46.tar.gz emacs-799d738bc7404b5bda4fe3c544a4fc24e6580f46.zip | |
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.
| -rw-r--r-- | doc/lispref/errors.texi | 8 | ||||
| -rw-r--r-- | etc/NEWS | 5 | ||||
| -rw-r--r-- | 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}. | |||
| 163 | 163 | ||
| 164 | @item range-error | 164 | @item range-error |
| 165 | The message is @code{Arithmetic range error}. | 165 | The message is @code{Arithmetic range error}. |
| 166 | |||
| 167 | @item overflow-error | ||
| 168 | The message is @samp{Arithmetic overflow error}. This is a subcategory | ||
| 169 | of @code{range-error}. | ||
| 166 | This can happen with integers exceeding the @code{integer-width} limit. | 170 | This can happen with integers exceeding the @code{integer-width} limit. |
| 167 | @xref{Integer Basics}. | 171 | @xref{Integer Basics}. |
| 168 | 172 | ||
| @@ -229,10 +233,6 @@ mathematical functions. @xref{Math Functions}. | |||
| 229 | @item domain-error | 233 | @item domain-error |
| 230 | The message is @samp{Arithmetic domain error}. | 234 | The message is @samp{Arithmetic domain error}. |
| 231 | 235 | ||
| 232 | @item overflow-error | ||
| 233 | The message is @samp{Arithmetic overflow error}. This is a subcategory | ||
| 234 | of @code{domain-error}. | ||
| 235 | |||
| 236 | @item singularity-error | 236 | @item singularity-error |
| 237 | The message is @samp{Arithmetic singularity error}. This is a | 237 | The message is @samp{Arithmetic singularity error}. This is a |
| 238 | subcategory of @code{domain-error}. | 238 | subcategory of @code{domain-error}. |
| @@ -2617,6 +2617,11 @@ like 'file-attributes' that compute file sizes and other attributes, | |||
| 2617 | functions like 'process-id' that compute process IDs, and functions like | 2617 | functions like 'process-id' that compute process IDs, and functions like |
| 2618 | 'user-uid' and 'group-gid' that compute user and group IDs. | 2618 | 'user-uid' and 'group-gid' that compute user and group IDs. |
| 2619 | 2619 | ||
| 2620 | +++ | ||
| 2621 | ** overflow-error is now documented as a subcategory of range-error. | ||
| 2622 | Formerly it was undocumented, and was (incorrectly) a subcategory | ||
| 2623 | of domain-error. | ||
| 2624 | |||
| 2620 | ** Time values | 2625 | ** Time values |
| 2621 | 2626 | ||
| 2622 | +++ | 2627 | +++ |
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) | |||
| 3935 | PUT_ERROR (Qsingularity_error, Fcons (Qdomain_error, arith_tail), | 3935 | PUT_ERROR (Qsingularity_error, Fcons (Qdomain_error, arith_tail), |
| 3936 | "Arithmetic singularity error"); | 3936 | "Arithmetic singularity error"); |
| 3937 | 3937 | ||
| 3938 | PUT_ERROR (Qoverflow_error, Fcons (Qdomain_error, arith_tail), | 3938 | PUT_ERROR (Qoverflow_error, Fcons (Qrange_error, arith_tail), |
| 3939 | "Arithmetic overflow error"); | 3939 | "Arithmetic overflow error"); |
| 3940 | PUT_ERROR (Qunderflow_error, Fcons (Qdomain_error, arith_tail), | 3940 | PUT_ERROR (Qunderflow_error, Fcons (Qrange_error, arith_tail), |
| 3941 | "Arithmetic underflow error"); | 3941 | "Arithmetic underflow error"); |
| 3942 | 3942 | ||
| 3943 | /* Types that type-of returns. */ | 3943 | /* Types that type-of returns. */ |