8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi, as far as I can tell, I can't match on a C99 compound literal (https://en.cppreference.com/w/c/language/compound_literal).
For example, I want to match this C code:
typedef struct { int * a; } A; static A aaa = { .a = (int[500]) { 0 } };
I tried a cocci script to match all compound literals:
@@ @@ * ( ... ) { ... }
I would expect that to match all compound literals but I get the following error:
init_defs_builtins: /nix/store/7ii5nryp5xl1frrlqz0s7r1p3i888jva-coccinelle-1.2/lib/coccinelle/standard.h minus: parse error: File "test.cocci", line 3, column 10, charpos = 16 around = '{', whole content = * ( ... ) { ... }
The text was updated successfully, but these errors were encountered:
Would you like to try another SmPL script variant out once more? 🤔
@display@ initialiser list il; type t; @@ *( t ) { il }
Test result:
Markus_Elfring@Sonne:…/Projekte/Coccinelle/Probe> spatch suggestion_for_Archit_Gupta-20241019.cocci example_Archit_Gupta-20241010.c … diff = --- example_Archit_Gupta-20241010.c +++ /tmp/cocci-output-38036-9c76c6-example_Archit_Gupta-20241010.c @@ -4,4 +4,3 @@ typedef struct { int * a; } A; -static A aaa = { .a = (int[500]) { 0 } };
Sorry, something went wrong.
No branches or pull requests
Hi, as far as I can tell, I can't match on a C99 compound literal (https://en.cppreference.com/w/c/language/compound_literal).
For example, I want to match this C code:
I tried a cocci script to match all compound literals:
I would expect that to match all compound literals but I get the following error:
The text was updated successfully, but these errors were encountered: