From: Jes Sorensen <jes@sgi.com>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: Anthony Liguori <aliguori@us.ibm.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [patch 1/2] machine struct - use C99 initializers
Date: Mon, 06 Oct 2008 17:03:56 +0200 [thread overview]
Message-ID: <48EA28DC.40604@sgi.com> (raw)
In-Reply-To: <alpine.DEB.1.00.0810061701090.22125@pacific.mpi-cbg.de.mpi-cbg.de>
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
next prev parent reply other threads:[~2008-10-06 15:04 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-06 13:09 [Qemu-devel] [patch 1/2] machine struct - use C99 initializers Jes Sorensen
2008-10-06 15:05 ` Johannes Schindelin
2008-10-06 15:03 ` Jes Sorensen [this message]
2008-10-06 15:26 ` Johannes Schindelin
2008-10-06 15:23 ` Anthony Liguori
2008-10-06 20:22 ` Ronan Keryell
2008-10-06 22:46 ` Andreas Färber
2008-10-06 23:07 ` Paul Brook
2008-10-06 23:38 ` M. Warner Losh
2008-10-07 13:50 ` Paul Brook
2008-10-07 7:13 ` Jes Sorensen
2008-10-26 15:17 ` Andreas Färber
2008-10-06 15:30 ` Thiemo Seufer
2008-10-07 20:34 ` Anthony Liguori
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=48EA28DC.40604@sgi.com \
--to=jes@sgi.com \
--cc=Johannes.Schindelin@gmx.de \
--cc=aliguori@us.ibm.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).