diff --git a/safeint-3.0.27-gcc14_test_fix.patch b/safeint-3.0.27-gcc14_test_fix.patch new file mode 100644 index 0000000..7ddd1cc --- /dev/null +++ b/safeint-3.0.27-gcc14_test_fix.patch @@ -0,0 +1,30 @@ +diff --git a/Test/ConstExpr.cpp b/Test/ConstExpr.cpp +index ab624ea..ad2d8f1 100644 +--- a/Test/ConstExpr.cpp ++++ b/Test/ConstExpr.cpp +@@ -9,25 +9,6 @@ + #pragma GCC diagnostic ignored "-Wunused-variable" + #endif + +-#if !defined __clang__ && defined __GNUC__ && __cplusplus >= 201402L +-// The gcc compiler isn't smart enough to sort out that the constexpr exception functions +-// are never hit, so create a null exception handler. Nothing in this file is tested at runtime in any case. +-class SafeIntGccCompileOnly +-{ +-public: +- constexpr static void SafeIntOnOverflow() +- { +- } +- +- constexpr static void SafeIntOnDivZero() +- { +- } +-}; +- +-#define SafeIntDefaultExceptionHandler SafeIntGccCompileOnly +- +-#endif +- + #include "../SafeInt.hpp" + + namespace TestConstExpr diff --git a/safeint-3.0.27-gcc98_test_rm.patch b/safeint-3.0.27-gcc98_test_rm.patch new file mode 100644 index 0000000..d372e77 --- /dev/null +++ b/safeint-3.0.27-gcc98_test_rm.patch @@ -0,0 +1,20 @@ +diff --git a/Test/GccTest/CMakeLists.txt b/Test/GccTest/CMakeLists.txt +index 38bf581..9254d70 100644 +--- a/Test/GccTest/CMakeLists.txt ++++ b/Test/GccTest/CMakeLists.txt +@@ -123,15 +123,6 @@ else() + + target_compile_options(CompileTest_gcc14_NoEH PUBLIC -Wall -std=c++14 -fno-exceptions) + +- add_executable(CompileTest_gcc98 +- ../CompileTest.cpp +- ../ConstExpr.cpp +- ../CleanCompile.cpp +- ../../SafeInt.hpp +- ) +- +- target_compile_options(CompileTest_gcc98 PUBLIC -D SAFEINT_USE_CPLUSCPLUS_98 -Wall -std=c++98 -fno-exceptions) +- + add_executable(safe_math_test_gcc + ../c_safe_math/safe_math_test.c + ../c_safe_math/safe_math_test.h diff --git a/safeint.spec b/safeint.spec index 827fece..0026729 100644 --- a/safeint.spec +++ b/safeint.spec @@ -12,6 +12,8 @@ Source0: https://github.com/dcleblanc/SafeInt/archive/%{version}/SafeInt- # https://github.com/dcleblanc/SafeInt/pull/48 Patch0: safeint-3.0.27-gcc13_fix.patch +Patch1: safeint-3.0.27-gcc98_test_rm.patch +Patch2: safeint-3.0.27-gcc14_test_fix.patch BuildRequires: gcc-c++ BuildRequires: cmake