Skip to content

Commit 2da1a5a

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 844e4bf commit 2da1a5a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Diff for: api/Print.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,11 @@ size_t Print::write(const uint8_t *buffer, size_t size)
4141
size_t Print::print(const __FlashStringHelper *ifsh)
4242
{
4343
#if defined(__AVR__)
44+
#if defined(__clang__)
45+
PGM_P p = (PGM_P)(ifsh);
46+
#else
4447
PGM_P p = reinterpret_cast<PGM_P>(ifsh);
48+
#endif
4549
size_t n = 0;
4650
while (1) {
4751
unsigned char c = pgm_read_byte(p++);

0 commit comments

Comments
 (0)