From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:33377) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SutEA-0005CZ-EA for qemu-devel@nongnu.org; Fri, 27 Jul 2012 18:41:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SutE9-00067e-9J for qemu-devel@nongnu.org; Fri, 27 Jul 2012 18:41:46 -0400 Received: from e3.ny.us.ibm.com ([32.97.182.143]:35347) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SutE9-00067D-2w for qemu-devel@nongnu.org; Fri, 27 Jul 2012 18:41:45 -0400 Received: from /spool/local by e3.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 27 Jul 2012 18:41:34 -0400 Received: from d01relay04.pok.ibm.com (d01relay04.pok.ibm.com [9.56.227.236]) by d01dlp01.pok.ibm.com (Postfix) with ESMTP id 714DC38C803A for ; Fri, 27 Jul 2012 18:40:39 -0400 (EDT) Received: from d01av02.pok.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by d01relay04.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q6RMedGS404634 for ; Fri, 27 Jul 2012 18:40:39 -0400 Received: from d01av02.pok.ibm.com (loopback [127.0.0.1]) by d01av02.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q6RMebCO026972 for ; Fri, 27 Jul 2012 19:40:38 -0300 From: Anthony Liguori In-Reply-To: References: <1343396239-19272-1-git-send-email-aliguori@us.ibm.com> <1343396239-19272-5-git-send-email-aliguori@us.ibm.com> <87hastmg8x.fsf@codemonkey.ws> <87mx2lfcf0.fsf@codemonkey.ws> <877gtpexm1.fsf@codemonkey.ws> Date: Fri, 27 Jul 2012 17:40:33 -0500 Message-ID: <87vch8x1y6.fsf@codemonkey.ws> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: Re: [Qemu-devel] [PATCH 4/7] compiler: add macro for GCC weak symbols List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Blue Swirl Cc: Peter Maydell , Alexander Graf , Eric Blake , Markus Armbruster , qemu-devel@nongnu.org Blue Swirl writes: > On Fri, Jul 27, 2012 at 8:51 PM, Anthony Liguori 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 >>>> >>>> >>