Skip to content

Commit d683da7

Browse files
danbevaddaleax
authored andcommitted
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'. PR-URL: #25663 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com>
1 parent da46be2 commit d683da7

File tree

33 files changed

+71
-57
lines changed

33 files changed

+71
-57
lines changed

test/addons/async-hello-world/binding.gyp

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
'targets': [
33
{
44
'target_name': 'binding',
5-
'defines': [ 'V8_DEPRECATION_WARNINGS=1' ],
6-
'sources': [ 'binding.cc' ]
5+
'sources': [ 'binding.cc' ],
6+
'includes': ['../common.gypi'],
77
}
88
]
99
}

test/addons/async-hooks-id/binding.gyp

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
'targets': [
33
{
44
'target_name': 'binding',
5-
'defines': [ 'V8_DEPRECATION_WARNINGS=1' ],
6-
'sources': [ 'binding.cc' ]
5+
'sources': [ 'binding.cc' ],
6+
'includes': ['../common.gypi'],
77
}
88
]
99
}

test/addons/async-hooks-promise/binding.gyp

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
'targets': [
33
{
44
'target_name': 'binding',
5-
'defines': [ 'V8_DEPRECATION_WARNINGS=1' ],
6-
'sources': [ 'binding.cc' ]
5+
'sources': [ 'binding.cc' ],
6+
'includes': ['../common.gypi'],
77
}
88
]
99
}

test/addons/async-resource/binding.gyp

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
'targets': [
33
{
44
'target_name': 'binding',
5-
'defines': [ 'V8_DEPRECATION_WARNINGS=1' ],
6-
'sources': [ 'binding.cc' ]
5+
'sources': [ 'binding.cc' ],
6+
'includes': ['../common.gypi'],
77
}
88
]
99
}

test/addons/at-exit/binding.gyp

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
'targets': [
33
{
44
'target_name': 'binding',
5-
'defines': [ 'V8_DEPRECATION_WARNINGS=1' ],
6-
'sources': [ 'binding.cc' ]
5+
'sources': [ 'binding.cc' ],
6+
'includes': ['../common.gypi'],
77
}
88
]
99
}

test/addons/buffer-free-callback/binding.gyp

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
'targets': [
33
{
44
'target_name': 'binding',
5-
'defines': [ 'V8_DEPRECATION_WARNINGS=1' ],
6-
'sources': [ 'binding.cc' ]
5+
'sources': [ 'binding.cc' ],
6+
'includes': ['../common.gypi'],
77
}
88
]
99
}

test/addons/callback-scope/binding.gyp

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
'targets': [
33
{
44
'target_name': 'binding',
5-
'defines': [ 'V8_DEPRECATION_WARNINGS=1' ],
6-
'sources': [ 'binding.cc' ]
5+
'sources': [ 'binding.cc' ],
6+
'includes': ['../common.gypi'],
77
}
88
]
99
}

test/addons/common.gypi

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
'defines': [ 'V8_DEPRECATION_WARNINGS=1' ],
3+
'conditions': [
4+
[ 'OS in "linux freebsd openbsd solaris android aix cloudabi"', {
5+
'cflags': ['-Wno-cast-function-type'],
6+
}],
7+
],
8+
}

test/addons/dlopen-ping-pong/binding.gyp

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
},
1818
{
1919
'target_name': 'binding',
20-
'defines': [ 'V8_DEPRECATION_WARNINGS=1' ],
2120
'sources': [ 'binding.cc' ],
21+
'includes': ['../common.gypi'],
2222
}
2323
]
2424
}

test/addons/errno-exception/binding.gyp

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
'targets': [
33
{
44
'target_name': 'binding',
5-
'defines': [ 'V8_DEPRECATION_WARNINGS=1' ],
6-
'sources': [ 'binding.cc' ]
5+
'sources': [ 'binding.cc' ],
6+
'includes': ['../common.gypi'],
77
}
88
]
99
}

test/addons/heap-profiler/binding.gyp

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
'targets': [
33
{
44
'target_name': 'binding',
5-
'defines': [ 'V8_DEPRECATION_WARNINGS=1' ],
65
'sources': [ 'binding.cc' ],
7-
'win_delay_load_hook': 'false'
6+
'win_delay_load_hook': 'false',
7+
'includes': ['../common.gypi'],
88
}
99
]
1010
}

