FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

src: fix type mismatch warnings from missing priv by sam-github · Pull Request #24737 · nodejs/node · GitHub

/ node Public

src: fix type mismatch warnings from missing priv - #24737

Closed
sam-github wants to merge 2 commits into
nodejs:masterfrom
sam-github:src-warning-cleanup
Closed

src: fix type mismatch warnings from missing priv#24737
sam-github wants to merge 2 commits into
nodejs:masterfrom
sam-github:src-warning-cleanup

Conversation

Copy link
Copy Markdown
Contributor

Registration initialization functions are expected to have a 4th
argument, a void*, so add them where necessary to fix the warnings.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

Registration initialization functions are expected to have a 4th
argument, a void*, so add them where necessary to fix the warnings.

Copy link
Copy Markdown
Collaborator

nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. lib / src Issues and PRs involving general changes in the lib/ or src/ directories. labels Nov 30, 2018

addaleax 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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM, but I’m curious, how/where does this generate warnings? I’ve never seen any…

sam-github commented Nov 30, 2018
edited
Loading

Copy link
Copy Markdown
Contributor Author

I guess that's why nobody has fixed them, then. When I'm working in src/, I can't see errors or warnings in my code, they are lost behind these:

  g++ -o /home/sam/w/core/node/out/Release/obj.target/node_lib/src/tty_wrap.o ../src/tty_wrap.cc '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-DOPENSSL_T
HREADS' '-DNODE_ARCH="x64"' '-DNODE_PLATFORM="linux"' '-DNODE_WANT_INTERNALS=1' '-DV8_DEPRECATION_WARNINGS=1' '-DNODE_OPENSSL_SYSTEM_CERT_PATH=""' '-DHAVE_INSPECTOR=1' '-D__POSIX__' '-DNODE_USE_V8_PLATFORM=1' '-DNODE_HAVE_I18N_SUPPORT=1' '-DNODE_HAVE_SMALL_ICU=1' '-DHAVE_OPENSSL=1' '-DUCONFIG_NO_SERVICE=1' '-DU_ENABLE_DYLOAD=0' '-DU_STATIC_IMPLEMENTATION=1' '-DU_HAVE_STD_STRING=1' '-DUCONFIG_NO_BREAK_ITERATION=0' '-DHTTP_PARSER_STRICT=0' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-D_POSIX_C_SOURCE=200112' '-DNGHTTP2_STATICLIB' -I../src -I/home/sam/w/core/node/out/Release/obj/gen -I/home/sam/w/core/node/out/Release/obj/gen/include -I/home/sam/w/core/node/out/Release/obj/gen/src -I../deps/v8/include -I../deps/icu-small/source/i18n -I../deps/icu-small/source/common -I../deps/zlib -I../deps/http_parser -I../deps/cares/include -I../deps/uv/include -I../deps/nghttp2/lib/includes -I../deps/openssl/openssl/include  -pthread -Wall -Wextra -Wno-unused-parameter -m64 -Wall -Wextra -Wno-unused-parameter -O3 -fno-omit-frame-pointer -fno-rtti -fno-exceptions -std=gnu++1y -MMD -MF /home/sam/w/core/node/out/Release/.deps//home/sam/w/core/node/out/Release/obj.target/node_lib/src/tty_wrap.o.d.raw   -c
           In file included from ../src/async_wrap-inl.h:29,                                                                                                                             
                 from ../src/stream_base.h:7,                                                                                                                                                  from ../src/stream_wrap.h:27,                                                                                                                                                 
from ../src/tty_wrap.h:29,                                                                                                                                                    
from ../src/tty_wrap.cc:22:                                                                                                                                  
../src/node_internals.h:159:49: warning: cast between incompatible function types from ‘void (*)
(v8::Local<v8::Object>, v8::Local<v8::Value>, v8::Local<v8::Context>)’ to 
‘node::addon_context_register_func’ {aka ‘void (*)(v8::Local<v8::Object>, v8::Local<v8::Value>, 
v8::Local<v8::Context>, void*)’} [-Wcast-function-type]                                
(node::addon_context_register_func) (regfunc),                            \                                                                                                                                               ^                                                                                                                            
../src/node_internals.h:786:3: note: in expansion of macro ‘NODE_MODULE_CONTEXT_AWARE_CPP’                                                                                       
NODE_MODULE_CONTEXT_AWARE_CPP(modname, regfunc, nullptr, NM_F_INTERNAL)                                                                                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                                                                                                                              
../src/tty_wrap.cc:173:1: note: in expansion of macro 
‘NODE_MODULE_CONTEXT_AWARE_INTERNAL’                                                                                     
NODE_MODULE_CONTEXT_AWARE_INTERNAL(tty_wrap, node::TTYWrap::Initialize)
core/node (master u=) % g++ --version; uname -a
g++ (Ubuntu 8.2.0-7ubuntu1) 8.2.0
Linux samtu 4.18.0-11-generic #12-Ubuntu SMP Tue Oct 23 19:22:37 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

Copy link
Copy Markdown
Member

It might just be a GCC 8 thing then. :)

Copy link
Copy Markdown
Contributor Author
In file included from ../src/node.h:63,
                 from ../src/node_crypto.h:27,
                 from ../src/node_crypto_bio.h:27,
                 from ../src/node_crypto_bio.cc:22:
