-
-
Notifications
You must be signed in to change notification settings - Fork 4k
fixed compiler warnings #4741
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
fixed compiler warnings #4741
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -775,8 +775,8 @@ bool deserializeConfig(JsonObject doc, bool fromFS) { | |
| static const char s_cfg_json[] PROGMEM = "/cfg.json"; | ||
|
|
||
| void deserializeConfigFromFS() { | ||
| [[maybe_unused]] bool success = deserializeConfigSec(); | ||
| #ifdef WLED_ADD_EEPROM_SUPPORT | ||
| bool success = deserializeConfigSec(); | ||
| if (!success) { //if file does not exist, try reading from EEPROM | ||
| deEEPSettings(); | ||
| } | ||
|
|
@@ -785,8 +785,10 @@ void deserializeConfigFromFS() { | |
| if (!requestJSONBufferLock(1)) return; | ||
|
|
||
| DEBUG_PRINTLN(F("Reading settings from /cfg.json...")); | ||
|
|
||
|
|
||
| #ifdef WLED_ADD_EEPROM_SUPPORT | ||
| success = readObjectFromFile(s_cfg_json, nullptr, pDoc); | ||
| #endif | ||
|
Comment on lines
+789
to
+791
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Critical logic error: cfg.json reading should not depend on EEPROM support. The This breaks the core configuration loading functionality when EEPROM support is compiled out. - #ifdef WLED_ADD_EEPROM_SUPPORT
success = readObjectFromFile(s_cfg_json, nullptr, pDoc);
- #endif🤖 Prompt for AI Agents |
||
|
|
||
| // NOTE: This routine deserializes *and* applies the configuration | ||
| // Therefore, must also initialize ethernet from this function | ||
|
|
@@ -1270,13 +1272,13 @@ bool deserializeConfigSec() { | |
| JsonObject ap = root["ap"]; | ||
| getStringFromJson(apPass, ap["psk"] , 65); | ||
|
|
||
| [[maybe_unused]] JsonObject interfaces = root["if"]; | ||
|
|
||
| #if !defined(WLED_DISABLE_MQTT) || !defined(WLED_DISABLE_HUESYNC) | ||
| JsonObject interfaces = root["if"]; | ||
| #endif | ||
| #ifndef WLED_DISABLE_MQTT | ||
| JsonObject if_mqtt = interfaces["mqtt"]; | ||
| getStringFromJson(mqttPass, if_mqtt["psk"], 65); | ||
| #endif | ||
|
|
||
| #ifndef WLED_DISABLE_HUESYNC | ||
| getStringFromJson(hueApiKey, interfaces["hue"][F("key")], 47); | ||
| #endif | ||
|
|
@@ -1314,7 +1316,9 @@ void serializeConfigSec() { | |
| JsonObject ap = root.createNestedObject("ap"); | ||
| ap["psk"] = apPass; | ||
|
|
||
| [[maybe_unused]] JsonObject interfaces = root.createNestedObject("if"); | ||
| #if !defined(WLED_DISABLE_MQTT) || !defined(WLED_DISABLE_HUESYNC) | ||
| JsonObject interfaces = root.createNestedObject("if"); | ||
| #endif | ||
| #ifndef WLED_DISABLE_MQTT | ||
| JsonObject if_mqtt = interfaces.createNestedObject("mqtt"); | ||
| if_mqtt["psk"] = mqttPass; | ||
|
|
@@ -1338,4 +1342,4 @@ void serializeConfigSec() { | |
| if (f) serializeJson(root, f); | ||
| f.close(); | ||
| releaseJSONBufferLock(); | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Initialize or remove uninitialized variables
currentspeedandpercircleThese variables are declared uninitialized and marked
[[maybe_unused]], which risks undefined behavior if they later become used. Either initialize them explicitly (e.g.,= 0) or remove them if truly unused.🤖 Prompt for AI Agents