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

src: fix warn_unused_result compiler warning #32241

Merged
merged 1 commit into from
Mar 15, 2020
Merged

Conversation

cjihrig
Copy link
Contributor

@cjihrig cjihrig commented Mar 13, 2020

../src/node_file.cc:386:7: warning: ignoring return value of function declared with 'warn_unused_result' attribute [-Wunused-result]

Refs: #31972

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. fs Issues and PRs related to the fs subsystem / file system. labels Mar 13, 2020
@sam-github
Copy link
Contributor

I wonder if we could add tests for this kind of thing. Maybe we are running into a gyp limitation, -Werror doesn't work for us, because the deps spew warnings. Is it possible to cause just the src/ files, node's src, to fail on warning? Or... maybe that won't work because of v8 warnings.

src/node_file.cc Outdated Show resolved Hide resolved
@addaleax
Copy link
Member

@sam-github One problem with -Werror for the src/ tree might be that it could fail on some compiler versions and not others :/

@sam-github
Copy link
Contributor

It could, but then we would see, and fix it, as opposed to people later noticing and there being a stream (ok, continuous trickle?) of PRs to fix the warnings. I don't think we've a situation where there is a warning that can't be fixed across gcc* and clang*. I have in the past worked on multi-platform code where it wasn't possible to make code that satisfied all our compilers simultaneously, but I think clang and gcc are under some kind of social or technical pressure to not diverge like that.

@addaleax addaleax added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Mar 13, 2020
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

nodejs-github-bot commented Mar 13, 2020

../src/node_file.cc:386:7: warning: ignoring return value of
function declared with 'warn_unused_result'
attribute [-Wunused-result]

PR-URL: nodejs#32241
Refs: nodejs#31972
Reviewed-By: Sam Roberts <[email protected]>
Reviewed-By: David Carlier <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
@cjihrig cjihrig merged commit 8617508 into nodejs:master Mar 15, 2020
@cjihrig cjihrig deleted the warning branch March 15, 2020 13:51
BridgeAR pushed a commit that referenced this pull request Mar 17, 2020
../src/node_file.cc:386:7: warning: ignoring return value of
function declared with 'warn_unused_result'
attribute [-Wunused-result]

PR-URL: #32241
Refs: #31972
Reviewed-By: Sam Roberts <[email protected]>
Reviewed-By: David Carlier <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
@MylesBorins MylesBorins mentioned this pull request Mar 19, 2020
MylesBorins pushed a commit that referenced this pull request Mar 24, 2020
../src/node_file.cc:386:7: warning: ignoring return value of
function declared with 'warn_unused_result'
attribute [-Wunused-result]

PR-URL: #32241
Refs: #31972
Reviewed-By: Sam Roberts <[email protected]>
Reviewed-By: David Carlier <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
targos pushed a commit that referenced this pull request Apr 22, 2020
../src/node_file.cc:386:7: warning: ignoring return value of
function declared with 'warn_unused_result'
attribute [-Wunused-result]

PR-URL: #32241
Refs: #31972
Reviewed-By: Sam Roberts <[email protected]>
Reviewed-By: David Carlier <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. c++ Issues and PRs that require attention from people who are familiar with C++. fs Issues and PRs related to the fs subsystem / file system.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants