Boost C++ Libraries: Ticket #5252: Remove extraneous parentheses around '==' if-expression https://svn.boost.org/trac10/ticket/5252 <p> Without this patch, Clang produces the following warning: </p> <p> % clang++ -fsyntax-only -Wparentheses -I . boost/date_time/gregorian_calendar.hpp In file included from boost/date_time/gregorian_calendar.hpp:63: ./boost/date_time/gregorian_calendar.ipp:50:15: warning: equality comparison with extraneous parentheses [-Wparentheses] </p> <blockquote> <p> if ((week == 53)) { </p> <blockquote> <p> <del></del>~<sup><del></del> </sup></p> </blockquote> </blockquote> <p> ./boost/date_time/gregorian_calendar.ipp:50:15: note: use '=' to turn this equality comparison into an assignment </p> <blockquote> <p> if ((week == 53)) { </p> <blockquote> <p> <sup>~ = </sup></p> </blockquote> </blockquote> <p> ./boost/date_time/gregorian_calendar.ipp:50:15: note: remove extraneous parentheses around the comparison to silence this warning </p> <blockquote> <p> if ((week == 53)) { </p> <blockquote> <p> ~ <sup> ~ </sup></p> </blockquote> </blockquote> <p> 1 warning generated. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/5252 Trac 1.4.3 chandlerc@… Wed, 02 Mar 2011 00:28:27 GMT attachment set https://svn.boost.org/trac10/ticket/5252 https://svn.boost.org/trac10/ticket/5252 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">fix-parentheses.patch</span> </li> </ul> <p> Fixes extraneous parentheses around '==' operator. </p> Ticket Steven Watanabe Sun, 13 Mar 2011 19:17:45 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/5252#comment:1 https://svn.boost.org/trac10/ticket/5252#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">duplicate</span> </li> </ul> <p> Duplicates <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/5250" title="#5250: Patches: Tiny warning removal for date_time (closed: fixed)">#5250</a>. </p> Ticket Steven Watanabe Sun, 13 Mar 2011 19:18:53 GMT component changed https://svn.boost.org/trac10/ticket/5252#comment:2 https://svn.boost.org/trac10/ticket/5252#comment:2 <ul> <li><strong>component</strong> <span class="trac-field-old">None</span> → <span class="trac-field-new">date_time</span> </li> </ul> Ticket