Re: [PATCH 7/7] qobject atomics osdep: Make a few macros more hygienic

2023-09-19 Thread Markus Armbruster
Eric Blake writes: > On Fri, Sep 01, 2023 at 10:48:26AM +0200, Markus Armbruster wrote: >> > Indeed, not fully understanding the preprocessor makes for some >> > interesting death traps. >> >> We use ALL_CAPS for macros to signal "watch out for traps". >> > >> >> -#define QOBJECT(obj) ({

Re: [PATCH 7/7] qobject atomics osdep: Make a few macros more hygienic

2023-09-01 Thread Cédric Le Goater
On 9/1/23 16:50, Markus Armbruster wrote: Cédric Le Goater writes: On 8/31/23 16:30, Eric Blake wrote: On Thu, Aug 31, 2023 at 03:25:46PM +0200, Markus Armbruster wrote: [This paragraph written last: Bear with my stream of consciousness review below, where I end up duplicating some of the

Re: [PATCH 7/7] qobject atomics osdep: Make a few macros more hygienic

2023-09-01 Thread Markus Armbruster
Cédric Le Goater writes: > On 8/31/23 16:30, Eric Blake wrote: >> On Thu, Aug 31, 2023 at 03:25:46PM +0200, Markus Armbruster wrote: >> [This paragraph written last: Bear with my stream of consciousness >> review below, where I end up duplicating some of the conslusions you >> reached before the

Re: [PATCH 7/7] qobject atomics osdep: Make a few macros more hygienic

2023-09-01 Thread Philippe Mathieu-Daudé
On 1/9/23 14:59, Cédric Le Goater wrote: On 8/31/23 16:30, Eric Blake wrote: On Thu, Aug 31, 2023 at 03:25:46PM +0200, Markus Armbruster wrote: [This paragraph written last: Bear with my stream of consciousness review below, where I end up duplicating some of the conslusions you reached before

Re: [PATCH 7/7] qobject atomics osdep: Make a few macros more hygienic

2023-09-01 Thread Eric Blake
On Fri, Sep 01, 2023 at 10:48:26AM +0200, Markus Armbruster wrote: > > Indeed, not fully understanding the preprocessor makes for some > > interesting death traps. > > We use ALL_CAPS for macros to signal "watch out for traps". > > >> -#define QOBJECT(obj) ({

Re: [PATCH 7/7] qobject atomics osdep: Make a few macros more hygienic

2023-09-01 Thread Cédric Le Goater
On 8/31/23 16:30, Eric Blake wrote: On Thu, Aug 31, 2023 at 03:25:46PM +0200, Markus Armbruster wrote: [This paragraph written last: Bear with my stream of consciousness review below, where I end up duplicating some of the conslusions you reached before the point where I saw where the patch was

Re: [PATCH 7/7] qobject atomics osdep: Make a few macros more hygienic

2023-09-01 Thread Markus Armbruster
Eric Blake writes: > On Thu, Aug 31, 2023 at 03:25:46PM +0200, Markus Armbruster wrote: > > [This paragraph written last: Bear with my stream of consciousness > review below, where I end up duplicating some of the conslusions you > reached before the point where I saw where the patch was headed]

Re: [PATCH 7/7] qobject atomics osdep: Make a few macros more hygienic

2023-09-01 Thread Markus Armbruster
Richard Henderson writes: > On 8/31/23 06:25, Markus Armbruster wrote: >> +#define PASTE(a, b) a##b > > We already have glue() in qemu/compiler.h. Missed it, will fix. > The rest of it looks quite sensible. Thanks!

Re: [PATCH 7/7] qobject atomics osdep: Make a few macros more hygienic

2023-08-31 Thread Richard Henderson
On 8/31/23 06:25, Markus Armbruster wrote: +#define PASTE(a, b) a##b We already have glue() in qemu/compiler.h. The rest of it looks quite sensible. r~

Re: [PATCH 7/7] qobject atomics osdep: Make a few macros more hygienic

2023-08-31 Thread Eric Blake
On Thu, Aug 31, 2023 at 03:25:46PM +0200, Markus Armbruster wrote: [This paragraph written last: Bear with my stream of consciousness review below, where I end up duplicating some of the conslusions you reached before the point where I saw where the patch was headed] > Variables declared in

[PATCH 7/7] qobject atomics osdep: Make a few macros more hygienic

2023-08-31 Thread Markus Armbruster
Variables declared in macros can shadow other variables. Much of the time, this is harmless, e.g.: #define _FDT(exp) \ do { \ int ret = (exp);