<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Jun 2, 2011, at 4:30 PM, Cory Nelson wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; ">On Thu, Jun 2, 2011 at 4:01 PM, Andrew Fish <<a href="mailto:afish@apple.com">afish@apple.com</a>> wrote:<br><blockquote type="cite">The gcc definition of -Wparentheses does not seem to include the extraneous parentheses case. I also noticed that older versions of clang don't flag this kind of warning.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">I could turn off -Wparentheses, but the other checking it does is quite useful.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">I could change the code, but the maintainers of the open source site don't think that this is valid warning. Does anyone know the history or reason behind this warning?<br></blockquote><blockquote type="cite"><br></blockquote><br>You get a warning for if(x = 1). to clarify that you actually want =<br>instead of == and to disable the warning, you use if((x = 1)). I<br>guess the warning you're seeing is the reverse of that, making sure<br>you didn't actually want if((x = 1)).</span></blockquote></div><br><div>Yes, that's exactly right. If Clang didn't warn here, one could defeat the utility of Wparentheses simply by always using '((..))'. The point is for the code to articulate what it intends to do.</div></body></html>