Coccinelle Archive on lore.kernel.org
 help / color / Atom feed
From: Julia Lawall <julia.lawall@inria.fr>
To: Markus Elfring <Markus.Elfring@web.de>
Cc: Coccinelle <cocci@systeme.lip6.fr>
Subject: Re: [Cocci] Replacing #define directives with the help of SmPL
Date: Sun, 28 Mar 2021 12:47:35 +0200 (CEST)
Message-ID: <alpine.DEB.2.22.394.2103281244200.2854@hadrien> (raw)
In-Reply-To: <1b5f6d22-5b89-097f-37bd-13b3b2ab011a@web.de>


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



On Sun, 28 Mar 2021, Markus Elfring wrote:

> >> https://github.com/coccinelle/coccinelle/issues/139
> >
> > I looked at the link, but there is no concrete example of something that
> > does not work, so I have no idea what the problem is.
>
> You expressed another bit of better understanding of known limitations for
> the Coccinelle software already, didn't you?
>
> Would you like to help any more with attempts to achieve support for
> a transformation pattern like “#define ⇒ enum” according to the semantic patch language?
> https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/981
> https://github.com/issues?q=is%3Aissue+author%3Aelfring+%22+enum%22

If you find that something does not work satisfactorily, propose a
semantic patch and show what doesn't work.  I'm not going to try to solve
a problem when I don't know what the problem is.

I think that this tranformation would be diffficult to make using
Coccinelle, due to the need to ensure that the enum values are end up in the
right order, if you want to rely on the implicit values of enums.
Furthermore, if this is targeting C code, the benefits will be limited,
because C considers enums to be the same as ints.

julia

[-- Attachment #2: Type: text/plain, Size: 136 bytes --]

_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci

  parent reply index

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-28  7:19 Markus Elfring
2021-03-28  9:29 ` Julia Lawall
     [not found]   ` <1b5f6d22-5b89-097f-37bd-13b3b2ab011a@web.de>
2021-03-28 10:47     ` Julia Lawall [this message]
     [not found]       ` <173fa182-4127-aaba-262e-e3953a81a1e2@web.de>
2021-03-28 11:46         ` Julia Lawall
     [not found]           ` <b80fe77f-0a11-2000-522e-836c9368eaa6@web.de>
2021-03-28 12:48             ` Julia Lawall
     [not found]           ` <b761969f-181b-5951-0730-11c340e236ab@web.de>
2021-03-28 14:08             ` Julia Lawall
     [not found]           ` <f720b262-708f-a603-3470-b374db625578@web.de>
2021-03-28 14:45             ` Julia Lawall
     [not found]               ` <fa66fce2-e60e-1907-7c8b-fd9ceedb8086@web.de>
2021-04-04 11:58                 ` [Cocci] Excluding quotes from strings of #define directives Julia Lawall
2021-04-04 12:11                   ` Markus Elfring
2021-04-04 12:19                     ` Julia Lawall
     [not found]                       ` <b9f6aceb-7e68-303d-bd1e-d41a7992b58b@web.de>
2021-04-05  7:09                         ` [Cocci] Checking support for compound expressions (according to #define directives) Julia Lawall
     [not found]                           ` <8561006e-7dc6-0f62-ecf0-c93146976925@web.de>
2021-04-05  7:54                             ` Julia Lawall
2021-04-05  8:46                               ` Markus Elfring
2021-04-05  8:53                                 ` Julia Lawall
2021-04-05 10:37                               ` [Cocci] Improve the handling of string literals with SmPL Markus Elfring
     [not found]       ` <eaa316bd-4c73-fcbb-bfad-20426348b1c2@web.de>
2021-03-28 15:17         ` [Cocci] Replacing #define directives with the help of SmPL Julia Lawall

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.22.394.2103281244200.2854@hadrien \
    --to=julia.lawall@inria.fr \
    --cc=Markus.Elfring@web.de \
    --cc=cocci@systeme.lip6.fr \
    /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

Coccinelle Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/cocci/0 cocci/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 cocci cocci/ https://lore.kernel.org/cocci \
		cocci@systeme.lip6.fr
	public-inbox-index cocci

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/fr.lip6.systeme.cocci


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git