0

I'm using GNU Arm Embedded Toolchain 10-2020-q4-major (arm-none-eabi-* 10.2.1) and I would like to take advantage of modern c++ features.

So I'm trying to find out which c++ features (language core features as well as libstdc++ features) are available with this particular toolchain. I read through this matrix https://gcc.gnu.org/projects/cxx-status.html, and they don't seem to distinguish between different compiler ports.

How could I find if I could use C++17 or C++20 features for example ?

Regards, Hugo

Hugo S
  • 11
  • 4

1 Answers1

1

As you can see on the gcc.gnu site you listed, all of the C++17 and C++20 features are listed. The "Available in GCC?" specifies which version of the GCC compiler is required to have a given feature available. It is essentially not your toolchain, but the compiler (as part of that tool chain) that defines your feature set.

In your given case, that you are using a GCC compiler for arm-non-eabi architecture, does not change this feature set, the version of the compiler does. So, with your arm-non-eabi-g++-10.2.1 you should have all the features for that compiler version available.

MathiasJ
  • 71
  • 7
  • 1
    What about RTTI, exceptions, dynamic initialization of globals? Some core language features need support from some runtime, which isn't always available on embedded systems. For the standard library, some functionality even _cannot_ be provided, like filesystem access (if there's no filesystem...) – dyp Apr 26 '21 at 09:33
  • 1
    @dyp: Taking RTTI as an example, it requires a fairly small bit of code which is specific to GCC. That's not provided by the platform, so it should still work on embedded systems. Similarly, the platform does not need to know about exceptions, and GCC doesn't rely on it either. In particular, Í believe even MinGW ignores the Windows support for exceptions and just uses its own runtime. – MSalters Apr 26 '21 at 10:15
  • @dyb I think there is some misconceptions here, between what is available in the language on the compiler, and what will work "out of the box". Take iostream, you can use this and map it to say a UART, by implementing the _write and _read functions. See https://alex-robenko.gitbook.io/bare_metal_cpp/peripherals/uart#writing-to-uart – MathiasJ Apr 26 '21 at 10:43