1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-30 12:21:25 -08:00

Tell user about read-integer-overflow-as-float

* src/lread.c (string_to_number): Suggest
read-integer-overflow-as-float in signal message.
Suggested by Stefan Monnier (Bug#31118#58).
This commit is contained in:
Paul Eggert 2018-04-18 12:38:19 -07:00
parent 5dff4905d7
commit 403f3d2c85

View file

@ -3797,7 +3797,12 @@ string_to_number (char const *string, int base, int flags)
value = n;
if (! (state & DOT_CHAR) && ! (flags & S2N_OVERFLOW_TO_FLOAT))
xsignal1 (Qoverflow_error, build_string (string));
{
AUTO_STRING (fmt, ("%s is out of fixnum range; "
"maybe set `read-integer-overflow-as-float'?"));
AUTO_STRING_WITH_LEN (arg, string, cp - string);
xsignal1 (Qoverflow_error, CALLN (Fformat_message, fmt, arg));
}
}
/* Either the number uses float syntax, or it does not fit into a fixnum.