mirror of
https://github.com/Open-Cascade-SAS/OCCT.git
synced 2026-05-10 09:30:48 +08:00
Coding - Fix clang warning suppression for function pointer casts (#1059)
- Switched from `__clang_major__ >= 16` gating to `__has_warning(...)` checks - Added fallback suppression for `-Wcast-function-type` when `-Wcast-function-type-mismatch` is unavailable
This commit is contained in:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user