Skip to content

Commit 83dd65a

Browse files
lundibundicodebytere
authored andcommittedFeb 17, 2020
src: fix ignore GCC -Wcast-function-type for older compilers
Fixes: #31517 PR-URL: #31524 Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Daniel Bevenius <[email protected]> Reviewed-By: Rich Trott <[email protected]>
1 parent 13c6965 commit 83dd65a

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed
 

‎src/base_object-inl.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@
2828
#include "env-inl.h"
2929
#include "util.h"
3030

31-
#if defined(__GNUC__) && !defined(__clang__)
31+
#if (__GNUC__ >= 8) && !defined(__clang__)
3232
#pragma GCC diagnostic push
3333
#pragma GCC diagnostic ignored "-Wcast-function-type"
3434
#endif
3535
#include "v8.h"
36-
#if defined(__GNUC__) && !defined(__clang__)
36+
#if (__GNUC__ >= 8) && !defined(__clang__)
3737
#pragma GCC diagnostic pop
3838
#endif
3939

‎src/node.h

+3-2
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,15 @@
6060
# define SIGKILL 9
6161
#endif
6262

63-
#if defined(__GNUC__) && !defined(__clang__)
63+
#if (__GNUC__ >= 8) && !defined(__clang__)
6464
#pragma GCC diagnostic push
6565
#pragma GCC diagnostic ignored "-Wcast-function-type"
6666
#endif
6767
#include "v8.h" // NOLINT(build/include_order)
68-
#if defined(__GNUC__) && !defined(__clang__)
68+
#if (__GNUC__ >= 8) && !defined(__clang__)
6969
#pragma GCC diagnostic pop
7070
#endif
71+
7172
#include "v8-platform.h" // NOLINT(build/include_order)
7273
#include "node_version.h" // NODE_MODULE_VERSION
7374

‎src/util.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@
2424

2525
#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
2626

27-
#if defined(__GNUC__) && !defined(__clang__)
27+
#if (__GNUC__ >= 8) && !defined(__clang__)
2828
#pragma GCC diagnostic push
2929
#pragma GCC diagnostic ignored "-Wcast-function-type"
3030
#endif
3131
#include "v8.h"
32-
#if defined(__GNUC__) && !defined(__clang__)
32+
#if (__GNUC__ >= 8) && !defined(__clang__)
3333
#pragma GCC diagnostic pop
3434
#endif
3535

0 commit comments

Comments
 (0)
Please sign in to comment.