From deb7ff524a73216c9907b8b6ef61efc27341b789 Mon Sep 17 00:00:00 2001 From: Anas Nashif Date: Tue, 4 Jun 2019 08:59:53 -0400 Subject: [PATCH] cmake: no-address-of-packed-member is not supported in older compilers Add a version check to allow building with older GCC versions that did not support this option. Fixes #16607 Signed-off-by: Anas Nashif --- cmake/compiler/gcc/target_warnings.cmake | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/cmake/compiler/gcc/target_warnings.cmake b/cmake/compiler/gcc/target_warnings.cmake index fe13931169..48988896f5 100644 --- a/cmake/compiler/gcc/target_warnings.cmake +++ b/cmake/compiler/gcc/target_warnings.cmake @@ -9,11 +9,16 @@ macro(toolchain_cc_warning_base) -Wformat -Wformat-security -Wno-format-zero-length - # FIXME: Remove once #16587 is fixed - -Wno-address-of-packed-member -Wno-main ) +if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "9.1.0") + zephyr_compile_options( + # FIXME: Remove once #16587 is fixed + -Wno-address-of-packed-member + ) +endif() + zephyr_cc_option(-Wno-pointer-sign) # Prohibit void pointer arithmetic. Illegal in C99