From: Kevin Wolf <kwolf@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: "Marc-André Lureau" <marcandre.lureau@gmail.com>,
"qemu trival" <qemu-trivial@nongnu.org>,
QEMU <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] clang-tidy: use g_new() family of functions
Date: Wed, 6 Sep 2017 10:52:59 +0200 [thread overview]
Message-ID: <20170906085259.GB3753@dhcp-200-186.str.redhat.com> (raw)
In-Reply-To: <87fuc1ma7d.fsf@dusky.pond.sub.org>
Am 05.09.2017 um 17:33 hat Markus Armbruster geschrieben:
> Marc-André Lureau <marcandre.lureau@gmail.com> writes:
> > code base). I find it easier to write a tidy check, and more friendly
> > command line / output etc:
> >
> > /tmp/test.c:3:17: warning: use g_new() instead [qemu-use-gnew]
> > int *f = (int*)malloc(sizeof(int) * 2);
> > ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
> > g_new(int, 2)
> >
> > clang-tidy should also respect clang-format rules when modifying the code
> > (see also
> > https://lists.nongnu.org/archive/html/qemu-devel/2017-08/msg05762.html).
> >
> > I also imagine it should be possible to integrate to clang warnings in the
> > future (similar to libreoffice clang plugins for ex). All in all,
> > coccinelle or clang-tidy are probably both capable of doing this job, but
> > clang-tidy is snappier and has more potentials for toolchain integration.
>
> Suggest you show us cool things you can do with clang-tidy that haven't
> been done with Coccinelle :)
Well, I don't really know clang-tidy, but if the above is what it does,
that _is_ cool. With Coccinelle scripts you run the script from time to
time and remove any new offenders. But if clang-tidy allows us to turn
any new offender into a build error so that they don't even make it into
master, then to me that's way superior.
Not all users are using clang, obviously, so even if we can
automatically enable this for clang, not everyone would see the
warnings. But if we can make some patchew hosts use it, that would
already be enough to catch those things.
Unless I'm misinterpreting what Marc-André is saying and running
clang-tidy actually requires more than is reasonable for patchew.
Kevin
prev parent reply other threads:[~2017-09-06 8:53 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-05 12:14 [Qemu-devel] clang-tidy: use g_new() family of functions Marc-André Lureau
2017-09-05 12:41 ` Philippe Mathieu-Daudé
2017-09-05 12:48 ` Marc-André Lureau
2017-09-05 12:56 ` Markus Armbruster
2017-09-05 13:29 ` Marc-André Lureau
2017-09-05 15:33 ` Markus Armbruster
2017-09-05 15:55 ` Marc-André Lureau
2017-09-05 16:23 ` Markus Armbruster
2017-09-06 8:52 ` Kevin Wolf [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=20170906085259.GB3753@dhcp-200-186.str.redhat.com \
--to=kwolf@redhat.com \
--cc=armbru@redhat.com \
--cc=marcandre.lureau@gmail.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@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).