cancel
Showing results for 
Search instead for 
Did you mean: 

C23 support

CTapp.1
Senior II

Are there any plans to upgrade STM32CubeIDE to include support for C23?

It would be nice to have as it brings things like constexpr in, which makes the use of constants much better as they are subject to compiler checking and can call (constexpr) functions.

1 ACCEPTED SOLUTION

Accepted Solutions
Semer CHERNI
ST Employee

Hello @CTapp.1 

First let me thank you for posting and sorry for the late reply.

The C+23 features are available from the GCC 13 which is not supported via STM32CubeIDE.
The request is raised internally for further analysis.

KR,
Semer.

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

View solution in original post

5 REPLIES 5
Semer CHERNI
ST Employee

Hello @CTapp.1 

First let me thank you for posting and sorry for the late reply.

The C+23 features are available from the GCC 13 which is not supported via STM32CubeIDE.
The request is raised internally for further analysis.

KR,
Semer.

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

alt
Associate

Would be really nice to have at least GNU extensions for C23 (`-std=gnu2x`).

Code like so: `int x = 0b00010000` or so: `int x = {}` produces warnings with `-Wpedantic` options, which is less than ideal, given that this is valid C and compiler recognize it and compiles just fine.

I believe the only bit missing here is the compiler flag set. If i add this flag in "Miscellaneous" then code compiles without warnings.

But the best would be indeed to have proper GCC13, GCC14 or even GCC15, and IMO would be also great to have C++23 support even if it is yet incomplete.

@alt Before C23 syntax 0b.... is a GNU extension. So compile with -std=gnu*** .

I'm just saying that it would be good to have GNU's C2X available in settings

Right now the top available C revisions are ISO C18 and GNU18, i need to set `-std=gnu2x` manually in "Miscellaneous" and unset C revision in "General" to "GCC default".

This is not a very obvious way to do that, GNU2X would be more obvious way to select the latest C revision available, given that compiler provided with toolchain support it anyway, and there are other GNU extension in the list as well, but not the GNU2X.

A toolchain with GCC 14.3 is already available and it supports -std:c23 though some features are not implemented yet (bitints ...) 

https://developer.arm.com/downloads/-/arm-gnu-toolchain-downloads

You can install it into CubeIDE with the Toolchain manager. Specify custom compiler options if CubeIDE GUI does not know about C23.