arduino / ArduinoCore-samd

Arduino Core for SAMD21 CPU
GNU Lesser General Public License v2.1
472 stars 720 forks source link

"LITTLE_ENDIAN" redefined #540

Open FedeBev opened 4 years ago

FedeBev commented 4 years ago

Hi there, I hope this is the right place to submit this issue, in case it is not, I apologize

Compiling library RTCZero I get the following warning

Compiling library "RTCZero"
/home/.../snap/arduino/41/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/bin/arm-none-eabi-g++ -mcpu=cortex-m0plus -mthumb -c -g -Os -Wall -Wextra -Wno-expansion-to-defined -std=gnu++11 -ffunction-sections -fdata-sections -fno-threadsafe-statics -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -MMD -DF_CPU=48000000L -DARDUINO=10813 -DARDUINO_SAMD_MKRWIFI1010 -DARDUINO_ARCH_SAMD -DUSE_ARDUINO_MKR_PIN_LAYOUT -D__SAMD21G18A__ -DUSB_VID=0x2341 -DUSB_PID=0x8054 -DUSBCON "-DUSB_MANUFACTURER=\"Arduino LLC\"" "-DUSB_PRODUCT=\"Arduino MKR WiFi 1010\"" -DUSE_BQ24195L_PMIC -I/home/.../snap/arduino/41/.arduino15/packages/arduino/tools/CMSIS/4.5.0/CMSIS/Include/ -I/home/.../snap/arduino/41/.arduino15/packages/arduino/tools/CMSIS-Atmel/1.2.0/CMSIS/Device/ATMEL/ -I/home/.../snap/arduino/41/.arduino15/packages/arduino/hardware/samd/1.8.6/cores/arduino -I/home/.../snap/arduino/41/.arduino15/packages/arduino/hardware/samd/1.8.6/variants/mkrwifi1010 -I/home/.../snap/arduino/current/Arduino/libraries/TaskScheduler/src -I/home/.../snap/arduino/current/Arduino/libraries/WiFiNINA/src -I/home/.../snap/arduino/current/Arduino/libraries/RTCZero/src -I/home/.../snap/arduino/current/Arduino/libraries/StreamUtils/src -I/home/.../snap/arduino/41/.arduino15/packages/arduino/hardware/samd/1.8.6/libraries/SPI /home/.../snap/arduino/current/Arduino/libraries/RTCZero/src/RTCZero.cpp -o /tmp/arduino_build_827430/libraries/RTCZero/RTCZero.cpp.o
In file included from /home/.../snap/arduino/41/.arduino15/packages/arduino/tools/CMSIS-Atmel/1.2.0/CMSIS/Device/ATMEL/samd21/include/samd21.h:69:0,
                 from /home/.../snap/arduino/41/.arduino15/packages/arduino/tools/CMSIS-Atmel/1.2.0/CMSIS/Device/ATMEL/samd.h:105,
                 from /home/.../snap/arduino/41/.arduino15/packages/arduino/tools/CMSIS-Atmel/1.2.0/CMSIS/Device/ATMEL/sam.h:540,
                 from /home/.../snap/arduino/41/.arduino15/packages/arduino/hardware/samd/1.8.6/cores/arduino/Arduino.h:48,
                 from /home/.../snap/arduino/current/Arduino/libraries/RTCZero/src/RTCZero.h:23,
                 from /home/.../snap/arduino/current/Arduino/libraries/RTCZero/src/RTCZero.cpp:22:
/home/.../snap/arduino/41/.arduino15/packages/arduino/tools/CMSIS-Atmel/1.2.0/CMSIS/Device/ATMEL/samd21/include/samd21g18a.h:226:0: warning: "LITTLE_ENDIAN" redefined
 #define LITTLE_ENDIAN          1

In file included from /home/.../snap/arduino/41/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/arm-none-eabi/include/sys/types.h:67:0,
                 from /home/.../snap/arduino/41/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/arm-none-eabi/include/time.h:28,
                 from /home/.../snap/arduino/current/Arduino/libraries/RTCZero/src/RTCZero.cpp:20:
/home/.../snap/arduino/41/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/arm-none-eabi/include/machine/endian.h:17:0: note: this is the location of the previous definition
 #define LITTLE_ENDIAN _LITTLE_ENDIAN

I guess the problem is not with The RTCZero lib, but every time Arduino.h is included

Environment

OS: ubuntu 18.04 Arduinio IDE: 1.8.13 Board: mkr 1010

kpfleming commented 4 years ago

Yep, this happens with other libraries too. The CMSIS code should not be defining LITTLE_ENDIAN (or anything similar).