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

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

comment:3 Changed 6 years ago by atompkins

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

Add Comment

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain atompkins.
The resolution will be deleted. Next status will be 'reopened'.

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

Note: See TracTickets for help on using tickets.