diff --git a/core/iwasm/common/arch/invokeNative_general.c b/core/iwasm/common/arch/invokeNative_general.c index 4799c9fa8..52ffee5ad 100644 --- a/core/iwasm/common/arch/invokeNative_general.c +++ b/core/iwasm/common/arch/invokeNative_general.c @@ -6,6 +6,11 @@ #include "../wasm_runtime_common.h" #include "../wasm_exec_env.h" +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-non-prototype" +#endif + void invokeNative(void (*native_code)(), uint32 argv[], uint32 argc) { @@ -112,3 +117,7 @@ invokeNative(void (*native_code)(), uint32 argv[], uint32 argc) } } } + +#if defined(__clang__) +#pragma clang diagnostic pop +#endif diff --git a/core/iwasm/include/wasm_c_api.h b/core/iwasm/include/wasm_c_api.h index 873913edf..948cef6b5 100644 --- a/core/iwasm/include/wasm_c_api.h +++ b/core/iwasm/include/wasm_c_api.h @@ -433,7 +433,7 @@ struct wasm_ref_t; typedef struct wasm_val_t { wasm_valkind_t kind; - uint8_t __paddings[7]; + uint8_t _paddings[7]; union { int32_t i32; int64_t i64; @@ -864,12 +864,12 @@ static inline void* wasm_val_ptr(const wasm_val_t* val) { #endif } -#define WASM_I32_VAL(i) {.kind = WASM_I32, .__paddings = {0}, .of = {.i32 = i}} -#define WASM_I64_VAL(i) {.kind = WASM_I64, .__paddings = {0}, .of = {.i64 = i}} -#define WASM_F32_VAL(z) {.kind = WASM_F32, .__paddings = {0}, .of = {.f32 = z}} -#define WASM_F64_VAL(z) {.kind = WASM_F64, .__paddings = {0}, .of = {.f64 = z}} -#define WASM_REF_VAL(r) {.kind = WASM_ANYREF, .__paddings = {0}, .of = {.ref = r}} -#define WASM_INIT_VAL {.kind = WASM_ANYREF, .__paddings = {0}, .of = {.ref = NULL}} +#define WASM_I32_VAL(i) {.kind = WASM_I32, ._paddings = {0}, .of = {.i32 = i}} +#define WASM_I64_VAL(i) {.kind = WASM_I64, ._paddings = {0}, .of = {.i64 = i}} +#define WASM_F32_VAL(z) {.kind = WASM_F32, ._paddings = {0}, .of = {.f32 = z}} +#define WASM_F64_VAL(z) {.kind = WASM_F64, ._paddings = {0}, .of = {.f64 = z}} +#define WASM_REF_VAL(r) {.kind = WASM_ANYREF, ._paddings = {0}, .of = {.ref = r}} +#define WASM_INIT_VAL {.kind = WASM_ANYREF, ._paddings = {0}, .of = {.ref = NULL}} #define KILOBYTE(n) ((n) * 1024) diff --git a/core/iwasm/include/wasm_export.h b/core/iwasm/include/wasm_export.h index 03c0e2fbe..6405a0181 100644 --- a/core/iwasm/include/wasm_export.h +++ b/core/iwasm/include/wasm_export.h @@ -255,7 +255,7 @@ struct wasm_ref_t; typedef struct wasm_val_t { wasm_valkind_t kind; - uint8_t __paddings[7]; + uint8_t _paddings[7]; union { /* also represent a function index */ int32_t i32; diff --git a/core/iwasm/interpreter/wasm_runtime.h b/core/iwasm/interpreter/wasm_runtime.h index 4249eb5c1..e60d4f7c8 100644 --- a/core/iwasm/interpreter/wasm_runtime.h +++ b/core/iwasm/interpreter/wasm_runtime.h @@ -112,7 +112,7 @@ struct WASMMemoryInstance { /* Four-byte paddings to ensure the layout of WASMMemoryInstance is the same * in both 64-bit and 32-bit */ - uint8 __paddings[4]; + uint8 _paddings[4]; /* Number bytes per page */ uint32 num_bytes_per_page; diff --git a/core/shared/mem-alloc/ems/ems_gc.h b/core/shared/mem-alloc/ems/ems_gc.h index 293ad18e8..59cc00285 100644 --- a/core/shared/mem-alloc/ems/ems_gc.h +++ b/core/shared/mem-alloc/ems/ems_gc.h @@ -70,7 +70,10 @@ typedef enum { GC_STAT_MAX } GC_STAT_INDEX; +#ifndef GC_FINALIZER_T_DEFINED +#define GC_FINALIZER_T_DEFINED typedef void (*gc_finalizer_t)(void *obj, void *data); +#endif #ifndef EXTRA_INFO_NORMAL_NODE_CNT #define EXTRA_INFO_NORMAL_NODE_CNT 32 diff --git a/core/shared/mem-alloc/mem_alloc.h b/core/shared/mem-alloc/mem_alloc.h index ca683d1e3..97e87d4a5 100644 --- a/core/shared/mem-alloc/mem_alloc.h +++ b/core/shared/mem-alloc/mem_alloc.h @@ -17,7 +17,10 @@ extern "C" { typedef void *mem_allocator_t; +#ifndef GC_FINALIZER_T_DEFINED +#define GC_FINALIZER_T_DEFINED typedef void (*gc_finalizer_t)(void *obj, void *data); +#endif mem_allocator_t mem_allocator_create(void *mem, uint32_t size);