From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Kmrcx-00050t-Ob for qemu-devel@nongnu.org; Mon, 06 Oct 2008 11:04:03 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Kmrcu-00050G-Ty for qemu-devel@nongnu.org; Mon, 06 Oct 2008 11:04:03 -0400 Received: from [199.232.76.173] (port=58175 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kmrcu-00050D-OA for qemu-devel@nongnu.org; Mon, 06 Oct 2008 11:04:00 -0400 Received: from netops-testserver-3-out.sgi.com ([192.48.171.28]:55542 helo=relay.sgi.com) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Kmrcu-0001MP-9i for qemu-devel@nongnu.org; Mon, 06 Oct 2008 11:04:00 -0400 Message-ID: <48EA28DC.40604@sgi.com> Date: Mon, 06 Oct 2008 17:03:56 +0200 From: Jes Sorensen MIME-Version: 1.0 Subject: Re: [Qemu-devel] [patch 1/2] machine struct - use C99 initializers References: <48EA0E22.4080302@sgi.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Johannes Schindelin Cc: Anthony Liguori , qemu-devel@nongnu.org Johannes Schindelin wrote: >> This patch simply converts all the machine structs to use C99 style >> initializers. There is no actual code change in this. > > Is it really such a good idea to do this? I mean, the only real change > you make here is to break compilation on compilers that do not grok C99 > (or do it badly). > > Sure, it does not concern _you_. You _obviously_ have a C99 compliant > compiler. Ehm, what compiler does _not_ support C99 these days? Point here is that using the proper initializers makes it a heck of a lot easier to avoid bugs when a struct is extended, and it *does* need to be extended. > And do not even bother starting a discussion "but nobody has C89 compilers > anymore". There are people out there, and you _will_ hear from them, and > _only_ when it is too late. Sorry, but there is already plenty of use of C99 initializers in QEMU today, the people who you refer to have either stopped building QEMU or switched to a 21st century compiler. > So maybe it is time to step back and defend why you need to "fix" > something that already works pretty well? Or in the alternative, just > leave it? Because it doesn't work well, it leaves a big hole open for bugs that are much worse to fix than doing the right thing. > P.S.: before somebody says that GCC is C99 compliant: search the mailing > list for the Beos GCC2 issue which was mentioned not long ago. GCC is sufficiently C99 compliant to handle this style of initializers. Maybe it's not C99 compliant enough for other stuff, but on this front it does just fine. Jes