Skip to content

Commit 89ba122

Browse files
committed
tests: mgmt: mcumgr: Disable erroneous clang warning
tests/subsys/mgmt/mcumgr/settings_mgmt/src/main.c:69:22: error: variable 'test_response_read_data_start' is not needed and will not be emitted [-Werror,-Wunneeded-internal-declaration] static const uint8_t test_response_read_data_start[5] = { ^ tests/subsys/mgmt/mcumgr/settings_mgmt/src/main.c:73:22: error: variable 'test_response_read_data_end' is not needed and will not be emitted [-Werror,-Wunneeded-internal-declaration] static const uint8_t test_response_read_data_end[1] = { ^ Signed-off-by: Tom Hughes <[email protected]>
1 parent a117d12 commit 89ba122

File tree

2 files changed

+4
-0
lines changed
  • include/zephyr/toolchain
  • tests/subsys/mgmt/mcumgr/settings_mgmt/src

2 files changed

+4
-0
lines changed

include/zephyr/toolchain/llvm.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
#include <zephyr/toolchain/gcc.h>
3232

3333
#define TOOLCHAIN_WARNING_SIZEOF_ARRAY_DECAY "-Wsizeof-array-decay"
34+
#define TOOLCHAIN_WARNING_UNNEEDED_INTERNAL_DECLARATION "-Wunneeded-internal-declaration"
3435

3536
#define TOOLCHAIN_DISABLE_CLANG_WARNING(warning) _TOOLCHAIN_DISABLE_WARNING(clang, warning)
3637
#define TOOLCHAIN_ENABLE_CLANG_WARNING(warning) _TOOLCHAIN_ENABLE_WARNING(clang, warning)

tests/subsys/mgmt/mcumgr/settings_mgmt/src/main.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,16 @@ static const uint8_t test_response_error_data[8] = {
6666
0xbf, 0x62, 0x72, 0x63, 0x19, 0x01, 0x00, 0xff
6767
};
6868

69+
/* Disable erroneous clang warning: https://github.com/llvm/llvm-project/issues/25458. */
70+
TOOLCHAIN_DISABLE_CLANG_WARNING(TOOLCHAIN_WARNING_UNNEEDED_INTERNAL_DECLARATION)
6971
static const uint8_t test_response_read_data_start[5] = {
7072
0xbf, 0x63, 0x76, 0x61, 0x6c
7173
};
7274

7375
static const uint8_t test_response_read_data_end[1] = {
7476
0xff
7577
};
78+
TOOLCHAIN_ENABLE_CLANG_WARNING(TOOLCHAIN_WARNING_UNNEEDED_INTERNAL_DECLARATION)
7679

7780
static void cleanup_test(void *p)
7881
{

0 commit comments

Comments
 (0)