[Perl/perl5] 0a49d2: POSIX: only define NAN and INFINITY when they are ...

[email protected] ("Craig A. Berry" via perl5-changes) Wed, 22 Jul 2026 06:36:34 -0700
Newsgroups perl.perl5.changes
Message-ID <Perl/perl5/push/refs/heads/blead/[email protected]>
  Branch: refs/heads/blead
  Home:   https://github.com/Perl/perl5
  Commit: 0a49d2a92495e8fbcd589f38ed139ce6d45e482c
      https://github.com/Perl/perl5/commit/0a49d2a92495e8fbcd589f38ed139ce6d45e482c
  Author: Craig A. Berry <[email protected]>
  Date:   2026-07-22 (Wed, 22 Jul 2026)

  Changed paths:
    M ext/POSIX/Makefile.PL

  Log Message:
  -----------
  POSIX: only define NAN and INFINITY when they are meaningful

This mostly reverts ebdbfbc, which claimed to prefer the system's
NAN and INFINITY but actually just removed the conditional guards
that only defined them when the double in use has the relevant
capabilities.  We need to go back to the conditional definitions
Jarkko created in 85272d3.

The problem with using INFINITY when the double in use does not
have infinities is that, per the standard, it is a value "that
overflows at translation time," and overflow when initializing a
double that can't do infinities causes the compile to fail.

The problem with using NAN when the double in use does not have
NaNs is that, per the standard, "this macro is only defined if the
implementation supports quiet NaNs," so if you initialize to it
when it doesn't exist, the compile fails with an undeclared value
error.

There are no visible changes here when using doubles that do support
IEEE NaNs and infinities.



To unsubscribe from these emails, change your notification settings at https://github.com/Perl/perl5/settings/notifications