qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 17/25] audio: remove gcc specific audio_MIN, aud


From: Gerd Hoffmann
Subject: Re: [Qemu-devel] [PATCH 17/25] audio: remove gcc specific audio_MIN, audio_MAX
Date: Wed, 19 Aug 2015 20:17:39 +0200

On Do, 2015-08-06 at 20:28 +0200, Kővágó, Zoltán wrote:
> Currently the gcc specific version only evaluates the arguments once,
> while the generic version evaluates one argument twice, which can cause
> debugging headaches when an argument has a side effect.

The answer to that is "don't do that".  Do we have macro calls with side
effects in the tree?

> This patch at least provides consistent behavior between compilers.

Makes sense.

> -#else
>  #define audio_MIN(a, b) ((a)>(b)?(b):(a))
>  #define audio_MAX(a, b) ((a)<(b)?(b):(a))
> -#endif

include/qemu/osdep.h already provides MIN/MAX macros.

I think we should either define audio_MIN (and audio_MAX) to those, or
simply do s/audio_MIN/MIN/ in audio/*.c

cheers,
  Gerd





reply via email to

[Prev in Thread] Current Thread [Next in Thread]