qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [patch 1/2] machine struct - use C99 initializers


From: Jes Sorensen
Subject: Re: [Qemu-devel] [patch 1/2] machine struct - use C99 initializers
Date: Mon, 06 Oct 2008 17:03:56 +0200
User-agent: Thunderbird 2.0.0.16 (X11/20080723)

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




reply via email to

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