Re: [cocci] Searching function implementations with variable declarations and statements?

Julia Lawall
2025-07-01T13:41:14Z

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

On Tue, 1 Jul 2025, Markus Elfring wrote:

> > Should any diff output be produced accordingly?
>
> Would you occasionally really find a source code search approach like the following
> more appropriate?
>
> Another SmPL script example:
> @display3@
> statement s;
> identifier i;
> type t;
> @@
> t i;
> <+...
> *s
> ...+>

You don't need the +

julia

>
>
> Markus_Elfring@Sonne:…/Projekte/Linux/next-analyses> time /usr/bin/spatch --no-loops …/Projekte/Coccinelle/janitor/show_statements_after_variable_declaration2.cocci include/
> …
> @@ -668,7 +668,6 @@ usb_endpoint_maxp_mult(const struct usb_
> …
> @@ -723,17 +722,10 @@ usb_ss_max_streams(const struct usb_ss_e
> …
> real 0m0,243s
> user 0m0,199s
> sys 0m0,042s
>
>
> Is there a need to reconsider the handling of curly brackets (for compound statements)?
>
> Regards,
> Markus
>