Skip to content

Duplicate macro definitions (LITTLE_ENDIAN and SPI_HAS_TRANSACTION) #581

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
matthijskooijman opened this issue Dec 17, 2020 · 0 comments · Fixed by #583
Closed

Duplicate macro definitions (LITTLE_ENDIAN and SPI_HAS_TRANSACTION) #581

matthijskooijman opened this issue Dec 17, 2020 · 0 comments · Fixed by #583
Labels

Comments

@matthijskooijman
Copy link
Collaborator

While compiling, I see duplicate definitions for these two macros. These usually just raise a warning, so it's not essential but probably nice to fix anyway. Below output is from an arduino-cli compile with -Werror set (from CI build where I want to try and build as clean as possible), so these are not normally errors, I believe.

IIRC this build used to work, so I suspect that at least the SPI duplicate definitions was introduced by the -API integration in 1.8.10. IIRC I've seen the LITTLE_ENDIAN warning before, so maybe that one was already there but just exposed (to this particular test sketch) by the recent 1.8.10 release.

I don't have a small sketch ready to reproduce this, but I suspect a simple sketch that just includes SPI.h would do.

Using board 'arduino_zero_edbg' from platform in folder: /home/runner/.arduino15/packages/arduino/hardware/samd/1.8.10
Using core 'arduino' from platform in folder: /home/runner/.arduino15/packages/arduino/hardware/samd/1.8.10
In file included from /home/runner/.arduino15/packages/arduino/tools/CMSIS-Atmel/1.2.0/CMSIS/Device/ATMEL/samd21/include/samd21.h:69:0,
                 from /home/runner/.arduino15/packages/arduino/tools/CMSIS-Atmel/1.2.0/CMSIS/Device/ATMEL/samd.h:105,
                 from /home/runner/.arduino15/packages/arduino/hardware/samd/1.8.10/cores/arduino/Arduino.h:34,
                 from /tmp/arduino-sketch-ABF9B50E94FCEC00D5773118A2D4EAA2/sketch/basicmac-otaa.ino.cpp:1:
/home/runner/.arduino15/packages/arduino/tools/CMSIS-Atmel/1.2.0/CMSIS/Device/ATMEL/samd21/include/samd21g18a.h:226:0: error: "LITTLE_ENDIAN" redefined [-Werror]
 #define LITTLE_ENDIAN          1
 
In file included from /home/runner/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/arm-none-eabi/include/sys/types.h:67:0,
                 from /home/runner/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/arm-none-eabi/include/stdio.h:61,
                 from /home/runner/.arduino15/packages/arduino/hardware/samd/1.8.10/cores/arduino/api/Print.h:22,
                 from /home/runner/.arduino15/packages/arduino/hardware/samd/1.8.10/cores/arduino/api/ArduinoAPI.h:31,
                 from /home/runner/.arduino15/packages/arduino/hardware/samd/1.8.10/cores/arduino/Arduino.h:23,
                 from /tmp/arduino-sketch-ABF9B50E94FCEC00D5773118A2D4EAA2/sketch/basicmac-otaa.ino.cpp:1:
/home/runner/.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
In file included from /home/runner/work/basicmac/basicmac/BasicMacArduino/examples/basicmac-otaa/basicmac-otaa.ino:34:0:
/home/runner/.arduino15/packages/arduino/hardware/samd/1.8.10/libraries/SPI/SPI.h:31:0: error: "SPI_HAS_TRANSACTION" redefined [-Werror]
 #define SPI_HAS_TRANSACTION 1
 
In file included from /home/runner/.arduino15/packages/arduino/hardware/samd/1.8.10/libraries/SPI/SPI.h:24:0,
                 from /home/runner/work/basicmac/basicmac/BasicMacArduino/examples/basicmac-otaa/basicmac-otaa.ino:34:
/home/runner/.arduino15/packages/arduino/hardware/samd/1.8.10/cores/arduino/api/HardwareSPI.h:25:0: note: this is the location of the previous definition
 #define SPI_HAS_TRANSACTION
facchinm added a commit to facchinm/ArduinoCore-samd that referenced this issue Dec 18, 2020
@facchinm facchinm added the api label Dec 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants