Browse Source

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>
pull/70658/head
Pieter De Gendt 1 year ago committed by Fabio Baltieri
parent
commit
ff6985766b
  1. 6
      arch/Kconfig
  2. 7
      arch/posix/CMakeLists.txt

6
arch/Kconfig

@ -144,6 +144,12 @@ config ARCH_POSIX @@ -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

7
arch/posix/CMakeLists.txt

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

Loading…
Cancel
Save