-
Notifications
You must be signed in to change notification settings - Fork 2.1k
native: Explicitly opt in to GNUisms rather than setting std=gnu11 #18681
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
native: Explicitly opt in to GNUisms rather than setting std=gnu11 #18681
Conversation
This eases experimentation with newer standards, as setting std=c2x now works consistently across boards.
Some builds failed with
-- the defines have been removed. It's generally (according to feature_test_macros(7)) preferable to provide these defines at the command line rather than around individual includes, for any other preceding include might already have transitively included that same file without the defines around it, negating their effect. |
OK, I'm leaving this rabbit hole for now. Right now we have a wild mix of files that require -std=gnuxx, C files that set I think it would be prudent to
and then look at whether we really need to set anything but std=cxx on native in the first place. (and I think this is best restarted when FreeBSD and MacOS are testable in CI, otherwise this'll be a nightmare to test) |
Murdock results❌ FAILED f1dbc39 fixup! native: Explicitly opt in to GNUisms rather than setting std=gnu11 Build failures (21)
ArtifactsThis only reflects a subset of all builds from https://ci-prod.riot-os.org. Please refer to https://ci.riot-os.org for a complete build for now. |
Please squash at will an ping me when Murdock is happy. I will only need a quick look to ACK this. |
I think this eneavour would need a more systematic reboot, distinguishing where we have GNUisms inside compilation units (and how to set CFLAGS for these specifically), or whether any are part of our headers (ugh). This issue probably best serves as inspiration for where to find them, or as a starting point. I can't drive this to completion right now, anyone with the energy to continue this is welcome to take anything in here they deem usable. |
Native used to default to std=gnu11 rather than std=c11 like the rest of RIOT. This changes the makefiles to use the same std as other boards, and sets (and documents) the relevant defines to keep using the GNU features that native (esp. async_read; the rest would be POSIX only) needs.
This eases experimentation with newer standards, as setting std=c2x now works consistently across boards, for example as needed to test #18650.