DEFINE_STANDARD_HANDLE(Standard_OutOfRange, Standard_RangeError)
#if !defined No_Exception && !defined No_Standard_OutOfRange
+#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 2))
+ // suppress false-positive warnings produced by GCC optimizer
+ #define Standard_OutOfRange_Raise_if(CONDITION, MESSAGE) \
+ _Pragma("GCC diagnostic push") \
+ _Pragma("GCC diagnostic ignored \"-Wstrict-overflow\"") \
+ if (CONDITION) throw Standard_OutOfRange(MESSAGE); \
+ _Pragma("GCC diagnostic pop")
+#else
#define Standard_OutOfRange_Raise_if(CONDITION, MESSAGE) \
if (CONDITION) throw Standard_OutOfRange(MESSAGE);
+#endif
#else
#define Standard_OutOfRange_Raise_if(CONDITION, MESSAGE)
#endif
DEFINE_STANDARD_HANDLE(Standard_RangeError, Standard_DomainError)
#if !defined No_Exception && !defined No_Standard_RangeError
+#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 2))
+ // suppress false-positive warnings produced by GCC optimizer
+ #define Standard_RangeError_Raise_if(CONDITION, MESSAGE) \
+ _Pragma("GCC diagnostic push") \
+ _Pragma("GCC diagnostic ignored \"-Wstrict-overflow\"") \
+ if (CONDITION) throw Standard_RangeError(MESSAGE); \
+ _Pragma("GCC diagnostic pop")
+#else
#define Standard_RangeError_Raise_if(CONDITION, MESSAGE) \
if (CONDITION) throw Standard_RangeError(MESSAGE);
+#endif
#else
#define Standard_RangeError_Raise_if(CONDITION, MESSAGE)
#endif