php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #74288 php check for isinf is wrong
Submitted: 2017-03-22 05:38 UTC Modified: 2017-03-23 11:25 UTC
From: apyhalov at gmail dot com Assigned:
Status: Duplicate Package: Compile Failure
PHP Version: 7.0.17 OS: illumos
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: apyhalov at gmail dot com
New email:
PHP Version: OS:

 

 [2017-03-22 05:38 UTC] apyhalov at gmail dot com
Description:
------------
In latest php versions it checks for isinf with

AC_CHECK_DECLS([isnan, isinf], [], [], [[#include <math.h>]]), 

which leads to defining 

#define HAVE_DECL_ISINF 0

when isinf is not declared.

Later it checks for it with 

#ifdef HAVE_DECL_ISINF
#define zend_isinf(a) isinf(a)
#elif defined(INFINITY)
/* Might not work, but is required by ISO C99 */
#define zend_isinf(a) (((a)==INFINITY || (a)==-INFINITY)?1:0)
#elif defined(HAVE_FPCLASS)
#define zend_isinf(a) ((fpclass(a) == FP_PINF) || (fpclass(a) == FP_NINF))
#else
#define zend_isinf(a) 0
#endif

This should be changed to something like 

#if defined(HAVE_DECL_ISINF) && (HAVE_DECL_ISINF!=0) 
...


This is also true for HAVE_DECL_ISNAN and HAVE_DECL_ISFINITE

Otherwise linking php fails with 'Undefined symbol isinf...'.



Patches

isinf.patch (last revision 2017-03-22 05:39 UTC by apyhalov at gmail dot com)

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-03-23 11:25 UTC] nikic@php.net
Duplicate of bug #74265.
 [2017-03-23 11:25 UTC] nikic@php.net
-Status: Open +Status: Duplicate
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Nov 22 04:01:28 2024 UTC