qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 4/7] compiler: add macro for GCC weak symbols


From: Anthony Liguori
Subject: Re: [Qemu-devel] [PATCH 4/7] compiler: add macro for GCC weak symbols
Date: Fri, 27 Jul 2012 17:40:33 -0500
User-agent: Notmuch/0.13.2+93~ged93d79 (http://notmuchmail.org) Emacs/23.3.1 (x86_64-pc-linux-gnu)

Blue Swirl <address@hidden> writes:

> On Fri, Jul 27, 2012 at 8:51 PM, Anthony Liguori <address@hidden> wrote:
>> If someone comes along and actively maintains support for another
>> compiler, we can revisit.  But otherwise, there's no practical reason to
>> avoid extensions.
>
> Because it's more compliant to standards.

That is not a benefit.  There is no practical advantage to sticking to
only C99.

If we stuck to C99 only, QEMU would look very different.  We wouldn't
have type_init() so we wouldn't have the module system we use today.
It literally took me months to get those patches merged because Paul
made exactly the same argument you're making now.

And it's really been one of the better cleanups in QEMU that we've ever
done (using modules to define devices).

> There's also very little benefit from using the nonessential
> extensions.

Using weak symbols eliminates #ifdefs and makes the code base a lot
cleaner.  It makes it easier to introduce architecture specific hooks in
a clean way.

Considering how messy a lot of our target-specific code is, I think
there could be quite a significant benefit down the road.

Regards,

Anthony Liguori

>
>>
>> Regards,
>>
>> Anthony Liguori
>>
>>>
>>>>
>>>> Regards,
>>>>
>>>> Anthony Liguori
>>>>
>>>>
>>>>> -- if I
>>>>> write a patch which is pretty much standard C then it's the
>>>>> platform's problem if it mishandles it. If I write a patch
>>>>> that uses a compiler-specific or OS-specific thing then I
>>>>> have to also provide the relevant alternatives...so I try
>>>>> to avoid doing that :-)
>>>>>
>>>>> -- PMM
>>>>
>>>>
>>




reply via email to

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