summaryrefslogtreecommitdiffhomepage
path: root/auto
diff options
context:
space:
mode:
authorAndrew Clayton <a.clayton@nginx.com>2022-10-28 00:17:51 +0100
committerAndrew Clayton <a.clayton@nginx.com>2022-10-28 03:17:31 +0100
commit8f0dd9478e164121e31bebaf1c10dd6e537d2918 (patch)
treeffa6a1e20de03c2592f415d17440421c3748e8ed /auto
parenta3cb07df20541939335fe42c75d0d479c2092b88 (diff)
downloadunit-8f0dd9478e164121e31bebaf1c10dd6e537d2918.tar.gz
unit-8f0dd9478e164121e31bebaf1c10dd6e537d2918.tar.bz2
Fixed main() prototypes in auto tests.
Future releases of GCC are planning to remove[0] default support for some old features that were removed from C99 but GCC still accepts. We can test for these changes by using the following -Werror= directives -Werror=implicit-int -Werror=implicit-function-declaration -Werror=int-conversion -Werror=strict-prototypes -Werror=old-style-definition Doing so revealed an issue with the auto/ tests in that the test programs always define main as int main() rather than int main(void) which results in a bunch of errors like build/autotest.c:3:23: error: function declaration isn't a prototype [-Werror=strict-prototypes] 3 | int main() { | ^~~~ build/autotest.c: In function 'main': build/autotest.c:3:23: error: old-style function definition [-Werror=old-style-definition] The fix was easy, it only required fixing the main prototype with find -type f -exec sed -i 's/int main() {/int main(void) {/g' {} \; Regardless of these upcoming GCC changes, this is probably a good thing to do anyway for correctness. [0]: https://fedoraproject.org/wiki/Changes/PortingToModernC Link: <https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/message/CJXKTLXJUPZ4F2C2VQOTNMEA5JAUPMBD/> Link: <https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/message/6SGHPHPAXKCVJ6PUZ57WVDQ5TDBVIRMF/> Reviewed-by: Alejandro Colomar <alx@nginx.com> Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
Diffstat (limited to 'auto')
-rw-r--r--auto/atomic8
-rw-r--r--auto/capability2
-rw-r--r--auto/clang20
-rw-r--r--auto/events16
-rw-r--r--auto/files8
-rw-r--r--auto/isolation16
-rw-r--r--auto/malloc16
-rw-r--r--auto/mmap8
-rw-r--r--auto/modules/java2
-rw-r--r--auto/modules/perl4
-rw-r--r--auto/modules/php8
-rw-r--r--auto/modules/python4
-rw-r--r--auto/modules/ruby6
-rw-r--r--auto/pcre2
-rw-r--r--auto/sendfile12
-rw-r--r--auto/shmem8
-rw-r--r--auto/sockets32
-rw-r--r--auto/ssltls18
-rw-r--r--auto/threads16
-rw-r--r--auto/time20
-rw-r--r--auto/types14
-rw-r--r--auto/unix18
22 files changed, 129 insertions, 129 deletions
diff --git a/auto/atomic b/auto/atomic
index 31259fc5..f99adf7e 100644
--- a/auto/atomic
+++ b/auto/atomic
@@ -10,7 +10,7 @@ nxt_feature_name=NXT_HAVE_GCC_ATOMIC
nxt_feature_run=yes
nxt_feature_incs=
nxt_feature_libs=
-nxt_feature_test="int main() {
+nxt_feature_test="int main(void) {
long n = 0;
if (!__sync_bool_compare_and_swap(&n, 0, 3))
@@ -44,7 +44,7 @@ if [ $nxt_found = no ]; then
nxt_feature_libs=
nxt_feature_test="#include <atomic.h>
- int main() {
+ int main(void) {
ulong_t n = 0;
if (atomic_cas_ulong(&n, 0, 3) != 0)
@@ -70,7 +70,7 @@ fi
if [ $nxt_found = no ]; then
if [ $NXT_64BIT = 1 ]; then
- nxt_feature_test="int main() {
+ nxt_feature_test="int main(void) {
long n = 0;
long o = 0;
@@ -87,7 +87,7 @@ if [ $nxt_found = no ]; then
return 0;
}"
else
- nxt_feature_test="int main() {
+ nxt_feature_test="int main(void) {
int n = 0;
int o = 0;
diff --git a/auto/capability b/auto/capability
index 48777665..c0410b34 100644
--- a/auto/capability
+++ b/auto/capability
@@ -10,7 +10,7 @@ nxt_feature_test="#include <linux/capability.h>
#include <unistd.h>
#include <sys/syscall.h>
- int main() {
+ int main(void) {
struct __user_cap_header_struct hdr;
hdr.version = _LINUX_CAPABILITY_VERSION;
syscall(SYS_capget, &hdr, 0);
diff --git a/auto/clang b/auto/clang
index 1a05b5a3..975a6468 100644
--- a/auto/clang
+++ b/auto/clang
@@ -14,7 +14,7 @@ nxt_feature_libs=
nxt_feature_test="#include <stdio.h>
#define set(dummy, ...) sprintf(__VA_ARGS__)
- int main() {
+ int main(void) {
char buf[4];
buf[0] = '0';
@@ -37,7 +37,7 @@ if [ $nxt_found = no ]; then
nxt_feature_test="#include <stdio.h>
#define set(dummy, args...) sprintf(args)
- int main() {
+ int main(void) {
char buf[4];
buf[0] = '0';
@@ -70,7 +70,7 @@ nxt_feature_name=NXT_HAVE_BUILTIN_UNREACHABLE
nxt_feature_run=no
nxt_feature_incs=
nxt_feature_libs=
-nxt_feature_test="int main() {
+nxt_feature_test="int main(void) {
__builtin_unreachable();
}"
. auto/feature
@@ -81,7 +81,7 @@ nxt_feature_name=NXT_HAVE_BUILTIN_PREFETCH
nxt_feature_run=no
nxt_feature_incs=
nxt_feature_libs=
-nxt_feature_test="int main() {
+nxt_feature_test="int main(void) {
__builtin_prefetch(0);
return 0;
}"
@@ -93,7 +93,7 @@ nxt_feature_name=NXT_HAVE_BUILTIN_CLZ
nxt_feature_run=
nxt_feature_incs=
nxt_feature_libs=
-nxt_feature_test="int main() {
+nxt_feature_test="int main(void) {
if (__builtin_clz(1) == 31)
return 0;
return 1;
@@ -106,7 +106,7 @@ nxt_feature_name=NXT_HAVE_BUILTIN_POPCOUNT
nxt_feature_run=
nxt_feature_incs=
nxt_feature_libs=
-nxt_feature_test="int main() {
+nxt_feature_test="int main(void) {
if (__builtin_popcount(5) == 2)
return 0;
return 1;
@@ -121,7 +121,7 @@ nxt_feature_incs=
nxt_feature_libs=
nxt_feature_test="int n __attribute__ ((visibility(\"default\")));
- int main() {
+ int main(void) {
return 1;
}"
. auto/feature
@@ -134,7 +134,7 @@ nxt_feature_incs=
nxt_feature_libs=
nxt_feature_test="int n __attribute__ ((aligned(64)));
- int main() {
+ int main(void) {
return 1;
}"
. auto/feature
@@ -153,7 +153,7 @@ nxt_feature_test="#include <stdlib.h>
return malloc(1);
}
- int main() {
+ int main(void) {
if (f() != NULL) {
return 1;
}
@@ -172,7 +172,7 @@ nxt_feature_test="struct s {
int i;
} __attribute__ ((__packed__));
- int main() {
+ int main(void) {
return 1;
}"
. auto/feature
diff --git a/auto/events b/auto/events
index 700dc20c..1ca6e7cd 100644
--- a/auto/events
+++ b/auto/events
@@ -13,7 +13,7 @@ nxt_feature_libs=
nxt_feature_test="#include <sys/epoll.h>
#include <unistd.h>
- int main() {
+ int main(void) {
int n;
n = epoll_create(1);
@@ -34,7 +34,7 @@ if [ $nxt_found = yes ]; then
#include <sys/signalfd.h>
#include <unistd.h>
- int main() {
+ int main(void) {
int n;
sigset_t mask;
@@ -54,7 +54,7 @@ if [ $nxt_found = yes ]; then
nxt_feature_test="#include <sys/eventfd.h>
#include <unistd.h>
- int main() {
+ int main(void) {
int n;
n = eventfd(0, 0);
@@ -79,7 +79,7 @@ nxt_feature_test="#include <sys/types.h>
#include <sys/event.h>
#include <unistd.h>
- int main() {
+ int main(void) {
int n;
n = kqueue();
@@ -100,7 +100,7 @@ if [ $nxt_found = yes ]; then
#include <sys/types.h>
#include <sys/event.h>
- int main() {
+ int main(void) {
struct kevent kev;
kev.filter = EVFILT_USER;
@@ -124,7 +124,7 @@ nxt_feature_libs=
nxt_feature_test="#include <port.h>
#include <unistd.h>
- int main() {
+ int main(void) {
int n;
n = port_create();
@@ -152,7 +152,7 @@ nxt_feature_test="#include <fcntl.h>
#include <sys/devpoll.h>
#include <unistd.h>
- int main() {
+ int main(void) {
int n;
n = open(\"/dev/poll\", O_RDWR);
@@ -180,7 +180,7 @@ nxt_feature_test="#include <fcntl.h>
#include <sys/pollset.h>
#include <unistd.h>
- int main() {
+ int main(void) {
pollset_t n;
n = pollset_create(-1);
diff --git a/auto/files b/auto/files
index 591c5ee1..1fa6ca28 100644
--- a/auto/files
+++ b/auto/files
@@ -12,7 +12,7 @@ nxt_feature_incs=
nxt_feature_libs=
nxt_feature_test="#include <fcntl.h>
- int main() {
+ int main(void) {
(void) posix_fadvise(0, 0, 0, POSIX_FADV_WILLNEED);
return 0;
}"
@@ -28,7 +28,7 @@ nxt_feature_incs=
nxt_feature_libs=
nxt_feature_test="#include <fcntl.h>
- int main() {
+ int main(void) {
(void) fcntl(0, F_READAHEAD, 1024);
return 0;
}"
@@ -44,7 +44,7 @@ nxt_feature_incs=
nxt_feature_libs=
nxt_feature_test="#include <fcntl.h>
- int main() {
+ int main(void) {
(void) fcntl(0, F_RDAHEAD, 1);
return 0;
}"
@@ -62,7 +62,7 @@ nxt_feature_test="#include <fcntl.h>
#include <linux/openat2.h>
#include <string.h>
- int main() {
+ int main(void) {
struct open_how how;
memset(&how, 0, sizeof(how));
diff --git a/auto/isolation b/auto/isolation
index 384f7ef1..cbf42d9d 100644
--- a/auto/isolation
+++ b/auto/isolation
@@ -20,7 +20,7 @@ nxt_feature_libs=
nxt_feature_test="#include <sys/wait.h>
#include <sys/syscall.h>
- int main() {
+ int main(void) {
return SYS_clone | SIGCHLD;
}"
. auto/feature
@@ -40,7 +40,7 @@ if [ $nxt_found = yes ]; then
#include <sys/syscall.h>
#include <sched.h>
- int main() {
+ int main(void) {
return CLONE_NEW$flag;
}"
. auto/feature
@@ -70,7 +70,7 @@ nxt_feature_test="#include <sys/syscall.h>
# error
#endif
- int main() {
+ int main(void) {
return SYS_pivot_root;
}"
. auto/feature
@@ -96,7 +96,7 @@ nxt_feature_incs=
nxt_feature_libs=
nxt_feature_test="#include <sys/prctl.h>
- int main() {
+ int main(void) {
return PR_SET_NO_NEW_PRIVS;
}"
. auto/feature
@@ -109,7 +109,7 @@ nxt_feature_incs=
nxt_feature_libs=
nxt_feature_test="#include <sys/mount.h>
- int main() {
+ int main(void) {
return mount(\"/\", \"/\", \"bind\",
MS_BIND | MS_REC, \"\");
}"
@@ -128,7 +128,7 @@ if [ $nxt_found = no ]; then
nxt_feature_libs=
nxt_feature_test="#include <sys/mount.h>
- int main() {
+ int main(void) {
return nmount((void *)0, 0, 0);
}"
. auto/feature
@@ -146,7 +146,7 @@ nxt_feature_incs=
nxt_feature_libs=
nxt_feature_test="#include <sys/mount.h>
- int main() {
+ int main(void) {
return umount2((void *)0, 0);
}"
. auto/feature
@@ -163,7 +163,7 @@ if [ $nxt_found = no ]; then
nxt_feature_libs=
nxt_feature_test="#include <sys/mount.h>
- int main() {
+ int main(void) {
return unmount((void *)0, 0);
}"
. auto/feature
diff --git a/auto/malloc b/auto/malloc
index 06a16b54..cf6fc59e 100644
--- a/auto/malloc
+++ b/auto/malloc
@@ -13,7 +13,7 @@ nxt_feature_incs=
nxt_feature_libs=
nxt_feature_test="#include <stdlib.h>
- int main() {
+ int main(void) {
void *p;
if (posix_memalign(&p, 4096, 4096) != 0)
@@ -36,7 +36,7 @@ if [ $nxt_found = no ]; then
nxt_feature_libs=
nxt_feature_test="#include <stdlib.h>
- int main() {
+ int main(void) {
void *p;
p = memalign(4096, 4096);
@@ -59,7 +59,7 @@ nxt_feature_incs=
nxt_feature_libs=
nxt_feature_test="#include <malloc.h>
- int main() {
+ int main(void) {
void *p;
p = malloc(4096);
@@ -82,7 +82,7 @@ if [ $nxt_found = no ]; then
nxt_feature_test="#include <stdlib.h>
#include <malloc_np.h>
- int main() {
+ int main(void) {
void *p;
p = malloc(4096);
@@ -105,7 +105,7 @@ if [ $nxt_found = no ]; then
nxt_feature_libs=
nxt_feature_test="#include <malloc/malloc.h>
- int main() {
+ int main(void) {
if (malloc_good_size(4096) < 4096)
return 1;
return 0;
@@ -125,7 +125,7 @@ nxt_feature_incs=
nxt_feature_libs=
nxt_feature_test="#include <stdlib.h>
- int main() {
+ int main(void) {
void *p;
p = alloca(256);
@@ -147,7 +147,7 @@ if [ $nxt_found = no ]; then
nxt_feature_libs=
nxt_feature_test="#include <alloca.h>
- int main() {
+ int main(void) {
void *p;
p = alloca(256);
@@ -168,7 +168,7 @@ nxt_feature_incs=
nxt_feature_libs=
nxt_feature_test="#include <malloc.h>
- int main() {
+ int main(void) {
mallopt(M_PERTURB, 0x55);
return 0;
}"
diff --git a/auto/mmap b/auto/mmap
index 8ecdf670..e8ffac78 100644
--- a/auto/mmap
+++ b/auto/mmap
@@ -13,7 +13,7 @@ nxt_feature_libs=
nxt_feature_test="#include <stdlib.h>
#include <sys/mman.h>
- int main() {
+ int main(void) {
if (mmap(NULL, 4096, PROT_READ | PROT_WRITE,
MAP_PRIVATE | MAP_ANON, -1, 0)
== MAP_FAILED)
@@ -35,7 +35,7 @@ if [ $nxt_found = no ]; then
nxt_feature_test="#include <stdlib.h>
#include <sys/mman.h>
- int main() {
+ int main(void) {
if (mmap(NULL, 4096, PROT_READ | PROT_WRITE,
MAP_PRIVATE | MAP_ANONYMOUS, -1, 0)
== MAP_FAILED)
@@ -56,7 +56,7 @@ nxt_feature_libs=
nxt_feature_test="#include <stdlib.h>
#include <sys/mman.h>
- int main() {
+ int main(void) {
if (mmap(NULL, 4096, PROT_READ | PROT_WRITE,
MAP_SHARED | MAP_POPULATE, -1, 0)
== MAP_FAILED)
@@ -76,7 +76,7 @@ nxt_feature_libs=
nxt_feature_test="#include <stdlib.h>
#include <sys/mman.h>
- int main() {
+ int main(void) {
if (mmap(NULL, 4096, PROT_READ | PROT_WRITE,
MAP_PRIVATE | MAP_ANON | MAP_PREFAULT_READ,
-1, 0)
diff --git a/auto/modules/java b/auto/modules/java
index e8137217..691060b3 100644
--- a/auto/modules/java
+++ b/auto/modules/java
@@ -191,7 +191,7 @@ nxt_feature_libs="${NXT_JAVA_LDFLAGS}"
nxt_feature_test="
#include <jni.h>
- int main() {
+ int main(void) {
JNI_CreateJavaVM(NULL, NULL, NULL);
return 0;
}"
diff --git a/auto/modules/perl b/auto/modules/perl
index e9d7e109..2daebd0d 100644
--- a/auto/modules/perl
+++ b/auto/modules/perl
@@ -79,7 +79,7 @@ if /bin/sh -c "$NXT_PERL -MConfig -e 'print \"Perl version: \",
static PerlInterpreter *my_perl;
- int main() {
+ int main(void) {
char argv[] = \"\\0-e\\00\";
char *embedding[] = { &argv[0], &argv[1], &argv[4] };
@@ -124,7 +124,7 @@ nxt_feature_test="
#include <EXTERN.h>
#include <perl.h>
- int main() {
+ int main(void) {
printf(\"%s\", PERL_VERSION_STRING);
return 0;
}"
diff --git a/auto/modules/php b/auto/modules/php
index 7d224ec1..f0ecb709 100644
--- a/auto/modules/php
+++ b/auto/modules/php
@@ -131,7 +131,7 @@ nxt_feature_libs="${NXT_PHP_LIB} ${NXT_PHP_LDFLAGS}"
nxt_feature_test="
#include <php.h>
- int main() {
+ int main(void) {
printf(\"%s\", PHP_VERSION);
return 0;
}"
@@ -148,7 +148,7 @@ nxt_feature_test="
#include <php.h>
#include <php_main.h>
- int main() {
+ int main(void) {
#if (PHP_VERSION_ID < 80200)
php_module_startup(NULL, NULL, 0);
#else
@@ -176,7 +176,7 @@ nxt_feature_test="
#include <php.h>
#include <php_main.h>
- int main() {
+ int main(void) {
#ifndef ZTS
#error ZTS is not defined.
#endif
@@ -197,7 +197,7 @@ nxt_feature_test="
#include <php.h>
#include <php_main.h>
- int main() {
+ int main(void) {
zend_signal_startup();
return 0;
}"
diff --git a/auto/modules/python b/auto/modules/python
index 9be6b370..480ae1da 100644
--- a/auto/modules/python
+++ b/auto/modules/python
@@ -86,7 +86,7 @@ if /bin/sh -c "$NXT_PYTHON_CONFIG --prefix" >> $NXT_AUTOCONF_ERR 2>&1; then
nxt_feature_test="
#include <Python.h>
- int main() {
+ int main(void) {
Py_Initialize();
return 0;
}"
@@ -114,7 +114,7 @@ nxt_feature_test="
#include <Python.h>
#include <stdio.h>
- int main() {
+ int main(void) {
printf(\"%s\", PY_VERSION);
return 0;
}"
diff --git a/auto/modules/ruby b/auto/modules/ruby
index dbedfd72..7c2f0102 100644
--- a/auto/modules/ruby
+++ b/auto/modules/ruby
@@ -106,7 +106,7 @@ if /bin/sh -c "$NXT_RUBY -v" >> $NXT_AUTOCONF_ERR 2>&1; then
nxt_feature_test="
#include <ruby.h>
- int main() {
+ int main(void) {
static const char *argv[3] = {
\"NGINX_Unit\", \"-rrbconfig\",
\"-eprint RbConfig::CONFIG['libdir']\"
@@ -130,7 +130,7 @@ if /bin/sh -c "$NXT_RUBY -v" >> $NXT_AUTOCONF_ERR 2>&1; then
nxt_feature_test="
#include <ruby.h>
- int main() {
+ int main(void) {
ruby_init();
return ruby_cleanup(0);
}"
@@ -159,7 +159,7 @@ nxt_feature_test="
#include <ruby.h>
#include <ruby/version.h>
- int main() {
+ int main(void) {
printf(\"%s\", ruby_version);
return 0;
}"
diff --git a/auto/pcre b/auto/pcre
index 955e4baf..27205118 100644
--- a/auto/pcre
+++ b/auto/pcre
@@ -50,7 +50,7 @@ if [ $nxt_found = no ]; then
nxt_feature_libs=$NXT_PCRE_LIB
nxt_feature_test="#include <pcre.h>
- int main() {
+ int main(void) {
pcre *re;
re = pcre_compile(NULL, 0, NULL, 0, NULL);
diff --git a/auto/sendfile b/auto/sendfile
index 1c20db06..abbda6c7 100644
--- a/auto/sendfile
+++ b/auto/sendfile
@@ -17,7 +17,7 @@ nxt_feature="Linux sendfile()"
nxt_feature_name=NXT_HAVE_LINUX_SENDFILE
nxt_feature_test="#include <sys/sendfile.h>
- int main() {
+ int main(void) {
off_t offset;
sendfile(-1, -1, &offset, 0);
@@ -43,7 +43,7 @@ if [ $nxt_found = no ]; then
#include <sys/uio.h>
#include <stdlib.h>
- int main() {
+ int main(void) {
off_t sent;
sendfile(-1, -1, 0, 0, NULL, &sent, 0);
@@ -69,7 +69,7 @@ if [ $nxt_found = no ]; then
#include <sys/uio.h>
#include <stdlib.h>
- int main() {
+ int main(void) {
off_t sent;
sendfile(-1, -1, 0, &sent, NULL, 0);
@@ -100,7 +100,7 @@ if [ $nxt_found = no ]; then
nxt_feature_libs="-lsendfile"
nxt_feature_test="#include <sys/sendfile.h>
- int main() {
+ int main(void) {
size_t sent;
struct sendfilevec vec;
@@ -124,7 +124,7 @@ if [ $nxt_found = no ]; then
nxt_feature_name=NXT_HAVE_AIX_SEND_FILE
nxt_feature_test="#include <sys/socket.h>
- int main() {
+ int main(void) {
int s;
struct sf_parms sf_iobuf;
@@ -152,7 +152,7 @@ if [ $nxt_found = no ]; then
sbsize_t sendfile(int s, int fd, off_t offset,
bsize_t nbytes, const struct iovec *hdtrl, int flags);
- int main() {
+ int main(void) {
sendfile(-1, -1, 0, 0, NULL, 0);
return 0;
}"
diff --git a/auto/shmem b/auto/shmem
index bfe0ee4a..c434a58f 100644
--- a/auto/shmem
+++ b/auto/shmem
@@ -18,7 +18,7 @@ nxt_feature_test="#include <sys/mman.h>
#include <sys/stat.h>
#include <sys/types.h>
- int main() {
+ int main(void) {
int ret;
static char name[] = \"/unit.configure\";
@@ -62,7 +62,7 @@ if [ $nxt_found = no ]; then
#include <sys/stat.h>
#include <sys/types.h>
- int main() {
+ int main(void) {
static char name[] = \"/tmp/unit.configure\";
shm_unlink(name);
@@ -94,7 +94,7 @@ nxt_feature_test="#include <sys/mman.h>
#include <fcntl.h>
#include <sys/stat.h>
- int main() {
+ int main(void) {
int fd = shm_open(SHM_ANON, O_RDWR, S_IRUSR | S_IWUSR);
if (fd == -1)
return 1;
@@ -119,7 +119,7 @@ nxt_feature_test="#include <linux/memfd.h>
#include <unistd.h>
#include <sys/syscall.h>
- int main() {
+ int main(void) {
static char name[] = \"/unit.configure\";
int fd = syscall(SYS_memfd_create, name, MFD_CLOEXEC);
diff --git a/auto/sockets b/auto/sockets
index e344a3db..241b88eb 100644
--- a/auto/sockets
+++ b/auto/sockets
@@ -15,7 +15,7 @@ if [ $NXT_INET6 = YES ]; then
#include <sys/types.h>
#include <netinet/in.h>
- int main() {
+ int main(void) {
struct sockaddr_in6 sin6;
sin6.sin6_family = AF_INET6;
@@ -36,7 +36,7 @@ nxt_feature_libs=
nxt_feature_test="#include <stdio.h>
#include <sys/socket.h>
- int main() {
+ int main(void) {
struct sockaddr sa;
sa.sa_len = 0;
@@ -54,7 +54,7 @@ nxt_feature_libs=
nxt_feature_test="#include <stdio.h>
#include <sys/socket.h>
- int main() {
+ int main(void) {
printf(\"%d\", (int) sizeof(struct sockaddr));
return 0;
}"
@@ -70,7 +70,7 @@ nxt_feature_test="#include <stdio.h>
#include <sys/types.h>
#include <netinet/in.h>
- int main() {
+ int main(void) {
printf(\"%d\", (int) sizeof(struct sockaddr_in));
return 0;
}"
@@ -86,7 +86,7 @@ nxt_feature_test="#include <stdio.h>
#include <sys/types.h>
#include <netinet/in.h>
- int main() {
+ int main(void) {
printf(\"%d\", (int) sizeof(struct sockaddr_in6));
return 0;
}"
@@ -102,7 +102,7 @@ nxt_feature_test="#include <stdio.h>
#include <sys/types.h>
#include <sys/un.h>
- int main() {
+ int main(void) {
printf(\"%d\", (int) sizeof(struct sockaddr_un));
return 0;
}"
@@ -117,7 +117,7 @@ nxt_feature_libs=
nxt_feature_test="#include <stdio.h>
#include <sys/socket.h>
- int main() {
+ int main(void) {
printf(\"%d\", (int) sizeof(struct sockaddr_storage));
return 0;
}"
@@ -132,7 +132,7 @@ nxt_feature_libs=
nxt_feature_test="#include <stdio.h>
#include <sys/socket.h>
- int main() {
+ int main(void) {
int pair[2];
if (socketpair(AF_UNIX, SOCK_SEQPACKET, 0, pair) != 0)
@@ -150,7 +150,7 @@ nxt_feature_libs=
nxt_feature_test="#include <stdio.h>
#include <sys/socket.h>
- int main() {
+ int main(void) {
struct msghdr msg;
printf(\"%d\", (int) sizeof(msg.msg_control));
@@ -175,7 +175,7 @@ if [ $NXT_SYSTEM != DragonFly ]; then
nxt_feature_test="#define _GNU_SOURCE
#include <sys/socket.h>
- int main() {
+ int main(void) {
return SO_PASSCRED == 0;
}"
. auto/feature
@@ -191,7 +191,7 @@ if [ $NXT_SYSTEM != DragonFly ]; then
#include <sys/socket.h>
#include <sys/un.h>
- int main() {
+ int main(void) {
return sizeof(struct ucred);
}"
. auto/feature
@@ -206,7 +206,7 @@ if [ $NXT_SYSTEM != DragonFly ]; then
nxt_feature_test="#define _GNU_SOURCE
#include <sys/socket.h>
- int main() {
+ int main(void) {
return sizeof(struct cmsgcred);
}"
. auto/feature
@@ -220,7 +220,7 @@ nxt_feature_incs=
nxt_feature_libs=
nxt_feature_test="#include <sys/filio.h>
- int main() {
+ int main(void) {
return 0;
}"
. auto/feature
@@ -235,7 +235,7 @@ nxt_feature_test="#include <unistd.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
- int main() {
+ int main(void) {
int nb;
nb = 0;
@@ -255,7 +255,7 @@ nxt_feature_libs=
nxt_feature_test="#define _GNU_SOURCE
#include <sys/socket.h>
- int main() {
+ int main(void) {
socket(AF_INET, SOCK_STREAM | SOCK_NONBLOCK, 0);
return 0;
}"
@@ -273,7 +273,7 @@ nxt_feature_test="#define _GNU_SOURCE
#include <stdlib.h>
#include <sys/socket.h>
- int main() {
+ int main(void) {
accept4(0, NULL, NULL, SOCK_NONBLOCK);
return 0;
}"
diff --git a/auto/ssltls b/auto/ssltls
index d678ba74..6512d330 100644
--- a/auto/ssltls
+++ b/auto/ssltls
@@ -23,7 +23,7 @@ if [ $NXT_OPENSSL = YES ]; then
nxt_feature_libs="-lssl -lcrypto"
nxt_feature_test="#include <openssl/ssl.h>
- int main() {
+ int main(void) {
SSL_library_init();
return 0;
}"
@@ -39,7 +39,7 @@ if [ $NXT_OPENSSL = YES ]; then
nxt_feature_run=value
nxt_feature_test="#include <openssl/ssl.h>
- int main() {
+ int main(void) {
printf(\"\\\"%s\\\"\",
SSLeay_version(SSLEAY_VERSION));
return 0;
@@ -61,7 +61,7 @@ if [ $NXT_OPENSSL = YES ]; then
nxt_feature_libs="$NXT_OPENSSL_LIBS"
nxt_feature_test="#include <openssl/ssl.h>
- int main() {
+ int main(void) {
SSL_CONF_cmd(NULL, NULL, NULL);
return 0;
}"
@@ -75,7 +75,7 @@ if [ $NXT_OPENSSL = YES ]; then
nxt_feature_libs="$NXT_OPENSSL_LIBS"
nxt_feature_test="#include <openssl/ssl.h>
- int main() {
+ int main(void) {
#if (OPENSSL_NO_TLSEXT)
#error OpenSSL: no tlsext support.
#else
@@ -100,7 +100,7 @@ if [ $NXT_GNUTLS = YES ]; then
nxt_feature_libs=$NXT_GNUTLS_LIBS
nxt_feature_test="#include <gnutls/gnutls.h>
- int main() {
+ int main(void) {
gnutls_global_init();
gnutls_global_deinit();
return 0;
@@ -121,7 +121,7 @@ if [ $NXT_GNUTLS = YES ]; then
nxt_feature_libs=$NXT_GNUTLS_LIBS
nxt_feature_test="#include <gnutls/gnutls.h>
- int main() {
+ int main(void) {
gnutls_transport_set_vec_push_function(NULL, NULL);
return 0;
}"
@@ -135,7 +135,7 @@ if [ $NXT_GNUTLS = YES ]; then
nxt_feature_libs=$NXT_GNUTLS_LIBS
nxt_feature_test="#include <gnutls/gnutls.h>
- int main() {
+ int main(void) {
gnutls_global_set_time_function(NULL);
return 0;
}"
@@ -160,7 +160,7 @@ if [ $NXT_CYASSL = YES ]; then
nxt_feature_libs="-lcyassl"
nxt_feature_test="#include <cyassl/ssl.h>
- int main() {
+ int main(void) {
CyaSSL_Init();
CyaSSL_Cleanup();
return 0;
@@ -191,7 +191,7 @@ if [ $NXT_POLARSSL = YES ]; then
nxt_feature_libs="-lpolarssl"
nxt_feature_test="#include <polarssl/ssl.h>
- int main() {
+ int main(void) {
ssl_context ssl;
memset(&ssl, '\0', sizeof(ssl));
ssl_init(&ssl);
diff --git a/auto/threads b/auto/threads
index ff33eaac..67b46690 100644
--- a/auto/threads
+++ b/auto/threads
@@ -47,7 +47,7 @@ nxt_feature_libs=$NXT_PTHREAD
nxt_feature_test="#define _GNU_SOURCE
#include <pthread.h>
- int main() {
+ int main(void) {
pthread_yield();
return 0;
}"
@@ -65,7 +65,7 @@ if [ $nxt_found = no ]; then
nxt_feature_libs=$NXT_PTHREAD
nxt_feature_test="#include <pthread.h>
- int main() {
+ int main(void) {
pthread_yield_np();
return 0;
}"
@@ -82,7 +82,7 @@ nxt_feature_incs=
nxt_feature_libs=$NXT_PTHREAD
nxt_feature_test="#include <pthread.h>
- int main() {
+ int main(void) {
pthread_spinlock_t lock;
if (pthread_spin_init(&lock, PTHREAD_PROCESS_PRIVATE) != 0)
@@ -112,7 +112,7 @@ if [ $nxt_found = yes ]; then
pthread_spinlock_t lock = 0;
- int main() {
+ int main(void) {
if (pthread_spin_trylock(&lock) != 0)
return 1;
if (pthread_spin_unlock(&lock) != 0)
@@ -130,7 +130,7 @@ nxt_feature_incs=
nxt_feature_libs=
nxt_feature_test="#include <semaphore.h>
- int main() {
+ int main(void) {
sem_t sem;
struct timespec ts;
@@ -199,7 +199,7 @@ nxt_feature_test="#include <pthread.h>
return NULL;
}
- int main() {
+ int main(void) {
void *n;
pthread_t pt;
@@ -227,7 +227,7 @@ if [ $nxt_found = no ]; then
nxt_feature_libs=$NXT_PTHREAD
nxt_feature_test="#include <pthread.h>
- int main() {
+ int main(void) {
pthread_key_t key = -1;
if (pthread_key_create(&key, NULL))
@@ -250,7 +250,7 @@ if [ $nxt_found = no ]; then
#include <pthread.h>
#include <stdio.h>
- int main() {
+ int main(void) {
printf(\"%d\", PTHREAD_KEYS_MAX);
return 0;
}"
diff --git a/auto/time b/auto/time
index 7663e62f..402a219c 100644
--- a/auto/time
+++ b/auto/time
@@ -13,7 +13,7 @@ nxt_feature_incs=
nxt_feature_libs="-lrt"
nxt_feature_test="#include <time.h>
- int main() {
+ int main(void) {
struct timespec ts;
if (clock_gettime(CLOCK_REALTIME_COARSE, &ts) == -1)
@@ -36,7 +36,7 @@ nxt_feature_incs=
nxt_feature_libs=
nxt_feature_test="#include <time.h>
- int main() {
+ int main(void) {
struct timespec ts;
if (clock_gettime(CLOCK_REALTIME_FAST, &ts) == -1)
@@ -53,7 +53,7 @@ nxt_feature_incs=
nxt_feature_libs=
nxt_feature_test="#include <time.h>
- int main() {
+ int main(void) {
struct timespec ts;
if (clock_gettime(CLOCK_REALTIME, &ts) == -1)
@@ -87,7 +87,7 @@ nxt_feature_incs=
nxt_feature_libs="-lrt"
nxt_feature_test="#include <time.h>
- int main() {
+ int main(void) {
struct timespec ts;
if (clock_gettime(CLOCK_MONOTONIC_COARSE, &ts) == -1)
@@ -110,7 +110,7 @@ nxt_feature_incs=
nxt_feature_libs=
nxt_feature_test="#include <time.h>
- int main() {
+ int main(void) {
struct timespec ts;
if (clock_gettime(CLOCK_MONOTONIC_FAST, &ts) == -1)
@@ -127,7 +127,7 @@ nxt_feature_incs=
nxt_feature_libs=
nxt_feature_test="#include <time.h>
- int main() {
+ int main(void) {
struct timespec ts;
if (clock_gettime(CLOCK_MONOTONIC, &ts) == -1)
@@ -163,7 +163,7 @@ nxt_feature_libs="-lhg"
nxt_feature_test="#include <stdlib.h>
#include <sys/mercury.h>
- int main() {
+ int main(void) {
hg_gethrtime();
return 0;
}"
@@ -181,7 +181,7 @@ nxt_feature_incs=
nxt_feature_libs=
nxt_feature_test="#include <time.h>
- int main() {
+ int main(void) {
time_t t;
struct tm tm;
@@ -199,7 +199,7 @@ nxt_feature_incs=
nxt_feature_libs=
nxt_feature_test="#include <time.h>
- int main() {
+ int main(void) {
altzone = 0;
return 0;
}"
@@ -213,7 +213,7 @@ nxt_feature_incs=
nxt_feature_libs=
nxt_feature_test="#include <time.h>
- int main() {
+ int main(void) {
time_t t;
struct tm tm;
diff --git a/auto/types b/auto/types
index 91d53b6f..c0a871dd 100644
--- a/auto/types
+++ b/auto/types
@@ -18,7 +18,7 @@ nxt_feature_incs=
nxt_feature_libs=
nxt_feature_test="#include <stdio.h>
- int main() {
+ int main(void) {
printf(\"%d\", (int) sizeof(int));
return 0;
}"
@@ -32,7 +32,7 @@ nxt_feature_incs=
nxt_feature_libs=
nxt_feature_test="#include <stdio.h>
- int main() {
+ int main(void) {
printf(\"%d\", (int) sizeof(long));
return 0;
}"
@@ -46,7 +46,7 @@ nxt_feature_incs=
nxt_feature_libs=
nxt_feature_test="#include <stdio.h>
- int main() {
+ int main(void) {
printf(\"%d\", (int) sizeof(long long));
return 0;
}"
@@ -60,7 +60,7 @@ nxt_feature_incs=
nxt_feature_libs=
nxt_feature_test="#include <stdio.h>
- int main() {
+ int main(void) {
printf(\"%d\", (int) sizeof(void *));
return 0;
}"
@@ -80,7 +80,7 @@ nxt_feature_incs=
nxt_feature_libs=
nxt_feature_test="#include <stdio.h>
- int main() {
+ int main(void) {
printf(\"%d\", (int) sizeof(size_t));
return 0;
}"
@@ -96,7 +96,7 @@ nxt_feature_test="#define _FILE_OFFSET_BITS 64
#include <unistd.h>
#include <stdio.h>
- int main() {
+ int main(void) {
printf(\"%d\", (int) sizeof(off_t));
return 0;
}"
@@ -111,7 +111,7 @@ nxt_feature_libs=
nxt_feature_test="#include <time.h>
#include <stdio.h>
- int main() {
+ int main(void) {
printf(\"%d\", (int) sizeof(time_t));
return 0;
}"
diff --git a/auto/unix b/auto/unix
index 45c6a139..1307bdbd 100644
--- a/auto/unix
+++ b/auto/unix
@@ -13,7 +13,7 @@ nxt_feature_libs=
nxt_feature_test="#include <unistd.h>
#include <sys/random.h>
- int main() {
+ int main(void) {
char buf[4];
if (getrandom(buf, 4, 0) < 0) {
@@ -35,7 +35,7 @@ if [ $nxt_found = no ]; then
#include <sys/syscall.h>
#include <linux/random.h>
- int main() {
+ int main(void) {
char buf[4];
if (syscall(SYS_getrandom, buf, 4, 0) < 0) {
@@ -56,7 +56,7 @@ if [ $nxt_found = no ]; then
nxt_feature_name=NXT_HAVE_GETENTROPY
nxt_feature_test="#include <unistd.h>
- int main() {
+ int main(void) {
char buf[4];
if (getentropy(buf, 4) == -1) {
@@ -78,7 +78,7 @@ if [ $nxt_found = no ]; then
nxt_feature_test="#include <unistd.h>
#include <sys/random.h>
- int main() {
+ int main(void) {
char buf[4];
if (getentropy(buf, 4) == -1) {
@@ -99,7 +99,7 @@ nxt_feature_libs=
nxt_feature_test="#include <stdlib.h>
#include <ucontext.h>
- int main() {
+ int main(void) {
ucontext_t uc;
if (getcontext(&uc) == 0) {
@@ -126,7 +126,7 @@ if [ $nxt_found = no ]; then
#include <stdlib.h>
#include <ucontext.h>
- int main() {
+ int main(void) {
ucontext_t uc;
if (getcontext(&uc) == 0) {
@@ -155,7 +155,7 @@ nxt_feature_libs=
nxt_feature_test="#include <stdlib.h>
#include <dlfcn.h>
- int main() {
+ int main(void) {
void *h = dlopen(NULL, RTLD_NOW | RTLD_GLOBAL);
dlsym(h, \"\");
dlclose(h);
@@ -188,7 +188,7 @@ nxt_feature_libs=
nxt_feature_test="#include <stdlib.h>
#include <unistd.h>
- int main() {
+ int main(void) {
setproctitle(\"%s\", \"title\");
return 0;
}"
@@ -204,7 +204,7 @@ nxt_feature_libs=
nxt_feature_test="#include <unistd.h>
#include <grp.h>
- int main() {
+ int main(void) {
getgrouplist(\"root\", 0, NULL, NULL);
return 0;
}"