Skip to content

Commit 81ed801

Browse files
committed
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.
1 parent 5d8570b commit 81ed801

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

tools/profiles/debug.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
"--diag_suppress=Pa050,Pa084,Pa093,Pa082", "-On", "-r", "-DMBED_DEBUG",
5454
"-DMBED_TRAP_ERRORS_ENABLED=1", "--enable_restrict", "-D_RTE_"],
5555
"asm": [],
56-
"c": ["--vla"],
56+
"c": ["--vla", "--diag_suppress=Pe546"],
5757
"cxx": ["--guard_calls", "--no_static_destruction"],
5858
"ld": ["--skip_dynamic_initialization", "--threaded_lib"]
5959
}

tools/profiles/develop.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
"--no_wrap_diagnostics", "-e",
4949
"--diag_suppress=Pa050,Pa084,Pa093,Pa082", "-Oh", "--enable_restrict", "-D_RTE_"],
5050
"asm": [],
51-
"c": ["--vla"],
51+
"c": ["--vla", "--diag_suppress=Pe546"],
5252
"cxx": ["--guard_calls", "--no_static_destruction"],
5353
"ld": ["--skip_dynamic_initialization", "--threaded_lib"]
5454
}

tools/profiles/release.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
"--no_wrap_diagnostics", "-e",
4949
"--diag_suppress=Pa050,Pa084,Pa093,Pa082", "-Ohz", "-DNDEBUG", "--enable_restrict", "-D_RTE_"],
5050
"asm": [],
51-
"c": ["--vla"],
51+
"c": ["--vla", "--diag_suppress=Pe546"],
5252
"cxx": ["--guard_calls", "--no_static_destruction"],
5353
"ld": ["--skip_dynamic_initialization", "--threaded_lib"]
5454
}

0 commit comments

Comments
 (0)