Opened 7 years ago

Closed 6 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:


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

Attachments (0)

Change History (3)

comment:1 Changed 7 years ago by Marshall Clow

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 Changed 7 years ago by Andy Tompkins

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

comment:3 Changed 6 years ago by Andy Tompkins

Resolution: fixed
Status: newclosed

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain Andy Tompkins.
The resolution will be deleted.

Add Comment

E-mail address and name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.