Opened 12 years ago

Closed 11 years ago

#4601 closed Bugs (fixed)

conversion from 'unsigned long' to 'boost::uint8_t warning

Reported by: Jeff Flinn <jflinn@…> Owned by: Andy Tompkins
Milestone: To Be Determined Component: uuid
Version: Boost 1.44.0 Severity: Cosmetic
Keywords: Cc:

Description

...\boost_1_44_0\boost/uuid/random_generator.hpp(93) : warning C4244: '=' : conversion from 'unsigned long' to 'boost::uint8_t', possible loss of data

with MSVC8

Change History (3)

comment:1 by Marshall Clow, 12 years ago

Here's the line of code:

            *it = ((random_value >> (i*8)) & 0xFF);

As you can see, there's no loss of data here, since the value is anded with 0xFF before being stored into the iterator. The compiler is just being a PITA.

comment:2 by Andy Tompkins, 12 years ago

Added a static_cast to get rid of warning. Committed to trunk.

comment:3 by Andy Tompkins, 11 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.