qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 2/3] w32: Add macro timersub to sys/time.h


From: Blue Swirl
Subject: Re: [Qemu-devel] [PATCH 2/3] w32: Add macro timersub to sys/time.h
Date: Sat, 5 Mar 2011 12:31:29 +0200

On Sat, Mar 5, 2011 at 11:55 AM, Peter Maydell <address@hidden> wrote:
> On 5 March 2011 09:48, Blue Swirl <address@hidden> wrote:
>> On Sat, Mar 5, 2011 at 11:42 AM, Peter Maydell <address@hidden> wrote:
>>> On 5 March 2011 09:34, Blue Swirl <address@hidden> wrote:
>>>> On Sun, Feb 27, 2011 at 7:52 PM, Stefan Weil <address@hidden> wrote:
>>>>> +#include_next <sys/time.h>
>>>>
>>>> Isn't include_next an extension by GCC?
>>>
>>> Are gcc extensions forbidden? We already have plenty of
>>> code that uses gcc-specific syntax or gcc extensions...
>>
>> No, but relying on them is not OK. For example gcc attributes are
>> wrapped in macros to allow other implementations.
>
> Three random counter-examples:
>
> vl.c:
>    machine->max_cpus = machine->max_cpus ?: 1; /* Default to UP */
>
> That use of ?: is a gcc extension.

There's no need to use that, so those should be removed.

> target-i386/cpu.h:
> register struct CPUX86State *env asm(AREG0);
>
> Explicit register variables are a gcc extension.

Is there any other way?

> qemu-timer-common.c:
> static void __attribute__((constructor)) init_get_clock(void)
>
> gcc-specific attribute not hidden by a macro.

Probably should be wrapped, but I don't think we can avoid constructors.



reply via email to

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