../deps/v8/include/v8.h: In instantiation of ‘void v8::PersistentBase<T>::SetWeak(P*, typename v8::WeakCallbackInfo<P>::Callback, v8::WeakCallbackType) [with P = node::BaseObject; T = v8::Object; typename v8::WeakCallbackInfo<P>::Callback = void (*)(const v8::WeakCallbackInfo<node::BaseObject>&)]’:
../src/base_object-inl.h:104:42:   required from here
../deps/v8/include/v8.h:9707:16: warning: cast between incompatible function types from ‘v8::WeakCallbackInfo<node::BaseObject>::Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<node::BaseObject>&)’} to ‘Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<void>&)’} [-Wcast-function-type]
                reinterpret_cast<Callback>(callback), type);
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

@addaleax What about the above, do you not see them, either? I see screen after screen of them. Its not clear to me how or even if they can be fixed.

Copy link
Copy Markdown
Member

@sam-github I don’t, no. I think we should maybe turn off this type of warning, or at least use pragmas to silence them? I’m not sure we could fix that one, either.

Copy link
Copy Markdown
Contributor Author

Copy link
Copy Markdown
Contributor Author

binary propogation failed on linux & arm: resumed the build

ci: https://ci.nodejs.org/job/node-test-pull-request/19096/

Trott commented Dec 2, 2018

Copy link
Copy Markdown
Member

Hmmm, let's try a full-on rebuild CI: https://ci.nodejs.org/job/node-test-pull-request/19126/

Trott added the author ready PRs with CI started, the required approvals, and no outstanding review comments. label Dec 2, 2018

Copy link
Copy Markdown
Contributor Author

Given that this makes no changes that anything other than the compiler should notice, I don't think these are related:

I'm not sure, can this land? @Trott do we absolutely require green in CI? I'll rekick the CI for now.

Copy link
Copy Markdown
Contributor Author

ci: https://ci.nodejs.org/job/node-test-pull-request/19157/ (rebuild of 19126)

Copy link
Copy Markdown
Contributor Author

Comment thread src/node_util.cc Outdated
}

static void GetPromiseDetails(const FunctionCallbackInfo<Value>& args) {
Environment* env = Environment::GetCurrent(args);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

@addaleax Is it possible this call and the similar one below had side-effects? Its suspicious that https://ci.nodejs.org/job/node-test-commit-linux/nodes=alpine-last-latest-x64/23666/testReport/junit/(root)/test/parallel_test_util_callbackify/ is happening regularly, and depends on promise behaviours.

addaleax Dec 3, 2018
edited
Loading

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

@sam-github No, that seems very unlikely – the only side effect I could possibly think of is allocating a Local<> under the hood (which leaks into the calling HandleScope), but since these are JS bindings, there’s always a HandleScope here, and V8 doesn’t generally rely on them being used in a specific way

Copy link
Copy Markdown
Contributor Author

Trott commented Dec 4, 2018

Copy link
Copy Markdown
Member

Rebuild Windows (only part that failed last time): https://ci.nodejs.org/job/node-test-commit-windows-fanned/22961/

Copy link
Copy Markdown
Contributor Author
15:49:04 c:\workspace\node-test-binary-windows>git fetch --no-tags binary_tmp@147.75.70.237:binary_tmp.git +refs/heads/jenkins-node-test-commit-windows-fanned-6e1503496847634a8b9ff0ed6f431f0d5c728a88-bin-win-vs2017:refs/remotes/jenkins_tmp 
15:49:05 error: refs/heads/jenkins-node-test-commit-arm-fanned-5db70cfafe955fd948736d77214b63cf10466286-binary-pi1p/cc-armv6 does not point to a valid object!
15:49:05 fatal: Couldn't find remote ref refs/heads/jenkins-node-test-commit-windows-fanned-6e1503496847634a8b9ff0ed6f431f0d5c728a88-bin-win-vs2017

^--- the Windows failures all look like that.

Copy link
Copy Markdown
Contributor Author

tried to restart node-test-commit: https://ci.nodejs.org/job/node-test-commit/23921/

Trott commented Dec 4, 2018

Copy link
Copy Markdown
Member

tried to restart node-test-commit: https://ci.nodejs.org/job/node-test-commit/23921/

The Windows rebuild I did an hour ago came back yellow, so I think this can land. https://ci.nodejs.org/job/node-test-commit-windows-fanned/22961/

Copy link
Copy Markdown
Contributor Author

Landed in 0c65314, thanks @Trott

sam-github closed this Dec 4, 2018
sam-github deleted the src-warning-cleanup branch December 4, 2018 03:44
sam-github added a commit that referenced this pull request Dec 4, 2018
Registration initialization functions are expected to have a 4th
argument, a void*, so add them where necessary to fix the warnings.

PR-URL: #24737
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
BridgeAR pushed a commit that referenced this pull request Dec 5, 2018
Registration initialization functions are expected to have a 4th
argument, a void*, so add them where necessary to fix the warnings.

PR-URL: #24737
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
BridgeAR mentioned this pull request Dec 5, 2018
4 tasks
refack pushed a commit to refack/node that referenced this pull request Jan 14, 2019
Registration initialization functions are expected to have a 4th
argument, a void*, so add them where necessary to fix the warnings.

PR-URL: nodejs#24737
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
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

Labels

author ready PRs with CI started, the required approvals, and no outstanding review comments. c++ Issues and PRs that require attention from people who are familiar with C++. lib / src Issues and PRs involving general changes in the lib/ or src/ directories.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants


Back | FazBrowse Home | New Git URL