arduino / arduino/ArduinoCore-samd
"LITTLE_ENDIAN" redefined
- Dominant language
- C
- Stars
- 502
- Forks
- 740
- PR merge metrics
- No merged PRs in 30d
Description
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
Contributor guide
No contributing guide indexed for this repository
Research direction
Reproduce the warning with the SAMD21 Arduino core and inspect how Arduino.h reaches samd21g18a.h, alongside the conflicting definition in machine/endian.h. Confirm whether the warning occurs for a minimal Arduino.h include, then determine whether the issue can be resolved without breaking either header; done means the affected build no longer reports the redefinition warning.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- embedded-iot
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100