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 <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Richard Lau <[email protected]>
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 8 additions & 0 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 2 additions & 2 deletions
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
}

0 commit comments

Comments
 (0)