Skip to content
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

Cpp: Disable warnings for external project #3707

Merged
merged 1 commit into from
Jun 25, 2022

Conversation

Krzmbrzl
Copy link
Contributor

@Krzmbrzl Krzmbrzl commented May 9, 2022

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.

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 <[email protected]>
@parrt
Copy link
Member

parrt commented Jun 25, 2022

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.

@Krzmbrzl
Copy link
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants