qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [Qemu-trivial] [PATCH] audio: Replace macro GCC_ATTR by


From: Andreas Färber
Subject: Re: [Qemu-devel] [Qemu-trivial] [PATCH] audio: Replace macro GCC_ATTR by GCC_FMT_ATTR and use inline functions
Date: Tue, 11 Jun 2013 14:42:09 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130510 Thunderbird/17.0.6

Am 11.06.2013 14:38, schrieb Michael Tokarev:
> [Removing malc's email since it bounces]
> 09.06.2013 16:22, Stefan Weil wrote:
>> GCC_ATTR was only used in audio_int.h, so it is now unused and
>> the definition can be removed from compiler.h.
>>
>> Signed-off-by: Stefan Weil <address@hidden>
>> ---
>>  audio/audio_int.h       |    8 +++-----
>>  include/qemu/compiler.h |    3 ---
>>  2 files changed, 3 insertions(+), 8 deletions(-)
>>
>> diff --git a/audio/audio_int.h b/audio/audio_int.h
>> index b9b0676..5a6284b 100644
>> --- a/audio/audio_int.h
>> +++ b/audio/audio_int.h
>> @@ -243,7 +243,7 @@ static inline int audio_ring_dist (int dst, int src, int 
>> len)
>>      return (dst >= src) ? (dst - src) : (len - src + dst);
>>  }
>>  
>> -static void GCC_ATTR dolog (const char *fmt, ...)
>> +static inline void GCC_FMT_ATTR(1, 2) dolog (const char *fmt, ...)
> 
> This change (adding `inline') causes build failure with at least with gcc-4.7:
> 
> audio/wavaudio.c: In function ‘dolog’:
> audio/audio_int.h:246:100: error: function ‘dolog’ can never be inlined 
> because it uses variable argument lists
> 
> $ gcc --version
> gcc (Debian 4.7.2-5) 4.7.2
> 
> I think the addition of inline should be dropped here and in other
> similar places (the rest is ok).
> 
> I can do that myself if you want.

But having a static function in the header still needs the __unused__
attribute, which this patch tries to remove, doesn't it?

Andreas

> 
> Alternatively these functions can be turned into varargs #defines.
> 
> Thanks,
> 
> /mjt
> 


-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg



reply via email to

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