Skip to content

Commit 23846b0

Browse files
committed
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 <[email protected]>
1 parent 94eb7d6 commit 23846b0

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

arch/Kconfig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,12 @@ config ARCH_POSIX
144144
select BARRIER_OPERATIONS_BUILTIN
145145
# POSIX arch based targets get their memory cleared on entry by the host OS
146146
select SKIP_BSS_CLEAR
147+
# Override the C standard used for compilation to C 2011
148+
# This is due to some tests using _Static_assert which is a 2011 feature, but
149+
# otherwise relying on compilers supporting it also when set to C99.
150+
# This was in general ok, but with some host compilers and C library versions
151+
# it led to problems. So we override it to 2011 for the native targets.
152+
select REQUIRES_STD_C11
147153
help
148154
POSIX (native) architecture
149155

arch/posix/CMakeLists.txt

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -196,11 +196,4 @@ if(NOT ${LLVM_SANITIZERS_ARG} STREQUAL "")
196196
target_compile_options(native_simulator INTERFACE ${LLVM_SANITIZERS_ARG})
197197
endif()
198198

199-
# Override the C standard used for compilation to C 2011
200-
# This is due to some tests using _Static_assert which is a 2011 feature, but
201-
# otherwise relying on compilers supporting it also when set to C99.
202-
# This was in general ok, but with some host compilers and C library versions
203-
# it led to problems. So we override it to 2011 for the native targets.
204-
set_property(GLOBAL PROPERTY CSTD c11)
205-
206199
add_subdirectory(core)

0 commit comments

Comments
 (0)