Boost C++ Libraries: Ticket #12363: int_adapter is_signed should be const https://svn.boost.org/trac10/ticket/12363 <p> In int_adapter at lines 171 to 183, with coverity comments: </p> <pre class="wiki">171 bool operator&lt;(const int&amp; rhs) const 172 { 173 // quiets compiler warnings assignment: Assigning: is_signed = true. 174 bool is_signed = std::numeric_limits&lt;int_type&gt;::is_signed; const: At condition is_signed, the value of is_signed must be equal to 1. dead_error_condition: The condition !is_signed cannot be true. 175 if(!is_signed) 176 { CID 10153 (#1 of 1): 'Constant' variable guards dead code (DEADCODE)dead_error_line: Execution cannot reach this statement: if (boost::date_time::int_a.... Local variable is_signed is assigned only once, to a constant value, making it effectively constant throughout its scope. If this is not the intent, examine the logic to see if there is a missing assignment that would make is_signed not remain constant. Otherwise, declaring is_signed as const will suppress this defect. 177 if(is_neg_inf(value_) &amp;&amp; rhs == 0) 178 { 179 return true; 180 } 181 } 182 return (compare(rhs) == -1); 183 } </pre><p> Coverity picks this up indicating that if is_signed was const (or perhaps even better in C++11 a constexpr?) it would allow the compiler to optimize better. </p> <p> This is in the development trunk back to at least 1.54. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/12363 Trac 1.4.3 James E. King, III Fri, 29 Dec 2017 02:28:14 GMT owner, status changed https://svn.boost.org/trac10/ticket/12363#comment:1 https://svn.boost.org/trac10/ticket/12363#comment:1 <ul> <li><strong>owner</strong> changed from <span class="trac-author">az_sw_dude</span> to <span class="trac-author">James E. King, III</span> </li> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> </ul> <p> <a class="ext-link" href="https://github.com/boostorg/date_time/pull/60"><span class="icon">​</span>https://github.com/boostorg/date_time/pull/60</a> </p> Ticket James E. King, III Thu, 18 Jan 2018 13:47:13 GMT milestone changed https://svn.boost.org/trac10/ticket/12363#comment:2 https://svn.boost.org/trac10/ticket/12363#comment:2 <ul> <li><strong>milestone</strong> <span class="trac-field-old">To Be Determined</span> → <span class="trac-field-new">Boost 1.67.0</span> </li> </ul> Ticket James E. King, III Sun, 28 Jan 2018 16:25:14 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/12363#comment:3 https://svn.boost.org/trac10/ticket/12363#comment:3 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> Fix merged to master; resolved. </p> Ticket