When compiling with the latest arm-none-eabi-gcc from here and compiling the soil sensor using make BOARD=soil produces the error:
bsp/bsp_dma.cpp: In function 'void dmac_init()':
bsp/bsp_dma.cpp:30:47: error: 'void* memset(void*, int, size_t)' clearing an object of type 'struct DmacDescriptor' with no trivial copy-assignment; use value-initialization instead [-Werror=class-memaccess]
30 | memset(_descriptor, 0, sizeof(_descriptor));
| ^
In file included from lib/samd10/include/samd10d14am.h:224,
from lib/samd10/include/sam.h:42,
from bsp/bsp_dma.cpp:8:
lib/samd10/include/component/dmac.h:984:16: note: 'struct DmacDescriptor' declared here
984 | typedef struct {
| ^
bsp/bsp_dma.cpp:31:46: error: 'void* memset(void*, int, size_t)' clearing an object of type 'struct DmacDescriptor' with no trivial copy-assignment; use value-initialization instead [-Werror=class-memaccess]
31 | memset(_writeback , 0, sizeof(_writeback));
| ^
In file included from lib/samd10/include/samd10d14am.h:224,
from lib/samd10/include/sam.h:42,
from bsp/bsp_dma.cpp:8:
lib/samd10/include/component/dmac.h:984:16: note: 'struct DmacDescriptor' declared here
984 | typedef struct {
| ^
cc1plus: all warnings being treated as errors
make: *** [Makefile:185: build/soil/bsp/bsp_dma.o] Error 1
This fixes this warning by initializing the struct with zeros so there is no need to memset.
When compiling with the latest
arm-none-eabi-gcc
from here and compiling the soil sensor usingmake BOARD=soil
produces the error:This fixes this warning by initializing the struct with zeros so there is no need to memset.