diff --git a/arch/Kconfig b/arch/Kconfig index a800d220b5..b9e40d8ec2 100644 --- a/arch/Kconfig +++ b/arch/Kconfig @@ -144,6 +144,12 @@ config ARCH_POSIX select BARRIER_OPERATIONS_BUILTIN # POSIX arch based targets get their memory cleared on entry by the host OS select SKIP_BSS_CLEAR + # Override the C standard used for compilation to C 2011 + # This is due to some tests using _Static_assert which is a 2011 feature, but + # otherwise relying on compilers supporting it also when set to C99. + # This was in general ok, but with some host compilers and C library versions + # it led to problems. So we override it to 2011 for the native targets. + select REQUIRES_STD_C11 help POSIX (native) architecture diff --git a/arch/posix/CMakeLists.txt b/arch/posix/CMakeLists.txt index 7ce45f9ad9..bc06cecac2 100644 --- a/arch/posix/CMakeLists.txt +++ b/arch/posix/CMakeLists.txt @@ -196,11 +196,4 @@ if(NOT ${LLVM_SANITIZERS_ARG} STREQUAL "") target_compile_options(native_simulator INTERFACE ${LLVM_SANITIZERS_ARG}) endif() -# Override the C standard used for compilation to C 2011 -# This is due to some tests using _Static_assert which is a 2011 feature, but -# otherwise relying on compilers supporting it also when set to C99. -# This was in general ok, but with some host compilers and C library versions -# it led to problems. So we override it to 2011 for the native targets. -set_property(GLOBAL PROPERTY CSTD c11) - add_subdirectory(core)