[Top][All Lists]

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

bug#37140: 27.0.50; calc gives "Wrong type argument: number-or-marker-p,

From: Mattias Engdegård
Subject: bug#37140: 27.0.50; calc gives "Wrong type argument: number-or-marker-p, inf" to many operations
Date: Sat, 24 Aug 2019 20:38:42 +0200

The bug could indeed be reproduced with gcc 9.1.1, and turned out to be caused 
by -ffinite-math-only which -Ofast includes. This option allows the compiler to 
assume that no number is infinity or NaN.

This causes printing ±Inf to misbehave since the standard isinf function now 
always returns false, and 1.0e+INF is printed as "inf" when generating the 
constant pool in the byte-compiled function. When this byte-code is loaded, the 
value is read back as the lisp symbol `inf' which caused the error we saw.

The precise location is in the initialisation of math-largest-emacs-expt; the 
error occurs during load time, but the damage was already done by 
float_to_string when calc-math.elc was generated.

In other words, the route to the error was somewhat roundabout, but it looks 
like there is no actual bug in Emacs nor in gcc. But at least I didn't know 
that, and was enlightened by the result.

reply via email to

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