Skip to content

Move __PRETTY_FUNCTION__ to progmem #5758

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

Merged
merged 2 commits into from
Feb 13, 2019

Conversation

earlephilhower
Copy link
Collaborator

@earlephilhower earlephilhower commented Feb 13, 2019

Match __FUNCTION__ linking, keep C++ function names out of rodata/heap.

Match __FUNCTION__ linking, keep C++ function names out of rodata/heap.
@cr1st1p
Copy link

cr1st1p commented Aug 25, 2019

Guys, not sure if this was announced or not, but this looks like a rather big change.
On one hand it is good (for those doing logging - it frees some RAM), but on the other hand... you should NOT expect that GCC definition is ONLY used via Arduino's String() class !
Possible wrong cases, where pull request #6368 probably does nothing:

  • allocating some memory (new/malloc), building a string, doing then a strcat(dest, __PRETTY_FUNCTION) (untested)
  • doing std:string s(PRETTY_FUNCTION) - crashes (real life example :-( )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants