Boost C++ Libraries: Ticket #2551: date_time's embedded constrained_value uses uninitialized member https://svn.boost.org/trac10/ticket/2551 <p> At first I thought this was a spurious warning from gcc-4.3, but upon further inspection, I agree that the constrained_value class that comes as part of date_time is using its value_ member before initializing it when constructed with an out-of-range value. </p> <p> I checked what the unofficial Boost Constrained Value proposed library does, and it seems to "initialize, then check". It's reality easy to apply the same approach here (see the attached patch). There may be a better approach overall, but this prevents value_'s value from being passed to a function (even if that function "doesn't use" the value) before it is initialized. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/2551 Trac 1.4.3 Brad Spencer <spencer@…> Sat, 29 Nov 2008 21:14:57 GMT attachment set https://svn.boost.org/trac10/ticket/2551 https://svn.boost.org/trac10/ticket/2551 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">50-date_time-constrained_value-uninitialized.diff</span> </li> </ul> Ticket Andrey Semashev Mon, 01 Dec 2008 18:29:43 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/2551#comment:1 https://svn.boost.org/trac10/ticket/2551#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> Already fixed in trunk. </p> Ticket