ArduinoCore-mbed icon indicating copy to clipboard operation
ArduinoCore-mbed copied to clipboard

Switch to gnu++17 for GIGA

Open SuMere opened this issue 1 year ago • 2 comments

Temporary support for g++17 for GIGA

SuMere avatar Oct 08 '24 08:10 SuMere

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Oct 08 '24 08:10 CLAassistant

I'm simply altering the files that came with the latest arduino IDE so hopefully I'm not off base here but I made the Arduino.h change but I'm still having issues with PI in Common.h

/Users/xnor/Library/Arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/bin/arm-none-eabi-g++ -c -w -g3 -nostdlib @/Users/xnor/Library/Arduino15/packages/arduino/hardware/mbed_giga/4.1.5/variants/GIGA/defines.txt @/Users/xnor/Library/Arduino15/packages/arduino/hardware/mbed_giga/4.1.5/variants/GIGA/cxxflags.txt -MMD -mcpu=cortex-m7 -mfloat-abi=softfp -mfpu=fpv5-d16 -DARDUINO=10607 -DARDUINO_GIGA -DARDUINO_ARCH_MBED_GIGA -DARDUINO_ARCH_MBED -DARDUINO_LIBRARY_DISCOVERY_PHASE=0 -I/Users/xnor/Library/Arduino15/packages/arduino/hardware/mbed_giga/4.1.5/cores/arduino -I/Users/xnor/Library/Arduino15/packages/arduino/hardware/mbed_giga/4.1.5/variants/GIGA -I/Users/xnor/Documents/Arduino/libraries/Arduino_AdvancedAnalog/src -I/Users/xnor/Documents/Arduino/libraries/rnbo/src -DCM4_BINARY_START=0x60000000 -DCM4_BINARY_END=0x60040000 -DCM4_RAM_END=0x60080000 -std=gnu++17 -I/Users/xnor/Library/Arduino15/packages/arduino/hardware/mbed_giga/4.1.5/cores/arduino/api/deprecated -I/Users/xnor/Library/Arduino15/packages/arduino/hardware/mbed_giga/4.1.5/cores/arduino/api/deprecated-avr-comp -iprefix/Users/xnor/Library/Arduino15/packages/arduino/hardware/mbed_giga/4.1.5/cores/arduino @/Users/xnor/Library/Arduino15/packages/arduino/hardware/mbed_giga/4.1.5/variants/GIGA/../GIGA/includes.txt /private/var/folders/8j/z_f6vtxs27s50txpq8q3p7w00000gn/T/arduino/sketches/4A4EB28BF770E6CAA54E6C29B3655FEB/sketch/sketch_nov5a.ino.cpp -o /private/var/folders/8j/z_f6vtxs27s50txpq8q3p7w00000gn/T/arduino/sketches/4A4EB28BF770E6CAA54E6C29B3655FEB/sketch/sketch_nov5a.ino.cpp.o
In file included from /Users/xnor/Library/Arduino15/packages/arduino/hardware/mbed_giga/4.1.5/variants/GIGA/pinmode_arduino.h:30:0,
                 from /Users/xnor/Library/Arduino15/packages/arduino/hardware/mbed_giga/4.1.5/cores/arduino/Arduino.h:26,
                 from /private/var/folders/8j/z_f6vtxs27s50txpq8q3p7w00000gn/T/arduino/sketches/4A4EB28BF770E6CAA54E6C29B3655FEB/sketch/sketch_nov5a.ino.cpp:1:
/Users/xnor/Library/Arduino15/packages/arduino/hardware/mbed_giga/4.1.5/cores/arduino/api/Common.h:51:21: error: expected unqualified-id before numeric constant
 #define PI          3.1415926535897932384626433832795
                     ^
/Users/xnor/Library/Arduino15/packages/arduino/hardware/mbed_giga/4.1.5/cores/arduino/api/Common.h:51:21: note: in definition of macro 'PI'
 #define PI          3.1415926535897932384626433832795
                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

adding that same ifdef around the #define PI line resolves it

#if __cplusplus < 201703L
#define PI          3.1415926535897932384626433832795
#endif

x37v avatar Nov 05 '24 23:11 x37v