diff --git a/src/Draw/TKDraw/Draw/Draw_Window_1.mm b/src/Draw/TKDraw/Draw/Draw_Window_1.mm index a27b6ead11..6e445bdfc5 100644 --- a/src/Draw/TKDraw/Draw/Draw_Window_1.mm +++ b/src/Draw/TKDraw/Draw/Draw_Window_1.mm @@ -13,7 +13,13 @@ #if defined(__APPLE__) && !defined(HAVE_XLIB) +// Suppress warnings from macOS system headers +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" +#pragma clang diagnostic ignored "-Wmissing-method-return-type" +#pragma clang diagnostic ignored "-Wavailability" #import +#pragma clang diagnostic pop #include #include diff --git a/src/Draw/TKViewerTest/ViewerTest/ViewerTest_ViewerCommands_1.mm b/src/Draw/TKViewerTest/ViewerTest/ViewerTest_ViewerCommands_1.mm index c971002082..fea8b07931 100644 --- a/src/Draw/TKViewerTest/ViewerTest/ViewerTest_ViewerCommands_1.mm +++ b/src/Draw/TKViewerTest/ViewerTest/ViewerTest_ViewerCommands_1.mm @@ -13,7 +13,13 @@ #if defined(__APPLE__) && !defined(HAVE_XLIB) +// Suppress warnings from macOS system headers +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" +#pragma clang diagnostic ignored "-Wmissing-method-return-type" +#pragma clang diagnostic ignored "-Wavailability" #import +#pragma clang diagnostic pop #include #include diff --git a/src/FoundationClasses/TKernel/Standard/Standard_WarningDisableFunctionCast.hxx b/src/FoundationClasses/TKernel/Standard/Standard_WarningDisableFunctionCast.hxx index dd5c04033a..9e9cbce603 100644 --- a/src/FoundationClasses/TKernel/Standard/Standard_WarningDisableFunctionCast.hxx +++ b/src/FoundationClasses/TKernel/Standard/Standard_WarningDisableFunctionCast.hxx @@ -24,7 +24,9 @@ //! There is no way to prevent this warning at OCCT level (until safer APIs is introduced), thus //! suppressing it is the only feasible way to avoid it. As this warning still can point out broken //! places, it should be suppressed only locally, where usage of function cast has been verified. -#if defined(__GNUC__) && !defined(__INTEL_COMPILER) && !defined(__clang__) +#if defined(__clang__) + #pragma clang diagnostic ignored "-Wcast-function-type-mismatch" +#elif defined(__GNUC__) && !defined(__INTEL_COMPILER) #if (__GNUC__ > 8) || ((__GNUC__ == 8) && (__GNUC_MINOR__ >= 1)) #pragma GCC diagnostic ignored "-Wcast-function-type" #endif diff --git a/src/FoundationClasses/TKernel/Standard/Standard_WarningsDisable.hxx b/src/FoundationClasses/TKernel/Standard/Standard_WarningsDisable.hxx index 99bce7de5a..d9fcbaad34 100644 --- a/src/FoundationClasses/TKernel/Standard/Standard_WarningsDisable.hxx +++ b/src/FoundationClasses/TKernel/Standard/Standard_WarningsDisable.hxx @@ -33,6 +33,9 @@ #pragma clang diagnostic ignored "-Wextra" #pragma clang diagnostic ignored "-Wshorten-64-to-32" #pragma clang diagnostic ignored "-Wdeprecated-declarations" + #if __clang_major__ >= 20 + #pragma clang diagnostic ignored "-Wnontrivial-memcall" + #endif #elif defined(_MSC_VER) #pragma warning(push, 0) #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) diff --git a/src/Visualization/TKOpenGl/OpenGl/OpenGl_Context_1.mm b/src/Visualization/TKOpenGl/OpenGl/OpenGl_Context_1.mm index 346e883cee..1d2ee807d0 100644 --- a/src/Visualization/TKOpenGl/OpenGl/OpenGl_Context_1.mm +++ b/src/Visualization/TKOpenGl/OpenGl/OpenGl_Context_1.mm @@ -24,11 +24,17 @@ #import +// Suppress warnings from macOS system headers +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" +#pragma clang diagnostic ignored "-Wmissing-method-return-type" +#pragma clang diagnostic ignored "-Wavailability" #if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE #import #else #import #endif +#pragma clang diagnostic pop #include #include diff --git a/src/Visualization/TKOpenGl/OpenGl/OpenGl_Window_1.mm b/src/Visualization/TKOpenGl/OpenGl/OpenGl_Window_1.mm index d42d11ec10..1a86166fc3 100644 --- a/src/Visualization/TKOpenGl/OpenGl/OpenGl_Window_1.mm +++ b/src/Visualization/TKOpenGl/OpenGl/OpenGl_Window_1.mm @@ -24,17 +24,24 @@ #import +// Suppress warnings from macOS system headers +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" +#pragma clang diagnostic ignored "-Wmissing-method-return-type" +#pragma clang diagnostic ignored "-Wavailability" #if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE #import #else #import +#endif +#pragma clang diagnostic pop +#if !defined(TARGET_OS_IPHONE) || !TARGET_OS_IPHONE #if !defined(MAC_OS_X_VERSION_10_7) || (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7) @interface NSView (LionAPI) - (NSSize )convertSizeToBacking: (NSSize )theSize; @end #endif - #endif #include diff --git a/src/Visualization/TKService/Cocoa/Cocoa_LocalPool.mm b/src/Visualization/TKService/Cocoa/Cocoa_LocalPool.mm index a089b2c8fe..c35c2f7ea1 100644 --- a/src/Visualization/TKService/Cocoa/Cocoa_LocalPool.mm +++ b/src/Visualization/TKService/Cocoa/Cocoa_LocalPool.mm @@ -17,11 +17,17 @@ #import +// Suppress warnings from macOS system headers +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" +#pragma clang diagnostic ignored "-Wmissing-method-return-type" +#pragma clang diagnostic ignored "-Wavailability" #if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE #import #else #import #endif +#pragma clang diagnostic pop #ifndef HAVE_OBJC_ARC diff --git a/src/Visualization/TKService/Cocoa/Cocoa_Window.mm b/src/Visualization/TKService/Cocoa/Cocoa_Window.mm index 279c28c8f5..1e8808772c 100644 --- a/src/Visualization/TKService/Cocoa/Cocoa_Window.mm +++ b/src/Visualization/TKService/Cocoa/Cocoa_Window.mm @@ -15,11 +15,17 @@ #import +// Suppress warnings from macOS system headers +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" +#pragma clang diagnostic ignored "-Wmissing-method-return-type" +#pragma clang diagnostic ignored "-Wavailability" #if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE #import #else #import #endif +#pragma clang diagnostic pop #include