From eecbe1fe2979466351f07b1dcf7f96836cc7da31 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Fri, 10 May 2024 10:41:58 +0000 Subject: [PATCH] * build/apr_threads.m4, build/apr_common.m4, configure.in: Use full prototype for main() throughout, avoiding warnings when building with gcc -Wstrict-prototypes. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1917642 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_common.m4 | 2 +- build/apr_threads.m4 | 4 ++-- configure.in | 16 ++++++++-------- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/build/apr_common.m4 b/build/apr_common.m4 index 03d7dca7fc..b7fc68bc13 100644 --- a/build/apr_common.m4 +++ b/build/apr_common.m4 @@ -922,7 +922,7 @@ else dnl should be available everywhere! cat > conftest.c < - int main() { return 0; } + int main(int argc, const char *argv[]) { return 0; } EOF MKDEP="true" for i in "$CC -MM" "$CC -M" "$CPP -MM" "$CPP -M" "cpp -M"; do diff --git a/build/apr_threads.m4 b/build/apr_threads.m4 index 8c24e07c7e..5e231fbd58 100644 --- a/build/apr_threads.m4 +++ b/build/apr_threads.m4 @@ -100,7 +100,7 @@ void *thread_routine(void *data) { return data; } -int main() { +int main(int argc, const char *argv[]) { pthread_t thd; pthread_mutexattr_t mattr; pthread_once_t once_init = PTHREAD_ONCE_INIT; @@ -228,7 +228,7 @@ AC_DEFUN([APR_CHECK_PTHREAD_RECURSIVE_MUTEX], [ #include #include -int main() { +int main(int argc, const char *argv[]) { pthread_mutexattr_t attr; pthread_mutex_t m; diff --git a/configure.in b/configure.in index f7d7eb518b..34aeebf034 100644 --- a/configure.in +++ b/configure.in @@ -684,7 +684,7 @@ int weak_noop(void) { return 0; } -int main() +int main(int argc, char **argv) { return weak_noop(); }], [ap_cv_weak_symbols=yes], [ap_cv_weak_symbols=no], [ap_cv_weak_symbols=no])]) @@ -1183,7 +1183,7 @@ AC_CACHE_CHECK([for asio -> message queue support], [apr_cv_aio_msgq], #define _AIO_OS390 #include -int main() +int main(int argc, const char *argv[]) { struct aiocb a; @@ -1201,7 +1201,7 @@ AC_CACHE_CHECK([for dup3 support], [apr_cv_dup3], [AC_TRY_RUN([ #include -int main() +int main(int argc, const char *argv[]) { return dup3(STDOUT_FILENO, STDERR_FILENO, 0) == -1; }], [apr_cv_dup3=yes], [apr_cv_dup3=no], [apr_cv_dup3=no])]) @@ -1278,7 +1278,7 @@ AC_CACHE_CHECK([for SOCK_CLOEXEC support], [apr_cv_sock_cloexec], #include #include -int main() +int main(int argc, const char *argv[]) { return socket(AF_INET, SOCK_STREAM|SOCK_CLOEXEC, 0) == -1; }], [apr_cv_sock_cloexec=yes], [apr_cv_sock_cloexec=no], [apr_cv_sock_cloexec=no])]) @@ -1335,7 +1335,7 @@ if test "$ac_cv_func_mmap" = "yes" && #ifdef HAVE_SYS_MMAN_H #include #endif - int main() + int main(int argc, const char *argv[]) { int fd; void *m; @@ -2476,7 +2476,7 @@ AC_TRY_RUN([ #ifndef SEM_FAILED #define SEM_FAILED (-1) #endif -int main() +int main(int argc, const char *argv[]) { sem_t *psem; const char *sem_name = "/apr_autoconf"; @@ -2537,7 +2537,7 @@ if test "$threads" = "1"; then #include #include #include - int main() + int main(int argc, const char *argv[]) { pthread_mutex_t mutex; pthread_mutexattr_t attr; @@ -2675,7 +2675,7 @@ const char *fname = "conftest.fcntl"; int lockit(); -int main() +int main(int argc, const char *argv[]) { int rc, status;; proc_mutex_lock_it.l_whence = SEEK_SET; /* from current point */