Re: [PATCH 1/2] hw/dma: sifive_pdma: Improve code readability for "!!foo & bar"

2021-09-27 Thread Markus Armbruster
Bin Meng writes: > Hi Markus, > > On Mon, Sep 27, 2021 at 2:51 PM Markus Armbruster wrote: >> >> Bin Meng writes: >> >> > GCC seems to be strict about processing pattern like "!!for & bar". >> > When 'bar' is not 0 or 1, it complains with -Werror=parentheses: >> > >> > suggest parentheses

Re: [PATCH 1/2] hw/dma: sifive_pdma: Improve code readability for "!!foo & bar"

2021-09-27 Thread Bin Meng
Hi Markus, On Mon, Sep 27, 2021 at 2:51 PM Markus Armbruster wrote: > > Bin Meng writes: > > > GCC seems to be strict about processing pattern like "!!for & bar". > > When 'bar' is not 0 or 1, it complains with -Werror=parentheses: > > > > suggest parentheses around operand of ‘!’ or change

Re: [PATCH 1/2] hw/dma: sifive_pdma: Improve code readability for "!!foo & bar"

2021-09-27 Thread Markus Armbruster
Bin Meng writes: > GCC seems to be strict about processing pattern like "!!for & bar". > When 'bar' is not 0 or 1, it complains with -Werror=parentheses: > > suggest parentheses around operand of ‘!’ or change ‘&’ to ‘&&’ or ‘!’ to > ‘~’ [-Werror=parentheses] > > Add a () around "foo && bar",

Re: [PATCH 1/2] hw/dma: sifive_pdma: Improve code readability for "!!foo & bar"

2021-09-27 Thread Bin Meng
Hi Philippe, On Mon, Sep 27, 2021 at 12:47 PM Philippe Mathieu-Daudé wrote: > > On 9/27/21 04:21, Bin Meng wrote: > > GCC seems to be strict about processing pattern like "!!for & bar". > > When 'bar' is not 0 or 1, it complains with -Werror=parentheses: > > > > suggest parentheses around

Re: [PATCH 1/2] hw/dma: sifive_pdma: Improve code readability for "!!foo & bar"

2021-09-26 Thread Philippe Mathieu-Daudé
On 9/27/21 06:47, Philippe Mathieu-Daudé wrote: > On 9/27/21 04:21, Bin Meng wrote: >> GCC seems to be strict about processing pattern like "!!for & bar". What GCC version btw? >> When 'bar' is not 0 or 1, it complains with -Werror=parentheses: >> >> suggest parentheses around operand of ‘!’

Re: [PATCH 1/2] hw/dma: sifive_pdma: Improve code readability for "!!foo & bar"

2021-09-26 Thread Philippe Mathieu-Daudé
On 9/27/21 04:21, Bin Meng wrote: > GCC seems to be strict about processing pattern like "!!for & bar". > When 'bar' is not 0 or 1, it complains with -Werror=parentheses: > > suggest parentheses around operand of ‘!’ or change ‘&’ to ‘&&’ or ‘!’ to > ‘~’ [-Werror=parentheses] > > Add a ()

[PATCH 1/2] hw/dma: sifive_pdma: Improve code readability for "!!foo & bar"

2021-09-26 Thread Bin Meng
GCC seems to be strict about processing pattern like "!!for & bar". When 'bar' is not 0 or 1, it complains with -Werror=parentheses: suggest parentheses around operand of ‘!’ or change ‘&’ to ‘&&’ or ‘!’ to ‘~’ [-Werror=parentheses] Add a () around "foo && bar", which also improves code