2025-10-20 2:28 AM
The STM32 toolchain based on gcc 13.3 already supports a lot of C23 features, e.g. constexpr. This is really awesome.
But the current version of CubeIDE seems not to be able yet to parse these new features, so syntax checking / highlighting / code linking breaks.
Is there any simple workaround for this? Or is there information available, whether the next version of CubeIDE will update this?
2025-10-20 2:47 AM
@A.D. wrote:But the current version of CubeIDE seems not to be able yet to parse these new features, so syntax checking / highlighting / code linking breaks.
Indeed, the syntax highlighting in the editor is performed by CubeIDE (ie, Eclipse) - not the toolchain - so doesn't (yet) support C23:
See this recent thread: Defining enum type compiles ok, but STM32CubeIDE flags syntax error.
But that shouldn't affect linking.
Please give more details of the link issues you're seeing?
@A.D. wrote:Is there any simple workaround for this?
Does this help ?
@A.D. wrote:Or is there information available, whether the next version of CubeIDE will update this?
As noted in that other thread, it's an Eclipse issue rather than specifically CubeIDE - so I guess Eclipse fora would be the place to find such info?
2025-10-20 4:04 AM
@Andrew Neil wrote:
But that shouldn't affect linking.
Please give more details of the link issues you're seeing?
Yes you are right, it was a wrong formulation used by me: Not actual code linking is breaking but the feature of the IDE to link a variable or constant to the place of definition by ctrl + mouse click.
The other thread you linked (no pun intended) describes exactly the same situation. As CubeIDE is based on Eclipse, I figured some ST member might already know if the next CubeIDE version will use a newer Eclipse build with C23 support in the language server.
2026-04-14 9:49 AM - edited 2026-04-14 9:57 AM
Hello,
FYI,
Starting from CubeIDE 2.1.0 version, you could use C23 by following these steps:
1- right click on the project > Properties > C/C++ Build > Settings > MCU/MPU GCC Compiler > Miscellaneous > Add a new flag "-std=gnu23"
2- click on "C/C++ Build > Settings > MCU/MPU GCC Compiler > General > select "GCC Default" in the "language standard" combo list
3- Apply and close the Settings dialog
4- Clean and build the project
2026-04-14 9:55 AM - edited 2026-04-14 9:55 AM
constexpr is in C+11.
STM32CubeIDE highlights it correctly by default, provided it's in a C++ source file.
2026-04-14 11:21 PM
@mƎALLEm Hey thanks for the heads up. We tried that, but the IDE is still flagging lines with constexpr as syntax error (without further explanation of that error):
@TDK constexpr is also C23, and that until now is not supported by default. Since we don't use C++, the use of constexp is a little annoying in CubeIDE.
It's not that it is not compiling, that works without problems. It's simply the highlighting as a syntax error in the editor.