Boost logo

Boost Users :

From: gfsdgadas_at_[hidden]
Date: 2008-02-24 12:39:31


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 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