arch: posix: Select at least C11 standard

Replace the global CSTD property with the CSTD kconfig option to select
at least C11 standard.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
This commit is contained in:
Pieter De Gendt 2024-04-03 09:44:48 +02:00 committed by Fabio Baltieri
parent a599ed13a1
commit ff6985766b
2 changed files with 6 additions and 7 deletions

View file

@ -144,6 +144,12 @@ config ARCH_POSIX
select BARRIER_OPERATIONS_BUILTIN select BARRIER_OPERATIONS_BUILTIN
# POSIX arch based targets get their memory cleared on entry by the host OS # POSIX arch based targets get their memory cleared on entry by the host OS
select SKIP_BSS_CLEAR 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 help
POSIX (native) architecture POSIX (native) architecture

View file

@ -196,11 +196,4 @@ if(NOT ${LLVM_SANITIZERS_ARG} STREQUAL "")
target_compile_options(native_simulator INTERFACE ${LLVM_SANITIZERS_ARG}) target_compile_options(native_simulator INTERFACE ${LLVM_SANITIZERS_ARG})
endif() 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) add_subdirectory(core)