Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Bevenius <daniel.bevenius@gmail.com>2020-04-06 07:25:38 +0300
committerRuben Bridgewater <ruben@bridgewater.de>2020-04-28 14:15:01 +0300
commit2f7e37207732b094582c2baa1381d73238d05e03 (patch)
treeb2d377997a19f1823db80892426494fdd0d9da8c /src/string_bytes.h
parent83f1e98a8e9ae997c7c4d957fc7c57d30ec67c61 (diff)
src: ignore GCC -Wcast-function-type for v8.h
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: https://github.com/nodejs/node/pull/32679 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'src/string_bytes.h')
-rw-r--r--src/string_bytes.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/string_bytes.h b/src/string_bytes.h
index 69bb828e018..e11b73b69e1 100644
--- a/src/string_bytes.h
+++ b/src/string_bytes.h
@@ -26,7 +26,14 @@
// Decodes a v8::Local<v8::String> or Buffer to a raw char*
+#if (__GNUC__ >= 8) && !defined(__clang__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wcast-function-type"
+#endif
#include "v8.h"
+#if (__GNUC__ >= 8) && !defined(__clang__)
+#pragma GCC diagnostic pop
+#endif
#include "env-inl.h"
#include <string>