-
-
Notifications
You must be signed in to change notification settings - Fork 388
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Default warnings level for compiling should be "default" #684
Comments
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. |
related to arduino/arduino-builder#301 |
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. |
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 :-) |
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: |
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
The text was updated successfully, but these errors were encountered: