C++17 revisited

Compiling Mbed-os with gcc and C++ >14 is working fine. With ARMC6 in Mbed Studio, I get some errors that I cannot resolve when changing “-std=c++17”, e.g. ./mbed-os/platform/cxxsupport\mstd_mutex:309:12: error: no member named 'scoped_lock' in namespace 'std'
The bunch of warnings can be ommitted by adding "-Wno-deprecated-volatile"to the compiler profiles.
I have checked als the documentation, it says the clib does not include C11 additions. I want to use aligned_alloc() wich is useful for M7 cache handling, but it looks that the compiler is behind the standards.
Its bad that Mbed as C++ OS is not at least at C++17 standard.

Hello @JojoS ,

It seems you probably need to specify the thread supporting version of the standard library. Please specify in your command line:
-D_ARM_LIBCPP_EXTERNAL_THREADS -Wl,--stdlib=threaded_libc++ --std=c++17

Please see the following AC6 docs for more info:
Support for this is ALPHA quality.

We can confirm, that aligned_alloc() is not implemented.

Kind regards,
Aleksandra - Studio team

1 Like

thanks for your fast reply, I will try it.

the same question. How to edit the release.json like below:
“ARMC6”: {
“common”: [“-c”, “–target=arm-arm-none-eabi”, “-mthumb”, “-Oz”,
“-Wno-armcc-pragma-push-pop”, “-Wno-armcc-pragma-anon-unions”,
“-Wno-reserved-user-defined-literal”, “-Wno-deprecated-register”,
“-DMULADDC_CANNOT_USE_R7”, “-fdata-sections”,
“-fno-exceptions”, “-MMD”, “-fshort-enums”, “-fshort-wchar”,
“asm”: ,
“c”: [“-D__ASSERT_MSG”, “-std=gnu11”],
“cxx”: [“-fno-rtti”, “-fno-c+±static-destructors”, “-std=gnu++14”],
“ld”: [“–show_full_path”, “–legacyalign”, “–inline”, “–any_contingency”,