Re: [PATCH] virtiofsd: Fix side-effect in assert()

2021-05-06 Thread Dr. David Alan Gilbert
* Greg Kurz (gr...@kaod.org) wrote: > It is bad practice to put an expression with a side-effect in > assert() because the side-effect won't happen if the code is > compiled with -DNDEBUG. > > Use an intermediate variable. Consolidate this in an macro to > have proper line numbers when the asserti

Re: [PATCH] virtiofsd: Fix side-effect in assert()

2021-04-09 Thread Philippe Mathieu-Daudé
Hi Stefan, On 4/9/21 5:11 PM, Stefan Weil wrote: > Am 09.04.21 um 12:06 schrieb Greg Kurz: > >> It is bad practice to put an expression with a side-effect in >> assert() because the side-effect won't happen if the code is >> compiled with -DNDEBUG. >> >> Use an intermediate variable. Consolidate

Re: [PATCH] virtiofsd: Fix side-effect in assert()

2021-04-09 Thread Stefan Weil
Am 09.04.21 um 12:06 schrieb Greg Kurz: It is bad practice to put an expression with a side-effect in assert() because the side-effect won't happen if the code is compiled with -DNDEBUG. Use an intermediate variable. Consolidate this in an macro to have proper line numbers when the assertion is

Re: [PATCH] virtiofsd: Fix side-effect in assert()

2021-04-09 Thread Alex Bennée
Greg Kurz writes: > It is bad practice to put an expression with a side-effect in > assert() because the side-effect won't happen if the code is > compiled with -DNDEBUG. > > Use an intermediate variable. Consolidate this in an macro to > have proper line numbers when the assertion is hit. > >

Re: [PATCH] virtiofsd: Fix side-effect in assert()

2021-04-09 Thread Wainer dos Santos Moschetta
On 4/9/21 7:06 AM, Greg Kurz wrote: It is bad practice to put an expression with a side-effect in assert() because the side-effect won't happen if the code is compiled with -DNDEBUG. Use an intermediate variable. Consolidate this in an macro to have proper line numbers when the assertion is hi

Re: [Virtio-fs] [PATCH] virtiofsd: Fix side-effect in assert()

2021-04-09 Thread Vivek Goyal
On Fri, Apr 09, 2021 at 12:06:27PM +0200, Greg Kurz wrote: > It is bad practice to put an expression with a side-effect in > assert() because the side-effect won't happen if the code is > compiled with -DNDEBUG. > > Use an intermediate variable. Consolidate this in an macro to > have proper line n

Re: [PATCH] virtiofsd: Fix side-effect in assert()

2021-04-09 Thread Philippe Mathieu-Daudé
On 4/9/21 12:06 PM, Greg Kurz wrote: > It is bad practice to put an expression with a side-effect in > assert() because the side-effect won't happen if the code is > compiled with -DNDEBUG. > > Use an intermediate variable. Consolidate this in an macro to > have proper line numbers when the assert

[PATCH] virtiofsd: Fix side-effect in assert()

2021-04-09 Thread Greg Kurz
It is bad practice to put an expression with a side-effect in assert() because the side-effect won't happen if the code is compiled with -DNDEBUG. Use an intermediate variable. Consolidate this in an macro to have proper line numbers when the assertion is hit. virtiofsd: ../../tools/virtiofsd/pas