Skip to contentSkip to conversation

Improving support for argument lists with SmPL

cocci Markus Elfring 2 participants 5 messages Mar 25, 2024

lore
Share & tools
lore
#0 lore raw

Hello,

I got the impression that there are opportunities to improve the support for argument lists at some places.

Identifiers can occasionally be followed by parentheses in the source code. Such a code combination can be interpreted in different ways.

* Function call

* Macro call

See also:
Improve support for handling arguments of function-like macros 2024-03-14
https://github.com/coccinelle/coccinelle/issues/362

Compiler-specific extensions can be provided also as macros.
The specification of attributes with arguments is a corresponding application area, isn't it?
https://en.cppreference.com/w/c/language/attributes

https://gitlab.inria.fr/coccinelle/coccinelle/-/blob/0011af1760e37caada1f9d48e2c549bd519bf203/docs/manual/cocci_syntax.tex#L461
https://github.com/coccinelle/coccinelle/blob/0011af1760e37caada1f9d48e2c549bd519bf203/docs/manual/cocci_syntax.tex#L461

Regards,
Markus

#1 lore raw
Quoted 17 lines · Markus Elfring

Hello,

I got the impression that there are opportunities to improve the support for argument lists at some places.

Identifiers can occasionally be followed by parentheses in the source code. Such a code combination can be interpreted in different ways.

* Function call

* Macro call

See also:
Improve support for handling arguments of function-like macros 2024-03-14
https://github.com/coccinelle/coccinelle/issues/362

Quoted 7 lines

Compiler-specific extensions can be provided also as macros.
The specification of attributes with arguments is a corresponding application area, isn't it?
https://en.cppreference.com/w/c/language/attributes

https://gitlab.inria.fr/coccinelle/coccinelle/-/blob/0011af1760e37caada1f9d48e2c549bd519bf203/docs/manual/cocci_syntax.tex#L461
https://github.com/coccinelle/coccinelle/blob/0011af1760e37caada1f9d48e2c549bd519bf203/docs/manual/cocci_syntax.tex#L461

If you have a specific question, please say what it is, and don't expect that I wuill try to infer it from a collection of links.

julia

#2 lore raw

…

Quoted 2 lines
Quoted 2 lines

Identifiers can occasionally be followed by parentheses in the source code. Such a code combination can be interpreted in different ways.

…

Quoted 3 lines
Quoted 3 lines

Improve support for handling arguments of function-like macros 2024-03-14
https://github.com/coccinelle/coccinelle/issues/362

…

Quoted 1 line

If you have a specific question, please say what it is,

Please take another look at information in known issue trackers.

How many programming interfaces can be shared by the Coccinelle software for data processing according to macro calls and handling of attributes with arguments?

See also another related clarification approach (from yesterday):
Fix a parse error for the addition of a special variable declaration
https://github.com/coccinelle/coccinelle/issues/363#issuecomment-2016794266

Quoted 2 lines

and don't expect
that I wuill try to infer it from a collection of links.

Would any more developers get into the mood to add ideas accordingly?

Regards,
Markus

#3 lore raw
Quoted 7 lines · Markus Elfring

…

Quoted 2 lines
Quoted 2 lines

Identifiers can occasionally be followed by parentheses in the source code. Such a code combination can be interpreted in different ways.

…

Quoted 3 lines
Quoted 3 lines

Improve support for handling arguments of function-like macros 2024-03-14
https://github.com/coccinelle/coccinelle/issues/362

Quoted 7 lines

…

Quoted 1 line

If you have a specific question, please say what it is,

Please take another look at information in known issue trackers.

How many programming interfaces can be shared by the Coccinelle software for data processing according to macro calls and handling of attributes with arguments?

Coccinelle makes no distinction between macro calls and function calls.

But if this is again about your question about non-expressions in macro arguments, nothing is going to happen. The issue is rare and is not a priority.

Quoted 4 lines

See also another related clarification approach (from yesterday):
Fix a parse error for the addition of a special variable declaration
https://github.com/coccinelle/coccinelle/issues/363#issuecomment-2016794266

I don't see what that has to do with macro arguments. Please don't mix issues in a single message, especially when the message doesn't even make clear what the issue is (giving a link dones't count as making it clear).

julia

Quoted 10 lines
Quoted 4 lines

and don't expect
that I wuill try to infer it from a collection of links.

Would any more developers get into the mood to add ideas accordingly?

Regards,
Markus

#4 lore raw
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

Improve support for handling arguments of function-like macros 2024-03-14
https://github.com/coccinelle/coccinelle/issues/362

…

Quoted 4 lines
Quoted 2 lines

How many programming interfaces can be shared by the Coccinelle software for data processing according to macro calls and handling of attributes with arguments?

Coccinelle makes no distinction between macro calls and function calls.

I got the impression that case distinctions should be enhanced here.

Quoted 2 lines

But if this is again about your question about non-expressions in macro arguments, nothing is going to happen. The issue is rare

I suggest to reconsider such a view.

Quoted 1 line

and is not a priority.

Further improvements would be nice for several issues.

Quoted 5 lines
Quoted 3 lines

See also another related clarification approach (from yesterday):
Fix a parse error for the addition of a special variable declaration
https://github.com/coccinelle/coccinelle/issues/363#issuecomment-2016794266

I don't see what that has to do with macro arguments.

How would you like to handle argument lists for attributes?

Quoted 3 lines

Please don't mix
issues in a single message, especially when the message doesn't even make clear what the issue is (giving a link dones't count as making it clear).

Do you find a referenced message more interesting for further clarifications?

Markus_Elfring@Sonne:…/Projekte/Coccinelle/janitor> spatch --parse-cocci reduce_scope_for_smart_pointers_in_ice-9-20240324.cocci …
warning: find: metavariable release not used in the - or context code
…

Regards,
Markus