From 080f9e23717462a90a2c1a639b2eafd00a3797dc Mon Sep 17 00:00:00 2001 From: Russ Butler Date: Wed, 18 May 2016 15:24:14 -0500 Subject: [PATCH] Turn on variable length arrays in C for IAR Turn on support for variable length arrays for the IAR C compiler. This provides greater compatibility with GCC and ARMCC. Note: The current version of iccarm at the time of this patch (V7.40.3.8902) does not support variable length arrays in C++. --- tools/toolchains/iar.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/toolchains/iar.py b/tools/toolchains/iar.py index 7d2fb60992..6c33f5a780 100644 --- a/tools/toolchains/iar.py +++ b/tools/toolchains/iar.py @@ -63,10 +63,10 @@ class IAR(mbedToolchain): main_cc = join(IAR_BIN, "iccarm") self.asm = [join(IAR_BIN, "iasmarm")] + ["--cpu", cpuchoice] if not "analyze" in self.options: - self.cc = [main_cc] + c_flags + self.cc = [main_cc, "--vla"] + c_flags self.cppc = [main_cc, "--c++", "--no_rtti", "--no_exceptions"] + c_flags else: - self.cc = [join(GOANNA_PATH, "goannacc"), '--with-cc="%s"' % main_cc.replace('\\', '/'), "--dialect=iar-arm", '--output-format="%s"' % self.GOANNA_FORMAT] + c_flags + self.cc = [join(GOANNA_PATH, "goannacc"), '--with-cc="%s"' % main_cc.replace('\\', '/'), "--dialect=iar-arm", '--output-format="%s"' % self.GOANNA_FORMAT, "--vla"] + c_flags self.cppc = [join(GOANNA_PATH, "goannac++"), '--with-cxx="%s"' % main_cc.replace('\\', '/'), "--dialect=iar-arm", '--output-format="%s"' % self.GOANNA_FORMAT] + ["--c++", "--no_rtti", "--no_exceptions"] + c_flags self.ld = join(IAR_BIN, "ilinkarm") self.ar = join(IAR_BIN, "iarchive")