-
Notifications
You must be signed in to change notification settings - Fork 8k
sapi/fpm: remove use of variable-length arrays #10645
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
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
Member
|
FPM doesn't support Windows so it can require VLA support. I have no issue with with trace and stdio changes but not sure if we want to put procs on heap atm. Will think about but it's a low priority. |
According to @cmb69, PHP does not require VLA support (php#10304 (comment)). VLAs are a bad idea for several reasons, so let's get rid of them. Two of the VLAs were probably unintended; unlike C++, C doesn't have the concept of "constant expressions", so an array with a "const" length is technically still a VLA. This is fixed by removing the "const" variable, and using sizeof() instead.
ca880d2 to
4c5a1c2
Compare
Contributor
Author
|
OK, I removed the fpm_status.c change and will resubmit it later in a new PR, so the fixes for the two accidental VLAs can be merged now. |
MaxKellermann
added a commit
to CM4all/php-src
that referenced
this pull request
Feb 22, 2023
According to @cmb69, PHP does not require VLA support (php#10304 (comment)). VLAs are a bad idea for several reasons, so let's get rid of them. This is a continuation of php#10645
ndossche
pushed a commit
that referenced
this pull request
Dec 14, 2025
According to @cmb69, PHP does not require VLA support (#10304 (comment)). VLAs are a bad idea for several reasons, so let's get rid of them. Two of the VLAs were probably unintended; unlike C++, C doesn't have the concept of "constant expressions", so an array with a "const" length is technically still a VLA. This is fixed by removing the "const" variable, and using sizeof() instead. (cherry picked from commit ff2a211)
ndossche
added a commit
that referenced
this pull request
Dec 14, 2025
* PHP-8.1: sapi/fpm: remove use of variable-length arrays (#10645)
ndossche
added a commit
that referenced
this pull request
Dec 14, 2025
* PHP-8.2: sapi/fpm: remove use of variable-length arrays (#10645)
ndossche
added a commit
that referenced
this pull request
Dec 14, 2025
* PHP-8.3: sapi/fpm: remove use of variable-length arrays (#10645)
ndossche
added a commit
that referenced
this pull request
Dec 14, 2025
* PHP-8.4: sapi/fpm: remove use of variable-length arrays (#10645)
ndossche
added a commit
that referenced
this pull request
Dec 14, 2025
* PHP-8.5: sapi/fpm: remove use of variable-length arrays (#10645)
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.
According to @cmb69, PHP does not require VLA support (#10304 (comment)). VLAs are a bad idea for several reasons, so let's get rid of them.
Two of the VLAs were probably unintended; unlike C++, C doesn't have the concept of "constant expressions", so an array with a "const" length is technically still a VLA. This is fixed by removing the "const" variable, and using sizeof() instead.