Skip to content

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

Merged
merged 1 commit into from
Jan 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions UPGRADING.INTERNALS
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Member

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.

Copy link
Contributor Author

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...

Copy link
Contributor Author

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!

struct fpm_scoreboard_proc_s procs[scoreboard.nprocs];

char buf[max_buf_size];

char buf[buf_size];

for C99 features have been removed and therefore macro definitions
from php_config.h have disappeared. Do not use those feature
macros.

========================
2. Build system changes
Expand Down
16 changes: 0 additions & 16 deletions Zend/zend_strtod_int.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,22 +44,6 @@

#include <inttypes.h>

#ifndef HAVE_INT32_T
# if SIZEOF_INT == 4
typedef int int32_t;
# elif SIZEOF_LONG == 4
typedef long int int32_t;
# endif
#endif

#ifndef HAVE_UINT32_T
# if SIZEOF_INT == 4
typedef unsigned int uint32_t;
# elif SIZEOF_LONG == 4
typedef unsigned long int uint32_t;
# endif
#endif

#ifdef USE_LOCALE
#undef USE_LOCALE
#endif
Expand Down
8 changes: 0 additions & 8 deletions build/php.m4
Original file line number Diff line number Diff line change
Expand Up @@ -2443,14 +2443,6 @@ AC_DEFUN([PHP_CHECK_STDINT_TYPES], [
AC_CHECK_SIZEOF([long long])
AC_CHECK_SIZEOF([size_t])
AC_CHECK_SIZEOF([off_t])
AC_CHECK_TYPES([int8_t, int16_t, int32_t, int64_t, uint8_t, uint16_t, uint32_t, uint64_t], [], [
AC_MSG_ERROR([One of the intN_t or uintN_t types is not available])
], [
#include <stdint.h>
#if HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
])
])

dnl
Expand Down
16 changes: 0 additions & 16 deletions ext/date/lib/timelib.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,22 +39,6 @@
#include <limits.h>
#include <inttypes.h>

# ifndef HAVE_INT32_T
# if SIZEOF_INT == 4
typedef int int32_t;
# elif SIZEOF_LONG == 4
typedef long int int32_t;
# endif
# endif

# ifndef HAVE_UINT32_T
# if SIZEOF_INT == 4
typedef unsigned int uint32_t;
# elif SIZEOF_LONG == 4
typedef unsigned long int uint32_t;
# endif
# endif

#ifdef _WIN32
# if _MSC_VER >= 1600
# include <stdint.h>
Expand Down
26 changes: 0 additions & 26 deletions ext/mysqlnd/config-win.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,32 +15,6 @@ This file is public domain and comes with NO WARRANTY of any kind */

#include <stdint.h>

#ifndef HAVE_INT8_T
#define HAVE_INT8_T
#endif
#ifndef HAVE_UINT8_T
#define HAVE_UINT8_T
#endif
#ifndef HAVE_INT16_T
#define HAVE_INT16_T
#endif
#ifndef HAVE_UINT16_T
#define HAVE_UINT16_T
#endif
#ifndef HAVE_INT32_T
#define HAVE_INT32_T
#endif
#ifndef HAVE_UINT32_T
#define HAVE_UINT32_T
#endif
#ifndef HAVE_INT64_T
#define HAVE_INT64_T
#endif
#ifndef HAVE_UINT64_T
#define HAVE_UINT64_T
#endif


#ifndef _WIN64
#ifndef _WIN32
#define _WIN32 /* Compatible with old source */
Expand Down