From: Julia Lawall <julia.lawall@lip6.fr>
To: Joe Perches <joe@perches.com>
Cc: Himangi Saraogi <himangi774@gmail.com>,
Stefan Achatz <erazor_de@users.sourceforge.net>,
Jiri Kosina <jkosina@suse.cz>,
linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] HID: roccat: Drop cast
Date: Sun, 29 Jun 2014 18:34:14 +0200 (CEST) [thread overview]
Message-ID: <alpine.DEB.2.02.1406291832430.2036@localhost6.localdomain6> (raw)
In-Reply-To: <1403848366.7977.92.camel@joe-AO725>
On Thu, 26 Jun 2014, Joe Perches wrote:
> On Fri, 2014-06-27 at 07:29 +0200, Julia Lawall wrote:
> > On Thu, 26 Jun 2014, Joe Perches wrote:
> > > The cast of a const void * to a void * was odd.
> > >
> > > Maybe a mechanism to verify appropriateness of
> > > loss of constness for any pointer might be useful.
> >
> > I tried the following, but didn't find anything interesting:
> >
> > @disable drop_cast@
> > type T;
> > const T e;
> > @@
> >
> > * (T)e
>
> What code does this match?
> Do you have an example match?
>
> This doesn't find a cast of a void type like:
>
> void func(const void * const p)
> {
> char *p2 = p;
>
> p2[0] = 1;
> }
Is this a real example? Because gcc complains about this sort of problem.
I made a semantic patch that detects this, but since gcc does the same
thing, it doesn't seem very interesting. Coccinelle gives a few false
positives due to lack of type information.
julia
next prev parent reply other threads:[~2014-06-29 16:34 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-26 17:28 [PATCH] HID: roccat: Drop cast Himangi Saraogi
2014-06-26 17:38 ` Joe Perches
2014-06-27 5:29 ` Julia Lawall
2014-06-27 5:52 ` Joe Perches
2014-06-27 7:59 ` Julia Lawall
2014-06-29 16:34 ` Julia Lawall [this message]
2014-06-29 18:25 ` Joe Perches
2014-06-30 9:08 ` Geert Uytterhoeven
2014-06-26 22:35 ` Jiri Kosina
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=alpine.DEB.2.02.1406291832430.2036@localhost6.localdomain6 \
--to=julia.lawall@lip6.fr \
--cc=erazor_de@users.sourceforge.net \
--cc=himangi774@gmail.com \
--cc=jkosina@suse.cz \
--cc=joe@perches.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.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