qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kurz <groug@kaod.org>
To: Richard Henderson <rth@twiddle.net>
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
	"Nikunj A Dadhania" <nikunj@linux.vnet.ibm.com>,
	"Peter Crosthwaite" <crosthwaite.peter@gmail.com>,
	"QEMU Developers" <qemu-devel@nongnu.org>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Alex Bennée" <alex.bennee@linaro.org>,
	"David Gibson" <david@gibson.dropbear.id.au>
Subject: Re: [Qemu-devel] [PATCH fix for-2.9] cpus: fix wrong define name
Date: Tue, 11 Apr 2017 00:13:22 +0200	[thread overview]
Message-ID: <20170411001322.5925a3bb@bahia.lan> (raw)
In-Reply-To: <3b38d5f9-3611-6ec8-df14-a6054d574dc2@twiddle.net>

[-- Attachment #1: Type: text/plain, Size: 1539 bytes --]

On Mon, 10 Apr 2017 10:49:12 -0700
Richard Henderson <rth@twiddle.net> wrote:

> On 04/10/2017 10:44 AM, Greg Kurz wrote:
> > On Mon, 10 Apr 2017 18:29:57 +0100
> > Peter Maydell <peter.maydell@linaro.org> wrote:
> >  
> >> On 10 April 2017 at 18:26, Richard Henderson <rth@twiddle.net> wrote:  
> >>> On 04/09/2017 11:06 PM, Nikunj A Dadhania wrote:  
> >>>> --- a/cpus.c
> >>>> +++ b/cpus.c
> >>>> @@ -202,7 +202,7 @@ void qemu_tcg_configure(QemuOpts *opts, Error **errp)
> >>>>              } else if (use_icount) {
> >>>>                  error_setg(errp, "No MTTCG when icount is enabled");
> >>>>              } else {
> >>>> -#ifndef TARGET_SUPPORT_MTTCG
> >>>> +#ifndef TARGET_SUPPORTS_MTTCG  
> >>>
> >>>
> >>> This sort of thing is why glibc moved to using -Wundef.
> >>>
> >>> It would be a huge amount of work to convert our existing sources, but it
> >>> would probably pay off in the long run.  
> >>
> >> We already build with -Wundef...
> >>  
> >
> > From the gcc info page:
> >
> > '-Wundef'
> >      Warn if an undefined identifier is evaluated in an '#if' directive.
> >
> > and BTW, isn't the purpose of #ifndef precisely to detect that the
> > identifier is undefined ?  
> 
> Yes, but it also has the typo problem above, whereas
> 
>    #if !TARGET_SUPPORTS_MTTCG
> 
> plus -Wundef would have caught that error.
> 

Turning such #ifdef/#ifndef to #if/#if ! would indeed make sense, but
we'd still have to be careful that every new addition follows the rule.

> 
> r~


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

      reply	other threads:[~2017-04-10 22:13 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-10  6:06 [Qemu-devel] [PATCH fix for-2.9] cpus: fix wrong define name Nikunj A Dadhania
2017-04-10  7:56 ` Alex Bennée
2017-04-10 17:26 ` Richard Henderson
2017-04-10 17:29   ` Peter Maydell
2017-04-10 17:31     ` Richard Henderson
2017-04-10 17:44     ` Greg Kurz
2017-04-10 17:49       ` Richard Henderson
2017-04-10 22:13         ` Greg Kurz [this message]

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=20170411001322.5925a3bb@bahia.lan \
    --to=groug@kaod.org \
    --cc=alex.bennee@linaro.org \
    --cc=crosthwaite.peter@gmail.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=nikunj@linux.vnet.ibm.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    /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).