Skip to content

Commit 6d5dd34

Browse files
RobinKastbergfabiobaltieri
authored andcommitted
iar: toolchain: enable VLA for IAR
Currently some subsystems outside the zephyr kernel use VLA:s such as bluetooth. We will enable it for now in the same kind of situations as gcc. Signed-off-by: Robin Kastberg <robin.kastberg@iar.com>
1 parent 5994a5e commit 6d5dd34

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

cmake/compiler/iar/target.cmake

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,11 @@ if("${IAR_TOOLCHAIN_VARIANT}" STREQUAL "iccarm")
8181
)
8282
endif()
8383

84+
# Enable VLA if CONFIG_MISRA_SANE is not set and warnings are not enabled.
85+
if(NOT CONFIG_MISRA_SANE AND NOT DEFINED W)
86+
list(APPEND IAR_COMMON_FLAGS --vla)
87+
endif()
88+
8489
# Minimal ASM compiler flags
8590
if("${IAR_TOOLCHAIN_VARIANT}" STREQUAL "iccarm")
8691
list(APPEND IAR_ASM_FLAGS

cmake/toolchain/iar/Kconfig.defconfig

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
# SPDX-License-Identifier: Apache-2.0
44

55

6-
config MISRA_SANE
7-
default y
8-
96
config PICOLIBC_SUPPORTED
107
default n
118

0 commit comments

Comments
 (0)