Skip to content

php-8.5.0alpha2 build failure in ext/session/session.c #19197

Closed

Description

@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

php-8.5.0alpha2

Operating System

Darwin 10.12.6

Activity

  1. self-assigned this
    on Jul 21, 2025
  2. added a commit that references this issue on Jul 21, 2025
    c85b870
  3. added a commit that references this issue on Jul 21, 2025
    bd886d2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions