Files
Michele Martone 8557b59055 added initial support for the Coccinelle code transformation system, closes #6999 (#7001)
This fork provides a rudimentary way of using Coccinelle within Compiler
Explorer.
In the left window one can edit either C or C++ code, and within
preprocessor ifdefs, one can write a semantic patch for Coccinelle.
The right window will display the transformed code.

A coccinelle on infra is not yet done.
Any distribution-based coccinelle would do, for the moment.

If you like it, this close #6999 .

---------

Signed-off-by: Michele Martone <michelemartone@users.sourceforge.net>
Co-authored-by: Patrick Quist <partouf@gmail.com>
Co-authored-by: Mats Jun Larsen <mats@jun.codes>
Co-authored-by: Matt Godbolt <matt@godbolt.org>
2025-02-24 10:10:35 -06:00

11 lines
261 B
C

// Write your C program in this section:
int main(){ return 0; }
#ifdef COCCINELLE // this keyword should only occur on this and the last line
// Write your Coccinelle 🐞 rules in this section (and keep the ifdef):
@patch@
@@
- 0
+ 1
#endif /* COCCINELLE */