mirror of
https://github.com/Open-Cascade-SAS/OCCT.git
synced 2026-05-10 09:30:48 +08:00
Coding - Fix compilation warnings (#1034)
- Added version guard for Clang compiler to conditionally apply `-Wcast-function-type-mismatch` pragma - Wrapped deprecated `Standard_HMutex` typedef with deprecation warning suppression macros
This commit is contained in:
@@ -173,8 +173,14 @@ private:
|
||||
};
|
||||
|
||||
//! @deprecated Use std::shared_ptr<std::mutex> instead. Will be removed in OCCT 8.0.0.
|
||||
Standard_DISABLE_DEPRECATION_WARNINGS;
|
||||
|
||||
Standard_DEPRECATED("Standard_HMutex is deprecated; use std::shared_ptr<std::mutex> instead. "
|
||||
"Will be removed in OCCT 8.0.0")
|
||||
typedef NCollection_Shared<Standard_Mutex> Standard_HMutex;
|
||||
|
||||
Standard_ENABLE_DEPRECATION_WARNINGS;
|
||||
|
||||
// Implementation of the method Unlock is inline, since it is
|
||||
// just a shortcut to system function
|
||||
inline void Standard_Mutex::Unlock()
|
||||
|
||||
@@ -25,7 +25,9 @@
|
||||
//! 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__)
|
||||
#pragma clang diagnostic ignored "-Wcast-function-type-mismatch"
|
||||
#if __clang_major__ >= 16
|
||||
#pragma clang diagnostic ignored "-Wcast-function-type-mismatch"
|
||||
#endif
|
||||
#elif defined(__GNUC__) && !defined(__INTEL_COMPILER)
|
||||
#if (__GNUC__ > 8) || ((__GNUC__ == 8) && (__GNUC_MINOR__ >= 1))
|
||||
#pragma GCC diagnostic ignored "-Wcast-function-type"
|
||||
|
||||
Reference in New Issue
Block a user