You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[AVR] error: reinterpret_cast from 'const __FlashStringHelper *' (aka 'const __attribute__((address_space(1))) char *') to 'const char *' is not allowed
#60982
Closed
KOLANICH opened this issue
Feb 24, 2023
· 4 comments
It seems convert from program memory pointer to data memory pointer in pure C are allowed by both clang and avr-gcc, but in c++ code are allowed by neither.
This is behaving by design; it was changed in https://reviews.llvm.org/D58346 -- in general, casting away the address space is not a safe operation, so you have to use a C-style cast to force it to "work". Closing the issue as not a bug, but please reopen if you have further information.
error: reinterpret_cast from 'const __FlashStringHelper *' (aka 'const __attribute__((address_space(1))) char *') to 'const char *' is not allowed
Workaround:
Related:
arduino/ArduinoCore-avr#524
arduino/ArduinoCore-API#184
The text was updated successfully, but these errors were encountered: