Description
Normally boards.txt can control settings as needed for each individual board. However, "build.warn_data_percentage" can not be customized. The default 75 setting is appropriate for small memory boards, but causes needless (and alarming) warnings on boards with much more memory.
To reproduce this problem, add this line to boards.txt:
uno.build.warn_data_percentage=80
Then compile this sketch for Arduino/Genuino Uno
volatile char bigbuf[1536];
void setup() {
bigbuf[0] = 0;
}
void loop() {
}
The 80% setting line will be ignored and Arduino will print the warning "Low memory available, stability problems may occur."
The problem seems to be on line 236 in Compiler.java:
https://github.com/arduino/Arduino/blob/master/arduino-core/src/cc/arduino/Compiler.java#L236
commandLine.addArgument("-prefs=build.warn_data_percentage=" + PreferencesData.get("build.warn_data_percentage"));
This gives the builder an explicit override, causing it to ignore any setting that may be present in boards.txt.