Bug #76574 [Opn->Fbk]: use of undeclared identifiers INT_MAX and LONG_MAX
| From: | ab@php.net | Date: | Thu, 05 Jul 2018 06:24:38 +0000 |
| Subject: | Bug #76574 [Opn->Fbk]: use of undeclared identifiers INT_MAX and LONG_MAX | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-216146@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=76574&edit=1
ID: 76574
Updated by: ab@php.net
Reported by: php-bugs-2018 at ryandesign dot com
Summary: use of undeclared identifiers INT_MAX and LONG_MAX
-Status: Open
+Status: Feedback
Type: Bug
Package: mbstring related
Operating System: macOS 10.12.6
PHP Version: 7.3.0alpha2
Block user comment: N
Private report: N
New Comment:
Ah, that explains it. Extensions in the core are usually not prepared for phpize usage. In this
particular case, the config expects an in core path, so it can create conifig.h dynamically.
Anything prevents to compile shared in the core?
Thanks.
Previous Comments:
------------------------------------------------------------------------
[2018-07-05 04:52:27] php-bugs-2018 at ryandesign dot com
I'm building mbstring as a separate extension, using MacPorts. (I'm the MacPorts
maintainer of PHP.) The only configure flags are:
--prefix=/opt/local --with-php-config=/opt/local/bin/php-config72
The configure output doesn't mention limits.
------------------------------------------------------------------------
[2018-07-04 13:48:54] ab@php.net
Thanks for the report. What are the configure flags? Especially, is --disable-mbregex used?
Thanks.
------------------------------------------------------------------------
[2018-07-04 09:59:04] dc dot link at yahoo dot fr
Odd, because normally limits.h is checked in the configure step.
------------------------------------------------------------------------
[2018-07-04 05:24:40] php-bugs-2018 at ryandesign dot com
I do not see the problem when I build oniguruma 6.7.1 by itself outside of PHP.
It looks like one needs to #include <limits.h> in order to get the definitions of INT_MAX and
LONG_MAX. The oniguruma source code does do that, but only if its configure script determined that
the header exists; it sets HAVE_LIMITS_H when that's the case. It doesn't look like PHP
runs oniguruma's configure script, so it's not set.
I am able to build successfully by adding "-DHAVE_LIMITS_H=1" to CFLAGS, but of course I
shouldn't have to do that.
------------------------------------------------------------------------
[2018-07-03 18:56:04] php-bugs-2018 at ryandesign dot com
Description:
------------
ext/mbstring/oniguruma/src/regparse.c:206:11: error: use of undeclared identifier
'INT_MAX'
if (x < INT_MAX / y)
^
ext/mbstring/oniguruma/src/regparse.c:6760:49: error: use of undeclared identifier
'LONG_MAX'
r = parse_long(enc, buf, bufend, 1, LONG_MAX, &rl);
^
2 errors generated.
make: *** [oniguruma/src/regparse.lo] Error 1
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=76574&edit=1