WString: remove operator==(const __FlashStringHelper*) by d-a-v · Pull Request #8569 · esp8266/Arduino (original) (raw)

We don't want to overload comparisons though? Check out operator calls you are proposing with older versions, or the esp32 Core, or even the ArduinoCore API test suite.

// with 2.7.4
src/main.cpp: In function 'void setup()':
src/main.cpp:7:16: error: invalid conversion from 'int' to 'const char*' [-fpermissive]
     if (tmp == 5) {
                ^

Main ambiguity comes from fpstr vs. const char, that wasn't there in the older Core versions.
== NULL is still an equals(int), even with the overloaded nullptr you are adding
it is a warning, but not something critical from the gcc pov.

Yes, this is another case of older code breaking, but I'd rather WiFiManager fixes this issue b/c we add another heap of issues on top.

src/main.cpp: In function 'void setup()':
src/main.cpp:7:16: warning: passing NULL to non-pointer argument 1 of 'bool String::operator==(int) const' [-Wconversion-null]
    7 |     if (tmp == NULL) {
      |                ^~~~
In file included from /home/builder/.platformio/packages/framework-arduinoespressif8266@src-31d658a59f41540201fc3726a1394910/cores/esp8266/Arduino.h:291,
                 from src/main.cpp:1:
/home/builder/.platformio/packages/framework-arduinoespressif8266@src-31d658a59f41540201fc3726a1394910/cores/esp8266/WString.h:234:30: note:   declared here
  234 |         bool operator ==(int val) const {
      |