git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] cocci: remove 'unused.cocci'

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
May 1, 2023, 17:28 UTC
Message-ID
<230501.865y9chs69.gmgdl@evledraar.gmail.com>
In-Reply-To
<xmqqlei86o7s.fsf@gitster.g>
On Mon, May 01 2023, Junio C Hamano wrote:
Show 14 quoted lines
> Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
>
>> It wasn't something I intended at the time, but arguably the main use of
>> this rule since it was added was that it served as a canary for the tree
>> becoming completely broken with coccinelle, due to adding C syntax it
>> didn't understand:
>> https://lore.kernel.org/git/220825.86ilmg4mil.gmgdl@evledraar.gmail.com/
>
> If it weren't Coccinelle, we could have used the much nicer looking
> UNUSED(var) notation, and the compilers were all fine.
>
> Only because Coccinelle did not understand the "cute" syntax trick,
> we couldn't.  Yes, it caught us when we used a syntax it couldn't
> understand, but is that a good thing in the first place?

I think it's unambiguously a good thing that we spotted an otherwise unknown side-effect of the proposed UNUSED(var) syntax on coccinelle.

We might also say that some bit of syntax that coccinelle doesn't understand is so valuable that we'd like to make coccinelle itself significantly less useful (as it wouldn't reach into those functions), or stop using it altogether.

But that's a seperate question. I'm just pointing out that we'd be losing a very valuable check on future syntax incompatibilities, particularly when it comes to clever use of macros.

A better way to spot that would be to start parsing the coccinelle logs, and detect when we have unknown parsing issues, and error on those. But until then...

Previous: Junio C HamanoNext: Junio C Hamano
Message 13 of 26 in “cocci: codify authoring and reviewing practices”
  1. 0/2 cocci: codify authoring and reviewing practicesGlen Choo via GitGitGadget, Apr 12, 2023
  2. 1/2 cocci: add headings to and reword READMEGlen Choo via GitGitGadget, Apr 12, 2023
  3. Junio C HamanoApr 12, 2023
  4. Glen ChooApr 13, 2023
  5. Junio C HamanoApr 13, 2023
  6. 2/2 cocci: codify authoring and reviewing practicesGlen Choo via GitGitGadget, Apr 12, 2023
  7. SZEDER GáborApr 16, 2023
  8. Glen ChooApr 19, 2023
  9. cocci: remove 'unused.cocci'SZEDER Gábor, Apr 20, 2023
  10. Junio C HamanoApr 21, 2023
  11. Ævar Arnfjörð BjarmasonMay 1, 2023
  12. Junio C HamanoMay 1, 2023
  13. Ævar Arnfjörð BjarmasonMay 1, 2023
  14. Junio C HamanoMay 10, 2023
  15. Ævar Arnfjörð BjarmasonApr 16, 2023
  16. Glen ChooApr 19, 2023
  17. Elijah NewrenApr 15, 2023
  18. Junio C HamanoApr 17, 2023
  19. 0/2 cocci: codify authoring and reviewing practicesGlen Choo via GitGitGadget, Apr 27, 2023
  20. 1/2 cocci: add headings to and reword READMEGlen Choo via GitGitGadget, Apr 27, 2023
  21. Ævar Arnfjörð BjarmasonMay 1, 2023
  22. Junio C HamanoMay 1, 2023
  23. Felipe ContrerasMay 2, 2023
  24. Felipe ContrerasMay 2, 2023
  25. Glen ChooMay 9, 2023
  26. 2/2 cocci: codify authoring and reviewing practicesGlen Choo via GitGitGadget, Apr 27, 2023

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.