[php-src] Issue #8453: Unable to build if Valgrind is available
| From: | vobruba-martin | Date: | Thu, 28 Apr 2022 10:00:23 +0000 |
| Subject: | [php-src] Issue #8453: Unable to build if Valgrind is available | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-241298@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/8453
Author: vobruba-martin
### Description
[This code](https://github.com/php/php-src/blob/PHP-8.1.6/Zend/zend_string.c#L369-L378) doesn't
seem right:
```c
/* Even if we don't build with valgrind support, include the symbol so that valgrind available
* only at runtime will not result in false positives. */
#ifndef HAVE_VALGRIND
# define I_REPLACE_SONAME_FNNAME_ZU(soname, fnname) _vgr00000ZU_ ## soname ## _ ## fnname
#endif
ZEND_API bool ZEND_FASTCALL I_REPLACE_SONAME_FNNAME_ZU(NONE,zend_string_equal_val)(zend_string *s1,
zend_string *s2)
{
return !memcmp(ZSTR_VAL(s1), ZSTR_VAL(s2), ZSTR_LEN(s1));
}
```
Build fails with this error:
```
Zend/zend_string.c:375:29: error: ‘I_REPLACE_SONAME_FNNAME_ZU’ declared as function returning a
function
ZEND_API bool ZEND_FASTCALL I_REPLACE_SONAME_FNNAME_ZU(NONE,zend_string_equal_val)(zend_string *s1,
zend_string *s2)
```
As a workaround I had to use
--without-valgrind to make the build successful.
### PHP Version
PHP 8.1.5
### Operating System
_No response_