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 <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
  • Loading branch information
lundibundi authored and codebytere committed Mar 17, 2020
1 parent a8d9c0f commit de6d552
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
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
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
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 de6d552

Please sign in to comment.