From 41335ad3e958b9c0bced48aa9a6e9b4b7ccbc10e Mon Sep 17 00:00:00 2001 From: Kevin Bracey Date: Tue, 19 Jun 2018 15:54:28 +0300 Subject: [PATCH] IAR: Suppress C "bypasses initialization" warning By default IAR generates "transfer of control bypasses initialization" warnings for C code - it's a legal construct that frequently occurs when doing Linux-style "goto error". Many occurrences in Nanostack. Suppress the warning for C only, to align with GCC and ARMCC. Have to take care not to put it in the "common" section, as this would suppress it for C++, where it actually is illegal. --- tools/profiles/debug.json | 2 +- tools/profiles/develop.json | 2 +- tools/profiles/release.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/profiles/debug.json b/tools/profiles/debug.json index 053ba43271..1800616967 100644 --- a/tools/profiles/debug.json +++ b/tools/profiles/debug.json @@ -53,7 +53,7 @@ "--diag_suppress=Pa050,Pa084,Pa093,Pa082", "-On", "-r", "-DMBED_DEBUG", "-DMBED_TRAP_ERRORS_ENABLED=1", "--enable_restrict", "-D_RTE_"], "asm": [], - "c": ["--vla"], + "c": ["--vla", "--diag_suppress=Pe546"], "cxx": ["--guard_calls", "--no_static_destruction"], "ld": ["--skip_dynamic_initialization", "--threaded_lib"] } diff --git a/tools/profiles/develop.json b/tools/profiles/develop.json index 19f7a5eaab..ed32506018 100644 --- a/tools/profiles/develop.json +++ b/tools/profiles/develop.json @@ -48,7 +48,7 @@ "--no_wrap_diagnostics", "-e", "--diag_suppress=Pa050,Pa084,Pa093,Pa082", "-Oh", "--enable_restrict", "-D_RTE_"], "asm": [], - "c": ["--vla"], + "c": ["--vla", "--diag_suppress=Pe546"], "cxx": ["--guard_calls", "--no_static_destruction"], "ld": ["--skip_dynamic_initialization", "--threaded_lib"] } diff --git a/tools/profiles/release.json b/tools/profiles/release.json index f224de0c12..4fe6f8cd6b 100644 --- a/tools/profiles/release.json +++ b/tools/profiles/release.json @@ -49,7 +49,7 @@ "--no_wrap_diagnostics", "-e", "--diag_suppress=Pa050,Pa084,Pa093,Pa082", "-Ohz", "-DNDEBUG", "--enable_restrict", "-D_RTE_"], "asm": [], - "c": ["--vla"], + "c": ["--vla", "--diag_suppress=Pe546"], "cxx": ["--guard_calls", "--no_static_destruction"], "ld": ["--skip_dynamic_initialization", "--threaded_lib"] }