Skip to content
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

Fix GH-13727: PHP_TEST_BUILD macro generating invalid call test proto… #13732

Closed
wants to merge 1 commit into from
Closed
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
2 changes: 1 addition & 1 deletion TSRM/threads.m4
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ void *thread_routine(void *data) {
return data;
}

int main() {
int main(void) {
pthread_t thd;
pthread_mutexattr_t mattr;
int data = 1;
Expand Down
2 changes: 1 addition & 1 deletion Zend/Zend.m4
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ typedef union _mm_align_test {
#define ZEND_MM_ALIGNMENT (sizeof(mm_align_test))
#endif

int main()
int main(void)
{
size_t i = ZEND_MM_ALIGNMENT;
int zeros = 0;
Expand Down
10 changes: 5 additions & 5 deletions build/libtool.m4
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ dnl This sometimes fails to find confdefs.h, for some reason.
dnl [#]line __oline__ "[$]0"
[#]line __oline__ "configure"
#include "confdefs.h"
int main() {
int main(void) {
; return 0; }
EOF
if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
Expand Down Expand Up @@ -978,8 +978,8 @@ else
# endif
#endif

void fnord() { int i=42;}
int main ()
void fnord(void) { int i=42;}
int main (void)
{
void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
int status = $lt_dlunknown;
Expand Down Expand Up @@ -2750,7 +2750,7 @@ _LT_AC_TAGVAR(objext, $1)=$objext
lt_simple_compile_test_code="int some_variable = 0;"

# Code to be used in simple link tests
lt_simple_link_test_code='int main(){return(0);}'
lt_simple_link_test_code='int main(void){return(0);}'

_LT_AC_SYS_COMPILER

Expand Down Expand Up @@ -4640,7 +4640,7 @@ void nm_test_func(){}
#ifdef __cplusplus
}
#endif
int main(){nm_test_var='a';nm_test_func();return(0);}
int main(void){nm_test_var='a';nm_test_func();return(0);}
EOF

if AC_TRY_EVAL(ac_compile); then
Expand Down
2 changes: 1 addition & 1 deletion build/ltmain.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3598,7 +3598,7 @@ EOF
# whether they linked in statically or dynamically with ldd.
$rm conftest.c
cat > conftest.c <<EOF
int main() { return 0; }
int main(void) { return 0; }
EOF
$rm conftest
if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
Expand Down
34 changes: 17 additions & 17 deletions build/php.m4
Original file line number Diff line number Diff line change
Expand Up @@ -1034,7 +1034,7 @@ AC_DEFUN([_PHP_CHECK_SIZEOF], [
#endif
$3

int main()
int main(void)
{
FILE *fp = fopen("conftestval", "w");
if (!fp) return(1);
Expand Down Expand Up @@ -1102,7 +1102,7 @@ AC_CACHE_CHECK(for type of reentrant time-related functions, ac_cv_time_r_type,[
AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <time.h>

int main() {
int main(void) {
char buf[27];
struct tm t;
time_t old = 0;
Expand All @@ -1118,7 +1118,7 @@ return (1);
],[
AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <time.h>
int main() {
int main(void) {
struct tm t, *s;
time_t old = 0;
char buf[27], *p;
Expand Down Expand Up @@ -1159,7 +1159,7 @@ AC_DEFUN([PHP_DOES_PWRITE_WORK],[
#include <errno.h>
#include <stdlib.h>
$1
int main() {
int main(void) {
int fd = open("conftest_in", O_WRONLY|O_CREAT, 0600);

if (fd < 0) return 1;
Expand Down Expand Up @@ -1193,7 +1193,7 @@ AC_DEFUN([PHP_DOES_PREAD_WORK],[
#include <errno.h>
#include <stdlib.h>
$1
int main() {
int main(void) {
char buf[3];
int fd = open("conftest_in", O_RDONLY);
if (fd < 0) return 1;
Expand Down Expand Up @@ -1261,27 +1261,27 @@ dnl PHP_MISSING_TIME_R_DECL
dnl
AC_DEFUN([PHP_MISSING_TIME_R_DECL],[
AC_MSG_CHECKING([for missing declarations of reentrant functions])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[struct tm *(*func)() = localtime_r]])],[
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[struct tm *(*func)(void) = localtime_r]])],[
:
],[
AC_DEFINE(MISSING_LOCALTIME_R_DECL,1,[Whether localtime_r is declared])
])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[struct tm *(*func)() = gmtime_r]])],[
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[struct tm *(*func)(void) = gmtime_r]])],[
:
],[
AC_DEFINE(MISSING_GMTIME_R_DECL,1,[Whether gmtime_r is declared])
])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[char *(*func)() = asctime_r]])],[
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[char *(*func)(void) = asctime_r]])],[
:
],[
AC_DEFINE(MISSING_ASCTIME_R_DECL,1,[Whether asctime_r is declared])
])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[char *(*func)() = ctime_r]])],[
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[char *(*func)(void) = ctime_r]])],[
:
],[
AC_DEFINE(MISSING_CTIME_R_DECL,1,[Whether ctime_r is declared])
])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <string.h>]], [[char *(*func)() = strtok_r]])],[
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <string.h>]], [[char *(*func)(void) = strtok_r]])],[
:
],[
AC_DEFINE(MISSING_STRTOK_R_DECL,1,[Whether strtok_r is declared])
Expand Down Expand Up @@ -1315,7 +1315,7 @@ dnl See if we have broken header files like SunOS has.
dnl
AC_DEFUN([PHP_MISSING_FCLOSE_DECL],[
AC_MSG_CHECKING([for fclose declaration])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h>]], [[int (*func)() = fclose]])],[
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h>]], [[int (*func)(void) = fclose]])],[
AC_DEFINE(MISSING_FCLOSE_DECL,0,[ ])
AC_MSG_RESULT([ok])
],[
Expand Down Expand Up @@ -1405,7 +1405,7 @@ struct s
int i;
char c[1];
};
int main()
int main(void)
{
struct s *s = malloc(sizeof(struct s) + 3);
s->i = 3;
Expand Down Expand Up @@ -1463,7 +1463,7 @@ int seeker(void *cookie, off64_t *position, int whence)

cookie_io_functions_t funcs = {reader, writer, seeker, closer};

int main() {
int main(void) {
struct cookiedata g = { 0 };
FILE *fp = fopencookie(&g, "r", funcs);

Expand Down Expand Up @@ -1590,7 +1590,7 @@ AC_DEFUN([PHP_CHECK_FUNC_LIB],[
if test "$found" = "yes"; then
ac_libs=$LIBS
LIBS="$LIBS -l$2"
AC_RUN_IFELSE([AC_LANG_SOURCE([[int main() { return (0); }]])],[found=yes],[found=no],[
AC_RUN_IFELSE([AC_LANG_PROGRAM()],[found=yes],[found=no],[
dnl Cross compilation.
found=yes
])
Expand Down Expand Up @@ -1643,8 +1643,8 @@ AC_DEFUN([PHP_TEST_BUILD], [
LIBS="$4 $LIBS"
AC_LINK_IFELSE([AC_LANG_SOURCE([[
$5
char $1();
int main() {
char $1(void);
int main(void) {
$1();
return 0;
}
Expand Down Expand Up @@ -2296,7 +2296,7 @@ AC_DEFUN([PHP_TEST_WRITE_STDOUT],[

#define TEXT "This is the test message -- "

int main()
int main(void)
{
int n;

Expand Down
4 changes: 2 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -1120,7 +1120,7 @@ case $host_alias in
save_LDFLAGS=$LDFLAGS
LDFLAGS="$LDFLAGS -Wl,-zcommon-page-size=2097152 -Wl,-zmax-page-size=2097152"
AC_RUN_IFELSE(
[AC_LANG_SOURCE([[int main() {return 0;}]])],
[AC_LANG_PROGRAM()],
[ac_cv_common_page_size=yes],
[ac_cv_common_page_size=no],
[ac_cv_common_page_size=no])
Expand All @@ -1134,7 +1134,7 @@ case $host_alias in
save_LDFLAGS=$LDFLAGS
LDFLAGS="$LDFLAGS -Wl,-zmax-page-size=2097152"
AC_RUN_IFELSE(
[AC_LANG_SOURCE([[int main() {return 0;}]])],
[AC_LANG_PROGRAM()],
[ac_cv_max_page_size=yes],
[ac_cv_max_page_size=no],
[ac_cv_max_page_size=no])
Expand Down
2 changes: 1 addition & 1 deletion ext/gd/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ dnl Various checks for GD features

PHP_TEST_BUILD(foobar, [], [
AC_MSG_ERROR([GD build test failed. Please check the config.log for details.])
], [ $GD_SHARED_LIBADD ], [char foobar () {}])
], [ $GD_SHARED_LIBADD ], [char foobar (void) {}])

else
extra_sources="gd_compat.c"
Expand Down
6 changes: 3 additions & 3 deletions ext/iconv/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ if test "$PHP_ICONV" != "no"; then
AC_MSG_CHECKING([if using GNU libiconv])
AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <iconv.h>
int main() {
int main(void) {
printf("%d", _libiconv_version);
return 0;
}
Expand Down Expand Up @@ -90,7 +90,7 @@ int main() {
#include <iconv.h>
#include <errno.h>

int main() {
int main(void) {
iconv_t cd;
cd = iconv_open( "*blahblah*", "*blahblahblah*" );
if (cd == (iconv_t)(-1)) {
Expand All @@ -117,7 +117,7 @@ int main() {
#include <iconv.h>
#include <stdlib.h>

int main() {
int main(void) {
iconv_t cd = iconv_open( "UTF-8//IGNORE", "UTF-8" );
if(cd == (iconv_t)-1) {
return 1;
Expand Down
6 changes: 3 additions & 3 deletions ext/opcache/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ if test "$PHP_OPCACHE" != "no"; then
#include <unistd.h>
#include <string.h>

int main() {
int main(void) {
pid_t pid;
int status;
int ipc_id;
Expand Down Expand Up @@ -200,7 +200,7 @@ int main() {
# define MAP_FAILED ((void*)-1)
#endif

int main() {
int main(void) {
pid_t pid;
int status;
char *shm;
Expand Down Expand Up @@ -262,7 +262,7 @@ int main() {
# define MAP_FAILED ((void*)-1)
#endif

int main() {
int main(void) {
pid_t pid;
int status;
int fd;
Expand Down
12 changes: 6 additions & 6 deletions ext/standard/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ if test "$PHP_EXTERNAL_LIBCRYPT" != "no"; then
#include <stdlib.h>
#include <string.h>

int main() {
int main(void) {
#if HAVE_CRYPT
char *encrypted = crypt("rasmuslerdorf","rl");
return !encrypted || strcmp(encrypted,"rl.3StKT.4T8M");
Expand Down Expand Up @@ -111,7 +111,7 @@ int main() {
#include <stdlib.h>
#include <string.h>

int main() {
int main(void) {
#if HAVE_CRYPT
char *encrypted = crypt("rasmuslerdorf","_J9..rasm");
return !encrypted || strcmp(encrypted,"_J9..rasmBYk8r9AiWNc");
Expand Down Expand Up @@ -141,7 +141,7 @@ int main() {
#include <stdlib.h>
#include <string.h>

int main() {
int main(void) {
#if HAVE_CRYPT
char salt[15], answer[40];
char *encrypted;
Expand Down Expand Up @@ -181,7 +181,7 @@ int main() {
#include <stdlib.h>
#include <string.h>

int main() {
int main(void) {
#if HAVE_CRYPT
char salt[30], answer[70];
char *encrypted;
Expand Down Expand Up @@ -218,7 +218,7 @@ int main() {
#include <stdlib.h>
#include <string.h>

int main() {
int main(void) {
#if HAVE_CRYPT
char salt[21], answer[21+86];
char *encrypted;
Expand Down Expand Up @@ -254,7 +254,7 @@ int main() {
#include <stdlib.h>
#include <string.h>

int main() {
int main(void) {
#if HAVE_CRYPT
char salt[21], answer[21+43];
char *encrypted;
Expand Down
10 changes: 5 additions & 5 deletions sapi/fpm/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ AC_DEFUN([AC_FPM_CLOCK],
#include <mach/clock.h>
#include <mach/mach_error.h>

int main()
int main(void)
{
kern_return_t ret; clock_serv_t aClock; mach_timespec_t aTime;
ret = host_get_clock_service(mach_host_self(), REALTIME_CLOCK, &aClock);
Expand Down Expand Up @@ -158,7 +158,7 @@ AC_DEFUN([AC_FPM_TRACE],
#define PTRACE_PEEKDATA PT_READ_D
#endif

int main()
int main(void)
{
long v1 = (unsigned int) -1; /* copy will fail if sizeof(long) == 8 and we've got "int ptrace()" */
long v2;
Expand Down Expand Up @@ -263,7 +263,7 @@ AC_DEFUN([AC_FPM_TRACE],
#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>
int main()
int main(void)
{
long v1 = (unsigned int) -1, v2 = 0;
char buf[128];
Expand Down Expand Up @@ -604,7 +604,7 @@ if test "$PHP_FPM" != "no"; then
AC_CHECK_HEADERS([sys/acl.h])

AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include <sys/acl.h>
int main()
int main(void)
{
acl_t acl;
acl_entry_t user, group;
Expand All @@ -623,7 +623,7 @@ if test "$PHP_FPM" != "no"; then
AC_MSG_RESULT([yes])
],[
AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <sys/acl.h>
int main()
int main(void)
{
acl_t acl;
acl_entry_t user, group;
Expand Down
Loading