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");