Skip to content
This repository has been archived by the owner on Oct 1, 2024. It is now read-only.

Feature request: adding arduino-cli option to set warning level (--warnings <level>) #1746

Open
da-phil opened this issue Jun 4, 2024 · 0 comments

Comments

@da-phil
Copy link

da-phil commented Jun 4, 2024

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:

if (this.useArduinoCli()) {

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?

@da-phil da-phil changed the title Feature request: adding option to set warning level Feature request: adding arduino-cli option to set warning level (--warnings <level>) Jun 4, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant