* [Cocci] Removing pointer declaration
@ 2013-06-08 17:28 Wolfram Sang
2013-06-08 18:53 ` Julia Lawall
2013-06-10 7:34 ` Michael Stefaniuc
0 siblings, 2 replies; 5+ messages in thread
From: Wolfram Sang @ 2013-06-08 17:28 UTC (permalink / raw)
To: cocci
Hi,
This spatch:
@@
int *p;
@@
- int *p;
with this code:
int main()
{
int *a;
return 0;
}
results in:
Fatal error: exception Failure("minus: parse error:
= File "test.cocci", line 5, column 7, charpos = 22
around = 'p', whole content = - int *p;
")
using:
spatch version 1.0.0-rc15 with Python support and with PCRE support
(although dpkg says it is rc16)
Am I doing something wrong?
Thanks,
Wolfram
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <https://systeme.lip6.fr/pipermail/cocci/attachments/20130608/353b5d59/attachment.asc>
^ permalink raw reply [flat|nested] 5+ messages in thread* [Cocci] Removing pointer declaration
2013-06-08 17:28 [Cocci] Removing pointer declaration Wolfram Sang
@ 2013-06-08 18:53 ` Julia Lawall
2013-06-08 19:02 ` Wolfram Sang
2013-06-10 7:34 ` Michael Stefaniuc
1 sibling, 1 reply; 5+ messages in thread
From: Julia Lawall @ 2013-06-08 18:53 UTC (permalink / raw)
To: cocci
On Sat, 8 Jun 2013, Wolfram Sang wrote:
> Hi,
>
> This spatch:
>
> @@
> int *p;
This should be "identifier p".
julia
> @@
>
> - int *p;
>
> with this code:
>
>
> int main()
> {
> int *a;
>
> return 0;
> }
>
> results in:
>
> Fatal error: exception Failure("minus: parse error:
> = File "test.cocci", line 5, column 7, charpos = 22
> around = 'p', whole content = - int *p;
> ")
>
> using:
>
> spatch version 1.0.0-rc15 with Python support and with PCRE support
> (although dpkg says it is rc16)
>
> Am I doing something wrong?
>
> Thanks,
>
> Wolfram
>
^ permalink raw reply [flat|nested] 5+ messages in thread* [Cocci] Removing pointer declaration
2013-06-08 18:53 ` Julia Lawall
@ 2013-06-08 19:02 ` Wolfram Sang
2013-06-08 19:06 ` Julia Lawall
0 siblings, 1 reply; 5+ messages in thread
From: Wolfram Sang @ 2013-06-08 19:02 UTC (permalink / raw)
To: cocci
Hi Julia,
On Sat, Jun 08, 2013 at 08:53:19PM +0200, Julia Lawall wrote:
> On Sat, 8 Jun 2013, Wolfram Sang wrote:
>
> > Hi,
> >
> > This spatch:
> >
> > @@
> > int *p;
>
> This should be "identifier p".
I noticed meanwhile. Is it because the type cannot be checked because
the pointer has not been declared yet? And, in general, can I get some
more info about what went wrong besides "parse error" somehow? --debug
didn't help.
Thanks!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <https://systeme.lip6.fr/pipermail/cocci/attachments/20130608/837973f5/attachment.asc>
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Cocci] Removing pointer declaration
2013-06-08 19:02 ` Wolfram Sang
@ 2013-06-08 19:06 ` Julia Lawall
0 siblings, 0 replies; 5+ messages in thread
From: Julia Lawall @ 2013-06-08 19:06 UTC (permalink / raw)
To: cocci
On Sat, 8 Jun 2013, Wolfram Sang wrote:
> Hi Julia,
>
> On Sat, Jun 08, 2013 at 08:53:19PM +0200, Julia Lawall wrote:
> > On Sat, 8 Jun 2013, Wolfram Sang wrote:
> >
> > > Hi,
> > >
> > > This spatch:
> > >
> > > @@
> > > int *p;
> >
> > This should be "identifier p".
>
> I noticed meanwhile. Is it because the type cannot be checked because
> the pointer has not been declared yet? And, in general, can I get some
> more info about what went wrong besides "parse error" somehow? --debug
> didn't help.
It is an identifier because it is a name. Not an int like 32.
Unfortunately, it is hard to get a yacc-like parser to generate helpful
error messages. The code that one writes doesn't know about the context
that it is in.
julia
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Cocci] Removing pointer declaration
2013-06-08 17:28 [Cocci] Removing pointer declaration Wolfram Sang
2013-06-08 18:53 ` Julia Lawall
@ 2013-06-10 7:34 ` Michael Stefaniuc
1 sibling, 0 replies; 5+ messages in thread
From: Michael Stefaniuc @ 2013-06-10 7:34 UTC (permalink / raw)
To: cocci
On 06/08/2013 07:28 PM, Wolfram Sang wrote:
> using:
>
> spatch version 1.0.0-rc15 with Python support and with PCRE support
> (although dpkg says it is rc16)
Yeah, coccinelle rc17 reports as version 1.0.0-rc15 too.
bye
michael
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-06-10 7:34 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-08 17:28 [Cocci] Removing pointer declaration Wolfram Sang
2013-06-08 18:53 ` Julia Lawall
2013-06-08 19:02 ` Wolfram Sang
2013-06-08 19:06 ` Julia Lawall
2013-06-10 7:34 ` Michael Stefaniuc
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox