This project is read-only.

SafeInt 3.0.12p

Rating: No reviews yet
Downloads: 1735
Released: Nov 30, 2008
Updated: Dec 4, 2008 by dcleblanc
Dev status: Stable Help Icon

Recommended Download

Source Code SafeInt3.0.12p.hpp
source code, 200K, uploaded Nov 30, 2008 - 1011 downloads

Other Available Downloads

Source Code SafeIntTest.cpp
source code, 7K, uploaded Dec 4, 2008 - 390 downloads
Source Code SafeIntGcc.hpp
source code, 1K, uploaded Nov 23, 2008 - 334 downloads

Release Notes

This release fixes the issues reported by Niels Dekker regarding standards compliance, as well as fixes for the floating point operators.

It also adds support for gcc 4.3.2, and creates the start of a test harness.

12/3/08 - Uploaded new copy of SafeIntTest.cpp - there was a typo on one of the lines that amazingly enough actually compiled. Still compiles, so no harm done.

Note - Seems that the MacOS gcc may not be the most current, and this does not compile correctly on MacOS. Seems to get confused by:

SafeInt<T>& operator %=(SafeInt<U> su)
U operator %=(SafeInt<T>)

when supplied with 2 SafeInts, despite the fact that the first is an exact match. We may be able to get it working by removing some operators.

Additionally, I've created SafeIntGcc.hpp, which needs to be included before SafeInt3.hpp. It is used to set up #defines to allow use of int8, int16, int32 and int64, which are all Microsoft-specific.

The Microsoft compiler is also happy with ptrdifft, where gcc on Linux seems to want <cstddef> included, and gcc also doesn't seem to natively know about intptrt or uintptr_t - there could be better ways to get these set up than what I've done here.

The compile test harness now effectively compiles every method using every appropriate combination of types. Some minor tweaks had to be made to make gcc happy with various things, but runtime behavior has not been changed.

Two elements of the test harness remain to be created:
1) Test all of the enums used for partial template specialization to ensure full coverage. This has been done in the internal Microsoft test harness, but an external version should be created in case someone wants to branch the code.
2) Full runtime checking of all operations. This is a large work item.

Because there is now full compile-time coverage under gcc, this is now getting moved to released stage.

Reviews for this release

No reviews yet for this release.