Incorrect const in pgm_read_ptr
tttapa opened this issue · 0 comments
tttapa commented
There seems to be bug in macro pgm_read_ptr macro in the pgmspace.h header.
ArduinoCore-sam/cores/arduino/avr/pgmspace.h
Line 106 in c893c62
The cast to const void ** is incorrect, because it casts it to "a pointer to a pointer to a read-only object of any type".
I believe that the correct type would be void *const *, "a pointer to a read-only pointer to an object of any type". The pointer itself is in progmem, and therefore is read-only, but the pointee is not necessarily read-only, as it could be in static memory.
Discovered here: tttapa/Control-Surface#64