Re: [Qemu-devel] [RFC PATCH] osdep: Make MIN/MAX evaluate arguments only once

2019-01-05 Thread Eric Blake
On 1/5/19 7:48 AM, Eric Blake wrote: > I'm fine keeping the name MIN/MAX for the common use, but we'd need a > second pair, maybe named MIN_CONST/MAX_CONST, for use in contexts that > require a constant (there, both arguments are evaluated twice because it > is the naive implementation, but that

Re: [Qemu-devel] [RFC PATCH] osdep: Make MIN/MAX evaluate arguments only once

2019-01-05 Thread Eric Blake
On 1/4/19 6:23 PM, Zoltán Kővágó wrote: > Hi, > > I have a similar patch in my queue[1] > Sorry for not noticing that thread. >> #ifndef MIN >> -#define MIN(a, b) (((a) < (b)) ? (a) : (b)) The old version is at least named in ALL_CAPS, to warn the user that it is a macro and may have side

Re: [Qemu-devel] [RFC PATCH] osdep: Make MIN/MAX evaluate arguments only once

2019-01-04 Thread Zoltán Kővágó
Hi, I have a similar patch in my queue[1] On 2019-01-04 16:39, Eric Blake wrote: > Use the __auto_type keyword to make sure our min/max macros only > evaluate their arguments once. > > Signed-off-by: Eric Blake > --- > > RFC because __auto_type didn't exist until gcc 4.9, and I don't know >

Re: [Qemu-devel] [RFC PATCH] osdep: Make MIN/MAX evaluate arguments only once

2019-01-04 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20190104153951.32306-1-ebl...@redhat.com/ Hi, This series failed the docker-quick@centos7 build test. Please find the testing commands and their output below. If you have Docker installed, you can probably reproduce it locally. === TEST SCRIPT BEGIN ===

[Qemu-devel] [RFC PATCH] osdep: Make MIN/MAX evaluate arguments only once

2019-01-04 Thread Eric Blake
Use the __auto_type keyword to make sure our min/max macros only evaluate their arguments once. Signed-off-by: Eric Blake --- RFC because __auto_type didn't exist until gcc 4.9, and I don't know which clang version introduced it (other than that it went in during 2015: