3 ms·
Arduino boards (the ones based on AVR chips) use the GCC C++ compiler adapted for the AVR. The current IDE version 1.8.10 uses avr-gcc-7.3.0 (https://github.com
by bxparks 7y ago
Arduino boards (the ones based on AVR chips) use the GCC C++ compiler adapted for the AVR. The current IDE version 1.8.10 uses avr-gcc-7.3.0 (https://github.com/arduino/Arduino/blob/master/hardware/package_index_bundled.json https://github.com/arduino/Arduino/blob/master/hardware/pack...). The previous IDE version 1.8.9 used avr-gcc-5.4.0.
The compiler is configured to follow the -std=gnu++11 variant. Here are the flags:
https://github.com/arduino/ArduinoCore-avr/blob/master/platform.txt https://github.com/arduino/ArduinoCore-avr/blob/master/platf...
If you use other Arduino-compatible boards (e.g. ARM chips, ESP8266 or ESP32), they will use a different C++ compiler and different settings. See for example:
* SAMD uses 'arm-none-eabi-g++' (https://github.com/arduino/ArduinoCore-sam/blob/master/platform.txt https://github.com/arduino/ArduinoCore-sam/blob/master/platf...)
* ESP8266 uses xtensa-lx106-elf-gcc (https://github.com/arduino/esp8266/blob/master/platform.txt https://github.com/arduino/esp8266/blob/master/platform.txt)
* ESP32 uses xtensa-esp32-elf-gcc (https://github.com/espressif/arduino-esp32/blob/master/platform.txt https://github.com/espressif/arduino-esp32/blob/master/platf...)
So Arduino programming is "just" C++ with additional libraries and an IDE. Though I wrote "just" in quotes because they've done a lot of work to make things easier and approachable for beginners, so I don't want to diminish their work.
- klingonopera 7y agoThanks, looks like there's an -mmcu flag that gets passed to the compiler as well, telling it what chip the code is intended for. I think the answers I'm looking for are buried in those specifications. Gotta check them out, one of these days... > So Arduino programming is "just" C++ with additional libraries and an IDE. Considering that flag, I think it's something more (or less) than just plain C++...