On Sat, Mar 5, 2011 at 11:55 AM, Peter Maydell <peter.mayd...@linaro.org> wrote: > On 5 March 2011 09:48, Blue Swirl <blauwir...@gmail.com> wrote: >> On Sat, Mar 5, 2011 at 11:42 AM, Peter Maydell <peter.mayd...@linaro.org> >> wrote: >>> On 5 March 2011 09:34, Blue Swirl <blauwir...@gmail.com> wrote: >>>> On Sun, Feb 27, 2011 at 7:52 PM, Stefan Weil <w...@mail.berlios.de> 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.