How to get rid of "warning: initialization from incompatible pointer type [-Wincompatible-pointer-types"]

After building I get these warnings:
/Users/janhkila/.platformio/packages/framework-arduinoespressif32/cores/esp32/esp32-hal-spi.c: In function ‘spiTransferBytesNL’:
/Users/janhkila/.platformio/packages/framework-arduinoespressif32/cores/esp32/esp32-hal-spi.c:922:39: warning: initialization from incompatible pointer type [-Wincompatible-pointer-types]
uint8_t * last_out8 = &result[c_longs-1];
^
/Users/janhkila/.platformio/packages/framework-arduinoespressif32/cores/esp32/esp32-hal-spi.c:923:40: warning: initialization from incompatible pointer type [-Wincompatible-pointer-types]
uint8_t * last_data8 = &last_data;

What can I do to silence this warning?

I tried replacing the contents of this file with the one you linked to as the new one, but the differences are too big (some includes not found and other errors)

If you’re still having issues with this I think I found the relevant changes, I think the line numbers changed since more changes were added to the file. You want these changes: Currently found here

uint8_t * last_out8 = (uint8_t *)&result[c_longs-1];
uint8_t * last_data8 = (uint8_t *)&last_data;

2 Likes