New GNU C Library (glibc) security flaw reported on 30 Jan 2024
Vincent Lefevre
vincent@vinc17.net
Thu Feb 1 01:03:35 GMT 2024
On 2024-02-01 01:51:55 +0100, Vincent Lefevre wrote:
> Yes, the point is to sort numbers. But since NaN may occur, the code
> must not yield undefined behavior in such a case. This is the goal
> of NaN: avoid undefined behavior for operations that do not make any
> sense, and be able to detect errors at the end.
BTW, note that the ISO C standard sometimes uses "number" even
when this can be a NaN. For instance, in 7.12.7.2:
The fabs functions compute the absolute value of a
floating-point number x.
(though this has been changed in C23). But the term "number"
is still used in C23 for ceil and floor.
--
Vincent Lefèvre <vincent@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)
More information about the Libc-alpha
mailing list