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

src: ignore GCC -Wcast-function-type for v8.h by danbev · Pull Request #32679 · nodejs/node · GitHub

/ node Public

src: ignore GCC -Wcast-function-type for v8.h - #32679

Closed
danbev wants to merge 1 commit into
nodejs:masterfrom
danbev:cast-function-type-warnings
Closed

src: ignore GCC -Wcast-function-type for v8.h#32679
danbev wants to merge 1 commit into
nodejs:masterfrom
danbev:cast-function-type-warnings

Conversation

danbev commented Apr 6, 2020

Copy link
Copy Markdown
Contributor

Currently, the following warnings are emitted during compilation:

In file included from ../src/string_bytes.h:29,
                 from ../src/string_bytes.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:135:42:   required from here
../deps/v8/include/v8.h:10732: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]
10732 |                reinterpret_cast<Callback>(callback), type);
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

And the same from test/cctest/test_aliased_buffer.cc

We have an open pull request against v8 for this:
https://chromium-review.googlesource.com/c/v8/v8/+/2080361

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

Currently, the following warnings are emitted during compilation:
In file included from ../src/string_bytes.h:29,
                 from ../src/string_bytes.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:135:42:   required from here
../deps/v8/include/v8.h:10732: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]
10732 |                reinterpret_cast<Callback>(callback), type);
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

And the same from test/cctest/test_aliased_buffer.cc

We have an open pull request against v8 for this:
https://chromium-review.googlesource.com/c/v8/v8/+/2080361
nodejs-github-bot added buffer Issues and PRs related to the buffer subsystem. c++ Issues and PRs that require attention from people who are familiar with C++. labels Apr 6, 2020

Copy link
Copy Markdown
Collaborator

Copy link
Copy Markdown
Member

How does that work? We include v8.h in numerous places, not just those two files. It also wouldn't silence the warnings when building V8 itself, right?

Apropos the V8 CL, you picked Yang as a reviewer but I don't think he is on the V8 team anymore.

danbev commented Apr 7, 2020

Copy link
Copy Markdown
Contributor Author

How does that work? We include v8.h in numerous places, not just those two files.

We have previously added these kinda of ignores in 3ff2aec. At that point in time I only focused on the ones that were being generated. Hopefully this is only temporary and this will be added in upstream v8.

It also wouldn't silence the warnings when building V8 itself, right?

As far as I can tell -Wcast-function-type is not specified when building V8, so these warnings are not generated for V8 itself. For example, looking at the generated make file out/tools/v8_gypfiles/v8_base_without_compiler.target.mk it has the following CFLAGS defined:

CFLAGS_Release := \                                                             
        -pthread \                                                              
        -Wno-unused-parameter \                                                 
        -m64 \                                                                  
        -Wno-return-type \                                                      
        -fno-strict-aliasing \                                                  
        -m64 \                                                                  
        -O3 \                                                                   
        -fno-omit-frame-pointer \                                               
        -fdata-sections \                                                       
        -ffunction-sections \                                                   
         \                                                                      
        -O3 

Adding -Wcast-function-type allows these warning to be generated when building V8.

Apropos the V8 CL, you picked Yang as a reviewer but I don't think he is on the V8 team anymore.

Thanks, I've updated it now and added someone else.

Copy link
Copy Markdown
Member

-Wcast-function-type is not specified when building V8

Oh, I understand now - it's stripped from cflags (-Wextra implies -Wcast-function-type):

'cflags!': [ '-Wall', '-Wextra' ],

I'm good with the pragma approach if it's temporary.

danbev commented Apr 9, 2020
edited
Loading

Copy link
Copy Markdown
Contributor Author

Re-run of failing node-test-commit-linux ✔️
Re-run of failing node-test-commit-arm-fanned ✔️
Re-run of failing /node-test-commit-osx ✔️
Re-run of failing node-test-commit-linux-containered ✔️

danbev added the author ready PRs with CI started, the required approvals, and no outstanding review comments. label Apr 14, 2020

danbev commented Apr 14, 2020

Copy link
Copy Markdown
Contributor Author

Landed in f21cf45.

danbev closed this Apr 14, 2020
danbev added a commit that referenced this pull request Apr 14, 2020
Currently, the following warnings are emitted during compilation:
In file included from ../src/string_bytes.h:29,
                 from ../src/string_bytes.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:135:42:   required from here
../deps/v8/include/v8.h:10732: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]
10732 |                reinterpret_cast<Callback>(callback), type);
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

And the same from test/cctest/test_aliased_buffer.cc

We have an open pull request against v8 for this:
https://chromium-review.googlesource.com/c/v8/v8/+/2080361

PR-URL: #32679
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
danbev deleted the cast-function-type-warnings branch April 14, 2020 08:29
BethGriggs pushed a commit that referenced this pull request Apr 14, 2020
Currently, the following warnings are emitted during compilation:
In file included from ../src/string_bytes.h:29,
                 from ../src/string_bytes.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:135:42:   required from here
../deps/v8/include/v8.h:10732: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]
10732 |                reinterpret_cast<Callback>(callback), type);
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

And the same from test/cctest/test_aliased_buffer.cc

We have an open pull request against v8 for this:
https://chromium-review.googlesource.com/c/v8/v8/+/2080361

PR-URL: #32679
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
targos pushed a commit to targos/node that referenced this pull request Apr 25, 2020
Currently, the following warnings are emitted during compilation:
In file included from ../src/string_bytes.h:29,
                 from ../src/string_bytes.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:135:42:   required from here
../deps/v8/include/v8.h:10732: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]
10732 |                reinterpret_cast<Callback>(callback), type);
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

And the same from test/cctest/test_aliased_buffer.cc

We have an open pull request against v8 for this:
https://chromium-review.googlesource.com/c/v8/v8/+/2080361

PR-URL: nodejs#32679
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
BridgeAR pushed a commit that referenced this pull request Apr 28, 2020
Currently, the following warnings are emitted during compilation:
In file included from ../src/string_bytes.h:29,
                 from ../src/string_bytes.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:135:42:   required from here
../deps/v8/include/v8.h:10732: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]
10732 |                reinterpret_cast<Callback>(callback), type);
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

And the same from test/cctest/test_aliased_buffer.cc

We have an open pull request against v8 for this:
https://chromium-review.googlesource.com/c/v8/v8/+/2080361

PR-URL: #32679
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
BridgeAR mentioned this pull request Apr 28, 2020
targos pushed a commit that referenced this pull request Apr 28, 2020
Currently, the following warnings are emitted during compilation:
In file included from ../src/string_bytes.h:29,
                 from ../src/string_bytes.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:135:42:   required from here
../deps/v8/include/v8.h:10732: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]
10732 |                reinterpret_cast<Callback>(callback), type);
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

And the same from test/cctest/test_aliased_buffer.cc

We have an open pull request against v8 for this:
https://chromium-review.googlesource.com/c/v8/v8/+/2080361

PR-URL: #32679
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@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. buffer Issues and PRs related to the buffer subsystem. c++ Issues and PRs that require attention from people who are familiar with C++.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants


Back | FazBrowse Home | New Git URL