Skip to content

Commit b0fe169

Browse files
committed
crypto: ignore useless gcc warnings
1 parent 326b5d3 commit b0fe169

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

lib/protocol/crypto/src/binding.cc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,20 @@
1+
#if defined(__GNUC__) && __GNUC__ >= 8
2+
#define DISABLE_WCAST_FUNCTION_TYPE _Pragma("GCC diagnostic push") _Pragma("GCC diagnostic ignored \"-Wcast-function-type\"")
3+
#define DISABLE_WCAST_FUNCTION_TYPE_END _Pragma("GCC diagnostic pop")
4+
#else
5+
#define DISABLE_WCAST_FUNCTION_TYPE
6+
#define DISABLE_WCAST_FUNCTION_TYPE_END
7+
#endif
8+
19
#include <stdio.h>
210
#include <string.h>
311
#include <assert.h>
412

513
#include <node.h>
614
#include <node_buffer.h>
15+
DISABLE_WCAST_FUNCTION_TYPE
716
#include <nan.h>
17+
DISABLE_WCAST_FUNCTION_TYPE_END
818

919
#if NODE_MAJOR_VERSION >= 17
1020
# include <openssl/configuration.h>
@@ -2145,4 +2155,6 @@ NAN_MODULE_INIT(init) {
21452155
GenericDecipher::Init(target);
21462156
}
21472157

2158+
DISABLE_WCAST_FUNCTION_TYPE
21482159
NODE_MODULE(sshcrypto, init)
2160+
DISABLE_WCAST_FUNCTION_TYPE_END

0 commit comments

Comments
 (0)