Cpp: Disable warnings for external project#3707
Merged
Conversation
When adding ANTLR as an external project, the downstream users will (generally) not be interested in compiler warnings emitted for ANTLR itself, as they won't be able to do anything about them anyway (in their project). Thus, this commit adds a new cmake option DISABLE_WARNINGS that can be used to suppress compiler warnings. This flag is then subsequently set whenever ANTLR is used as an ExternalProject. Signed-off-by: Robert Adam <dev@robert-adam.de>
Member
|
It seems kind of dangerous to disable warnings. I don't understand the build file enough to know and what circumstances they would be turned off. |
Contributor
Author
|
It's not dangerous at all. The warnings are only turned off if someone uses ANTLR as an external project - aka as a 3rdparty dependency. In these cases having warnings for ANTLR base code does not gain anything as the respective developers won't be able to maintain the ANTLR code itself. Therefore any warning emitted there is not really actionable anyway. Warnings will still be shown when compiling ANTLR for ANTLR's sake - aka when working on ANTLR itself. Thus, actual ANTLR developers will still continue to see warnings as usual. |
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.
When adding ANTLR as an external project, the downstream users will
(generally) not be interested in compiler warnings emitted for ANTLR
itself, as they won't be able to do anything about them anyway (in their
project).
Thus, this commit adds a new cmake option DISABLE_WARNINGS that can be
used to suppress compiler warnings. This flag is then subsequently set
whenever ANTLR is used as an ExternalProject.