Bug #74288 [Opn->Dup]: php check for isinf is wrong

[email protected]
Newsgroups php.bugs
Message-ID <[email protected]>
Edit report at https://bugs.php.net/bug.php?id=74288&edit=1

 ID:                 74288
 Updated by:         [email protected]
 Reported by:        apyhalov at gmail dot com
 Summary:            php check for isinf is wrong
-Status:             Open
+Status:             Duplicate
 Type:               Bug
 Package:            Compile Failure
 Operating System:   illumos
 PHP Version:        7.0.17
 Block user comment: N
 Private report:     N



Previous Comments:
------------------------------------------------------------------------
[2017-03-23 11:25:14] [email protected]

Duplicate of bug #74265.

------------------------------------------------------------------------
[2017-03-22 05:38:04] 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...'.




------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=74288&edit=1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.