Repository navigation
php: the config.h template has an epilogue too, and it carries <strin… - #724
Merged
Merged
Conversation
…g.h> Past ZEND_API, and stopped at zend_operators.h:308 -- `incompatible types: "IND VOID" and "INT" for op "RETURN"' on `return mempcpy(dest, src, n);'. mempcpy is declared unguarded at sys/include/ape/string.h:62, and <string.h> was not reachable in that translation unit at all. zend_operators.h does not include it, and the only thing that does is main/php.h:208, which a Zend file never reaches. memcpy, memcmp and strncasecmp were undeclared in the same unit and said nothing, because an implicit int converts to size_t in silence: the pointer return was the only one loud enough to notice. php_config.h.in:2225-2236 ends with four #includes -- stdlib.h, sys/types.h, sys/select.h, string.h -- and that is how every unit in php sees them. The same category as the prologue, missed for the same reason, and copied verbatim now with its guards. cfghdr-sweep could not see it either: its first version compared macro NAMES, which is the prologue's shape and not the epilogue's. The category is verbatim template text, and an #include is as verbatim as a #define. It compares both now and its control carries both shapes, so a run reports 2 where it reported 1. The host reproduced the whole thing -- gcc -fsyntax-only on block_pass.c with the real flags listed the same implicit declarations -- which is how it was diagnosed without a second round trip. One residual host-only artifact is recorded so nobody fixes it: memrchr still warns there, because glibc guards it behind _GNU_SOURCE while APE declares it unguarded. 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.
…g.h>
Past ZEND_API, and stopped at zend_operators.h:308 --
incompatible types: "IND VOID" and "INT" for op "RETURN"' onreturn mempcpy(dest, src, n);'.mempcpy is declared unguarded at sys/include/ape/string.h:62, and <string.h> was not reachable in that translation unit at all. zend_operators.h does not include it, and the only thing that does is main/php.h:208, which a Zend file never reaches. memcpy, memcmp and strncasecmp were undeclared in the same unit and said nothing, because an implicit int converts to size_t in silence: the pointer return was the only one loud enough to notice.
php_config.h.in:2225-2236 ends with four #includes -- stdlib.h, sys/types.h, sys/select.h, string.h -- and that is how every unit in php sees them. The same category as the prologue, missed for the same reason, and copied verbatim now with its guards.
cfghdr-sweep could not see it either: its first version compared macro NAMES, which is the prologue's shape and not the epilogue's. The category is verbatim template text, and an #include is as verbatim as a #define. It compares both now and its control carries both shapes, so a run reports 2 where it reported 1.
The host reproduced the whole thing -- gcc -fsyntax-only on block_pass.c with the real flags listed the same implicit declarations -- which is how it was diagnosed without a second round trip. One residual host-only artifact is recorded so nobody fixes it: memrchr still warns there, because glibc guards it behind _GNU_SOURCE while APE declares it unguarded.
Claude-Session: https://claude.ai/code/session_01WGAwvvTwDg2yknFkmZ3qzs