Issue 60982
Summary [AVR] error: reinterpret_cast from 'const __FlashStringHelper *' (aka 'const __attribute__((address_space(1))) char *') to 'const char *' is not allowed
Labels new issue
Assignees
Reporter KOLANICH
    ```c++
//toolchain/hardware/tools/avr/avr/include/avr/pgmspace.h
#ifndef PGM_P
#define PGM_P const char *
// or #define PGM_P __attribute__((address_space(1))) const char * - the same issue
#endif

//toolchain/hardware/arduino/avr/cores/arduino/WString.h
using __FlashStringHelper = __attribute__((address_space(1))) char;

//toolchain/hardware/arduino/avr/cores/arduino/Print.cpp
PGM_P p = reinterpret_cast<PGM_P>(ifsh);
```

```
error: reinterpret_cast from 'const __FlashStringHelper *' (aka 'const __attribute__((address_space(1))) char *') to 'const char *' is not allowed
```

Workaround:

```c++
PGM_P p = (PGM_P)(ifsh);
```

_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to