Skip to content

src: add override to ThreadPool methods in zlib - #20769

Closed
danbev wants to merge 2 commits into
nodejs:masterfrom
danbev:zlib_compiler_warning
Closed

src: add override to ThreadPool methods in zlib#20769
danbev wants to merge 2 commits into
nodejs:masterfrom
danbev:zlib_compiler_warning

Conversation

@danbev

Copy link
Copy Markdown
Contributor

Currently the following compiler warnings are generated:

../src/node_zlib.cc:222:8:warning: 'DoThreadPoolWork' overrides a member function but is not marked 'override' [-Winconsistent-missing-override] void DoThreadPoolWork() { ^../src/node_internals.h:509:16: note: overridden virtual function is here virtual void DoThreadPoolWork() = 0; ^../src/node_zlib.cc:357:8: warning:'AfterThreadPoolWork' overrides a member function but is not marked 'override' [-Winconsistent-missing-override] void AfterThreadPoolWork(int status) { ^../src/node_internals.h:510:16:note: overridden virtual function is here virtual void AfterThreadPoolWork(int status) = 0; ^

This commit adds the override specifier to the methods to silence the
warnings.

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

Currently the following compiler warnings are generated:
../src/node_zlib.cc:222:8:
warning: 'DoThreadPoolWork' overrides a member function but is not marked
'override' [-Winconsistent-missing-override]
void DoThreadPoolWork() {
^
../src/node_internals.h:509:16: note: overridden virtual function is here
virtual void DoThreadPoolWork() = 0;
^
../src/node_zlib.cc:357:8: warning:
'AfterThreadPoolWork' overrides a member function but is not marked
'override' [-Winconsistent-missing-override]
void AfterThreadPoolWork(int status) {
^
../src/node_internals.h:510:16:
note: overridden virtual function is here
virtual void AfterThreadPoolWork(int status) = 0;
^
This commit adds the override specifier to the methods to silence the
warnings.
@nodejs-github-botnodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. zlib Issues and PRs related to the zlib subsystem. labels May 16, 2018
@danbev

Copy link
Copy Markdown
ContributorAuthor

@addaleaxaddaleax left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Not sure if my compiler just doesn’t display these or I’m overlooking them 🙃

@bnoordhuis

Copy link
Copy Markdown
Member

@addaleax You use gcc < 5? -Winconsistent-missing-override is a clang special. gcc calls it -Wsuggest-override and (I think) turns it on with -Wall.

@addaleax

Copy link
Copy Markdown
Member

7.2.0, actually. It does provide warnings when used with -Wsuggest-override, but that suggests override for other spots in the source too.

@danbevdanbev added the fast-track PRs that do not need to wait for 48 hours to land. label May 17, 2018
@danbev

Copy link
Copy Markdown
ContributorAuthor

Would it be alright to fast-track this issue?

@lpincalpinca added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label May 17, 2018
@danbev

Copy link
Copy Markdown
ContributorAuthor

Landed in 0419adc.

@danbevdanbev closed this May 18, 2018
@danbev
danbev deleted the zlib_compiler_warning branch May 18, 2018 05:13
danbev added a commit that referenced this pull request May 18, 2018
Currently the following compiler warnings are generated:
../src/node_zlib.cc:222:8:
warning: 'DoThreadPoolWork' overrides a member function but is not marked
'override' [-Winconsistent-missing-override]
void DoThreadPoolWork() {
^
../src/node_internals.h:509:16: note: overridden virtual function is here
virtual void DoThreadPoolWork() = 0;
^
../src/node_zlib.cc:357:8: warning:
'AfterThreadPoolWork' overrides a member function but is not marked
'override' [-Winconsistent-missing-override]
void AfterThreadPoolWork(int status) {
^
../src/node_internals.h:510:16:
note: overridden virtual function is here
virtual void AfterThreadPoolWork(int status) = 0;
^
This commit adds the override specifier to the methods to silence the
warnings.
PR-URL: #20769
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
MylesBorins pushed a commit that referenced this pull request May 22, 2018
Currently the following compiler warnings are generated:
../src/node_zlib.cc:222:8:
warning: 'DoThreadPoolWork' overrides a member function but is not marked
'override' [-Winconsistent-missing-override]
void DoThreadPoolWork() {
^
../src/node_internals.h:509:16: note: overridden virtual function is here
virtual void DoThreadPoolWork() = 0;
^
../src/node_zlib.cc:357:8: warning:
'AfterThreadPoolWork' overrides a member function but is not marked
'override' [-Winconsistent-missing-override]
void AfterThreadPoolWork(int status) {
^
../src/node_internals.h:510:16:
note: overridden virtual function is here
virtual void AfterThreadPoolWork(int status) = 0;
^
This commit adds the override specifier to the methods to silence the
warnings.
PR-URL: #20769
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
@addaleaxaddaleax mentioned this pull request May 22, 2018
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author readyPRs 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++.fast-trackPRs that do not need to wait for 48 hours to land.zlibIssues and PRs related to the zlib subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants

@danbev@bnoordhuis@addaleax@jasnell@cjihrig@joyeecheung@lpinca@nodejs-github-bot