-
Notifications
You must be signed in to change notification settings - Fork 7.8k
build/php.m4: remove test for integer types #10304
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
These are mandatory in C99, so it's a pointless waste of time to check for them. (Actually, the fixed-size integer types are not mandatory, but if they are really not available on some theoretical system, PHP's fallbacks won't work either, so nothing is gained from this check.)
dcff651
to
9906ef8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know why I didn't clean those up when I did the clean-up for a bunch of other checks.
@@ -26,6 +26,10 @@ PHP 8.3 INTERNALS UPGRADE NOTES | |||
break the build of third-party extensions which relied on this | |||
implementation detail. Those extensions may need to add the missing | |||
#include lines. | |||
* Since version 8, PHP requires a C99 compiler. Configure-time checks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW, we do not actually fully C99 compliant compilers, but merely rely on some of its features (e.g. we do not require VLA support, which is optional as of C11). I don't think this needs to be updated, though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Requiring a C99 compiler doesn't imply that all C99 features are really used - VLA is a special example of a feature that many people nowadays think was a bad idea, and I'm happy PHP doesn't use them.
I compile my projects with -Wvla
so GCC kicks me if I accidently use one...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we do not require VLA support, which is optional as of C11
@cmb69, turns out PHP does use VLAs!
php-src/sapi/fpm/fpm/fpm_status.c
Line 64 in 2f65da0
struct fpm_scoreboard_proc_s procs[scoreboard.nprocs]; |
php-src/sapi/fpm/fpm/fpm_stdio.c
Line 173 in 2f65da0
char buf[max_buf_size]; |
php-src/sapi/fpm/fpm/fpm_php_trace.c
Line 43 in 2f65da0
char buf[buf_size]; |
@cmb69 that PR was rejected by @derickr: derickr/timelib#141 (comment) I'm puzzled by his stated reason.... |
I've just stumbled upon https://github.com/php-memcached-dev/php-memcached/blob/04a0f72eaafc0ac4ba646b57761b8d7331cdc82a/php_memcached_private.h#L65-L79. Many other extensions may be affected by this removal as well. I'm not suggesting to revert this, but we should have a look at the discussion on derickr/timelib#141. |
Yeah, apparently people have been copying code ... Apparently, extensions are supposed to Maybe make including (The "timelib" problem is different; it's a vendored library embedded in PHP which PHP can easily fix in its local copy, but feeding that change back to timelib appears to be difficult.) |
This header already exists - undocumented, but apparently for the same reason I wanted to have it. @cmb69, what do you think, do you want me to add the |
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.
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.
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.
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
These are mandatory in C99, so it's a pointless waste of time to check for them.
(Actually, the fixed-size integer types are not mandatory, but if they are really not available on some theoretical system, PHP's fallbacks won't work either, so nothing is gained from this check.)