test/addons/hello-world-esm/binding.gyp

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
'targets': [
33
{
44
'target_name': 'binding',
5-
'defines': [ 'V8_DEPRECATION_WARNINGS=1' ],
6-
'sources': [ 'binding.cc' ]
5+
'sources': [ 'binding.cc' ],
6+
'includes': ['../common.gypi'],
77
}
88
]
99
}

test/addons/hello-world-function-export/binding.gyp

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
'targets': [
33
{
44
'target_name': 'binding',
5-
'defines': [ 'V8_DEPRECATION_WARNINGS=1' ],
6-
'sources': [ 'binding.cc' ]
5+
'sources': [ 'binding.cc' ],
6+
'includes': ['../common.gypi'],
77
}
88
]
99
}

test/addons/hello-world/binding.gyp

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
'targets': [
33
{
44
'target_name': 'binding',
5-
'defines': [ 'V8_DEPRECATION_WARNINGS=1' ],
6-
'sources': [ 'binding.cc' ]
5+
'sources': [ 'binding.cc' ],
6+
'includes': ['../common.gypi'],
77
}
88
]
99
}

test/addons/load-long-path/binding.gyp

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
'targets': [
33
{
44
'target_name': 'binding',
5-
'defines': [ 'V8_DEPRECATION_WARNINGS=1' ],
6-
'sources': [ 'binding.cc' ]
5+
'sources': [ 'binding.cc' ],
6+
'includes': ['../common.gypi'],
77
}
88
]
99
}

test/addons/make-callback-domain-warning/binding.gyp

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
'targets': [
33
{
44
'target_name': 'binding',
5-
'defines': [ 'V8_DEPRECATION_WARNINGS=1' ],
6-
'sources': [ 'binding.cc' ]
5+
'sources': [ 'binding.cc' ],
6+
'includes': ['../common.gypi'],
77
}
88
]
99
}

test/addons/make-callback-recurse/binding.gyp

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
'targets': [
33
{
44
'target_name': 'binding',
5-
'defines': [ 'V8_DEPRECATION_WARNINGS=1' ],
6-
'sources': [ 'binding.cc' ]
5+
'sources': [ 'binding.cc' ],
6+
'includes': ['../common.gypi'],
77
}
88
]
99
}

test/addons/make-callback/binding.gyp

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
'targets': [
33
{
44
'target_name': 'binding',
5-
'defines': [ 'V8_DEPRECATION_WARNINGS=1' ],
6-
'sources': [ 'binding.cc' ]
5+
'sources': [ 'binding.cc' ],
6+
'includes': ['../common.gypi'],
77
}
88
]
99
}

test/addons/new-target/binding.gyp

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
'targets': [
33
{
44
'target_name': 'binding',
5-
'defines': [ 'V8_DEPRECATION_WARNINGS=1' ],
6-
'sources': [ 'binding.cc' ]
5+
'sources': [ 'binding.cc' ],
6+
'includes': ['../common.gypi'],
77
}
88
]
99
}

test/addons/node-module-version/binding.gyp

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
'targets': [
33
{
44
'target_name': 'binding',
5-
'defines': [ 'V8_DEPRECATION_WARNINGS=1' ],
6-
'sources': [ 'binding.cc' ]
5+
'sources': [ 'binding.cc' ],
6+
'includes': ['../common.gypi'],
77
}
88
]
99
}

test/addons/non-node-context/binding.gyp

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
'targets': [
33
{
44
'target_name': 'binding',
5-
'sources': ['binding.cc']
5+
'sources': ['binding.cc'],
6+
'includes': ['../common.gypi'],
67
},
78
]
89
}

test/addons/not-a-binding/binding.gyp

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
'targets': [
33
{
44
'target_name': 'binding',
5-
'sources': [ 'not_a_binding.c' ]
5+
'sources': [ 'not_a_binding.c' ],
6+
'includes': ['../common.gypi'],
67
}
78
]
89
}

