From c7ad0b574a86576d1f961d69cb15dfa589e89ff5 Mon Sep 17 00:00:00 2001 From: Peter Bigot Date: Fri, 18 Dec 2020 07:52:33 -0600 Subject: [PATCH] cmake: disable warning on C++ 20 Compound assigments like x |= y to volatile qualified values are deprecated in C++20. This idiom is common in CMSIS headers for manipulating peripheral registers. Since these headers are core they are likely to be included indirectly in C++ modules; since they are in vendor-provided headers we can't "fix" them. Disable the warning when building for C++. Signed-off-by: Peter Bigot --- cmake/compiler/gcc/compiler_flags.cmake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmake/compiler/gcc/compiler_flags.cmake b/cmake/compiler/gcc/compiler_flags.cmake index 11377ab54c7..6cd89422f1b 100644 --- a/cmake/compiler/gcc/compiler_flags.cmake +++ b/cmake/compiler/gcc/compiler_flags.cmake @@ -124,7 +124,8 @@ set_property(TARGET compiler-cpp PROPERTY dialect_cpp98 "-std=c++98") set_property(TARGET compiler-cpp PROPERTY dialect_cpp11 "-std=c++11" "-Wno-register") set_property(TARGET compiler-cpp PROPERTY dialect_cpp14 "-std=c++14" "-Wno-register") set_property(TARGET compiler-cpp PROPERTY dialect_cpp17 "-std=c++17" "-Wno-register") -set_property(TARGET compiler-cpp PROPERTY dialect_cpp2a "-std=c++2a" "-Wno-register") +set_property(TARGET compiler-cpp PROPERTY dialect_cpp2a "-std=c++2a" + "-Wno-register" "-Wno-volatile") # Disable exeptions flag in C++ set_property(TARGET compiler-cpp PROPERTY no_exceptions "-fno-exceptions")