Modify

Ticket #4601 (closed Bugs: fixed)

Opened 4 years ago

Last modified 3 years ago

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

Reported by: Jeff Flinn <jflinn@…> Owned by: atompkins
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

Attachments

Change History

comment:1 Changed 3 years ago by marshall

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 3 years ago by atompkins

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

comment:3 Changed 3 years ago by atompkins

  • Status changed from new to closed
  • Resolution set to fixed
View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


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

 
Note: See TracTickets for help on using tickets.