c++17

Status
Not open for further replies.
Found this: gcc.gnu.org/projects/cxx-status.html#cxx17
C++17 Support in GCC
GCC has almost full support for the latest revision of the C++ standard, which was published in 2017. Some library features are missing or incomplete, as described in the library documentation.
C++17 features are available as part of "mainline" GCC in the trunk of GCC's repository and in GCC 5 and later. To enable C++17 support, add the command-line parameter -std=c++17 to your g++ command line. Or, to enable GNU extensions in addition to C++17 features, add -std=gnu++17.

As far as Teensy ggc version - this was just posted:
The ARM compiler shipped with Arduino 1.8.10 is version 5.4.1 which was released in June 2016. The AVR compiler is 7.3.0 which was released in January 2018. The current GCC compiler is 9.2.0 which was released in August 2019. GCC 10 will likely be released in a couple of months (we are currently at stage3 of development). As GCC 10 comes out, the GCC 7.x branch will be frozen (GCC 5.x was frozen much earlier).
 
Today we use C++14, and probably will stay with it for at least another year.

We're probably due for a toolchain upgrade "soon". But that's not going to happen while we're in the middle of so much activity on the code lib and porting libs and adding new features to Teensy 4.
 
Thanks, appreciated. I understand and fully respect the need to trade off "stable" vs "the latest".
I have quite some code which takes advantage of C++17 language features. But hey, just askin'

Update - with PlatformIO, this switches to version 7.2.1:

* add the line "platform_packages = toolchain-gccarmnoneeabi" to platformio.ini to switch compilers in a project
* unfortunately, this leads to "cannot find -larm_cortexM7lfsp_math", which I worked around using this:

Code:
cd $HOME/.platformio/toolchain/gccarmnoneeabi/arm-none-eabi/lib/
ln -s ../../../toolchain-gccarmnoneeabi@1.50401.190816/arm-none-eabi/lib/libarm_cortexM7lfsp_math.a

It's a kludge, but it's a way to try things out and see how it goes ...
 
Last edited:
...
It's a kludge, but it's a way to try things out and see how it goes ...

Have seen other notes about swapping in alternate newer toolchain - maybe one on the linked thread - differs with platformIO .vs. Arduino building. And yes last one read said some files need to be pulled over the updated chain as you found.

Times are also tough supporting/extending new hardware and the state of things with limits on in person work and ripples of parts availability/scarcity - and also the dev issues noted in linked thread are non-trivial made harder with limited dev time. The TD 1.54 update came with significant changes that took time and tweaks on a stable known system.
 
* unfortunately, this leads to "cannot find -larm_cortexM7lfsp_math", which I worked around using this:

Code:
cd $HOME/.platformio/toolchain/gccarmnoneeabi/arm-none-eabi/lib/
ln -s ../../../toolchain-gccarmnoneeabi@1.50401.190816/arm-none-eabi/lib/libarm_cortexM7lfsp_math.a

It's a kludge, but it's a way to try things out and see how it goes ...

A much cleaner way is to include this the [env] section of your platformio.ini.

Code:
build_unflags= -larm_cortexM4lf_math

or -larm_cortexM7lfsp_math as the case may be depending on which cpu you are targetting
 
Last edited:
Status
Not open for further replies.
Back
Top