From befcb801b44dc7ee8fbd8305871ab9d94cf47a5b Mon Sep 17 00:00:00 2001 From: Dawid Niedzwiecki Date: Tue, 6 Aug 2024 11:11:26 +0200 Subject: [PATCH] tests: lib: cpp: add __maybe_unused to unused variable The foos variable is not really used. Add __maybe_unused to silence compiler. Signed-off-by: Dawid Niedzwiecki --- tests/lib/cpp/cxx/src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/lib/cpp/cxx/src/main.cpp b/tests/lib/cpp/cxx/src/main.cpp index 8b149290bab..1f6864a3375 100644 --- a/tests/lib/cpp/cxx/src/main.cpp +++ b/tests/lib/cpp/cxx/src/main.cpp @@ -99,7 +99,7 @@ struct foo { /* Check that BUILD_ASSERT compiles. */ BUILD_ASSERT(sizeof(foo) == sizeof(int)); -static struct foo foos[5]; +__maybe_unused static struct foo foos[5]; /* Check that ARRAY_SIZE compiles. */ BUILD_ASSERT(ARRAY_SIZE(foos) == 5, "expected 5 elements");