Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 3290e34

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 3290e34

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

‎api/Print.cpp‎

Lines changed: 4 additions & 0 deletions
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)

AltStyle によって変換されたページ (->オリジナル) /