[prev in list] [next in list] [prev in thread] [next in thread] 

List:       koffice-devel
Subject:    Re: [PATCH] Fix warning about missing parentheses around && within ||
From:       "=?ISO-8859-1?Q?Alexis_M=E9nard?=" <menard () kde ! org>
Date:       2008-11-30 19:56:03
Message-ID: 81941aea0811301156icb00c77hae172167ed5de58a () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


On Sun, Nov 30, 2008 at 8:49 PM, Johannes Simon <johannes.simon@gmail.com>wrote:

> On Sunday 30 November 2008 01:25:16 Magnus Lundborg wrote:
> > This patch fixes six compilation warnings about missing parentheses in
> > if statements.
>
> Hi,
>
> Are you sure that "a && (b || c)" is equivalent to "a && b || c"? As far as
> I
> know, it is not ;) But parantheses should be added either way, to make it
> clearer.


Right && has a higher priority than ||. So the patch is wrong in some cases.
:D


>
>
> - Johannes
> _______________________________________________
> koffice-devel mailing list
> koffice-devel@kde.org
> https://mail.kde.org/mailman/listinfo/koffice-devel
>

[Attachment #5 (text/html)]

<br><br><div class="gmail_quote">On Sun, Nov 30, 2008 at 8:49 PM, Johannes Simon \
<span dir="ltr">&lt;<a \
href="mailto:johannes.simon@gmail.com">johannes.simon@gmail.com</a>&gt;</span> \
wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, \
204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> <div class="Ih2E3d">On Sunday \
30 November 2008 01:25:16 Magnus Lundborg wrote:<br> &gt; This patch fixes six \
compilation warnings about missing parentheses in<br> &gt; if statements.<br>
<br>
</div>Hi,<br>
<br>
Are you sure that &quot;a &amp;&amp; (b || c)&quot; is equivalent to &quot;a \
&amp;&amp; b || c&quot;? As far as I<br> know, it is not ;) But parantheses should be \
added either way, to make it<br> clearer.</blockquote><div><br>Right &amp;&amp; has a \
higher priority than ||. So the patch is wrong in some cases. \
:D<br>&nbsp;</div><blockquote class="gmail_quote" style="border-left: 1px solid \
rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> <br>
<br>
- Johannes<br>
_______________________________________________<br>
koffice-devel mailing list<br>
<a href="mailto:koffice-devel@kde.org">koffice-devel@kde.org</a><br>
<a href="https://mail.kde.org/mailman/listinfo/koffice-devel" \
target="_blank">https://mail.kde.org/mailman/listinfo/koffice-devel</a><br> \
</blockquote></div><br>



_______________________________________________
koffice-devel mailing list
koffice-devel@kde.org
https://mail.kde.org/mailman/listinfo/koffice-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic