Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
test, tools: suppress addon function cast warnings
Currently, there are a number of compiler warnings generated when
building the addons on Linux, for example:

make[1]: Entering directory '/node/test/addons/zlib-binding/build'
  CXX(target) Release/obj.target/binding/binding.o
  SOLINK_MODULE(target) Release/obj.target/binding.node
  COPY Release/binding.node
make[1]: Leaving directory '/node/test/addons/zlib-binding/build'
In file included from ../binding.cc:1:
/node/src/node.h:515:51: 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), \
					   ^
/node/src/node.h:533:3:
note: in expansion of macro 'NODE_MODULE_CONTEXT_AWARE_X'
   NODE_MODULE_CONTEXT_AWARE_X(modname, regfunc, NULL, 0)
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~
../binding.cc:58:1:
note: in expansion of macro 'NODE_MODULE_CONTEXT_AWARE'
 NODE_MODULE_CONTEXT_AWARE(NODE_GYP_MODULE_NAME, Initialize)
 ^~~~~~~~~~~~~~~~~~~~~~~~~

This commit adds the flag -Wno-cast-function-type to suppress these
warnings. With this change the warnings are not displayed anymore and
the output matches that of osx when running
'make -j8 test/addons/.buildstamp'.
  • Loading branch information
danbev committed Jan 28, 2019
commit ede6c4a048e54ab6516bc186ca5d5b16f8175b02
3 changes: 2 additions & 1 deletion test/addons/async-hello-world/binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
{
'target_name': 'binding',
'defines': [ 'V8_DEPRECATION_WARNINGS=1' ],
'sources': [ 'binding.cc' ]
'sources': [ 'binding.cc' ],
'cflags': ['-Wno-cast-function-type'],
}
]
}
3 changes: 2 additions & 1 deletion test/addons/async-hooks-id/binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
{
'target_name': 'binding',
'defines': [ 'V8_DEPRECATION_WARNINGS=1' ],
'sources': [ 'binding.cc' ]
'sources': [ 'binding.cc' ],
'cflags': ['-Wno-cast-function-type'],
}
]
}
3 changes: 2 additions & 1 deletion test/addons/async-hooks-promise/binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
{
'target_name': 'binding',
'defines': [ 'V8_DEPRECATION_WARNINGS=1' ],
'sources': [ 'binding.cc' ]
'sources': [ 'binding.cc' ],
'cflags': ['-Wno-cast-function-type'],
}
]
}
3 changes: 2 additions & 1 deletion test/addons/async-resource/binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
{
'target_name': 'binding',
'defines': [ 'V8_DEPRECATION_WARNINGS=1' ],
'sources': [ 'binding.cc' ]
'sources': [ 'binding.cc' ],
'cflags': ['-Wno-cast-function-type'],
}
]
}
3 changes: 2 additions & 1 deletion test/addons/at-exit/binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
{
'target_name': 'binding',
'defines': [ 'V8_DEPRECATION_WARNINGS=1' ],
'sources': [ 'binding.cc' ]
'sources': [ 'binding.cc' ],
'cflags': ['-Wno-cast-function-type'],
}
]
}
3 changes: 2 additions & 1 deletion test/addons/buffer-free-callback/binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
{
'target_name': 'binding',
'defines': [ 'V8_DEPRECATION_WARNINGS=1' ],
'sources': [ 'binding.cc' ]
'sources': [ 'binding.cc' ],
'cflags': ['-Wno-cast-function-type'],
}
]
}
3 changes: 2 additions & 1 deletion test/addons/callback-scope/binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
{
'target_name': 'binding',
'defines': [ 'V8_DEPRECATION_WARNINGS=1' ],
'sources': [ 'binding.cc' ]
'sources': [ 'binding.cc' ],
'cflags': ['-Wno-cast-function-type'],
}
]
}
1 change: 1 addition & 0 deletions test/addons/dlopen-ping-pong/binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
'target_name': 'binding',
'defines': [ 'V8_DEPRECATION_WARNINGS=1' ],
'sources': [ 'binding.cc' ],
'cflags': ['-Wno-cast-function-type'],
}
]
}
3 changes: 2 additions & 1 deletion test/addons/errno-exception/binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
{
'target_name': 'binding',
'defines': [ 'V8_DEPRECATION_WARNINGS=1' ],
'sources': [ 'binding.cc' ]
'sources': [ 'binding.cc' ],
'cflags': ['-Wno-cast-function-type'],
}
]
}
3 changes: 2 additions & 1 deletion test/addons/heap-profiler/binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
'target_name': 'binding',
'defines': [ 'V8_DEPRECATION_WARNINGS=1' ],
'sources': [ 'binding.cc' ],
'win_delay_load_hook': 'false'
'win_delay_load_hook': 'false',
'cflags': ['-Wno-cast-function-type'],
}
]
}
3 changes: 2 additions & 1 deletion test/addons/hello-world-esm/binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
{
'target_name': 'binding',
'defines': [ 'V8_DEPRECATION_WARNINGS=1' ],
'sources': [ 'binding.cc' ]
'sources': [ 'binding.cc' ],
'cflags': ['-Wno-cast-function-type'],
}
]
}
3 changes: 2 additions & 1 deletion test/addons/hello-world-function-export/binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
{
'target_name': 'binding',
'defines': [ 'V8_DEPRECATION_WARNINGS=1' ],
'sources': [ 'binding.cc' ]
'sources': [ 'binding.cc' ],
'cflags': ['-Wno-cast-function-type'],
}
]
}
3 changes: 2 additions & 1 deletion test/addons/hello-world/binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
{
'target_name': 'binding',
'defines': [ 'V8_DEPRECATION_WARNINGS=1' ],
'sources': [ 'binding.cc' ]
'sources': [ 'binding.cc' ],
'cflags': ['-Wno-cast-function-type'],
}
]
}
3 changes: 2 additions & 1 deletion test/addons/load-long-path/binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
{
'target_name': 'binding',
'defines': [ 'V8_DEPRECATION_WARNINGS=1' ],
'sources': [ 'binding.cc' ]
'sources': [ 'binding.cc' ],
'cflags': ['-Wno-cast-function-type'],
}
]
}
3 changes: 2 additions & 1 deletion test/addons/make-callback-domain-warning/binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
{
'target_name': 'binding',
'defines': [ 'V8_DEPRECATION_WARNINGS=1' ],
'sources': [ 'binding.cc' ]
'sources': [ 'binding.cc' ],
'cflags': ['-Wno-cast-function-type'],
}
]
}
3 changes: 2 additions & 1 deletion test/addons/make-callback-recurse/binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
{
'target_name': 'binding',
'defines': [ 'V8_DEPRECATION_WARNINGS=1' ],
'sources': [ 'binding.cc' ]
'sources': [ 'binding.cc' ],
'cflags': ['-Wno-cast-function-type'],
}
]
}
3 changes: 2 additions & 1 deletion test/addons/make-callback/binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
{
'target_name': 'binding',
'defines': [ 'V8_DEPRECATION_WARNINGS=1' ],
'sources': [ 'binding.cc' ]
'sources': [ 'binding.cc' ],
'cflags': ['-Wno-cast-function-type'],
}
]
}
3 changes: 2 additions & 1 deletion test/addons/new-target/binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
{
'target_name': 'binding',
'defines': [ 'V8_DEPRECATION_WARNINGS=1' ],
'sources': [ 'binding.cc' ]
'sources': [ 'binding.cc' ],
'cflags': ['-Wno-cast-function-type'],
}
]
}
3 changes: 2 additions & 1 deletion test/addons/node-module-version/binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
{
'target_name': 'binding',
'defines': [ 'V8_DEPRECATION_WARNINGS=1' ],
'sources': [ 'binding.cc' ]
'sources': [ 'binding.cc' ],
'cflags': ['-Wno-cast-function-type'],
}
]
}
3 changes: 2 additions & 1 deletion test/addons/non-node-context/binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
'targets': [
{
'target_name': 'binding',
'sources': ['binding.cc']
'sources': ['binding.cc'],
'cflags': ['-Wno-cast-function-type'],
},
]
}
3 changes: 2 additions & 1 deletion test/addons/not-a-binding/binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
'targets': [
{
'target_name': 'binding',
'sources': [ 'not_a_binding.c' ]
'sources': [ 'not_a_binding.c' ],
'cflags': ['-Wno-cast-function-type'],
}
]
}
3 changes: 2 additions & 1 deletion test/addons/null-buffer-neuter/binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
{
'target_name': 'binding',
'defines': [ 'V8_DEPRECATION_WARNINGS=1' ],
'sources': [ 'binding.cc' ]
'sources': [ 'binding.cc' ],
'cflags': ['-Wno-cast-function-type'],
}
]
}
3 changes: 2 additions & 1 deletion test/addons/openssl-binding/binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
'sources': ['binding.cc'],
'include_dirs': ['../../../deps/openssl/openssl/include'],
}]
]
],
'cflags': ['-Wno-cast-function-type'],
},
]
}
1 change: 1 addition & 0 deletions test/addons/openssl-client-cert-engine/binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
{
'target_name': 'testengine',
'type': 'none',
'cflags': ['-Wno-cast-function-type'],
'conditions': [
['OS=="mac" and '
'node_use_openssl=="true" and '
Expand Down
3 changes: 2 additions & 1 deletion test/addons/parse-encoding/binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
{
'target_name': 'binding',
'defines': [ 'V8_DEPRECATION_WARNINGS=1' ],
'sources': [ 'binding.cc' ]
'sources': [ 'binding.cc' ],
'cflags': ['-Wno-cast-function-type'],
}
]
}
3 changes: 2 additions & 1 deletion test/addons/repl-domain-abort/binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
{
'target_name': 'binding',
'defines': [ 'V8_DEPRECATION_WARNINGS=1' ],
'sources': [ 'binding.cc' ]
'sources': [ 'binding.cc' ],
'cflags': ['-Wno-cast-function-type'],
}
]
}
3 changes: 2 additions & 1 deletion test/addons/stringbytes-external-exceed-max/binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
{
'target_name': 'binding',
'defines': [ 'V8_DEPRECATION_WARNINGS=1' ],
'sources': [ 'binding.cc' ]
'sources': [ 'binding.cc' ],
'cflags': ['-Wno-cast-function-type'],
}
]
}
3 changes: 2 additions & 1 deletion test/addons/symlinked-module/binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
'targets': [
{
'target_name': 'binding',
'sources': [ 'binding.cc' ]
'sources': [ 'binding.cc' ],
'cflags': ['-Wno-cast-function-type'],
}
]
}
3 changes: 2 additions & 1 deletion test/addons/uv-handle-leak/binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
{
'target_name': 'binding',
'defines': [ 'V8_DEPRECATION_WARNINGS=1' ],
'sources': [ 'binding.cc' ]
'sources': [ 'binding.cc' ],
'cflags': ['-Wno-cast-function-type'],
}
]
}
3 changes: 2 additions & 1 deletion test/addons/worker-addon/binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
{
'target_name': 'binding',
'defines': [ 'V8_DEPRECATION_WARNINGS=1' ],
'sources': [ 'binding.cc' ]
'sources': [ 'binding.cc' ],
'cflags': ['-Wno-cast-function-type'],
}
]
}
1 change: 1 addition & 0 deletions test/addons/zlib-binding/binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
'target_name': 'binding',
'sources': ['binding.cc'],
'include_dirs': ['../../../deps/zlib'],
'cflags': ['-Wno-cast-function-type'],
},
]
}
3 changes: 2 additions & 1 deletion tools/doc/addon-verify.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ ${files[name].replace(
{
target_name: 'addon',
defines: [ 'V8_DEPRECATION_WARNINGS=1' ],
sources: files.map(({ name }) => name)
sources: files.map(({ name }) => name),
cflags: [ '-Wno-cast-function-type' ]
}
]
})
Expand Down