Skip to content

Commit 91c9a45

Browse files
committed
Fix error: reinterpret_cast from 'const __FlashStringHelper *' (aka 'const __attribute__((address_space(1))) char *') to 'const char *' is not allowed when compiling with Clang
1 parent 0428ad8 commit 91c9a45

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

cores/arduino/Print.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,11 @@ size_t Print::write(const uint8_t *buffer, size_t size)
4343

4444
size_t Print::print(const __FlashStringHelper *ifsh)
4545
{
46+
#if defined(__clang__)
47+
PGM_P p = (PGM_P)(ifsh);
48+
#else
4649
PGM_P p = reinterpret_cast<PGM_P>(ifsh);
50+
#endif
4751
size_t n = 0;
4852
while (1) {
4953
unsigned char c = pgm_read_byte(p++);

0 commit comments

Comments
 (0)