Skip to content

Commit 29bb7fc

Browse files
Fix pgm_read_ptr() (#5735)
Fix dereferencing in pgm_read_ptr() macro on 8266 and host. Fixes #5733
1 parent 82be4d0 commit 29bb7fc

File tree

1 file changed

+2
-2
lines changed
  • tools/sdk/libc/xtensa-lx106-elf/include/sys

1 file changed

+2
-2
lines changed

tools/sdk/libc/xtensa-lx106-elf/include/sys/pgmspace.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,11 @@ static inline uint16_t pgm_read_word_inlined(const void* addr) {
7373
#ifdef __cplusplus
7474
#define pgm_read_dword(addr) (*reinterpret_cast<const uint32_t*>(addr))
7575
#define pgm_read_float(addr) (*reinterpret_cast<const float*>(addr))
76-
#define pgm_read_ptr(addr) (*reinterpret_cast<const void*>(addr))
76+
#define pgm_read_ptr(addr) (*reinterpret_cast<const void* const *>(addr))
7777
#else
7878
#define pgm_read_dword(addr) (*(const uint32_t*)(addr))
7979
#define pgm_read_float(addr) (*(const float*)(addr))
80-
#define pgm_read_ptr(addr) (*(const void*)(addr))
80+
#define pgm_read_ptr(addr) (*(const void* const*)(addr))
8181
#endif
8282

8383
#define pgm_read_byte_near(addr) pgm_read_byte(addr)

0 commit comments

Comments
 (0)