This is an archive of the discontinued LLVM Phabricator instance.

Add -std=c17 as a flag
ClosedPublic

Authored by aaron.ballman on Nov 19 2017, 9:18 AM.

Details

Reviewers
rsmith
Summary

GCC currently supports the flags -std=c17, -std=gnu17, and -std=iso9899:2017, with the only functional difference with C11 being the value of STDC_VERSION. These flags are documented at: https://gcc.gnu.org/onlinedocs/gcc/Standards.html

This patch adds these flags and updates STDC_VERSION based on the C17 FDIS. Note that C17 is going out for balloting in December. I spoke with the GCC maintainer for the flags about what they will do when C17 is published in 2018 and their plan is to add c18, iso9899:2018, and gnu18. I will add the additional flags to Clang when the C17 ballot succeeds.

Diff Detail

Event Timeline

aaron.ballman created this revision.Nov 19 2017, 9:18 AM

Rebased on ToT and given more context.

Rebased on ToT and given more context.

Ping. I'd like to get this in before the 6.0 branch.

rsmith accepted this revision.Dec 7 2017, 12:43 PM

LGTM, makes sense to add this for GCC compatibility even if the standard ends up being called C18.

This revision is now accepted and ready to land.Dec 7 2017, 12:43 PM
aaron.ballman closed this revision.Dec 7 2017, 1:47 PM

Commit in r320089.