From 2744e2c2105ac59deb7e3246902c5995811bc5ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Kowalczyk?= Date: Tue, 31 Mar 2020 03:10:00 +0200 Subject: [PATCH] Add missing void to empty arguments list This isn't technically required in those cases (we're in a definition, not in a declaration), but let's add it for consistency. --- LibOS/shim/test/fs/common.c | 2 +- LibOS/shim/test/native/exec_fork.c | 2 +- LibOS/shim/test/native/fs.c | 2 +- LibOS/shim/test/native/vfork.c | 2 +- LibOS/shim/test/regression/eventfd.c | 6 +++--- LibOS/shim/test/regression/getdents.c | 2 +- LibOS/shim/test/regression/init_fail.c | 2 +- LibOS/shim/test/regression/large-mmap.c | 2 +- LibOS/shim/test/regression/shared_object.c | 2 +- Pal/lib/list-test.c | 2 +- Pal/regression/AvxDisable.c | 2 +- Pal/regression/Event.c | 2 +- Pal/regression/Exception.c | 2 +- Pal/regression/Hex.c | 2 +- Pal/regression/Thread2.c | 2 +- Pal/src/host/Linux-SGX/enclave_framework.c | 2 +- Pal/src/host/Linux-SGX/enclave_untrusted.c | 2 +- Pal/src/host/Linux-SGX/sgx_main.c | 2 +- Pal/src/host/Linux-SGX/tools/common/util.c | 4 ++-- Pal/test/Thread.c | 2 +- 20 files changed, 23 insertions(+), 23 deletions(-) diff --git a/LibOS/shim/test/fs/common.c b/LibOS/shim/test/fs/common.c index ae3bd8cb..74b27b95 100644 --- a/LibOS/shim/test/fs/common.c +++ b/LibOS/shim/test/fs/common.c @@ -9,7 +9,7 @@ noreturn void fatal_error(const char* fmt, ...) { exit(-1); } -void setup() { +void setup(void) { // set output to line-buffered for easier debugging setvbuf(stdout, NULL, _IOLBF, 0); setvbuf(stderr, NULL, _IOLBF, 0); diff --git a/LibOS/shim/test/native/exec_fork.c b/LibOS/shim/test/native/exec_fork.c index e16a0758..fe9dbff1 100644 --- a/LibOS/shim/test/native/exec_fork.c +++ b/LibOS/shim/test/native/exec_fork.c @@ -2,7 +2,7 @@ #include #include -int main() { +int main(void) { char* argv[] = {"./fork", NULL}; execv(argv[0], argv); return 0; diff --git a/LibOS/shim/test/native/fs.c b/LibOS/shim/test/native/fs.c index 2038c147..136cedea 100644 --- a/LibOS/shim/test/native/fs.c +++ b/LibOS/shim/test/native/fs.c @@ -6,7 +6,7 @@ #include #include -int main() { +int main(void) { int fd = open("test.open.file", O_CREAT | O_RDWR, S_IRWXU); int fd2 = open("fs.manifest", O_RDONLY); diff --git a/LibOS/shim/test/native/vfork.c b/LibOS/shim/test/native/vfork.c index b9dd15e3..2fc694f8 100644 --- a/LibOS/shim/test/native/vfork.c +++ b/LibOS/shim/test/native/vfork.c @@ -6,7 +6,7 @@ #include #include -int main() { +int main(void) { pid_t pid = vfork(); if (pid < 0) { printf("failed on vfork (%s)\n", strerror(errno)); diff --git a/LibOS/shim/test/regression/eventfd.c b/LibOS/shim/test/regression/eventfd.c index c3e373b8..3983beb6 100644 --- a/LibOS/shim/test/regression/eventfd.c +++ b/LibOS/shim/test/regression/eventfd.c @@ -62,7 +62,7 @@ void* write_eventfd_thread(void* arg) { /* This function used to test polling on a group of eventfd descriptors. * To support regression testing, positive value returned for error case. */ -int eventfd_using_poll() { +int eventfd_using_poll(void) { int ret = 0; struct pollfd pollfds[MAX_EFDS]; pthread_t tid = 0; @@ -140,7 +140,7 @@ out: /* This function used to test various flags supported while creating eventfd * descriptors. * To support regression testing, positive value returned for error case. */ -int eventfd_using_various_flags() { +int eventfd_using_various_flags(void) { uint64_t count = 0; int efd = 0; ssize_t bytes = 0; @@ -216,7 +216,7 @@ int eventfd_using_various_flags() { return 0; } -int eventfd_using_fork() { +int eventfd_using_fork(void) { int status = 0; int efd = 0; uint64_t count = 0; diff --git a/LibOS/shim/test/regression/getdents.c b/LibOS/shim/test/regression/getdents.c index 0bcf993f..19edefc9 100644 --- a/LibOS/shim/test/regression/getdents.c +++ b/LibOS/shim/test/regression/getdents.c @@ -24,7 +24,7 @@ struct linux_dirent64 { #define BUF_SIZE 512 -int main() { +int main(void) { int rv, fd, offs; const mode_t perm = S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH; char buf[BUF_SIZE]; diff --git a/LibOS/shim/test/regression/init_fail.c b/LibOS/shim/test/regression/init_fail.c index 8dcc8a5c..4c7c235b 100644 --- a/LibOS/shim/test/regression/init_fail.c +++ b/LibOS/shim/test/regression/init_fail.c @@ -1,6 +1,6 @@ #include -int main() { +int main(void) { printf("Hello world\n"); return 42; } diff --git a/LibOS/shim/test/regression/large-mmap.c b/LibOS/shim/test/regression/large-mmap.c index 0b7f0b51..22887b03 100644 --- a/LibOS/shim/test/regression/large-mmap.c +++ b/LibOS/shim/test/regression/large-mmap.c @@ -7,7 +7,7 @@ #define TEST_LENGTH 0x10000f000 #define TEST_LENGTH2 0x8000f000 -int main() { +int main(void) { FILE* fp = fopen("testfile", "a+"); if (!fp) { perror("fopen"); diff --git a/LibOS/shim/test/regression/shared_object.c b/LibOS/shim/test/regression/shared_object.c index f1ed7305..a88632ec 100644 --- a/LibOS/shim/test/regression/shared_object.c +++ b/LibOS/shim/test/regression/shared_object.c @@ -2,7 +2,7 @@ #include -int main() { +int main(void) { printf("Hello world\n"); return 0; } diff --git a/Pal/lib/list-test.c b/Pal/lib/list-test.c index 4e6fc8ca..83ded287 100644 --- a/Pal/lib/list-test.c +++ b/Pal/lib/list-test.c @@ -81,7 +81,7 @@ void print_list_reverse(LISTP_TYPE(simple)* listp) { printf("End of list\n\n"); } -int main() { +int main(void) { int i; struct simple* tmp; struct simple* tmp2; diff --git a/Pal/regression/AvxDisable.c b/Pal/regression/AvxDisable.c index 235762d1..f1302a57 100644 --- a/Pal/regression/AvxDisable.c +++ b/Pal/regression/AvxDisable.c @@ -4,7 +4,7 @@ #include "pal.h" #include "pal_debug.h" -int main() { +int main(void) { /* Initialize the two argument vectors */ __m256 evens = _mm256_set_ps(2.0, 4.0, 6.0, 8.0, 10.0, 12.0, 14.0, 16.0); __m256 odds = _mm256_set_ps(1.0, 3.0, 5.0, 7.0, 9.0, 11.0, 13.0, 15.0); diff --git a/Pal/regression/Event.c b/Pal/regression/Event.c index b697466a..b970d0d9 100644 --- a/Pal/regression/Event.c +++ b/Pal/regression/Event.c @@ -30,7 +30,7 @@ void pal_failure_handler(PAL_PTR event, PAL_NUM error, PAL_CONTEXT* context) { DkExceptionReturn(event); } -int main() { +int main(void) { pal_printf("Started main thread.\n"); DkSetExceptionHandler(pal_failure_handler, PAL_EVENT_FAILURE); diff --git a/Pal/regression/Exception.c b/Pal/regression/Exception.c index cbcb19d2..c32bca06 100644 --- a/Pal/regression/Exception.c +++ b/Pal/regression/Exception.c @@ -54,7 +54,7 @@ void handler4(PAL_PTR event, PAL_NUM arg, PAL_CONTEXT * context) } -static void red_zone_test() { +static void red_zone_test(void) { uint64_t res = 0; // First call some function to ensure that gcc doesn't use the red zone diff --git a/Pal/regression/Hex.c b/Pal/regression/Hex.c index 7e706b6b..d219c858 100644 --- a/Pal/regression/Hex.c +++ b/Pal/regression/Hex.c @@ -11,7 +11,7 @@ noreturn void __abort(void) { DkProcessExit(-131); } -int main() { +int main(void) { char x[] = {0xde, 0xad, 0xbe, 0xef}; char y[] = {0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd}; pal_printf("Hex test 1 is %s\n", ALLOCA_BYTES2HEXSTR(x)); diff --git a/Pal/regression/Thread2.c b/Pal/regression/Thread2.c index 5d861ef9..36b740e7 100644 --- a/Pal/regression/Thread2.c +++ b/Pal/regression/Thread2.c @@ -48,7 +48,7 @@ int thread4_run(void* args) { // If there's a thread limit, like on SGX, it should be set to exactly 2. There // should be only the main thread and only one other thread at a time. -int main() { +int main(void) { pal_printf("Thread 1 (main) started.\n"); PAL_HANDLE thread2 = DkThreadCreate(thread2_run, NULL); diff --git a/Pal/src/host/Linux-SGX/enclave_framework.c b/Pal/src/host/Linux-SGX/enclave_framework.c index d4618077..cc749d6a 100644 --- a/Pal/src/host/Linux-SGX/enclave_framework.c +++ b/Pal/src/host/Linux-SGX/enclave_framework.c @@ -489,7 +489,7 @@ failed: return ret; } -int get_file_check_policy () +int get_file_check_policy(void) { return file_check_policy; } diff --git a/Pal/src/host/Linux-SGX/enclave_untrusted.c b/Pal/src/host/Linux-SGX/enclave_untrusted.c index bec18a76..a10ac598 100644 --- a/Pal/src/host/Linux-SGX/enclave_untrusted.c +++ b/Pal/src/host/Linux-SGX/enclave_untrusted.c @@ -50,7 +50,7 @@ static inline void __free(void* addr, int size) { static SLAB_MGR untrusted_slabmgr = NULL; -void init_untrusted_slab_mgr() { +void init_untrusted_slab_mgr(void) { if (untrusted_slabmgr) return; diff --git a/Pal/src/host/Linux-SGX/sgx_main.c b/Pal/src/host/Linux-SGX/sgx_main.c index abc362d2..6c5d3921 100644 --- a/Pal/src/host/Linux-SGX/sgx_main.c +++ b/Pal/src/host/Linux-SGX/sgx_main.c @@ -956,7 +956,7 @@ static int load_enclave (struct pal_enclave * enclave, * each stack page (Linux dynamically grows the stack of the main thread but gets confused with * huge-jump stack accesses coming from within the enclave). Note that other, non-main threads * are created manually via clone(.., THREAD_STACK_SIZE, ..) and thus do not need this hack. */ -static void __attribute__ ((noinline)) force_linux_to_grow_stack() { +static void __attribute__ ((noinline)) force_linux_to_grow_stack(void) { char dummy[THREAD_STACK_SIZE]; for (uint64_t i = 0; i < sizeof(dummy); i += PRESET_PAGESIZE) { /* touch each page on the stack just to make it is not optimized away */ diff --git a/Pal/src/host/Linux-SGX/tools/common/util.c b/Pal/src/host/Linux-SGX/tools/common/util.c index 5ee02872..359f5a8c 100644 --- a/Pal/src/host/Linux-SGX/tools/common/util.c +++ b/Pal/src/host/Linux-SGX/tools/common/util.c @@ -37,7 +37,7 @@ void set_verbose(bool verbose) { DBG("Verbose output disabled\n"); } -bool get_verbose() { +bool get_verbose(void) { return g_verbose; } @@ -187,6 +187,6 @@ int parse_hex(const char* hex, void* buffer, size_t buffer_size) { } /* For PAL's assert compatibility */ -void __abort() { +void __abort(void) { ERROR("exiting\n"); } diff --git a/Pal/test/Thread.c b/Pal/test/Thread.c index c4f82d19..7035689c 100644 --- a/Pal/test/Thread.c +++ b/Pal/test/Thread.c @@ -22,7 +22,7 @@ int thread_2(void* args) { return 0; } -int main() { +int main(void) { pal_printf("Enter Main Thread\n"); PAL_HANDLE thd1, thd2;