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

warning: cast between incompatible function types #895 #421

Closed
uday1331 opened this issue Jul 26, 2020 · 2 comments
Closed

warning: cast between incompatible function types #895 #421

uday1331 opened this issue Jul 26, 2020 · 2 comments
Labels
debt help wanted Issues identified as good community contribution opportunities

Comments

@uday1331
Copy link

Environment details

  • OS: alpine (in docker)
  • OS version: latest
  • node-pty version: 0.9.0

Issue description

When installing node-pty [0.9.0] on a node:14-alpine container, i got the following warning:

In file included from ../src/unix/pty.cc:20:
../../nan/nan.h: In function 'void Nan::AsyncQueueWorker(Nan::AsyncWorker*)':
../../nan/nan.h:2294:62: warning: cast between incompatible function types from 'void (*)(uv_work_t*)' {aka 'void (*)(uv_work_s*)'} to 'uv_after_work_cb' {aka 'void (*)(uv_work_s*, int)'} [-Wcast-function-type]
 2294 |     , reinterpret_cast<uv_after_work_cb>(AsyncExecuteComplete)
      |                                                              ^
../src/unix/pty.cc: In function 'void pty_after_waitpid(uv_async_t*)':
../src/unix/pty.cc:486:43: warning: 'void* memset(void*, int, size_t)' writing to an object of type 'class Nan::Persistent<v8::Function>' with no trivial copy-assignment [-Wclass-memaccess]
  486 |   memset(&baton->cb, -1, sizeof(baton->cb));
      |                                           ^
In file included from ../../nan/nan.h:405,
                 from ../src/unix/pty.cc:20:
../../nan/nan_persistent_12_inl.h:12:40: note: 'class Nan::Persistent<v8::Function>' declared here
   12 | template<typename T, typename M> class Persistent :
      |                                        ^~~~~~~~~~
In file included from ../../nan/nan.h:56,
                 from ../src/unix/pty.cc:20:
../src/unix/pty.cc: At global scope:
/root/.cache/node-gyp/14.5.0/include/node/node.h:738:43: warning: cast between incompatible function types from 'void (*)(Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE)' {aka 'void (*)(v8::Local<v8::Object>)'} to 'node::addon_register_func' {aka 'void (*)(v8::Local<v8::Object>, v8::Local<v8::Value>, void*)'} [-Wcast-function-type]
  738 |       (node::addon_register_func) (regfunc),                          \
      |                                           ^
/root/.cache/node-gyp/14.5.0/include/node/node.h:772:3: note: in expansion of macro 'NODE_MODULE_X'
  772 |   NODE_MODULE_X(modname, regfunc, NULL, 0)  // NOLINT (readability/null_usage)
      |   ^~~~~~~~~~~~~
../src/unix/pty.cc:708:1: note: in expansion of macro 'NODE_MODULE'
  708 | NODE_MODULE(pty, init)
      | ^~~~~~~~~~~

The following issues may be related:

  1. Fails to install with node 12 #319
  2. GCC 8.1 and 8.2 compilation error: cast between incompatible function types openresty/lua-nginx-module#1357

My Diagnosis:

When i changed the docker image from node:14-alpine to node:14 (tested with other versions of node, errors only with alpine), everything works fine. I looked at the gcc version in both of the previous mentioned and they are 9.2.0 and 6.3.0 respectively. Referring to related issue 2 from above, it may be because of incompatible gcc versions.

@Tyriar
Copy link
Member

Tyriar commented Jul 27, 2020

Related: #17

@Tyriar Tyriar added debt help wanted Issues identified as good community contribution opportunities labels Jul 27, 2020
@Tyriar
Copy link
Member

Tyriar commented Oct 21, 2021

Tracked in #17

@Tyriar Tyriar closed this as completed Oct 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
debt help wanted Issues identified as good community contribution opportunities
Projects
None yet
Development

No branches or pull requests

2 participants