qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@gmail.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: "qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	"mdroth@linux.vnet.ibm.com" <mdroth@linux.vnet.ibm.com>,
	"lcapitulino@redhat.com" <lcapitulino@redhat.com>,
	"vrozenfe@redhat.com" <vrozenfe@redhat.com>,
	Tomoki Sekiyama <tomoki.sekiyama@hds.com>,
	"pbonzini@redhat.com" <pbonzini@redhat.com>,
	Seiji Aguchi <seiji.aguchi@hds.com>,
	"areis@redhat.com" <areis@redhat.com>
Subject: Re: [Qemu-devel] [RFC PATCH v3 02/11] Fix errors and warnings while compiling with c++ compilier
Date: Mon, 27 May 2013 13:43:39 +0200	[thread overview]
Message-ID: <20130527114339.GB23204@stefanha-thinkpad.redhat.com> (raw)
In-Reply-To: <87ehcwmmce.fsf@blackfin.pond.sub.org>

On Fri, May 24, 2013 at 05:25:21PM +0200, Markus Armbruster wrote:
> Tomoki Sekiyama <tomoki.sekiyama@hds.com> writes:
> 
> > On 5/24/13 4:52 , "Stefan Hajnoczi" <stefanha@gmail.com> wrote:
> >
> >>On Thu, May 23, 2013 at 06:34:43PM +0000, Tomoki Sekiyama wrote:
> >>> On 5/23/13 8:12 , "Stefan Hajnoczi" <stefanha@gmail.com> wrote:
> >>> 
> >>> >On Tue, May 21, 2013 at 11:33:41AM -0400, Tomoki Sekiyama wrote:
> >>> >> Add C++ keywords to avoid errors in compiling with c++ compiler.
> >>> >> This also renames class member of PciDeviceInfo to q_class.
> >>> >> 
> >>> >> Signed-off-by: Tomoki Sekiyama <tomoki.sekiyama@hds.com>
> >>> >> ---
> >>> >>  hmp.c           |    2 +-
> >>> >>  hw/pci/pci.c    |    2 +-
> >>> >>  scripts/qapi.py |    9 ++++++++-
> >>> >>  3 files changed, 10 insertions(+), 3 deletions(-)
> >>> >
> >>> >Please also extend scripts/checkpatch.pl.  Otherwise it is very likely
> >>> >that C++ keywords will be introduced again in the future.  Most people
> >>> >will not build the VSS code and therefore checkpatch.pl needs to ensure
> >>> >that patches with C++ keywords will not be accepted.
> >>> >
> >>> >Stefan
> >>> 
> >>> I think it would be difficult to identify problematic C++ keywords usage
> >>> from patches because headers can legally contain C++ keywords and
> >>> checkpatch.pl doesn't know where it should be used.
> >>> Do you have any good ideas?
> >>
> >>We can ignore false warnings for 0.1% of patches (the ones that touch
> >>VSS C++ code).  But for the remaining 99.9% of patches it's worth
> >>guarding against VSS bitrot.
> >>
> >>Remember not many people will compile it and therefore they won't notice
> >>when they break it.  I really think it's worth putting some effort in
> >>now so VSS doesn't periodically break.
> >>
> >>checkpatch.pl is a hacky sort of C parser.  It already checks for a
> >>bunch of similar things and it knows about comments, macros, and
> >>strings.  It does not perform #include expansion, so there is no risk of
> >>including system headers that have C++ code.
> >>
> >>Stefan
> >
> > Thanks for your comment.
> >
> > I'm still wondering because it actually causes a lot false positives
> > (not just 0.1%...) even for the patches not touching VSS.
> >
> > For example, keyword 'class' is used in qdev-monitor.c, qom/object.c,
> > and a lot of files in hw/*/*.c and include/{hw,qom}/*.h, but
> > they have nothing to do with qemu-ga. Qemu-ga is just a part of whole
> > qemu source code, so I don't want to warn around the other parts.
> 
> And I appreciate that.  Purging some other language's keywords feels
> like pointless churn to me.

I see what you guys are saying now.  You want to protect only qemu-ga.
I was proposing protecting the entire codebase so we never get into a
situation where changing a header breaks qemu-ga.

It's not that hard to use "klass" instead of "class", but if it's
unpopular then we'll just have to live with VSS breakage.

Stefan

  reply	other threads:[~2013-05-27 11:43 UTC|newest]

Thread overview: 65+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-21 15:33 [Qemu-devel] [RFC PATCH v3 00/11] qemu-ga: fsfreeze on Windows using VSS Tomoki Sekiyama
2013-05-21 15:33 ` [Qemu-devel] [RFC PATCH v3 01/11] configure: Support configuring c++ compiler Tomoki Sekiyama
2013-05-21 16:42   ` Eric Blake
2013-05-21 21:02     ` Tomoki Sekiyama
2013-05-21 16:56   ` Peter Maydell
2013-05-21 21:01     ` Tomoki Sekiyama
2013-05-21 15:33 ` [Qemu-devel] [RFC PATCH v3 02/11] Fix errors and warnings while compiling with c++ compilier Tomoki Sekiyama
2013-05-23 12:12   ` Stefan Hajnoczi
2013-05-23 18:34     ` Tomoki Sekiyama
2013-05-24  8:52       ` Stefan Hajnoczi
2013-05-24 14:20         ` Tomoki Sekiyama
2013-05-24 15:25           ` Markus Armbruster
2013-05-27 11:43             ` Stefan Hajnoczi [this message]
2013-05-24 13:01   ` Laszlo Ersek
2013-05-24 14:33     ` Tomoki Sekiyama
2013-05-21 15:33 ` [Qemu-devel] [RFC PATCH v3 03/11] Add a script to extract VSS SDK headers on POSIX system Tomoki Sekiyama
2013-05-21 16:48   ` Eric Blake
2013-05-21 21:02     ` Tomoki Sekiyama
2013-05-24 13:14       ` Laszlo Ersek
2013-05-24 13:38   ` Laszlo Ersek
2013-05-24 15:59     ` Eric Blake
2013-05-24 18:27       ` Laszlo Ersek
2013-05-21 15:33 ` [Qemu-devel] [RFC PATCH v3 04/11] qemu-ga: Add an configure option to specify path to Windows VSS SDK Tomoki Sekiyama
2013-05-21 16:53   ` Eric Blake
2013-05-21 21:02     ` Tomoki Sekiyama
2013-05-24 13:48     ` Laszlo Ersek
2013-05-24 14:03   ` Laszlo Ersek
2013-05-21 15:33 ` [Qemu-devel] [RFC PATCH v3 05/11] qemu-ga: Add Windows VSS provider to quiesce applications on fsfreeze Tomoki Sekiyama
2013-05-23 12:22   ` Stefan Hajnoczi
2013-05-23 18:36     ` Tomoki Sekiyama
2013-05-24  8:54       ` Stefan Hajnoczi
2013-05-24 14:30         ` Tomoki Sekiyama
2013-05-28 21:01       ` Jeff Cody
2013-05-29  7:39         ` Stefan Hajnoczi
2013-05-31  2:15           ` Tomoki Sekiyama
2013-05-21 15:33 ` [Qemu-devel] [RFC PATCH v3 06/11] qemu-ga: Add Windows VSS requester to quisce applications and filesystems Tomoki Sekiyama
2013-05-21 16:56   ` Eric Blake
2013-05-21 21:02     ` Tomoki Sekiyama
2013-05-28 20:17   ` Jeff Cody
2013-05-31  5:06     ` Tomoki Sekiyama
2013-05-21 15:34 ` [Qemu-devel] [RFC PATCH v3 07/11] qemu-ga: call Windows VSS requester in fsfreeze command handler Tomoki Sekiyama
2013-05-21 15:34 ` [Qemu-devel] [RFC PATCH v3 08/11] qemu-ga: install Windows VSS provider on `qemu-ga -s install' Tomoki Sekiyama
2013-05-21 15:34 ` [Qemu-devel] [RFC PATCH v3 09/11] qemu-ga: Add VSS provider .tlb file in the repository Tomoki Sekiyama
2013-05-28 21:07   ` Jeff Cody
2013-05-21 15:34 ` [Qemu-devel] [RFC PATCH v3 10/11] QMP/qemu-ga-client: make timeout longer for guest-fsfreeze-freeze command Tomoki Sekiyama
2013-05-21 15:34 ` [Qemu-devel] [RFC PATCH v3 11/11] QMP/qmp.py: set locale for exceptions to display non-ascii messages correctly Tomoki Sekiyama
2013-05-23 12:30   ` Stefan Hajnoczi
2013-05-24 18:55     ` Tomoki Sekiyama
2013-05-27 12:06       ` Stefan Hajnoczi
2013-05-23 11:05 ` [Qemu-devel] [RFC PATCH v3 00/11] qemu-ga: fsfreeze on Windows using VSS Laszlo Ersek
2013-05-23 17:11   ` Tomoki Sekiyama
2013-05-23 12:15 ` Stefan Hajnoczi
2013-05-23 13:20   ` Paolo Bonzini
2013-05-23 13:28     ` Stefan Hajnoczi
2013-05-23 13:50       ` Paolo Bonzini
2013-05-24  8:59         ` Stefan Hajnoczi
2013-05-24 12:08           ` Paolo Bonzini
2013-05-24  9:20         ` Stefan Hajnoczi
2013-05-27  4:13 ` Libaiqing
2013-05-27  7:01   ` Tomoki Sekiyama
2013-05-27 10:00     ` Libaiqing
2013-05-31  1:30 ` Libaiqing
2013-05-31  2:20   ` Tomoki Sekiyama
2013-06-03  9:12     ` Libaiqing
2013-06-03 12:20       ` Luiz Capitulino

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=20130527114339.GB23204@stefanha-thinkpad.redhat.com \
    --to=stefanha@gmail.com \
    --cc=areis@redhat.com \
    --cc=armbru@redhat.com \
    --cc=lcapitulino@redhat.com \
    --cc=mdroth@linux.vnet.ibm.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=seiji.aguchi@hds.com \
    --cc=tomoki.sekiyama@hds.com \
    --cc=vrozenfe@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).