Boost logo

Boost Users :

From: Demian Nave (demian_at_[hidden])
Date: 2008-02-24 18:46:59


The easiest thing to do is to turn off "Smaller type checks" when
building your code in debug mode. To do this, select one or more
projects, open the Property Pages (right-click, select Properties).
Then, set "Configuration Properties -> Code Generation -> Smaller Type
Check" to "No".

Hope this helps,
Demian

gfsdgadas_at_[hidden] wrote:
> I want to compute the Crc32 checksum of a bunch of bytes. To do so, I simply use crc_32_type and process_bytes. Unfortunately this does not work in debug mode.
> Visual Studio (2008) breaks at line 574 of crc.hpp.
>
> // Compare a byte to the remainder's highest byte
> static unsigned char index( value_type rem, unsigned char x )
> { return x ^ rem; }
>
>
> Error message:
>
> Run-Time Check Failure #1 - A cast to a smaller data type has caused a loss of data. If this was intentional, you should mask the source of the cast with the appropriate bitmask. For example:
>
> char c = (i & 0xFF);
>
> Changing the code in this way will not affect the quality of the resulting optimized code.
>
>
>
> I do not like changing the boost source code, so what can I do to workaround this problem?
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net