-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Closed
Description
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
php-8.5.0alpha2
Operating System
Darwin 10.12.6