Re: [boost] [Review] of binary_int utility starts

Markus Sch?pflin <markus.schoepflin@comsoft.de> wrote:
Tried on Tru64 5.1, CXX 7.1-006:
cxx -model ansi -std strict_ansi -I boost-HEAD binary_int_test.cpp
cxx: Error: binary_int.hpp, line 51: incomplete type is not allowed binary_nibble_VALID_VALUES_BINARY_0000_THROUGH_1111<false> t; ---------------------------------------------------------------^ cxx: Warning: binary_int.hpp, line 101: trailing comma is nonstandard shl = 4u, ------------------^ cxx: Warning: binary_int.hpp, line 109: trailing comma is nonstandard shl = 0u, ------------------^ cxx: Warning: binary_int.hpp, line 191: trailing comma is nonstandard v0_ = (v1_ << binary_int_arg<b0>::shl) | binary_int_arg<b0>::value, -----------------------------------------------------------------------------^ cxx: Warning: binary_int.hpp, line 171: missing return statement at end of non-void function "binary_int<b15, b14, b13, b12, b11, b10, b9, b8, b7, b6, b5, b4, b3, b2, b1, b0>::operator=" binary_int& operator=(const binary_int& rhs) { }; ---------------------------------------------------^ cxx: Info: 1 error detected in the compilation of "binary_int_test.cpp".
I have attempted fixes for these errors. 1. I removed the BOOST_WORKAROUND, and made what was the BOOST_WORKAROUND the only behavior. 2. I removed trailing commas at the end of three enum definitions. 3. I removed the assignment operator definition from the protected section. I am hoping that with these changes the template will survive appropriately picky compilers with no warnings or errors. Unfortunately I can't verify my changes because my compilers are passing both the old and new versions of the template. I have uploaded the new version of the zip to the sandbox: http://boost-consulting.com/vault/ under the name binary_int. I hope that I actually improved the template :-). I'm sure I'll hear. Thanks. And thanks for your efforts on the review. Scott Schurr

Scott Schurr wrote: <snip>
I am hoping that with these changes the template will survive appropriately picky compilers with no warnings or errors. Unfortunately I can't verify my changes because my compilers are passing both the old and new versions of the template.
I have uploaded the new version of the zip to the sandbox:
http://boost-consulting.com/vault/
under the name binary_int.
I hope that I actually improved the template :-). I'm sure I'll hear.
Compiles and works now without any warnings or errors. For the next test, I changed struct test_values (in binary_int_test.cpp) to the following: struct test_values { uint64_t hex_value; uint64_t bin_value; }; This additionally needs #include <boost/cstdint.hpp>. When compiling and running this (on both 32 bit and 64 bit systems), I got the following error: At test_array index 40 8a6c4e20 != ffffffff8a6c4e20 assertion "test_array[i].hex_value == test_array[i].bin_value" failed: file "../binary_int_test.cpp", line 118 Markus
participants (2)
-
Markus Schöpflin
-
Scott Schurr