Repository navigation
php: ZEND_API was never defined, and cfghdr-sweep for the class - #723
Merged
Merged
Conversation
TSRM/TSRM.c compiled -- the first object of the port -- and Zend/Optimizer/block_pass.c then answered, from zend_map_ptr.h:82, `not a function' / `not a parameter: zend_map_ptr_reset' / `syntax error, last name: ZEND_API'. That is `ZEND_API void zend_map_ptr_reset(void);' with ZEND_API an undefined identifier, and every ZEND_API in php is that shape, so the first file to declare anything would have failed whichever it was. The cause is a blind spot in how the config.h was written. autoheader emits only `#undef NAME'; anything spelled `#define' in a .h.in is text copied straight through. php_config.h.in:7-15 copies three -- ZEND_API, ZEND_DLEXPORT, ZEND_DLIMPORT -- under an `#if defined(__GNUC__)' whose #else arm makes all three empty. Reading the generated config as a list of capabilities, which is the method used here, does not show them. The prologue is copied verbatim now, guard included, since that guard is already right for kencc. 21 names were missing in all, and the check that shows them is a diff of the two name sets: sys/lib/tests/cfghdr-sweep.py. It gates on a template #define the answered file does not carry, and reports without gating both an unanswered #undef (php's template asks 696 questions and 474 are deliberately silent) and a name the answered file invents, since only the author can tell an addition from a typo. It found one of each on its first run. PHP_OS_FAMILY was mine and was a collision: main/php.h:38-51 computes it and ends in an unconditional #else "Unknown", so php.h would have redefined it with a different string. Plan 9 defines none of BSD, __linux__ or the rest, so php answers "Unknown", which is true. And five names in clisp's hand-answered config, which builds and runs, so they are recorded rather than acted on -- which is why clisp is not in the gating list. Its own control caught two faults in two runs: the include guard is a #define like any other and was being demanded of the answered file, and a name the template both #defines in a dead arm and #undefs elsewhere is a question rather than verbatim text -- clisp's WORDS_BIGENDIAN, which dropped the count from 6 to 5. The other 18 are _GNU_SOURCE and its family, __STDC_WANT_* and two Linux headers, left out deliberately: APE's feature macros are the three the mkfile already passes. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGAwvvTwDg2yknFkmZ3qzs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TSRM/TSRM.c compiled -- the first object of the port -- and Zend/Optimizer/block_pass.c then answered, from zend_map_ptr.h:82,
not a function' /not a parameter: zend_map_ptr_reset' /syntax error, last name: ZEND_API'. That isZEND_API void zend_map_ptr_reset(void);' with ZEND_API an undefined identifier, and every ZEND_API in php is that shape, so the first file to declare anything would have failed whichever it was.The cause is a blind spot in how the config.h was written. autoheader emits only
#undef NAME'; anything spelled#define' in a .h.in is text copied straight through. php_config.h.in:7-15 copies three -- ZEND_API, ZEND_DLEXPORT, ZEND_DLIMPORT -- under an `#if defined(GNUC)' whose #else arm makes all three empty. Reading the generated config as a list of capabilities, which is the method used here, does not show them. The prologue is copied verbatim now, guard included, since that guard is already right for kencc.21 names were missing in all, and the check that shows them is a diff of the two name sets: sys/lib/tests/cfghdr-sweep.py. It gates on a template #define the answered file does not carry, and reports without gating both an unanswered #undef (php's template asks 696 questions and 474 are deliberately silent) and a name the answered file invents, since only the author can tell an addition from a typo.
It found one of each on its first run. PHP_OS_FAMILY was mine and was a collision: main/php.h:38-51 computes it and ends in an unconditional #else "Unknown", so php.h would have redefined it with a different string. Plan 9 defines none of BSD, linux or the rest, so php answers "Unknown", which is true. And five names in clisp's hand-answered config, which builds and runs, so they are recorded rather than acted on -- which is why clisp is not in the gating list.
Its own control caught two faults in two runs: the include guard is a #define like any other and was being demanded of the answered file, and a name the template both #defines in a dead arm and #undefs elsewhere is a question rather than verbatim text -- clisp's WORDS_BIGENDIAN, which dropped the count from 6 to 5.
The other 18 are _GNU_SOURCE and its family, _STDC_WANT* and two Linux headers, left out deliberately: APE's feature macros are the three the mkfile already passes.
Claude-Session: https://claude.ai/code/session_01WGAwvvTwDg2yknFkmZ3qzs