From 56e3db0f75534288c3dbc097021a5439e540adf3 Mon Sep 17 00:00:00 2001 From: Nicolas Savoire Date: Thu, 17 Apr 2025 17:20:05 +0200 Subject: [PATCH] Fix compilation with xcode 16.3 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::Callback' (aka 'void (*)(const WeakCallbackInfo &)') to 'Callback' (aka 'void (*)(const WeakCallbackInfo &)') 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. --- binding.gyp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/binding.gyp b/binding.gyp index d059d3c0..55fa8b9a 100644 --- a/binding.gyp +++ b/binding.gyp @@ -83,6 +83,8 @@ 'xcode_settings': { 'OTHER_CFLAGS+': [ "-Wno-deprecated-declarations", + "-Wno-cast-function-type-mismatch", # clang17 now warns about casts between incompatible function types and v8 has some of those + "-Wno-unknown-warning-option", # "-Wcast-function-type-mismatch" is not a valid warning option for clang < 17 "-Werror", '-std=gnu++20', ],