qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Greg Kurz <groug@kaod.org>, Thomas Huth <thuth@redhat.com>
Cc: qemu-devel@nongnu.org, "Richard Henderson" <rth@twiddle.net>,
	"Daniel P. Berrangé" <berrange@redhat.com>,
	peter.maydell@linaro.org, "Markus Armbruster" <armbru@redhat.com>,
	qemu-ppc@nongnu.org, "Cédric Le Goater" <clg@kaod.org>,
	"David Gibson" <david@gibson.dropbear.id.au>
Subject: Re: [Qemu-devel] [PATCH v4 2/3] ppc: Drop duplicated typedefs to be able to compile with Clang in gnu99 mode
Date: Thu, 10 Jan 2019 21:35:14 +0100	[thread overview]
Message-ID: <120f1d93-7085-e5ee-18ee-e7b7b1a218ef@redhat.com> (raw)
In-Reply-To: <20190110170054.232da6a0@bahia.lan>

On 10/01/19 17:00, Greg Kurz wrote:
>>> Hmm... so the choice here is to simply ignore the official coding
>>> style ?  
>>
>> Are typedefs really our "official coding style"? It's mentioned in
>> HACKING, not in CODING_STYLE, so I rather see this as a recommendation
> 
> Indeed.
> 
>> only. (Otherwise, all the forward struct definitions at the beginning of
>> spapr.h are a plain violation of the coding style, too...)
>>
> 
> Yeah.
> 
>> IMHO we should rather adopt the coding style of the kernel which rather
>> tries to avoid to typedef each and every struct.
>>
> 
> From https://www.kernel.org/doc/html/latest/process/coding-style.html#typedefs :
> 
> "In general, a pointer, or a struct that has elements that can reasonably be
>  directly accessed should never be a typedef."
> 
> So if we were to adopt the coding style of the kernel, we'd have to face a
> lot more violations with the current QEMU code base :)

Yes, that's just not going to happen.  QEMU has a different coding
style; it's used consistently(*) and we'll live with it. I do like the
kernel style too as well, but it's just too different for a transition
to make sense and it may make even less sense if QEMU ever becomes
multi-language.  To put it clearly, this is not multiline comments.

It's a different thing to allow struct in prototypes, that's a special
case that already exists and can be adopted only if necessary.

Paolo

    (*) camel-case type identifiers are also shared with GLib and many
        other libraries we use, and they are pretty much a universal
        convention in every language but C and C++.

  reply	other threads:[~2019-01-10 20:35 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-10  9:15 [Qemu-devel] [PATCH v4 0/3] Force the C standard to gnu99 Thomas Huth
2019-01-10  9:15 ` [Qemu-devel] [PATCH v4 1/3] ppc: Move spapr-related prototypes from xics.h into a seperate header file Thomas Huth
2019-01-10  9:24   ` Greg Kurz
2019-01-10  9:54   ` Cédric Le Goater
2019-01-10  9:15 ` [Qemu-devel] [PATCH v4 2/3] ppc: Drop duplicated typedefs to be able to compile with Clang in gnu99 mode Thomas Huth
2019-01-10 13:15   ` Greg Kurz
2019-01-10 14:07     ` Thomas Huth
2019-01-10 16:00       ` Greg Kurz
2019-01-10 20:35         ` Paolo Bonzini [this message]
2019-01-11  0:17       ` David Gibson
2019-01-11  6:50         ` Thomas Huth
2019-01-10  9:15 ` [Qemu-devel] [PATCH v4 3/3] configure: Force the C standard to gnu99 Thomas Huth

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=120f1d93-7085-e5ee-18ee-e7b7b1a218ef@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=clg@kaod.org \
    --cc=david@gibson.dropbear.id.au \
    --cc=groug@kaod.org \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=rth@twiddle.net \
    --cc=thuth@redhat.com \
    /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).