mirror of https://github.com/ARMmbed/mbed-os.git
Warn about or prevent VLA use in C++
ARM and GNU compilers currently are in a mode where they will accept VLAs in C++ as an extension. IAR does not accept them in C++. Avoid potential portability surprises by making GCC warn, and deactivating the extension in ArmCC.pull/1985/head
parent
80a03e1787
commit
b74546c731
|
|
@ -38,7 +38,7 @@ class ARM(mbedToolchain):
|
|||
"--brief_diagnostics", "--restrict", "--multibyte_chars", "-I \""+ARM_INC+"\""],
|
||||
'asm': [],
|
||||
'c': ["--md", "--no_depend_system_headers", "--c99", "-D__ASSERT_MSG"],
|
||||
'cxx': ["--cpp", "--no_rtti"],
|
||||
'cxx': ["--cpp", "--no_rtti", "--no_vla"],
|
||||
'ld': [],
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ class GCC(mbedToolchain):
|
|||
],
|
||||
'asm': ["-x", "assembler-with-cpp"],
|
||||
'c': ["-std=gnu99"],
|
||||
'cxx': ["-std=gnu++98", "-fno-rtti"],
|
||||
'cxx': ["-std=gnu++98", "-fno-rtti", "-Wvla"],
|
||||
'ld': ["-Wl,--gc-sections", "-Wl,--wrap,main",
|
||||
"-Wl,--wrap,_malloc_r", "-Wl,--wrap,_free_r", "-Wl,--wrap,_realloc_r"],
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue