From a7bcad4be2e466101aa2e1f60432345c1d6c688d Mon Sep 17 00:00:00 2001 From: past-due <30942300+past-due@users.noreply.github.com> Date: Sun, 12 Jan 2025 20:05:01 -0500 Subject: [PATCH] Silence quickjs.h warning on Clang >= 19 --- lib/wzmaplib/src/map_script.cpp | 7 +++++++ src/quickjs_backend.cpp | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/lib/wzmaplib/src/map_script.cpp b/lib/wzmaplib/src/map_script.cpp index 3d62e9d3acf..eda6d81b259 100644 --- a/lib/wzmaplib/src/map_script.cpp +++ b/lib/wzmaplib/src/map_script.cpp @@ -35,6 +35,10 @@ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wcast-function-type" #endif +#if defined(__clang__) && defined(__clang_major__) && __clang_major__ >= 19 +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wcast-function-type-mismatch" +#endif #if defined(_MSC_VER) __pragma(warning( push )) __pragma(warning( disable : 4191 )) // disable "warning C4191: 'type cast': unsafe conversion from 'JSCFunctionMagic (__cdecl *)' to 'JSCFunction (__cdecl *)'" @@ -44,6 +48,9 @@ __pragma(warning( disable : 4191 )) // disable "warning C4191: 'type cast': unsa #if defined(_MSC_VER) __pragma(warning( pop )) #endif +#if defined(__clang__) && defined(__clang_major__) && __clang_major__ >= 19 +#pragma clang diagnostic pop +#endif #if !defined(__clang__) && defined(__GNUC__) && __GNUC__ >= 8 #pragma GCC diagnostic pop #endif diff --git a/src/quickjs_backend.cpp b/src/quickjs_backend.cpp index f83159c84fc..555c00cc249 100644 --- a/src/quickjs_backend.cpp +++ b/src/quickjs_backend.cpp @@ -85,12 +85,19 @@ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wcast-function-type" #endif +#if defined(__clang__) && defined(__clang_major__) && __clang_major__ >= 19 +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wcast-function-type-mismatch" +#endif MSVC_PRAGMA(warning( push )) MSVC_PRAGMA(warning( disable : 4191 )) // disable "warning C4191: 'type cast': unsafe conversion from 'JSCFunctionMagic (__cdecl *)' to 'JSCFunction (__cdecl *)'" #include "quickjs.h" #include "quickjs-debugger.h" #include "quickjs-limitedcontext.h" MSVC_PRAGMA(warning( pop )) +#if defined(__clang__) && defined(__clang_major__) && __clang_major__ >= 19 +#pragma clang diagnostic pop +#endif #if !defined(__clang__) && defined(__GNUC__) && __GNUC__ >= 8 #pragma GCC diagnostic pop #endif