Juerd / ESP-WiFiSettings

WiFi Manager for the ESP32 Arduino environment
Other
166 stars 34 forks source link

Warning in ESP8266 #11

Closed Juerd closed 3 years ago

Juerd commented 3 years ago

... However there's still this warning:

.../ESP-WiFiSettings/WiFiSettings.cpp: In lambda function:
.../ESP-WiFiSettings/WiFiSettings.cpp:313:40: warning: comparison is always false due to limited range of data type [-Wtype-limits]
  313 |             opt.replace("{1x}",   mode == WIFI_AUTH_WPA2_ENTERPRISE ? "(won't work: 802.1x is not supported)" : "");
      |                                        ^

which is solved by this non-invasive change:

--- a/WiFiSettings.cpp
+++ b/WiFiSettings.cpp
@@ -16,7 +16,7 @@
     #define esp_task_wdt_reset wdt_reset
     #define wifi_auth_mode_t uint8_t    // wl_enc_type
     #define WIFI_AUTH_OPEN ENC_TYPE_NONE
-    #define WIFI_AUTH_WPA2_ENTERPRISE -1337 // not available on ESP8266
+    constexpr auto WIFI_AUTH_WPA2_ENTERPRISE = -1337; // not available on ESP8266
     #define setHostname hostname
     #define INADDR_NONE IPAddress(0,0,0,0)

Originally posted by @d-a-v in https://github.com/Juerd/ESP-WiFiSettings/issues/10#issuecomment-730013882

Juerd commented 3 years ago

Released as v3.5.3