Skip to content

Commit d5a5e59

Browse files
authored
Fix compilation with xcode 16.3 (#205)
xcode 16.3 ships with clang17 as default compiler. This version of clang warns about casts between incompatible function types, and v8 has some of those: ``` include/node/v8-persistent-handle.h:512:26: error: cast from 'typename WeakCallbackInfo<ObjectWrap>::Callback' (aka 'void (*)(const WeakCallbackInfo<ObjectWrap> &)') to 'Callback' (aka 'void (*)(const WeakCallbackInfo<void> &)') converts to incompatible function type [-Werror,-Wcast-function-type-mismatch] ``` This commit adds a -Wno-cast-function-type-mismatch flag to the compiler flags to suppress these warnings (that would otherwise cause errors because of the -Werror flag) and also a -Wno-unknown-warning-option flag to suppress the warning about the unknown warning option "-Wcast-function-type-mismatch" for clang < 17.
1 parent f972f10 commit d5a5e59

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

binding.gyp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@
8383
'xcode_settings': {
8484
'OTHER_CFLAGS+': [
8585
"-Wno-deprecated-declarations",
86+
"-Wno-cast-function-type-mismatch", # clang17 now warns about casts between incompatible function types and v8 has some of those
87+
"-Wno-unknown-warning-option", # "-Wcast-function-type-mismatch" is not a valid warning option for clang < 17
8688
"-Werror",
8789
'-std=gnu++20',
8890
],

0 commit comments

Comments
 (0)