Skip to content

Commit 9fb5fcc

Browse files
authored
Add comments to suppress warning from clang-tidy (#3088)
Suppress style warnings for macro definition, name of these macros is inconsistent with others (upper case).
1 parent ad46290 commit 9fb5fcc

File tree

4 files changed

+11
-3
lines changed

4 files changed

+11
-3
lines changed

core/iwasm/aot/aot_loader.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,8 @@ GET_U16_FROM_ADDR(const uint8 *p)
214214
p += sizeof(type); \
215215
} while (0)
216216

217+
/* NOLINTBEGIN, disable lint for this region with clang-tidy */
218+
217219
#define read_byte_array(p, p_end, addr, len) \
218220
do { \
219221
CHECK_BUF(p, p_end, len); \
@@ -236,6 +238,8 @@ GET_U16_FROM_ADDR(const uint8 *p)
236238
#define read_uint32(p, p_end, res) TEMPLATE_READ(p, p_end, res, uint32)
237239
#define read_uint64(p, p_end, res) TEMPLATE_READ(p, p_end, res, uint64)
238240

241+
/* NOLINTEND */
242+
239243
/* Legal values for bin_type */
240244
#define BIN_TYPE_ELF32L 0 /* 32-bit little endian */
241245
#define BIN_TYPE_ELF32B 1 /* 32-bit big endian */

core/iwasm/aot/aot_runtime.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1474,7 +1474,7 @@ invoke_native_with_hw_bound_check(WASMExecEnv *exec_env, void *func_ptr,
14741474
(void)jmpbuf_node_pop;
14751475
return ret;
14761476
}
1477-
#define invoke_native_internal invoke_native_with_hw_bound_check
1477+
#define invoke_native_internal invoke_native_with_hw_bound_check /* NOLINT */
14781478
#else /* else of OS_ENABLE_HW_BOUND_CHECK */
14791479
static inline bool
14801480
invoke_native_internal(WASMExecEnv *exec_env, void *func_ptr,

core/iwasm/common/wasm_application.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ static union {
4646
char b;
4747
} __ue = { .a = 1 };
4848

49-
#define is_little_endian() (__ue.b == 1)
49+
#define is_little_endian() (__ue.b == 1) /* NOLINT */
5050

5151
/**
5252
* Implementation of wasm_application_execute_main()

core/iwasm/common/wasm_runtime_common.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -785,6 +785,7 @@ align_ptr(const uint8 *p, uint32 b)
785785
return false; \
786786
} while (0)
787787

788+
/* NOLINTNEXTLINE */
788789
#define read_uint16(p, p_end, res) \
789790
do { \
790791
p = (uint8 *)align_ptr(p, sizeof(uint16)); \
@@ -793,6 +794,7 @@ align_ptr(const uint8 *p, uint32 b)
793794
p += sizeof(uint16); \
794795
} while (0)
795796

797+
/* NOLINTNEXTLINE */
796798
#define read_uint32(p, p_end, res) \
797799
do { \
798800
p = (uint8 *)align_ptr(p, sizeof(uint32)); \
@@ -3537,7 +3539,7 @@ static union {
35373539
char b;
35383540
} __ue = { .a = 1 };
35393541

3540-
#define is_little_endian() (__ue.b == 1)
3542+
#define is_little_endian() (__ue.b == 1) /* NOLINT */
35413543

35423544
bool
35433545
wasm_runtime_register_natives(const char *module_name,
@@ -4446,6 +4448,7 @@ typedef int64 (*Int64FuncPtr)(GenericFunctionPointer, uint64 *, uint64);
44464448
typedef int32 (*Int32FuncPtr)(GenericFunctionPointer, uint64 *, uint64);
44474449
typedef void (*VoidFuncPtr)(GenericFunctionPointer, uint64 *, uint64);
44484450

4451+
/* NOLINTBEGIN */
44494452
static volatile Float64FuncPtr invokeNative_Float64 =
44504453
(Float64FuncPtr)(uintptr_t)invokeNative;
44514454
static volatile Float32FuncPtr invokeNative_Float32 =
@@ -4461,6 +4464,7 @@ static volatile VoidFuncPtr invokeNative_Void =
44614464
typedef v128 (*V128FuncPtr)(GenericFunctionPointer, uint64 *, uint64);
44624465
static V128FuncPtr invokeNative_V128 = (V128FuncPtr)(uintptr_t)invokeNative;
44634466
#endif
4467+
/* NOLINTEND */
44644468

44654469
#if defined(_WIN32) || defined(_WIN32_)
44664470
#define MAX_REG_FLOATS 4

0 commit comments

Comments
 (0)