Releases: dcleblanc/SafeInt
3.0.28a
This release only includes fixes for warnings found with clang -Weverything. Changes include:
Using inline only works in C with most compilers, but not all. Changed instances of inline in the C headers to static inline.
Changed macros with a leading underscore to not have a leading underscore.
Fixed a constructor warning in the test harness, which then resulted in a large number integer literal casting errors, especially when compiling with MSVC. Warnings have been quenched in the test harness, but it doesn't look as nice as previously in some places.
Added a new cast to one spot in SafeInt.hpp which deals with long double.
No substantial functional changes, just warnings.
3.0.28
Add nodiscard support, enhanced warnings
This release is the first substantial release in some time. Changes:
Support for nodiscard
Additional warnings enabled (and fixed) for -Wextra on clang
Removed outdated and inaccurate help in the header, refer to helpfile.md for help topics
Cleaned up implementation of exception handler options to be readable and maintainable. Prevents inclusion of operating system specific headers unless you specifically opt into something that requires them.
Completed safe_math.h, now have check_ versions of add, subtract, multiply, and divide for built-in types (int, long, etc)
Add C library
This release adds a C library, and also rewrites a good bit of the test harness to make adding new tests easier.
Faster 64-bit multiplication checks on gcc, and clang
This release fixes a build break due to a new ARM compile target on Visual Studio not having intrinsics, uses __int128 to check for 64-bit multiplication on gcc and clang, or if an older compiler without __int128 support, will use built-in functions. Produces smaller code.
Minor update
This release verifies that a reported issue in Visual Studio 16.5.x is fixed in 16.6. Warning 5045, which is just an informative warning explaining that Spectre mitigations have been inserted, has been quenched. Also, an internal error enum has been updated to an enum class to align with current C++ coding standards. There are no runtime differences between this and the previous version.
Fix bug in VISUAL_STUDIO_SAFEINT_COMPAT define
The VISUAL_STUDIO_SAFEINT_COMPAT is to manage a very old issue to help people who were using the Visual Studio version of SafeInt migrate to this version, which is supported. There was a bug where if SafeInt were multiply included, and this define was set, it wouldn't compile.
The VISUAL_STUDIO_SAFEINT_COMPAT define will be removed in a future release.
Add support for fwrapv
Code is now tested and supported with fwrapv under clang. One undefined behavior error was fixed. The fix did not show any errors in whether there was an overflow, but can cause a crash under a certain set of compiler flags.
Addition of SafeNegate non-throwing function
Add new non-throwing function, and additional test collateral to ensure it works.
3.20 - Intrinsics and Constexpr can co-exist
Intrinsic functions, used on x64 when compiling with Visual Studio, give you much smaller code, but they are not marked constexpr. Methods that call intrinsics are now not annotated constexpr when intrinsics are used, but remain annotated when intrinsics are not used.