Skip to content

Commit 80a03e1

Browse files
committed
Turn on C99 VLAs in IAR
IAR defaults to C99 mode, but doesn't enable VLAs by default. Enable them to make it more conformant. We don't have much if any code using actual variable-length arrays, but variably-modified types are occasionally used. The same switch controls both. (VLAs were actually already enabled in most of the project export templates, but not the build script).
1 parent b4bb088 commit 80a03e1

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

tools/export/iar_template.ewp.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@
402402
</option>
403403
<option>
404404
<name>IccAllowVLA</name>
405-
<state>0</state>
405+
<state>1</state>
406406
</option>
407407
<option>
408408
<name>IccCppDialect</name>

tools/toolchains/iar.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class IAR(mbedToolchain):
4040
"-e", # Enable IAR language extension
4141
"--diag_suppress=Pa050,Pa084,Pa093,Pa082"],
4242
'asm': [],
43-
'c': [],
43+
'c': ["--vla"],
4444
'cxx': ["--guard_calls"],
4545
'ld': ["--skip_dynamic_initialization", "--threaded_lib"],
4646
}

0 commit comments

Comments
 (0)