Skip to content

Commit cca8448

Browse files
authored
Merge pull request #300 from adafruit/fix-warnings
Fix warnings
2 parents fa24f50 + 33a1e15 commit cca8448

File tree

3 files changed

+6
-14
lines changed

3 files changed

+6
-14
lines changed

libraries/SPI/SPI.cpp

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff 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

platform.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
# https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5---3rd-party-Hardware-specification
2121

2222
name=Adafruit SAMD (32-bits ARM Cortex-M0+ and Cortex-M4) Boards
23-
version=1.7.0
23+
version=1.7.1
2424

2525
# Compile variables
2626
# -----------------
@@ -70,7 +70,7 @@ compiler.S.extra_flags=
7070
compiler.ar.extra_flags=
7171
compiler.elf2hex.extra_flags=
7272

73-
compiler.arm.cmsis.c.flags="-I{runtime.tools.CMSIS-5.4.0.path}/CMSIS/Core/Include/" "-I{runtime.tools.CMSIS-5.4.0.path}/CMSIS/DSP/Include/" "-I{runtime.tools.CMSIS-Atmel-1.2.1.path}/CMSIS/Device/ATMEL/"
73+
compiler.arm.cmsis.c.flags="-I{runtime.tools.CMSIS-5.4.0.path}/CMSIS/Core/Include/" "-I{runtime.tools.CMSIS-5.4.0.path}/CMSIS/DSP/Include/" "-I{runtime.tools.CMSIS-Atmel-1.2.2.path}/CMSIS/Device/ATMEL/"
7474
compiler.arm.cmsis.ldflags="-L{runtime.tools.CMSIS-5.4.0.path}/CMSIS/Lib/GCC/" -larm_cortexM0l_math
7575

7676
compiler.libraries.ldflags=

0 commit comments

Comments
 (0)