Support the -std=<standard> command-line option#456
Merged
xavierleroy merged 6 commits intomasterfrom Sep 23, 2022
Merged
Conversation
Activation and deactivation of a given warning, plus set-as-error and remove-as-error.
…rg>` Also: use `int_of_string_opt` instead of `int_of_string` for slightly cleaner code.
bschommer
reviewed
Sep 21, 2022
It has two effects:
- With a GNU toolchain, it's passed down to the preprocessor.
This influences the contents of standard includes.
- It determines the default effect of the "C11 feature" warning:
-std=c99: warn on the use of C11 features
-std=c11 or -std=c18: don't warn
For backward compatiblity, the default, if no `-std` option is given,
is to not warn, but to pass `-std=c99` to the preprocessor.
Co-authored-by: Bernhard Schommer <bschommer@users.noreply.github.com>
The correct -std option is now added by ccomp itself.
Just like in the other test/ directories.
c84a6e4 to
a595d45
Compare
xavierleroy
added a commit
that referenced
this pull request
Sep 23, 2022
It has two effects:
- With a GNU toolchain, it's passed down to the preprocessor.
This influences the contents of standard includes.
- It determines the default effect of the "C11 feature" warning:
-std=c99: warn on the use of C11 features
-std=c11 or -std=c18: don't warn
For backward compatiblity, the default, if no `-std` option is given,
is to not warn, but to pass `-std=c99` to the preprocessor.
Co-authored-by: Bernhard Schommer <bschommer@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds a
-stdcommand-line option similar to those of GCC and Clang.Currently three values are supported:
-std=c99,-std=c11and-std=c18.The option has two effects:
-std=c99, CompCert warns on the use of C11 features; with-std=c11or-std=c18, no warnings are emitted.For backward compatibility with CompCert's current behavior, if no
-stdoption is given, the default is to not warn, but-std=c99is passed to the preprocessor. This may change in the future, when C11 will become the default instead of C99.