-
Notifications
You must be signed in to change notification settings - Fork 13.3k
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
String += PSTR() crashes (and it should on Arduino, but can esp8266 be more flexible?) #6367
Comments
d-a-v@35e0ad2 works for me! |
@d-a-v , @earlephilhower As an example, related to user's code, even a code like To me, it looks like if you want to use strings stored in flash, always use F() and FPSTR() and not just PSTR(). |
To continue: @everslick You should stop using PSTR() strings in such a way, unless you really know what you do (like use the PSTR() string into a _P function call). Before using flash stored strings, please ensure you read documentation: |
Per #6368 (comment), |
@d-a-v |
None that I'm aware of. It is true in #6368 (comment) that @everslick should have used
This issue and the proposed temporary merged PR is only happening to restore something that was working before some commit, on esp8266 arduino only, even if the API is not correctly used. All that because there were some optimizations in newlib to internally and transparently allow the use of data from flash without need of copying them to ram before use. |
I'm a bit confused about this. I thought the expression |
@bxparks you are right. |
Basic Infos
Platform
Settings in IDE
Problem Description
Exception 3 when I concatenate a global
const char *
that is declared to be stored in flash via thePSTR()
macro to aString
object.Last known good git version is:
0ab76fc
from 2019/05/09MCVE Sketch
Debug Messages
Stacktrace
The text was updated successfully, but these errors were encountered: