Feature request: adding arduino-cli option to set warning level (--warnings <level>) #1746
Description
See discussion #1508
The arduino-cli
has a CLI option --warnings string Optional, can be: none, default, more, all. Used to tell gcc which warning level to use (-W flag). (default "none")
to set which warning compiler flags are used during compilation.
As a reminder, those are:
["compiler.warning_flags",""],
["compiler.warning_flags.none", ""],
["compiler.warning_flags.all",""],
["compiler.warning_flags.extra",""]
In previous vscode-arduino versions somehow it was possible to set this option via buildPreferences
:
"buildPreferences": [
["compiler.warning_level", "all"]
]
However this does not work anymore, as those are directly parsed to ``--build-property STRING` CLI options, see here:
vscode-arduino/src/arduino/arduino.ts
Line 151 in 6f24815
Can we either also expose this CLI option to the vscode-arduino plug-in (clean approach) or add a special case for compiler.warning_level
when parsing buildPreferences
to set
["--warnings", `${key}=${value}`]);
which is not so clean and rather a "temporary" solution 😇 .
What do you think?