diff --git a/src/FoundationClasses/TKernel/Standard/Standard_WarningDisableFunctionCast.hxx b/src/FoundationClasses/TKernel/Standard/Standard_WarningDisableFunctionCast.hxx index 798632a5c6..29f6076984 100644 --- a/src/FoundationClasses/TKernel/Standard/Standard_WarningDisableFunctionCast.hxx +++ b/src/FoundationClasses/TKernel/Standard/Standard_WarningDisableFunctionCast.hxx @@ -24,9 +24,11 @@ //! 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(__clang__) - #if __clang_major__ >= 16 +#if defined(__clang__) && defined(__has_warning) + #if __has_warning("-Wcast-function-type-mismatch") #pragma clang diagnostic ignored "-Wcast-function-type-mismatch" + #elif __has_warning("-Wcast-function-type") + #pragma clang diagnostic ignored "-Wcast-function-type" #endif #elif defined(__GNUC__) && !defined(__INTEL_COMPILER) #if (__GNUC__ > 8) || ((__GNUC__ == 8) && (__GNUC_MINOR__ >= 1))