earlephilhower / newlib-xtensa

newlib-xtensa fork intended for esp8266
GNU General Public License v2.0
5 stars 7 forks source link

Avoid void pointer arithmetic #18

Closed oxan closed 3 years ago

oxan commented 3 years ago

Avoid void pointer arithmetic in pgm_read_double_unaligned(), by casting it to a char-pointer before doing arithmetic. Generated code is identical.

The background for this is that void pointer arithmetic is a GNU extension, that clang doesn't allow at all in C++ mode. This precludes running clang-based static analyzers (such as clang-tidy) on any files that include pgmspace.h, which is unfortunate.