[Top][All Lists]
[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: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] [PATCH 2/3] w32: Add macro timersub to sys/time.h |
Date: |
Sat, 5 Mar 2011 09:55:51 +0000 |
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.
target-i386/cpu.h:
register struct CPUX86State *env asm(AREG0);
Explicit register variables are a gcc extension.
qemu-timer-common.c:
static void __attribute__((constructor)) init_get_clock(void)
gcc-specific attribute not hidden by a macro.
-- PMM