From f453d9d5ce2cb58080154ecbbb4642409beba056 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Tue, 10 Sep 2024 10:42:23 +0900 Subject: [PATCH] Appease GCC strict prototypes warning (#3775) --- core/iwasm/aot/aot_reloc.h | 2 +- core/iwasm/aot/aot_runtime.h | 2 +- core/iwasm/aot/arch/aot_reloc_aarch64.c | 2 +- core/iwasm/aot/arch/aot_reloc_arm.c | 194 +++++++++--------- core/iwasm/aot/arch/aot_reloc_mips.c | 2 +- core/iwasm/aot/arch/aot_reloc_riscv.c | 106 +++++----- core/iwasm/aot/arch/aot_reloc_thumb.c | 194 +++++++++--------- core/iwasm/aot/arch/aot_reloc_x86_64.c | 2 +- core/iwasm/aot/arch/aot_reloc_xtensa.c | 68 +++--- core/iwasm/aot/debug/jit_debug.c | 10 +- core/iwasm/aot/debug/jit_debug.h | 4 +- core/iwasm/common/wasm_memory.c | 4 +- core/iwasm/common/wasm_memory.h | 4 +- core/iwasm/common/wasm_native.c | 4 +- core/iwasm/common/wasm_native.h | 4 +- core/iwasm/common/wasm_runtime_common.c | 18 +- core/iwasm/common/wasm_runtime_common.h | 8 +- core/iwasm/common/wasm_shared_memory.h | 4 +- core/iwasm/compilation/aot.h | 2 +- core/iwasm/interpreter/wasm_interp_fast.c | 2 +- core/iwasm/interpreter/wasm_loader.c | 2 +- core/iwasm/interpreter/wasm_mini_loader.c | 2 +- .../lib_wasi_threads_wrapper.c | 2 +- .../libraries/thread-mgr/thread_manager.h | 8 +- .../platform/include/platform_api_extension.h | 10 +- .../shared/platform/nuttx/platform_internal.h | 2 +- product-mini/platforms/common/libc_wasi.c | 2 +- product-mini/platforms/nuttx/CMakeLists.txt | 2 +- product-mini/platforms/nuttx/wamr.mk | 2 +- product-mini/platforms/posix/main.c | 2 +- 30 files changed, 335 insertions(+), 335 deletions(-) diff --git a/core/iwasm/aot/aot_reloc.h b/core/iwasm/aot/aot_reloc.h index 8ead3cd9..f7ada4d8 100644 --- a/core/iwasm/aot/aot_reloc.h +++ b/core/iwasm/aot/aot_reloc.h @@ -226,7 +226,7 @@ SymbolMap * get_target_symbol_map(uint32 *sym_num); uint32 -get_plt_table_size(); +get_plt_table_size(void); void init_plt_table(uint8 *plt); diff --git a/core/iwasm/aot/aot_runtime.h b/core/iwasm/aot/aot_runtime.h index f6bff00b..3ff0e0e3 100644 --- a/core/iwasm/aot/aot_runtime.h +++ b/core/iwasm/aot/aot_runtime.h @@ -648,7 +648,7 @@ aot_check_app_addr_and_convert(AOTModuleInstance *module_inst, bool is_str, void **p_native_addr); uint32 -aot_get_plt_table_size(); +aot_get_plt_table_size(void); void * aot_memmove(void *dest, const void *src, size_t n); diff --git a/core/iwasm/aot/arch/aot_reloc_aarch64.c b/core/iwasm/aot/arch/aot_reloc_aarch64.c index ec646b4e..26815334 100644 --- a/core/iwasm/aot/arch/aot_reloc_aarch64.c +++ b/core/iwasm/aot/arch/aot_reloc_aarch64.c @@ -79,7 +79,7 @@ get_current_target(char *target_buf, uint32 target_buf_size) } static uint32 -get_plt_item_size() +get_plt_item_size(void) { /* 6*4 bytes instructions and 8 bytes symbol address */ return 32; diff --git a/core/iwasm/aot/arch/aot_reloc_arm.c b/core/iwasm/aot/arch/aot_reloc_arm.c index bb492bfe..0be17ef4 100644 --- a/core/iwasm/aot/arch/aot_reloc_arm.c +++ b/core/iwasm/aot/arch/aot_reloc_arm.c @@ -12,102 +12,102 @@ #define R_ARM_MOVT_ABS 44 /* clang-format off */ -void __adddf3(); -void __addsf3(); -void __aeabi_d2f(); -void __aeabi_d2iz(); -void __aeabi_d2lz(); -void __aeabi_d2uiz(); -void __aeabi_d2ulz(); -void __aeabi_dadd(); -void __aeabi_dcmpeq(); -void __aeabi_dcmpge(); -void __aeabi_dcmpgt(); -void __aeabi_dcmple(); -void __aeabi_dcmplt(); -void __aeabi_dcmpun(); -void __aeabi_ddiv(); -void __aeabi_dmul(); -void __aeabi_dsub(); -void __aeabi_f2d(); -void __aeabi_f2iz(); -void __aeabi_f2lz(); -void __aeabi_f2ulz(); -void __aeabi_fadd(); -void __aeabi_fcmpeq(); -void __aeabi_fcmpge(); -void __aeabi_fcmpgt(); -void __aeabi_fcmple(); -void __aeabi_fcmplt(); -void __aeabi_fcmpun(); -void __aeabi_fdiv(); -void __aeabi_fmul(); -void __aeabi_fsub(); -void __aeabi_i2d(); -void __aeabi_i2f(); -void __aeabi_idiv(); -void __aeabi_idivmod(); -void __aeabi_l2d(); -void __aeabi_l2f(); -void __aeabi_ldivmod(); -void __aeabi_memclr(); -void __aeabi_memcpy(); -void __aeabi_memmove(); -void __aeabi_memset(); -void __aeabi_ui2d(); -void __aeabi_ui2f(); -void __aeabi_uidiv(); -void __aeabi_uidivmod(); -void __aeabi_ul2d(); -void __aeabi_ul2f(); -void __aeabi_uldivmod(); -void __clzsi2(); -void __divdf3(); -void __divdi3(); -void __divsf3(); -void __divsi3(); -void __eqdf2(); -void __eqsf2(); -void __extendsfdf2(); -void __fixdfdi(); -void __fixdfsi(); -void __fixsfdi(); -void __fixsfsi(); -void __fixunsdfdi(); -void __fixunsdfsi(); -void __fixunssfdi(); -void __floatdidf(); -void __floatdisf(); -void __floatsidf(); -void __floatsisf(); -void __floatundidf(); -void __floatundisf(); -void __floatunsidf(); -void __floatunsisf(); -void __gedf2(); -void __gesf2(); -void __gtdf2(); -void __gtsf2(); -void __ledf2(); -void __lesf2(); -void __ltdf2(); -void __ltsf2(); -void __moddi3(); -void __modsi3(); -void __muldf3(); -void __mulsf3(); -void __nedf2(); -void __nesf2(); -void __subdf3(); -void __subsf3(); -void __truncdfsf2(); -void __udivdi3(); -void __udivmoddi4(); -void __udivsi3(); -void __umoddi3(); -void __umodsi3(); -void __unorddf2(); -void __unordsf2(); +void __adddf3(void); +void __addsf3(void); +void __aeabi_d2f(void); +void __aeabi_d2iz(void); +void __aeabi_d2lz(void); +void __aeabi_d2uiz(void); +void __aeabi_d2ulz(void); +void __aeabi_dadd(void); +void __aeabi_dcmpeq(void); +void __aeabi_dcmpge(void); +void __aeabi_dcmpgt(void); +void __aeabi_dcmple(void); +void __aeabi_dcmplt(void); +void __aeabi_dcmpun(void); +void __aeabi_ddiv(void); +void __aeabi_dmul(void); +void __aeabi_dsub(void); +void __aeabi_f2d(void); +void __aeabi_f2iz(void); +void __aeabi_f2lz(void); +void __aeabi_f2ulz(void); +void __aeabi_fadd(void); +void __aeabi_fcmpeq(void); +void __aeabi_fcmpge(void); +void __aeabi_fcmpgt(void); +void __aeabi_fcmple(void); +void __aeabi_fcmplt(void); +void __aeabi_fcmpun(void); +void __aeabi_fdiv(void); +void __aeabi_fmul(void); +void __aeabi_fsub(void); +void __aeabi_i2d(void); +void __aeabi_i2f(void); +void __aeabi_idiv(void); +void __aeabi_idivmod(void); +void __aeabi_l2d(void); +void __aeabi_l2f(void); +void __aeabi_ldivmod(void); +void __aeabi_memclr(void); +void __aeabi_memcpy(void); +void __aeabi_memmove(void); +void __aeabi_memset(void); +void __aeabi_ui2d(void); +void __aeabi_ui2f(void); +void __aeabi_uidiv(void); +void __aeabi_uidivmod(void); +void __aeabi_ul2d(void); +void __aeabi_ul2f(void); +void __aeabi_uldivmod(void); +void __clzsi2(void); +void __divdf3(void); +void __divdi3(void); +void __divsf3(void); +void __divsi3(void); +void __eqdf2(void); +void __eqsf2(void); +void __extendsfdf2(void); +void __fixdfdi(void); +void __fixdfsi(void); +void __fixsfdi(void); +void __fixsfsi(void); +void __fixunsdfdi(void); +void __fixunsdfsi(void); +void __fixunssfdi(void); +void __floatdidf(void); +void __floatdisf(void); +void __floatsidf(void); +void __floatsisf(void); +void __floatundidf(void); +void __floatundisf(void); +void __floatunsidf(void); +void __floatunsisf(void); +void __gedf2(void); +void __gesf2(void); +void __gtdf2(void); +void __gtsf2(void); +void __ledf2(void); +void __lesf2(void); +void __ltdf2(void); +void __ltsf2(void); +void __moddi3(void); +void __modsi3(void); +void __muldf3(void); +void __mulsf3(void); +void __nedf2(void); +void __nesf2(void); +void __subdf3(void); +void __subsf3(void); +void __truncdfsf2(void); +void __udivdi3(void); +void __udivmoddi4(void); +void __udivsi3(void); +void __umoddi3(void); +void __umodsi3(void); +void __unorddf2(void); +void __unordsf2(void); /* clang-format on */ static SymbolMap target_sym_map[] = { @@ -255,7 +255,7 @@ get_current_target(char *target_buf, uint32 target_buf_size) #undef BUILD_TARGET_ARM_DEFAULT uint32 -get_plt_item_size() +get_plt_item_size(void) { /* 8 bytes instructions and 4 bytes symbol address */ return 12; diff --git a/core/iwasm/aot/arch/aot_reloc_mips.c b/core/iwasm/aot/arch/aot_reloc_mips.c index f9f06a05..4b856119 100644 --- a/core/iwasm/aot/arch/aot_reloc_mips.c +++ b/core/iwasm/aot/arch/aot_reloc_mips.c @@ -28,7 +28,7 @@ get_current_target(char *target_buf, uint32 target_buf_size) } static uint32 -get_plt_item_size() +get_plt_item_size(void) { return 0; } diff --git a/core/iwasm/aot/arch/aot_reloc_riscv.c b/core/iwasm/aot/arch/aot_reloc_riscv.c index b87bb200..058ad0e1 100644 --- a/core/iwasm/aot/arch/aot_reloc_riscv.c +++ b/core/iwasm/aot/arch/aot_reloc_riscv.c @@ -49,58 +49,58 @@ #endif /* clang-format off */ -void __adddf3(); -void __addsf3(); -void __divdf3(); -void __divdi3(); -void __divsf3(); -void __divsi3(); -void __eqdf2(); -void __eqsf2(); -void __extendsfdf2(); -void __fixdfdi(); -void __fixdfsi(); -void __fixsfdi(); -void __fixsfsi(); -void __fixunsdfdi(); -void __fixunsdfsi(); -void __fixunssfdi(); -void __fixunssfsi(); -void __floatdidf(); -void __floatdisf(); -void __floatsidf(); -void __floatsisf(); -void __floatundidf(); -void __floatundisf(); -void __floatunsidf(); -void __floatunsisf(); -void __gedf2(); -void __gesf2(); -void __gtdf2(); -void __gtsf2(); -void __ledf2(); -void __lesf2(); -void __ltdf2(); -void __ltsf2(); -void __moddi3(); -void __modsi3(); -void __muldf3(); -void __muldi3(); -void __mulsf3(); -void __mulsi3(); -void __nedf2(); -void __negdf2(); -void __negsf2(); -void __nesf2(); -void __subdf3(); -void __subsf3(); -void __truncdfsf2(); -void __udivdi3(); -void __udivsi3(); -void __umoddi3(); -void __umodsi3(); -void __unorddf2(); -void __unordsf2(); +void __adddf3(void); +void __addsf3(void); +void __divdf3(void); +void __divdi3(void); +void __divsf3(void); +void __divsi3(void); +void __eqdf2(void); +void __eqsf2(void); +void __extendsfdf2(void); +void __fixdfdi(void); +void __fixdfsi(void); +void __fixsfdi(void); +void __fixsfsi(void); +void __fixunsdfdi(void); +void __fixunsdfsi(void); +void __fixunssfdi(void); +void __fixunssfsi(void); +void __floatdidf(void); +void __floatdisf(void); +void __floatsidf(void); +void __floatsisf(void); +void __floatundidf(void); +void __floatundisf(void); +void __floatunsidf(void); +void __floatunsisf(void); +void __gedf2(void); +void __gesf2(void); +void __gtdf2(void); +void __gtsf2(void); +void __ledf2(void); +void __lesf2(void); +void __ltdf2(void); +void __ltsf2(void); +void __moddi3(void); +void __modsi3(void); +void __muldf3(void); +void __muldi3(void); +void __mulsf3(void); +void __mulsi3(void); +void __nedf2(void); +void __negdf2(void); +void __negsf2(void); +void __nesf2(void); +void __subdf3(void); +void __subsf3(void); +void __truncdfsf2(void); +void __udivdi3(void); +void __udivsi3(void); +void __umoddi3(void); +void __umodsi3(void); +void __unorddf2(void); +void __unordsf2(void); /* clang-format on */ static SymbolMap target_sym_map[] = { @@ -193,7 +193,7 @@ get_current_target(char *target_buf, uint32 target_buf_size) } uint32 -get_plt_item_size() +get_plt_item_size(void) { #if __riscv_xlen == 64 /* auipc + ld + jalr + nop + addr */ diff --git a/core/iwasm/aot/arch/aot_reloc_thumb.c b/core/iwasm/aot/arch/aot_reloc_thumb.c index f90507de..c0957a42 100644 --- a/core/iwasm/aot/arch/aot_reloc_thumb.c +++ b/core/iwasm/aot/arch/aot_reloc_thumb.c @@ -14,102 +14,102 @@ #define R_ARM_THM_MOVT_PREL 50 /* clang-format off */ -void __adddf3(); -void __addsf3(); -void __aeabi_d2f(); -void __aeabi_d2iz(); -void __aeabi_d2lz(); -void __aeabi_d2uiz(); -void __aeabi_d2ulz(); -void __aeabi_dadd(); -void __aeabi_dcmpeq(); -void __aeabi_dcmpge(); -void __aeabi_dcmpgt(); -void __aeabi_dcmple(); -void __aeabi_dcmplt(); -void __aeabi_dcmpun(); -void __aeabi_ddiv(); -void __aeabi_dmul(); -void __aeabi_dsub(); -void __aeabi_f2d(); -void __aeabi_f2iz(); -void __aeabi_f2lz(); -void __aeabi_f2ulz(); -void __aeabi_fadd(); -void __aeabi_fcmpeq(); -void __aeabi_fcmpge(); -void __aeabi_fcmpgt(); -void __aeabi_fcmple(); -void __aeabi_fcmplt(); -void __aeabi_fcmpun(); -void __aeabi_fdiv(); -void __aeabi_fmul(); -void __aeabi_fsub(); -void __aeabi_i2d(); -void __aeabi_i2f(); -void __aeabi_idiv(); -void __aeabi_idivmod(); -void __aeabi_l2d(); -void __aeabi_l2f(); -void __aeabi_ldivmod(); -void __aeabi_llsl(); -void __aeabi_llsr(); -void __aeabi_lmul(); -void __aeabi_ui2d(); -void __aeabi_ui2f(); -void __aeabi_uidiv(); -void __aeabi_uidivmod(); -void __aeabi_ul2d(); -void __aeabi_ul2f(); -void __aeabi_uldivmod(); -void __ashldi3(); -void __clzsi2(); -void __divdf3(); -void __divdi3(); -void __divsi3(); -void __eqdf2(); -void __eqsf2(); -void __extendsfdf2(); -void __fixdfdi(); -void __fixdfsi(); -void __fixsfdi(); -void __fixunsdfdi(); -void __fixunsdfsi(); -void __fixunssfdi(); -void __floatdidf(); -void __floatdisf(); -void __floatsidf(); -void __floatsisf(); -void __floatundidf(); -void __floatundisf(); -void __floatunsidf(); -void __floatunsisf(); -void __gedf2(); -void __gesf2(); -void __gtdf2(); -void __gtsf2(); -void __ledf2(); -void __lesf2(); -void __lshrdi3(); -void __ltdf2(); -void __ltsf2(); -void __moddi3(); -void __modsi3(); -void __muldf3(); -void __muldi3(); -void __mulsf3(); -void __nedf2(); -void __nesf2(); -void __subdf3(); -void __subsf3(); -void __truncdfsf2(); -void __udivdi3(); -void __udivmoddi4(); -void __udivsi3(); -void __umoddi3(); -void __umodsi3(); -void __unorddf2(); -void __unordsf2(); +void __adddf3(void); +void __addsf3(void); +void __aeabi_d2f(void); +void __aeabi_d2iz(void); +void __aeabi_d2lz(void); +void __aeabi_d2uiz(void); +void __aeabi_d2ulz(void); +void __aeabi_dadd(void); +void __aeabi_dcmpeq(void); +void __aeabi_dcmpge(void); +void __aeabi_dcmpgt(void); +void __aeabi_dcmple(void); +void __aeabi_dcmplt(void); +void __aeabi_dcmpun(void); +void __aeabi_ddiv(void); +void __aeabi_dmul(void); +void __aeabi_dsub(void); +void __aeabi_f2d(void); +void __aeabi_f2iz(void); +void __aeabi_f2lz(void); +void __aeabi_f2ulz(void); +void __aeabi_fadd(void); +void __aeabi_fcmpeq(void); +void __aeabi_fcmpge(void); +void __aeabi_fcmpgt(void); +void __aeabi_fcmple(void); +void __aeabi_fcmplt(void); +void __aeabi_fcmpun(void); +void __aeabi_fdiv(void); +void __aeabi_fmul(void); +void __aeabi_fsub(void); +void __aeabi_i2d(void); +void __aeabi_i2f(void); +void __aeabi_idiv(void); +void __aeabi_idivmod(void); +void __aeabi_l2d(void); +void __aeabi_l2f(void); +void __aeabi_ldivmod(void); +void __aeabi_llsl(void); +void __aeabi_llsr(void); +void __aeabi_lmul(void); +void __aeabi_ui2d(void); +void __aeabi_ui2f(void); +void __aeabi_uidiv(void); +void __aeabi_uidivmod(void); +void __aeabi_ul2d(void); +void __aeabi_ul2f(void); +void __aeabi_uldivmod(void); +void __ashldi3(void); +void __clzsi2(void); +void __divdf3(void); +void __divdi3(void); +void __divsi3(void); +void __eqdf2(void); +void __eqsf2(void); +void __extendsfdf2(void); +void __fixdfdi(void); +void __fixdfsi(void); +void __fixsfdi(void); +void __fixunsdfdi(void); +void __fixunsdfsi(void); +void __fixunssfdi(void); +void __floatdidf(void); +void __floatdisf(void); +void __floatsidf(void); +void __floatsisf(void); +void __floatundidf(void); +void __floatundisf(void); +void __floatunsidf(void); +void __floatunsisf(void); +void __gedf2(void); +void __gesf2(void); +void __gtdf2(void); +void __gtsf2(void); +void __ledf2(void); +void __lesf2(void); +void __lshrdi3(void); +void __ltdf2(void); +void __ltsf2(void); +void __moddi3(void); +void __modsi3(void); +void __muldf3(void); +void __muldi3(void); +void __mulsf3(void); +void __nedf2(void); +void __nesf2(void); +void __subdf3(void); +void __subsf3(void); +void __truncdfsf2(void); +void __udivdi3(void); +void __udivmoddi4(void); +void __udivsi3(void); +void __umoddi3(void); +void __umodsi3(void); +void __unorddf2(void); +void __unordsf2(void); /* clang-format on */ static SymbolMap target_sym_map[] = { @@ -259,7 +259,7 @@ get_current_target(char *target_buf, uint32 target_buf_size) #undef BUILD_TARGET_THUMB_V4T uint32 -get_plt_item_size() +get_plt_item_size(void) { /* 16 bytes instructions and 4 bytes symbol address */ return 20; diff --git a/core/iwasm/aot/arch/aot_reloc_x86_64.c b/core/iwasm/aot/arch/aot_reloc_x86_64.c index d1f5cb5a..fe18d79c 100644 --- a/core/iwasm/aot/arch/aot_reloc_x86_64.c +++ b/core/iwasm/aot/arch/aot_reloc_x86_64.c @@ -58,7 +58,7 @@ get_current_target(char *target_buf, uint32 target_buf_size) } static uint32 -get_plt_item_size() +get_plt_item_size(void) { /* size of mov instruction and jmp instruction */ return 12; diff --git a/core/iwasm/aot/arch/aot_reloc_xtensa.c b/core/iwasm/aot/arch/aot_reloc_xtensa.c index a29c9f2b..fca1b80d 100644 --- a/core/iwasm/aot/arch/aot_reloc_xtensa.c +++ b/core/iwasm/aot/arch/aot_reloc_xtensa.c @@ -10,44 +10,44 @@ /* clang-format off */ /* for soft-float */ -void __floatsidf(); -void __divdf3(); -void __ltdf2(); +void __floatsidf(void); +void __divdf3(void); +void __ltdf2(void); /* for mul32 */ -void __mulsi3(); -void __muldi3(); +void __mulsi3(void); +void __muldi3(void); -void __modsi3(); +void __modsi3(void); -void __divdi3(); +void __divdi3(void); -void __udivdi3(); -void __unorddf2(); -void __adddf3(); -void __eqdf2(); -void __muldf3(); -void __gedf2(); -void __ledf2(); -void __fixunsdfsi(); -void __floatunsidf(); -void __subdf3(); -void __nedf2(); -void __fixdfsi(); -void __moddi3(); -void __extendsfdf2(); -void __truncdfsf2(); -void __gtdf2(); -void __umoddi3(); -void __floatdidf(); -void __divsf3(); -void __fixdfdi(); -void __floatundidf(); -void __fixsfdi(); -void __fixunssfdi(); -void __fixunsdfdi(); -void __floatdisf(); -void __floatundisf(); +void __udivdi3(void); +void __unorddf2(void); +void __adddf3(void); +void __eqdf2(void); +void __muldf3(void); +void __gedf2(void); +void __ledf2(void); +void __fixunsdfsi(void); +void __floatunsidf(void); +void __subdf3(void); +void __nedf2(void); +void __fixdfsi(void); +void __moddi3(void); +void __extendsfdf2(void); +void __truncdfsf2(void); +void __gtdf2(void); +void __umoddi3(void); +void __floatdidf(void); +void __divsf3(void); +void __fixdfdi(void); +void __floatundidf(void); +void __fixsfdi(void); +void __fixunssfdi(void); +void __fixunsdfdi(void); +void __floatdisf(void); +void __floatundisf(void); static SymbolMap target_sym_map[] = { @@ -119,7 +119,7 @@ get_current_target(char *target_buf, uint32 target_buf_size) } static uint32 -get_plt_item_size() +get_plt_item_size(void) { return 0; } diff --git a/core/iwasm/aot/debug/jit_debug.c b/core/iwasm/aot/debug/jit_debug.c index 261c2054..9f92dd39 100644 --- a/core/iwasm/aot/debug/jit_debug.c +++ b/core/iwasm/aot/debug/jit_debug.c @@ -69,10 +69,10 @@ typedef struct JITDescriptor { * and inline assembler statement inside. */ void attribute_noinline -__jit_debug_register_code(); +__jit_debug_register_code(void); void attribute_noinline -__jit_debug_register_code() +__jit_debug_register_code(void) { int x; *(char *)&x = '\0'; @@ -96,7 +96,7 @@ extern JITDescriptor __jit_debug_descriptor; * This gives the debugger an easy way to inject custom code to * handle the events. */ -void (*__jit_debug_register_code_ptr)() = __jit_debug_register_code; +void (*__jit_debug_register_code_ptr)(void) = __jit_debug_register_code; #ifdef __cplusplus } @@ -171,7 +171,7 @@ DestroyJITCodeEntryInternal(JITCodeEntry *entry) } bool -jit_debug_engine_init() +jit_debug_engine_init(void) { if (jit_debug_engine) { return true; @@ -194,7 +194,7 @@ jit_debug_engine_init() } void -jit_debug_engine_destroy() +jit_debug_engine_destroy(void) { if (jit_debug_engine) { WASMJITEntryNode *node, *node_next; diff --git a/core/iwasm/aot/debug/jit_debug.h b/core/iwasm/aot/debug/jit_debug.h index 5e3e3651..813c8b78 100644 --- a/core/iwasm/aot/debug/jit_debug.h +++ b/core/iwasm/aot/debug/jit_debug.h @@ -11,10 +11,10 @@ extern "C" { #endif bool -jit_debug_engine_init(); +jit_debug_engine_init(void); void -jit_debug_engine_destroy(); +jit_debug_engine_destroy(void); bool jit_code_entry_create(const uint8 *symfile_addr, uint64 symfile_size); diff --git a/core/iwasm/common/wasm_memory.c b/core/iwasm/common/wasm_memory.c index 71d33754..82eebbf3 100644 --- a/core/iwasm/common/wasm_memory.c +++ b/core/iwasm/common/wasm_memory.c @@ -159,7 +159,7 @@ wasm_runtime_memory_init(mem_alloc_type_t mem_alloc_type, } void -wasm_runtime_memory_destroy() +wasm_runtime_memory_destroy(void) { if (memory_mode == MEMORY_MODE_POOL) { #if BH_ENABLE_GC_VERIFY == 0 @@ -176,7 +176,7 @@ wasm_runtime_memory_destroy() } unsigned -wasm_runtime_memory_pool_size() +wasm_runtime_memory_pool_size(void) { if (memory_mode == MEMORY_MODE_POOL) return global_pool_size; diff --git a/core/iwasm/common/wasm_memory.h b/core/iwasm/common/wasm_memory.h index a5dfefae..2f20d3f6 100644 --- a/core/iwasm/common/wasm_memory.h +++ b/core/iwasm/common/wasm_memory.h @@ -46,10 +46,10 @@ wasm_runtime_memory_init(mem_alloc_type_t mem_alloc_type, const MemAllocOption *alloc_option); void -wasm_runtime_memory_destroy(); +wasm_runtime_memory_destroy(void); unsigned -wasm_runtime_memory_pool_size(); +wasm_runtime_memory_pool_size(void); void wasm_runtime_set_mem_bound_check_bytes(WASMMemoryInstance *memory, diff --git a/core/iwasm/common/wasm_native.c b/core/iwasm/common/wasm_native.c index 9e8764a2..0ff3053f 100644 --- a/core/iwasm/common/wasm_native.c +++ b/core/iwasm/common/wasm_native.c @@ -469,7 +469,7 @@ wasi_context_dtor(WASMModuleInstanceCommon *inst, void *ctx) #if WASM_ENABLE_QUICK_AOT_ENTRY != 0 static bool -quick_aot_entry_init(); +quick_aot_entry_init(void); #endif bool @@ -1461,7 +1461,7 @@ quick_aot_entry_cmp(const void *quick_aot_entry1, const void *quick_aot_entry2) } static bool -quick_aot_entry_init() +quick_aot_entry_init(void) { qsort(quick_aot_entries, sizeof(quick_aot_entries) / sizeof(QuickAOTEntry), sizeof(QuickAOTEntry), quick_aot_entry_cmp); diff --git a/core/iwasm/common/wasm_native.h b/core/iwasm/common/wasm_native.h index 5cb78bf9..9a6afee1 100644 --- a/core/iwasm/common/wasm_native.h +++ b/core/iwasm/common/wasm_native.h @@ -100,10 +100,10 @@ wasm_native_inherit_contexts(struct WASMModuleInstanceCommon *child, #endif /* WASM_ENABLE_MODULE_INST_CONTEXT */ bool -wasm_native_init(); +wasm_native_init(void); void -wasm_native_destroy(); +wasm_native_destroy(void); #if WASM_ENABLE_QUICK_AOT_ENTRY != 0 void * diff --git a/core/iwasm/common/wasm_runtime_common.c b/core/iwasm/common/wasm_runtime_common.c index 5dd2957d..314dc7dd 100644 --- a/core/iwasm/common/wasm_runtime_common.c +++ b/core/iwasm/common/wasm_runtime_common.c @@ -86,7 +86,7 @@ static bh_list registered_module_list_head; static bh_list *const registered_module_list = ®istered_module_list_head; static korp_mutex registered_module_list_lock; static void -wasm_runtime_destroy_registered_module_list(); +wasm_runtime_destroy_registered_module_list(void); #endif /* WASM_ENABLE_MULTI_MODULE */ #define E_TYPE_XIP 4 @@ -97,11 +97,11 @@ val_type_to_val_kind(uint8 value_type); #if WASM_ENABLE_GC == 0 && WASM_ENABLE_REF_TYPES != 0 /* Initialize externref hashmap */ static bool -wasm_externref_map_init(); +wasm_externref_map_init(void); /* Destroy externref hashmap */ static void -wasm_externref_map_destroy(); +wasm_externref_map_destroy(void); #endif /* end of WASM_ENABLE_GC == 0 && WASM_ENABLE_REF_TYPES != 0 */ static void @@ -438,7 +438,7 @@ wasm_runtime_get_exec_env_tls() #endif /* end of OS_ENABLE_HW_BOUND_CHECK */ static bool -wasm_runtime_env_init() +wasm_runtime_env_init(void) { if (bh_platform_init() != 0) return false; @@ -584,7 +584,7 @@ static korp_mutex runtime_lock = OS_THREAD_MUTEX_INITIALIZER; static int32 runtime_ref_count = 0; static bool -wasm_runtime_init_internal() +wasm_runtime_init_internal(void) { if (!wasm_runtime_memory_init(Alloc_With_System_Allocator, NULL)) return false; @@ -622,7 +622,7 @@ wasm_runtime_init() } static void -wasm_runtime_destroy_internal() +wasm_runtime_destroy_internal(void) { #if WASM_ENABLE_GC == 0 && WASM_ENABLE_REF_TYPES != 0 wasm_externref_map_destroy(); @@ -4747,7 +4747,7 @@ fail: || defined(BUILD_TARGET_RISCV32_ILP32D) \ || defined(BUILD_TARGET_RISCV32_ILP32F) \ || defined(BUILD_TARGET_RISCV32_ILP32) || defined(BUILD_TARGET_ARC) -typedef void (*GenericFunctionPointer)(); +typedef void (*GenericFunctionPointer)(void); void invokeNative(GenericFunctionPointer f, uint32 *args, uint32 n_stacks); @@ -5312,7 +5312,7 @@ fail: #if defined(BUILD_TARGET_X86_32) || defined(BUILD_TARGET_ARM) \ || defined(BUILD_TARGET_THUMB) || defined(BUILD_TARGET_MIPS) \ || defined(BUILD_TARGET_XTENSA) -typedef void (*GenericFunctionPointer)(); +typedef void (*GenericFunctionPointer)(void); void invokeNative(GenericFunctionPointer f, uint32 *args, uint32 sz); @@ -5597,7 +5597,7 @@ typedef uint32x4_t __m128i; #endif /* end of WASM_ENABLE_SIMD != 0 */ -typedef void (*GenericFunctionPointer)(); +typedef void (*GenericFunctionPointer)(void); void invokeNative(GenericFunctionPointer f, uint64 *args, uint64 n_stacks); diff --git a/core/iwasm/common/wasm_runtime_common.h b/core/iwasm/common/wasm_runtime_common.h index 71264ca7..fb2c7940 100644 --- a/core/iwasm/common/wasm_runtime_common.h +++ b/core/iwasm/common/wasm_runtime_common.h @@ -852,10 +852,10 @@ wasm_runtime_set_module_reader(const module_reader reader, const module_destroyer destroyer); module_reader -wasm_runtime_get_module_reader(); +wasm_runtime_get_module_reader(void); module_destroyer -wasm_runtime_get_module_destroyer(); +wasm_runtime_get_module_destroyer(void); bool wasm_runtime_register_module_internal(const char *module_name, @@ -881,7 +881,7 @@ bool wasm_runtime_is_loading_module(const char *module_name); void -wasm_runtime_destroy_loading_module_list(); +wasm_runtime_destroy_loading_module_list(void); WASMModuleCommon * wasm_runtime_search_sub_module(const WASMModuleCommon *parent_module, @@ -1168,7 +1168,7 @@ wasm_runtime_quick_invoke_c_api_native(WASMModuleInstanceCommon *module_inst, uint32 result_count); void -wasm_runtime_show_app_heap_corrupted_prompt(); +wasm_runtime_show_app_heap_corrupted_prompt(void); #if WASM_ENABLE_LOAD_CUSTOM_SECTION != 0 void diff --git a/core/iwasm/common/wasm_shared_memory.h b/core/iwasm/common/wasm_shared_memory.h index 8bbc4a80..e1c5154a 100644 --- a/core/iwasm/common/wasm_shared_memory.h +++ b/core/iwasm/common/wasm_shared_memory.h @@ -17,10 +17,10 @@ extern "C" { extern korp_mutex g_shared_memory_lock; bool -wasm_shared_memory_init(); +wasm_shared_memory_init(void); void -wasm_shared_memory_destroy(); +wasm_shared_memory_destroy(void); uint16 shared_memory_inc_reference(WASMMemoryInstance *memory); diff --git a/core/iwasm/compilation/aot.h b/core/iwasm/compilation/aot.h index dcf9bbe1..98d2cc6c 100644 --- a/core/iwasm/compilation/aot.h +++ b/core/iwasm/compilation/aot.h @@ -312,7 +312,7 @@ void aot_destroy_comp_data(AOTCompData *comp_data); char * -aot_get_last_error(); +aot_get_last_error(void); void aot_set_last_error(const char *error); diff --git a/core/iwasm/interpreter/wasm_interp_fast.c b/core/iwasm/interpreter/wasm_interp_fast.c index 51963759..1d7ca8f9 100644 --- a/core/iwasm/interpreter/wasm_interp_fast.c +++ b/core/iwasm/interpreter/wasm_interp_fast.c @@ -6030,7 +6030,7 @@ wasm_interp_call_func_bytecode(WASMModuleInstance *module, #if WASM_ENABLE_LABELS_AS_VALUES != 0 void ** -wasm_interp_get_handle_table() +wasm_interp_get_handle_table(void) { WASMModuleInstance module; memset(&module, 0, sizeof(WASMModuleInstance)); diff --git a/core/iwasm/interpreter/wasm_loader.c b/core/iwasm/interpreter/wasm_loader.c index ed85bb78..7b99c60a 100644 --- a/core/iwasm/interpreter/wasm_loader.c +++ b/core/iwasm/interpreter/wasm_loader.c @@ -5751,7 +5751,7 @@ wasm_loader_prepare_bytecode(WASMModule *module, WASMFunction *func, #if WASM_ENABLE_FAST_INTERP != 0 && WASM_ENABLE_LABELS_AS_VALUES != 0 void ** -wasm_interp_get_handle_table(); +wasm_interp_get_handle_table(void); static void **handle_table; #endif diff --git a/core/iwasm/interpreter/wasm_mini_loader.c b/core/iwasm/interpreter/wasm_mini_loader.c index 34f4a183..968eaf00 100644 --- a/core/iwasm/interpreter/wasm_mini_loader.c +++ b/core/iwasm/interpreter/wasm_mini_loader.c @@ -2532,7 +2532,7 @@ wasm_loader_prepare_bytecode(WASMModule *module, WASMFunction *func, #if WASM_ENABLE_FAST_INTERP != 0 && WASM_ENABLE_LABELS_AS_VALUES != 0 void ** -wasm_interp_get_handle_table(); +wasm_interp_get_handle_table(void); static void **handle_table; #endif diff --git a/core/iwasm/libraries/lib-wasi-threads/lib_wasi_threads_wrapper.c b/core/iwasm/libraries/lib-wasi-threads/lib_wasi_threads_wrapper.c index aeaafced..c9512fb4 100644 --- a/core/iwasm/libraries/lib-wasi-threads/lib_wasi_threads_wrapper.c +++ b/core/iwasm/libraries/lib-wasi-threads/lib_wasi_threads_wrapper.c @@ -29,7 +29,7 @@ typedef struct { } ThreadStartArg; static int32 -allocate_thread_id() +allocate_thread_id(void) { os_mutex_lock(&thread_id_lock); int32 id = tid_allocator_get_tid(&tid_allocator); diff --git a/core/iwasm/libraries/thread-mgr/thread_manager.h b/core/iwasm/libraries/thread-mgr/thread_manager.h index f5ca1eae..7ad6c772 100644 --- a/core/iwasm/libraries/thread-mgr/thread_manager.h +++ b/core/iwasm/libraries/thread-mgr/thread_manager.h @@ -64,10 +64,10 @@ void wasm_cluster_set_max_thread_num(uint32 num); bool -thread_manager_init(); +thread_manager_init(void); void -thread_manager_destroy(); +thread_manager_destroy(void); /* Create cluster */ WASMCluster * @@ -109,7 +109,7 @@ bool wasm_cluster_register_destroy_callback(void (*callback)(WASMCluster *)); void -wasm_cluster_cancel_all_callbacks(); +wasm_cluster_cancel_all_callbacks(void); void wasm_cluster_suspend_all(WASMCluster *cluster); @@ -190,7 +190,7 @@ struct WASMCurrentEnvStatus { }; WASMCurrentEnvStatus * -wasm_cluster_create_exenv_status(); +wasm_cluster_create_exenv_status(void); void wasm_cluster_destroy_exenv_status(WASMCurrentEnvStatus *status); diff --git a/core/shared/platform/include/platform_api_extension.h b/core/shared/platform/include/platform_api_extension.h index b1c3b4f4..37b8399b 100644 --- a/core/shared/platform/include/platform_api_extension.h +++ b/core/shared/platform/include/platform_api_extension.h @@ -379,19 +379,19 @@ os_sem_unlink(const char *name); * Initialize process-global state for os_wakeup_blocking_op. */ int -os_blocking_op_init(); +os_blocking_op_init(void); /** * Start accepting os_wakeup_blocking_op requests for the calling thread. */ void -os_begin_blocking_op(); +os_begin_blocking_op(void); /** * Stop accepting os_wakeup_blocking_op requests for the calling thread. */ void -os_end_blocking_op(); +os_end_blocking_op(void); /** * Wake up the specified thread. @@ -1586,7 +1586,7 @@ os_closedir(os_dir_stream dir_stream); * @return the invalid directory stream */ os_dir_stream -os_get_invalid_dir_stream(); +os_get_invalid_dir_stream(void); /** * Checks whether the given directory stream is valid. An invalid directory @@ -1605,7 +1605,7 @@ os_is_dir_stream_valid(os_dir_stream *dir_stream); * @return the invalid handle */ os_file_handle -os_get_invalid_handle(); +os_get_invalid_handle(void); /** * Checks whether the given file handle is valid. An invalid handle is diff --git a/core/shared/platform/nuttx/platform_internal.h b/core/shared/platform/nuttx/platform_internal.h index 0b54d85a..fef2122d 100644 --- a/core/shared/platform/nuttx/platform_internal.h +++ b/core/shared/platform/nuttx/platform_internal.h @@ -137,7 +137,7 @@ typedef DIR *os_dir_stream; typedef int os_raw_file_handle; static inline os_file_handle -os_get_invalid_handle() +os_get_invalid_handle(void) { return -1; } diff --git a/product-mini/platforms/common/libc_wasi.c b/product-mini/platforms/common/libc_wasi.c index 84e133bc..2f0b3512 100644 --- a/product-mini/platforms/common/libc_wasi.c +++ b/product-mini/platforms/common/libc_wasi.c @@ -28,7 +28,7 @@ typedef enum { } libc_wasi_parse_result_t; static void -libc_wasi_print_help() +libc_wasi_print_help(void) { printf(" --env= Pass wasi environment variables with " "\"key=value\"\n"); diff --git a/product-mini/platforms/nuttx/CMakeLists.txt b/product-mini/platforms/nuttx/CMakeLists.txt index ac6c47b9..ca07a5d5 100644 --- a/product-mini/platforms/nuttx/CMakeLists.txt +++ b/product-mini/platforms/nuttx/CMakeLists.txt @@ -197,7 +197,7 @@ include(${WAMR_ROOT_DIR}/build-scripts/runtime_lib.cmake) # NuttX wamr lib complie required: `WAMR_SOURCES` `WAMR_CFLAGS` `WAMR_INCDIRS` # `WAMR_DEFINITIONS` set(WAMR_SOURCES ${WAMR_RUNTIME_LIB_SOURCE}) -set(WAMR_CFLAGS -Wno-strict-prototypes -Wno-shadow -Wno-unused-variable +set(WAMR_CFLAGS -Wno-shadow -Wno-unused-variable -Wno-int-conversion -Wno-implicit-function-declaration) get_directory_property(WAMR_INCDIRS INCLUDE_DIRECTORIES) get_directory_property(WAMR_DEFINITIONS COMPILE_DEFINITIONS) diff --git a/product-mini/platforms/nuttx/wamr.mk b/product-mini/platforms/nuttx/wamr.mk index 38553e86..0ee76c7d 100644 --- a/product-mini/platforms/nuttx/wamr.mk +++ b/product-mini/platforms/nuttx/wamr.mk @@ -400,7 +400,7 @@ CFLAGS += -DWASM_ENABLE_EXCE_HANDLING=0 CFLAGS += -DWASM_ENABLE_TAGS=0 endif -CFLAGS += -Wno-strict-prototypes -Wno-shadow -Wno-unused-variable +CFLAGS += -Wno-shadow -Wno-unused-variable CFLAGS += -Wno-int-conversion -Wno-implicit-function-declaration CFLAGS += -I${CORE_ROOT} \ diff --git a/product-mini/platforms/posix/main.c b/product-mini/platforms/posix/main.c index c1ba169d..14dc01f6 100644 --- a/product-mini/platforms/posix/main.c +++ b/product-mini/platforms/posix/main.c @@ -27,7 +27,7 @@ static char **app_argv; /* clang-format off */ static int -print_help() +print_help(void) { printf("Usage: iwasm [-options] wasm_file [args...]\n"); printf("options:\n");