Skip to content

Commit

Permalink
src: fix ignore GCC -Wcast-function-type for older compilers
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
lundibundi authored and codebytere committed Feb 17, 2020
1 parent 13c6965 commit 83dd65a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/base_object-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@
#include "env-inl.h"
#include "util.h"

#if defined(__GNUC__) && !defined(__clang__)
#if (__GNUC__ >= 8) && !defined(__clang__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wcast-function-type"
#endif
#include "v8.h"
#if defined(__GNUC__) && !defined(__clang__)
#if (__GNUC__ >= 8) && !defined(__clang__)
#pragma GCC diagnostic pop
#endif

Expand Down
5 changes: 3 additions & 2 deletions src/node.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,15 @@
# define SIGKILL 9
#endif

#if defined(__GNUC__) && !defined(__clang__)
#if (__GNUC__ >= 8) && !defined(__clang__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wcast-function-type"
#endif
#include "v8.h" // NOLINT(build/include_order)
#if defined(__GNUC__) && !defined(__clang__)
#if (__GNUC__ >= 8) && !defined(__clang__)
#pragma GCC diagnostic pop
#endif

#include "v8-platform.h" // NOLINT(build/include_order)
#include "node_version.h" // NODE_MODULE_VERSION

Expand Down
4 changes: 2 additions & 2 deletions src/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@

#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS

#if defined(__GNUC__) && !defined(__clang__)
#if (__GNUC__ >= 8) && !defined(__clang__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wcast-function-type"
#endif
#include "v8.h"
#if defined(__GNUC__) && !defined(__clang__)
#if (__GNUC__ >= 8) && !defined(__clang__)
#pragma GCC diagnostic pop
#endif

Expand Down

0 comments on commit 83dd65a

Please sign in to comment.