Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 10 of 10

Thread: c++17

  1. #1

    c++17

    Hi,

    Will the teensy platform support c++17? (from within the Arduino ide)

  2. #2
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    14,859
    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:
    Quote Originally Posted by MichaelMeissner View Post
    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).

  3. #3
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    24,775
    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.

  4. #4
    thank you!

  5. #5
    Member
    Join Date
    Jan 2013
    Posts
    29
    Is C++17 on the roadmap? (I noticed that Teensy 4 is still using 5.4.1)

  6. #6
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    14,859
    latest comment on toolchain update was here : pjrc.com/threads/66738-to_string()-doesn-t-work

    Then commentary on the value/risks 3 posts later ...

  7. #7
    Member
    Join Date
    Jan 2013
    Posts
    29
    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 by jcw; 07-28-2021 at 10:40 PM.

  8. #8
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    14,859
    Quote Originally Posted by jcw View Post
    ...
    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.

  9. #9
    Member
    Join Date
    Aug 2018
    Location
    Brisbane, Australia
    Posts
    66
    Quote Originally Posted by jcw View Post
    * 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 by thebigg; 07-29-2021 at 02:32 AM. Reason: add extra info about library name

  10. #10
    Member
    Join Date
    Jan 2013
    Posts
    29
    Indeed, thanks!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •