This is an archive of the discontinued LLVM Phabricator instance.

[C2x] Support -std=c23 and -std=gnu23
ClosedPublic

Authored by aaron.ballman on Aug 10 2023, 5:17 AM.

Details

Summary

C2x was finalized at the June 2023 WG14 meeting. The DIS is out for balloting and the comment period for that closes later this year/early next year. While that does leave an opportunity for more changes to the standard during the DIS ballot resolution process, only editorial changes are anticipated and as a result, the C committee considers C2x to be final. The committee took a straw poll on what we'd prefer the informal name of the standard be, and we decided it should be called C23 regardless of what year ISO publishes it.

However, because the final publication is not out, this patch does not add the language standard alias for the -std=iso9899:<year> spelling of the standard mode; that will be added once ISO finally publishes the document and the year chosen will match the publication date.

This also changes the value of __STDC_VERSION__ from the placeholder value 202000L to the final value 202311L.

Subsequent patches will start renaming things from c2x to c23, cleaning up documentation, etc.

Diff Detail

Event Timeline

aaron.ballman created this revision.Aug 10 2023, 5:17 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 10 2023, 5:17 AM
aaron.ballman requested review of this revision.Aug 10 2023, 5:17 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptAug 10 2023, 5:17 AM

Options.td defines:
defvar c2x = LangOpts<"C2x">;

Does this need change as well?

UsersManual.rst also needs an update, but that can be another patch

Options.td defines:
defvar c2x = LangOpts<"C2x">;

Does this need change as well?

UsersManual.rst also needs an update, but that can be another patch

Both of those changes will happen separately as part of the C2x -> C23 cleanup. The Options.td one needs to change when I rename the LangOption field, and UsersManual.rst needs to change in several places as well (that could perhaps be done in this patch, but I figured it was best left to a follow-up).

cor3ntin accepted this revision.Aug 10 2023, 6:47 AM

Fair enough! the rest looked sensible to me :)

This revision is now accepted and ready to land.Aug 10 2023, 6:47 AM
This revision was landed with ongoing or failed builds.Aug 10 2023, 10:57 AM
This revision was automatically updated to reflect the committed changes.