Description
Board
ESP32
Device Description
YUBOX-Node
Hardware Configuration
No special hardware configuration needed.
Version
v2.0.8
IDE Name
Arduino IDE 2.1.0
Operating System
Fedora Linux 38 x86_64
Flash frequency
80MHz
PSRAM enabled
no
Upload speed
115200
Description
After updating to Arduino-ESP32 2.0.8, the attached sketch will no longer compile, and displays the following error messages:
In file included from /home/alex/.arduino15/packages/esp32-alternatives/2.0.8/hardware/esp32/2.0.8/cores/esp32/Arduino.h:176,
from /home/alex/programa/practica/arduino/esp32/test-bug-compile-fail-flashstringhelper/test-bug-compile-fail-flashstringhelper.ino:1:
/home/alex/programa/practica/arduino/esp32/test-bug-compile-fail-flashstringhelper/test-bug-compile-fail-flashstringhelper.ino: In function 'const __FlashStringHelper* testfunc()':
/home/alex/.arduino15/packages/esp32-alternatives/2.0.8/hardware/esp32/2.0.8/cores/esp32/WString.h:38:42: error: cannot convert 'const char*' to 'const __FlashStringHelper*' in return
#define F(string_literal) (string_literal)
^
/home/alex/programa/practica/arduino/esp32/test-bug-compile-fail-flashstringhelper/test-bug-compile-fail-flashstringhelper.ino:5:10: note: in expansion of macro 'F'
return F("test");
^
exit status 1
Compilation error: exit status 1
The same sketch compiles correctly under previous 2.0.7.
Sketch
#include <Arduino.h>
const __FlashStringHelper * testfunc(void)
{
return F("test");
}
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
delay(1000);
}
Debug Message
In file included from /home/alex/.arduino15/packages/esp32-alternatives/2.0.8/hardware/esp32/2.0.8/cores/esp32/Arduino.h:176,
from /home/alex/programa/practica/arduino/esp32/test-bug-compile-fail-flashstringhelper/test-bug-compile-fail-flashstringhelper.ino:1:
/home/alex/programa/practica/arduino/esp32/test-bug-compile-fail-flashstringhelper/test-bug-compile-fail-flashstringhelper.ino: In function 'const __FlashStringHelper* testfunc()':
/home/alex/.arduino15/packages/esp32-alternatives/2.0.8/hardware/esp32/2.0.8/cores/esp32/WString.h:38:42: error: cannot convert 'const char*' to 'const __FlashStringHelper*' in return
#define F(string_literal) (string_literal)
^
/home/alex/programa/practica/arduino/esp32/test-bug-compile-fail-flashstringhelper/test-bug-compile-fail-flashstringhelper.ino:5:10: note: in expansion of macro 'F'
return F("test");
^
exit status 1
Compilation error: exit status 1
Other Steps to Reproduce
No response
I have checked existing issues, online documentation and the Troubleshooting Guide
- I confirm I have checked existing issues, online documentation and Troubleshooting guide.
Metadata
Metadata
Assignees
Type
Projects
Status
Done
Activity
avillacis commentedon Apr 22, 2023
Forgot to mention: although the sketch shown above does not explicitly need the F() macro, several libraries available through the Arduino IDE library manager do use this pattern internally. I was bitten by this issue when trying to compile a project using the ESPAsyncWebServer library.
avillacis commentedon Apr 22, 2023
Apparently the breaking change was introduced in b98255d .
me-no-dev commentedon Apr 23, 2023
@dok-net any comments? Please take some action or we will need to revert your PR
dok-net commentedon Apr 23, 2023
@me-no-dev Now people start calling the fix a bug... #7940 details how there is an inconsistency in this core's libraries, on the other hand. Do we want to add __FlashStringHelper wrappers to all ESP32 libs that don't use it now, because it is redundant on ESP32, then? It seems like a lot of work for nothing. This has just been left to rot for far too long, it seems?
dok-net commentedon Apr 23, 2023
Anyway, here's a PR #8111 to fix what originally got in my way.
tueddy commentedon Apr 23, 2023
Same problem compiling this popular RFID lib with 2.0.8:
https://github.com/miguelbalboa/rfid
dok-net commentedon Apr 23, 2023
@tueddy RFID lib (I used the example ReadUidMultiReader.ino) also fixed by #8111.
18 remaining items