<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div><font face="arial, helvetica, sans-serif">Hi,</font></div><div><font face="arial, helvetica, sans-serif">Im looking at an old minor bug for "Missing -Wparentheses warning" where clang do not warning for a missing parentheses in the case of "<span style="color:rgb(0,0,0);white-space:pre-wrap">assert(x && val == 4 || (!x && val == 5));" whereas GCC would complain about missing parentheses for </span><span style="color:rgb(0,0,0);white-space:pre-wrap">x && val == 4</span><span style="color:rgb(0,0,0);white-space:pre-wrap">.</span></font></div><div><span style="color:rgb(0,0,0);white-space:pre-wrap"><font face="arial, helvetica, sans-serif"><br></font></span></div><div><font face="arial, helvetica, sans-serif"><a href="https://bugs.llvm.org/show_bug.cgi?id=18971">https://bugs.llvm.org/show_bug.cgi?id=18971</a><span style="color:rgb(0,0,0);white-space:pre-wrap"><br></span></font></div><div><span style="color:rgb(0,0,0);white-space:pre-wrap"><font face="arial, helvetica, sans-serif"><br></font></span></div><div><font color="#000000" face="arial, helvetica, sans-serif"><span style="white-space:pre-wrap">The following comments are found in the code so it seems like a conscious decision.</span></font></div><div><span style="color:rgb(0,0,0);white-space:pre-wrap"><font face="monospace, monospace">// Warn about arg1 || arg2 && arg3, as GCC 4.3+ does.</font></span></div><div><span style="color:rgb(0,0,0);white-space:pre-wrap"><font face="monospace, monospace">// We don't warn for 'assert(a || b && "bad")' since this is safe.</font></span></div><div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">And since we never warn on macros</font></div><div><pre class="gmail-bz_comment_text" id="gmail-comment_text_8" style="white-space:pre-wrap;width:50em;color:rgb(0,0,0)">if (Opc == BO_LOr && !OpLoc.isMacroID()/* Don't warn in macros. */)</pre></div><div><pre class="gmail-bz_comment_text" id="gmail-comment_text_8" style="white-space:pre-wrap;width:50em;color:rgb(0,0,0)"><pre class="gmail-bz_comment_text" id="gmail-comment_text_9" style="white-space:pre-wrap;width:50em"><font face="arial, helvetica, sans-serif">This will not warn either.<br></font></pre><pre class="gmail-bz_comment_text" id="gmail-comment_text_9" style="white-space:pre-wrap;width:50em">define bar(x) \
  ( \
    (void) 0 \
  )

bar(x && val == 4 || !x && val == 5);</pre></pre><pre class="gmail-bz_comment_text" id="gmail-comment_text_8" style="white-space:pre-wrap;width:50em;color:rgb(0,0,0)"><font face="arial, helvetica, sans-serif">Not sure what to make of this bug. </font></pre></div><div><font face="arial, helvetica, sans-serif">Br. Mattias</font></div><div><pre class="gmail-bz_comment_text" id="gmail-comment_text_8" style="white-space:pre-wrap;width:50em;color:rgb(0,0,0)"><font face="arial, helvetica, sans-serif">PS. I'm new at this so play nice :)</font></pre></div></div></div></div></div></div></div>