Open
Description
Bug Report
DEFAULT_WARNINGS_LEVEL is "none"
Current behavior
DEFAULT_WARNINGS_LEVEL is set to "none"
arduino-cli/legacy/builder/builder.go
Line 39 in 0866d99
Expected behavior
const DEFAULT_WARNINGS_LEVEL = "default"
Environment
Version: 0.10.0 Commit: ec5c3ed
Additional context
The Arduino IDE has four preferences options for warnings: None, Default, More, All
based on the selection, "none", "default", "more", or "all" gets concatenated with compiler.warning_flags. and the corresponding option from platform.txt is used in the build flags.
https://github.com/arduino/ArduinoCore-avr/blob/master/platform.txt#L16
Metadata
Metadata
Assignees
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
matthijskooijman commentedon May 5, 2020
One complication of enabling warnings by default is that you get warnings for all compiled code, including code you are not actually working on (e.g. warnings in the Arduino core and libraries) and not in a good position to fix. This can be especially confusing to novice users.
IMHO, having warnings enabled for the sketch, but not other parts, would be ideal.
See also arduino/arduino-ide#1630 for previous discussion of this issue for the Java IDE, with some alternative proposals too.
cmaglie commentedon May 18, 2020
related to arduino/arduino-builder#301
per1234 commentedon Jun 12, 2020
One thing to consider is that the target user of Arduino CLI is different from the target user of Arduino IDE. Although I'm a big fan of always enabling and paying attention to compiler warnings, I can somewhat understand the reasoning behind disabling them by default in the Arduino IDE. After all, we regularly get posts on the forum:
and much more often than that get posts from people freaked out by innocuous warnings from libraries, thinking they are "errors".
However, that level of beginner should not be using Arduino CLI, so we don't need to cater to them.
matthijskooijman commentedon Jun 12, 2020
Fair point. However, would this work technically? Does arduino-cli have a completely separate configuration from the IDE? Once the arduino-cli is used as a backend for the IDE, would it pass all options explicitly? Would people expect to configure the cli and the IDE completely separately (especially when the IDE includes the cli)? Just some thoughts :-)
[-]DEFAULT_WARNINGS_LEVEL should be "default"[/-][+]Default warnings level for compiling should be "default"[/+]per1234 commentedon Nov 3, 2022
Yes. Arduino IDE always specifies the warning level in the compile request. That warning level is set according to the user's preferences. The default value of the preference is set in the Arduino IDE codebase:
https://github.com/arduino/arduino-ide/blob/260227e79a05fefeb87ba1400c14215b358cc20c/arduino-ide-extension/src/browser/arduino-preferences.ts#L93