test/addons/null-buffer-neuter/binding.gyp

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
'targets': [
33
{
44
'target_name': 'binding',
5-
'defines': [ 'V8_DEPRECATION_WARNINGS=1' ],
6-
'sources': [ 'binding.cc' ]
5+
'sources': [ 'binding.cc' ],
6+
'includes': ['../common.gypi'],
77
}
88
]
99
}

test/addons/openssl-binding/binding.gyp

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@
22
'targets': [
33
{
44
'target_name': 'binding',
5+
'includes': ['../common.gypi'],
56
'conditions': [
67
['node_use_openssl=="true"', {
78
'sources': ['binding.cc'],
89
'include_dirs': ['../../../deps/openssl/openssl/include'],
9-
}]
10-
]
10+
}],
11+
],
1112
},
1213
]
1314
}

test/addons/openssl-client-cert-engine/binding.gyp

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
{
44
'target_name': 'testengine',
55
'type': 'none',
6+
'includes': ['../common.gypi'],
67
'conditions': [
78
['OS=="mac" and '
89
'node_use_openssl=="true" and '
@@ -17,7 +18,7 @@
1718
'../../../../out/<(PRODUCT_DIR)/<(openssl_product)'
1819
]
1920
},
20-
}]
21+
}],
2122
]
2223
}
2324
]

test/addons/parse-encoding/binding.gyp

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
'targets': [
33
{
44
'target_name': 'binding',
5-
'defines': [ 'V8_DEPRECATION_WARNINGS=1' ],
6-
'sources': [ 'binding.cc' ]
5+
'sources': [ 'binding.cc' ],
6+
'includes': ['../common.gypi'],
77
}
88
]
99
}

test/addons/repl-domain-abort/binding.gyp

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
'targets': [
33
{
44
'target_name': 'binding',
5-
'defines': [ 'V8_DEPRECATION_WARNINGS=1' ],
6-
'sources': [ 'binding.cc' ]
5+
'sources': [ 'binding.cc' ],
6+
'includes': ['../common.gypi'],
77
}
88
]
99
}

test/addons/stringbytes-external-exceed-max/binding.gyp

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
'targets': [
33
{
44
'target_name': 'binding',
5-
'defines': [ 'V8_DEPRECATION_WARNINGS=1' ],
6-
'sources': [ 'binding.cc' ]
5+
'sources': [ 'binding.cc' ],
6+
'includes': ['../common.gypi'],
77
}
88
]
99
}

test/addons/symlinked-module/binding.gyp

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
'targets': [
33
{
44
'target_name': 'binding',
5-
'sources': [ 'binding.cc' ]
5+
'sources': [ 'binding.cc' ],
6+
'includes': ['../common.gypi'],
67
}
78
]
89
}

test/addons/uv-handle-leak/binding.gyp

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
'targets': [
33
{
44
'target_name': 'binding',
5-
'defines': [ 'V8_DEPRECATION_WARNINGS=1' ],
6-
'sources': [ 'binding.cc' ]
5+
'sources': [ 'binding.cc' ],
6+
'includes': ['../common.gypi'],
77
}
88
]
99
}

test/addons/worker-addon/binding.gyp

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
'targets': [
33
{
44
'target_name': 'binding',
5-
'defines': [ 'V8_DEPRECATION_WARNINGS=1' ],
6-
'sources': [ 'binding.cc' ]
5+
'sources': [ 'binding.cc' ],
6+
'includes': ['../common.gypi'],
77
}
88
]
99
}

test/addons/zlib-binding/binding.gyp

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
'target_name': 'binding',
55
'sources': ['binding.cc'],
66
'include_dirs': ['../../../deps/zlib'],
7+
'includes': ['../common.gypi'],
78
},
89
]
910
}

tools/doc/addon-verify.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ ${files[name].replace(
7979
targets: [
8080
{
8181
target_name: 'addon',
82-
defines: [ 'V8_DEPRECATION_WARNINGS=1' ],
83-
sources: files.map(({ name }) => name)
82+
sources: files.map(({ name }) => name),
83+
includes: ['../common.gypi'],
8484
}
8585
]
8686
})

0 commit comments

Comments
 (0)