RTEMS | RTEMS Build Does Not Specify C Language Version (#5327)
Joel Sherrill (@joel)
gitlab at rtems.org
Sun Aug 31 16:30:11 UTC 2025
Joel Sherrill created an issue: https://gitlab.rtems.org/rtems/rtos/rtems/-/issues/5327
Assignee: Joel Sherrill
## Summary
RTEMS builds do not use the -std= compiler option except for a few specific cases shown below. Because of this builds are done using the default C language version for the GCC version in use.
```
rtems]$ grep -r std= spec/
spec/build/cpukit/librtemscxx.yml:- -std=c++17
spec/build/testsuites/libtests/rcxx01.yml:- -std=c++17
spec/build/testsuites/sptests/spcxx01.yml:- -std=gnu++17
spec/build/testsuites/sptests/spstdc17.yml:- -std=c17
```
I was looking into this because the published POSIX Issue 8 is based on C17, not C11 as drafts were.
- GCC 13 defaults to C17.
- GCC 15 defaults to C23.
The autoconf build system did not specify the C Language version either.
I really believe that we should have been specifying this all along but somehow this got missed.
I have been building with both versions and we can build with either language version with -Werror. We just need to make a decision which we want to build against and add this option to the RTEMS compiler flags.
I don't particular have a preference for C17 or C23 for 7. But if we change 6 to specify the version, it should be C17 so we are not changing released behavior.
### Pre-set options
--
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/issues/5327
You're receiving this email because of your account on gitlab.rtems.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/bugs/attachments/20250831/47bf0634/attachment-0001.htm>
More information about the bugs
mailing list