File tree Expand file tree Collapse file tree 1 file changed +3
-11
lines changed Expand file tree Collapse file tree 1 file changed +3
-11
lines changed Original file line number Diff line number Diff line change @@ -333,24 +333,16 @@ void SPIClass::dmaAllocate(void) {
333333 use_dma = true ; // Everything allocated successfully
334334 extraWriteDescriptors = &extraReadDescriptors[numReadDescriptors];
335335
336- // dmac.h didn't include extern "C" which cause
337- // DmacDescriptor and its members are defined as C++ struct therefore
338- // memcpy will throw warning on copying where simple assignment won't work
339- #pragma GCC diagnostic push
340- #pragma GCC diagnostic ignored "-Wclass-memaccess"
341-
342336 // Initialize descriptors (copy from first ones)
337+ // cast to void* to suppress warning: with no trivial copy-assignment [-Wclass-memaccess]
343338 for (int i=0 ; i<numReadDescriptors; i++) {
344- memcpy (&extraReadDescriptors[i], firstReadDescriptor,
339+ memcpy (( void *) &extraReadDescriptors[i], firstReadDescriptor,
345340 sizeof (DmacDescriptor));
346341 }
347342 for (int i=0 ; i<numWriteDescriptors; i++) {
348- memcpy (&extraWriteDescriptors[i], firstWriteDescriptor,
343+ memcpy (( void *) &extraWriteDescriptors[i], firstWriteDescriptor,
349344 sizeof (DmacDescriptor));
350345 }
351-
352- #pragma GCC diagnostic pop
353-
354346 } // end malloc
355347 } // end extra descriptor check
356348
You can’t perform that action at this time.
0 commit comments