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

build: add build option suppress_all_error_on_warn #56647

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mhdawson
Copy link
Member

Add an option to suppress cases where warnings are on by default

Add an option to suppress cases where warnings are on by
default

Signed-off-by: Michael Dawson <[email protected]>
@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/gyp

@nodejs-github-bot nodejs-github-bot added build Issues and PRs related to build files or the CI. needs-ci PRs that need a full CI run. labels Jan 17, 2025
@mhdawson
Copy link
Member Author

Address comments in #56615 (comment) that there should be a way to opt out of all cases where Warnings are turned into errors.

I looked at the history to see if there was any discussion in Werror=unused-result was added
and I did not find anything specific to that option being added.

Given that the existing configuration option --error_on_warn would have already caught the unused-result if it was turned on, my assumption is that the desired behaviour was that -Werror=unused-result, be on by default and if you used the --error-on-warn configuration that would turn on/off additiona validation.

I agree we should make it possible to turn off all instances where warnings are turned into errors, and that is added in this PR.

The alternative would be to remove the -Werror=unused-result definition and have no enforcement by default but I don't think that meets the original intent. It is not possible to use the existing flag to get the existing behaviour and provide a way to disable all cases where warnings are turned into errors.

@mhdawson
Copy link
Member Author

@khardix, @jackorp FYI

@bnoordhuis
Copy link
Member

I think you or the reporter misunderstands what that flag does. An unused result warning is a bug. It's not harmless. Disabling the build error makes no sense at all. Fix the error instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Issues and PRs related to build files or the CI. needs-ci PRs that need a full CI run.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants