mirror of
https://github.com/compiler-explorer/compiler-explorer.git
synced 2025-12-27 09:23:52 -05:00
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>
11 lines
261 B
C
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 */
|