[php-src] Issue #19197: php-8.5.0alpha2 build failure in ext/session/session.c
| From: | debohman | Date: | Mon, 21 Jul 2025 06:59:15 +0000 |
| Subject: | [php-src] Issue #19197: php-8.5.0alpha2 build failure in ext/session/session.c | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-250465@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/19197
Author: debohman
### Description
The use of
ZEND_STRL() is problematic.
```
#define ZEND_STRL(str) (str), (sizeof(str)-1)
```
given:
```
memcpy(buf, ZEND_STRL(LAST_MODIFIED));
```
When memcpy is defined as a macro, it does not expand as expected.
```
/tera/tera/debo/Projects/php/php-8.5.0alpha2/ext/session/session.c:1249:39: error: too few arguments
provided to function-like macro invocation
1249 | memcpy(buf, ZEND_STRL(LAST_MODIFIED));
| ^
/usr/include/secure/_string.h:64:9: note: macro 'memcpy' defined here
64 | #define memcpy(dest, src, len) \
| ^
/tera/tera/debo/Projects/php/php-8.5.0alpha2/ext/session/session.c:1249:3: warning: expression
result unused [-Wunused-value]
1249 | memcpy(buf, ZEND_STRL(LAST_MODIFIED));
| ^~~~~~
/tera/tera/debo/Projects/php/php-8.5.0alpha2/ext/session/session.c:1264:32: error: too few arguments
provided to function-like macro invocation
1264 | memcpy(buf, ZEND_STRL(EXPIRES));
| ^
/usr/include/secure/_string.h:64:9: note: macro 'memcpy' defined here
64 | #define memcpy(dest, src, len) \
| ^
/tera/tera/debo/Projects/php/php-8.5.0alpha2/ext/session/session.c:1264:2: warning: expression
result unused [-Wunused-value]
1264 | memcpy(buf, ZEND_STRL(EXPIRES));
| ^~~~~~
2 warnings and 2 errors generated.
make: *** [Makefile:2244: ext/session/session.lo] Error 1
make: *** Waiting for unfinished jobs....
```
Darwin 10.12.6, clang 20.1.8.
### PHP Version
```plain
php-8.5.0alpha2
```
### Operating System
Darwin 10.12.6