Re: [PATCH] Fix warning about missing parentheses around && within || in kchart/kdchart/src/KDChartCartesianAxis.cpp
2008-12-01 07:54:20 GMT
Alexis Ménard wrote: > > > On Sun, Nov 30, 2008 at 8:49 PM, Johannes Simon > <johannes.simon <at> gmail.com <mailto:johannes.simon <at> 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 Hello, It is definitely true there can be no rule where to put the parentheses in a generic "a && b || c" case. But at least they should be added. When I have made the patches I have analysed the if statements to find the intentions of them. So have you found my submitted patch to be wrong? Or do you just mean that it could be wrong in other cases? It is indeed a(Continue reading)
RSS Feed