Opened 10 years ago

Closed 10 years ago

#7375 closed Patches (fixed)

seed_rng.hpp gives warning on gcc 4.1.2

Reported by: Leonid Gershanovich <gleonid@…> Owned by: Andy Tompkins
Milestone: To Be Determined Component: uuid
Version: Boost 1.51.0 Severity: Problem
Keywords: Cc:

Description

I am getting a warning in default generator_iterator ctor.

template <class Generator>
class generator_iterator

: public iterator_facade<

generator_iterator<Generator>

, typename Generator::result_type
, single_pass_traversal_tag
, typename Generator::result_type const&


{

public:

generator_iterator() : m_g(NULL) {}
generator_iterator(Generator* g) : m_g(g), m_value((*m_g)()) {}


...


private:

Generator* m_g;
typename Generator::result_type m_value;

};

Depending on resulting type of "typename Generator::result_type" it is possible that m_value member remains uninitialized when object created via default ctor.

Please consider attached patch.

Attachments (1)

seed_rng.hpp.1_46_1.patch (474 bytes ) - added by Leonid Gershanovich <gleonid@…> 10 years ago.
patch for boost/uuid/seed_rng.hpp

Download all attachments as: .zip

Change History (3)

by Leonid Gershanovich <gleonid@…>, 10 years ago

Attachment: seed_rng.hpp.1_46_1.patch added

patch for boost/uuid/seed_rng.hpp

comment:1 by Andrey Semashev, 10 years ago

I'm havind the same warning with GCC 4.7. What's the status of this ticket?

comment:2 by Andy Tompkins, 10 years ago

Resolution: fixed
Status: newclosed

checked in release - changeset #80846

Note: See TracTickets for help on using tickets.