Re: [eigen] integer types - something's odd...

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


2010/6/7 Hauke Heibel <hauke.heibel@xxxxxxxxxxxxxx>:
> Hi,
>
> I tried to get rid of some of the MSVC warning since we are once again
> hitting the 50 warnings limit and the dashboard is at its limits. ;)
>
> Well, by trying to do that, I stumbled over something strange in the
> integer_types test. I seems natural that it generates a bunch of
> warnings since in some cases we are negating unsigned values. First, I
> was surprised that the test was anyways working

It's just arithmetic modulo 2^N... the usual arithmetic rules are the
same as for integers, and our integer_types tests are only based
around such simple arithmetic rules, so the wrapping around doesn't
make them fail :)

But it's true that it's ugly, so, feel free to fix that. For example
by isolating the tests that would emit warnings with unsigned types
into separate functions...

> and then I tried to
> run it in debug mode and I got an unaligned memory assertion on
>
>  m3 = m2; m3 *= s1;
>  VERIFY_IS_EQUAL(m3,                      s1*m2);
>
> while calling
>
>  CALL_SUBTEST_1( integer_types(Matrix<unsigned long, 3, 4>()) );
>
> I tried to reproduce this in a separate program but failed. Does
> anybody have an idea?

can you paste a backtrace from that assert?

Does the assert persist if you replace unsigned long by signed long?

Benoit

>
> - Hauke
>
>
>



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/