cocci.inria.fr archive mirror
 help / color / mirror / Atom feed
* [cocci] Matching against struct_group()
@ 2022-10-04 10:21 Christoph Böhmwalder
  2022-10-04 11:50 ` Julia Lawall
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Christoph Böhmwalder @ 2022-10-04 10:21 UTC (permalink / raw)
  To: cocci

Hi all,

say I would like to replace an instance of the struct_group macro in the
Linux kernel:

	struct_group(algs,
		char verify_alg[SHARED_SECRET_MAX];
		char csums_alg[SHARED_SECRET_MAX];
	);

I'm guessing this is not supported by coccinelle because of the
"unusual" syntax? I tried specifying struct_group as a "declarer", but
that did not work (which does not surprise me because it's not really a
declarer anyway).

Is there any way I can still make this match?

Thanks.

-- 
Christoph Böhmwalder
LINBIT | Keeping the Digital World Running
DRBD HA —  Disaster Recovery — Software defined Storage

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [cocci] Matching against struct_group()
  2022-10-04 10:21 [cocci] Matching against struct_group() Christoph Böhmwalder
@ 2022-10-04 11:50 ` Julia Lawall
  2022-10-04 18:10 ` Markus Elfring
  2022-10-05 10:25 ` Julia Lawall
  2 siblings, 0 replies; 4+ messages in thread
From: Julia Lawall @ 2022-10-04 11:50 UTC (permalink / raw)
  To: Christoph Böhmwalder; +Cc: cocci

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



On Tue, 4 Oct 2022, Christoph Böhmwalder wrote:

> Hi all,
>
> say I would like to replace an instance of the struct_group macro in the
> Linux kernel:
>
> 	struct_group(algs,
> 		char verify_alg[SHARED_SECRET_MAX];
> 		char csums_alg[SHARED_SECRET_MAX];
> 	);

The corresponding C code is not parsed.  I will check whether this can be
integrated without introducing parse conflicts.

julia

>
> I'm guessing this is not supported by coccinelle because of the
> "unusual" syntax? I tried specifying struct_group as a "declarer", but
> that did not work (which does not surprise me because it's not really a
> declarer anyway).
>
> Is there any way I can still make this match?
>
> Thanks.
>
> --
> Christoph Böhmwalder
> LINBIT | Keeping the Digital World Running
> DRBD HA —  Disaster Recovery — Software defined Storage
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [cocci] Matching against struct_group()
  2022-10-04 10:21 [cocci] Matching against struct_group() Christoph Böhmwalder
  2022-10-04 11:50 ` Julia Lawall
@ 2022-10-04 18:10 ` Markus Elfring
  2022-10-05 10:25 ` Julia Lawall
  2 siblings, 0 replies; 4+ messages in thread
From: Markus Elfring @ 2022-10-04 18:10 UTC (permalink / raw)
  To: Christoph Böhmwalder, cocci

> say I would like to replace an instance of the struct_group macro in the
> Linux kernel:
>
> 	struct_group(algs,
> 		char verify_alg[SHARED_SECRET_MAX];
> 		char csums_alg[SHARED_SECRET_MAX];
> 	);
>
> I'm guessing this is not supported by coccinelle because of the
> "unusual" syntax?
> Is there any way I can still make this match?


Probably, yes.


Corresponding solution approaches depend on the detail how many software
development resources can be invested for the support of the desired
source code transformation.

I imagine that it will be needed to achieve also support for the proper distinction
of macro calls from function calls by the means of the semantic patch language.
Would you like to influence evolution for affected software components any further?

Regards,
Markus


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [cocci] Matching against struct_group()
  2022-10-04 10:21 [cocci] Matching against struct_group() Christoph Böhmwalder
  2022-10-04 11:50 ` Julia Lawall
  2022-10-04 18:10 ` Markus Elfring
@ 2022-10-05 10:25 ` Julia Lawall
  2 siblings, 0 replies; 4+ messages in thread
From: Julia Lawall @ 2022-10-05 10:25 UTC (permalink / raw)
  To: Christoph Böhmwalder; +Cc: cocci

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



On Tue, 4 Oct 2022, Christoph Böhmwalder wrote:

> Hi all,
>
> say I would like to replace an instance of the struct_group macro in the
> Linux kernel:
>
> 	struct_group(algs,
> 		char verify_alg[SHARED_SECRET_MAX];
> 		char csums_alg[SHARED_SECRET_MAX];
> 	);
>
> I'm guessing this is not supported by coccinelle because of the
> "unusual" syntax? I tried specifying struct_group as a "declarer", but
> that did not work (which does not surprise me because it's not really a
> declarer anyway).
>
> Is there any way I can still make this match?

What is it about this struct_group that makes you want to match it?  That
is, would your semantic patch involve something about the second argument,
with the declarations?

julia

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-10-05 10:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-04 10:21 [cocci] Matching against struct_group() Christoph Böhmwalder
2022-10-04 11:50 ` Julia Lawall
2022-10-04 18:10 ` Markus Elfring
2022-10-05 10:25 ` Julia Lawall

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).