qemu-trivial
[Top][All Lists]
Advanced

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

Re: [Qemu-trivial] [Qemu-devel] [PATCH] Drop QEMU_GNUC_PREREQ() checks f


From: Paolo Bonzini
Subject: Re: [Qemu-trivial] [Qemu-devel] [PATCH] Drop QEMU_GNUC_PREREQ() checks for gcc older than 4.1
Date: Wed, 1 Feb 2017 17:09:00 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1


On 31/01/2017 22:49, Markus Armbruster wrote:
> Paolo Bonzini <address@hidden> writes:
> 
>> On 31/01/2017 12:40, Markus Armbruster wrote:
>>>>  
>>>>  #define QEMU_NORETURN __attribute__ ((__noreturn__))
>>>>  
>>>> -#if QEMU_GNUC_PREREQ(3, 4)
>>>>  #define QEMU_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
>>>> -#else
>>>> -#define QEMU_WARN_UNUSED_RESULT
>>>> -#endif
>>> Should we inline this macro?
>>>
>>>>  
>>>> -#if QEMU_GNUC_PREREQ(4, 0)
>>>>  #define QEMU_SENTINEL __attribute__((sentinel))
>>>> -#else
>>>> -#define QEMU_SENTINEL
>>>> -#endif
>>> Likewise.
>>
>> Why, since we don't do that for QEMU_NORETURN, QEMU_PACKED, etc.?
> 
> Because we do it for aligned, always_inline, constructor, format, mode,
> noinline, and in places even noreturn and packed:
> 
>     $ git-grep __attribute__ | sed '/define/d;s/.*__attribute__ 
> *((\([A-Za-z0-9_]*\).*/\1/' | sort -u
> 

Uh oh. :)  You have to remove uses in firmware and in imported code
(which covers mode, format and noreturn), but there's certainly room for
some BiteSizedTasks.

For sure noinline should be wrapped by a macro so that you also include
noclone (usually you want to thwart some compiler optimization so both
are needed).

That leaves aligned, always_inline and constructor.  always_inline has
three users, constructors has many, aligned has many and there's
QEMU_ALIGNED too.  The smallest work would be to convert these three to
QEMU_* rather than convert QEMU_* to __attribute__.

Thanks,

Paolo



reply via email to

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