Re: [Cocci] [v4 3/3] tests: Add test case to match const pointer variants

2020-02-09 Thread Markus Elfring
> > Do you mean that the C file/res file should conform to the Linux style? > > I think it would be nicer if it did. Is the interest for the clarification of a topic like “Make change influence configurable for coding style rules” growing? https://github.com/coccinelle/coccinelle/issues/37 Regard

Re: [Cocci] [PATCH v4 3/3] tests: Add test case to match const pointer variants

2020-02-09 Thread Julia Lawall
On Sun, 9 Feb 2020, Jaskaran Singh wrote: > On Sun, 2020-02-09 at 17:48 +0100, Julia Lawall wrote: > > On Sun, 9 Feb 2020, Jaskaran Singh wrote: > > > > > Pointer to const pointer and its variants would not match > > > previously. > > > Add a test case for matching these types. > > > > > > Sign

Re: [Cocci] [PATCH v4 3/3] tests: Add test case to match const pointer variants

2020-02-09 Thread Jaskaran Singh
On Sun, 2020-02-09 at 17:48 +0100, Julia Lawall wrote: > On Sun, 9 Feb 2020, Jaskaran Singh wrote: > > > Pointer to const pointer and its variants would not match > > previously. > > Add a test case for matching these types. > > > > Signed-off-by: Jaskaran Singh > > --- > > tests/constptr.c

Re: [Cocci] [PATCH v4 3/3] tests: Add test case to match const pointer variants

2020-02-09 Thread Julia Lawall
On Sun, 9 Feb 2020, Jaskaran Singh wrote: > Pointer to const pointer and its variants would not match previously. > Add a test case for matching these types. > > Signed-off-by: Jaskaran Singh > --- > tests/constptr.c | 7 +++ > tests/constptr.cocci | 19 +++ > tests/cons

Re: [Cocci] [PATCH v4 1/3] parsing_c: Align C AST and Cocci AST for pointer

2020-02-09 Thread Julia Lawall
On Sun, 9 Feb 2020, Jaskaran Singh wrote: > For a pointer, the C parser constructed an AST dissimilar from that > of the Cocci AST. This caused failures in matching with certain > pointer types. For example, for the following case: > > char *1 const *2 id; > > The C AST constructed would be: > con

[Cocci] [PATCH v4 2/3] tests: Add space between * and const in ptrconstptr.res

2020-02-09 Thread Jaskaran Singh
A space is now added between the * and qualifier. Reflect this change in the ptrconstptr test case. Signed-off-by: Jaskaran Singh --- tests/ptrconstptr.res | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/ptrconstptr.res b/tests/ptrconstptr.res index f5b2210c..1d0c3c1d 1

[Cocci] [PATCH v4 3/3] tests: Add test case to match const pointer variants

2020-02-09 Thread Jaskaran Singh
Pointer to const pointer and its variants would not match previously. Add a test case for matching these types. Signed-off-by: Jaskaran Singh --- tests/constptr.c | 7 +++ tests/constptr.cocci | 19 +++ tests/constptr.res | 7 +++ 3 files changed, 33 insertions(+)

[Cocci] [PATCH v4 1/3] parsing_c: Align C AST and Cocci AST for pointer

2020-02-09 Thread Jaskaran Singh
For a pointer, the C parser constructed an AST dissimilar from that of the Cocci AST. This caused failures in matching with certain pointer types. For example, for the following case: char *1 const *2 id; The C AST constructed would be: const Pointer1 -> Pointer2 -> char The Cocci AST constructe

[Cocci] [PATCH v4 0/3] cocci: Align the C AST and Cocci AST for pointer

2020-02-09 Thread Jaskaran Singh
This series is to address the type matching problem in Coccinelle. Patch 1/3 is for aligning the C and Cocci AST so that pointer to const pointer and its variants can be matched. Patch 2/3 reflects the pretty printing changes made in 1/3 in the ptrconstptr test case. A space is added between the

Re: [Cocci] [PATCH v3 1/3] parsing_c: Align C AST and Cocci AST for pointer

2020-02-09 Thread Julia Lawall
On Sun, 9 Feb 2020, Jaskaran Singh wrote: > For a pointer, the C parser constructed an AST dissimilar from that > of the Cocci AST. This caused failures in matching with certain > pointer types. For example, for the following case: > > char *1 const *2 id; > > The C AST constructed would be: > con

[Cocci] [PATCH v3 2/3] tests: Add space between * and const in ptrconstptr.res

2020-02-09 Thread Jaskaran Singh
A space is now added between the * and qualifier. Reflect this change in the ptrconstptr test case. Signed-off-by: Jaskaran Singh --- tests/ptrconstptr.res | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/ptrconstptr.res b/tests/ptrconstptr.res index f5b2210c..1d0c3c1d 1

[Cocci] [PATCH v3 3/3] tests: Add test case to match const pointer variants

2020-02-09 Thread Jaskaran Singh
Pointer to const pointer and its variants would not match previously. Add a test case for matching these types. Signed-off-by: Jaskaran Singh --- tests/constptr.c | 7 +++ tests/constptr.cocci | 19 +++ tests/constptr.res | 7 +++ 3 files changed, 33 insertions(+)

[Cocci] [PATCH v3 1/3] parsing_c: Align C AST and Cocci AST for pointer

2020-02-09 Thread Jaskaran Singh
For a pointer, the C parser constructed an AST dissimilar from that of the Cocci AST. This caused failures in matching with certain pointer types. For example, for the following case: char *1 const *2 id; The C AST constructed would be: const Pointer1 -> Pointer2 -> char The Cocci AST constructe

[Cocci] [PATCH v3 0/3] cocci: Align the C AST and Cocci AST for pointer

2020-02-09 Thread Jaskaran Singh
This series is to address the type matching problem in Coccinelle. Patch 1/3 is for aligning the C and Cocci AST so that pointer to const pointer and its variants can be matched. Patch 2/3 reflects the pretty printing changes made in 1/3 in the ptrconstptr test case. A space is added between the

Re: [Cocci] [v2 1/2] parsing_c: Align C AST and Coccinelle AST for pointers

2020-02-09 Thread Markus Elfring
>> https://en.wikipedia.org/wiki/AST > > Not necessary. Anyone who is looking at the Coccinelle commits should > know what an AST is. I would appreciate to reduce the potential for confusion around the application of parsing technologies. Regards, Markus _

Re: [Cocci] [PATCH v2 1/2] parsing_c: Align C AST and Coccinelle AST for pointers

2020-02-09 Thread Julia Lawall
On Sun, 9 Feb 2020, Markus Elfring wrote: > > For a pointer, the C parser constructed an AST dissimilar from that > > I find it helpful to mention the meaning of the term “AST” without > abbreviation > for a nicer patch description. > https://en.wikipedia.org/wiki/AST Not necessary. Anyone who

Re: [Cocci] [PATCH v2 1/2] parsing_c: Align C AST and Coccinelle AST for pointers

2020-02-09 Thread Markus Elfring
> For a pointer, the C parser constructed an AST dissimilar from that I find it helpful to mention the meaning of the term “AST” without abbreviation for a nicer patch description. https://en.wikipedia.org/wiki/AST Regards, Markus ___ Cocci mailing list

Re: [Cocci] [v2 1/2] parsing_c: Align C AST and Coccinelle AST for pointers

2020-02-09 Thread Markus Elfring
> + const char *const *y; > } > > There should be a space between * and const on the + line. Will such a detail become more interesting for the clarification around coding styles? https://github.com/coccinelle/coccinelle/issues/37 Regards, Markus _

Re: [Cocci] [v2 0/2] Align the C AST and Coccinelle AST for pointers

2020-02-09 Thread Julia Lawall
On Sun, 9 Feb 2020, Markus Elfring wrote: > > Like what? > > Do find my corresponding previous suggestion reasonable? > https://lore.kernel.org/cocci/702596c2-84bf-13ca-b014-8784bbb98...@web.de/ > https://systeme.lip6.fr/pipermail/cocci/2020-February/006842.html I have absolutely no preference ei

Re: [Cocci] [v2 0/2] Align the C AST and Coccinelle AST for pointers

2020-02-09 Thread Markus Elfring
> Like what? Do find my corresponding previous suggestion reasonable? https://lore.kernel.org/cocci/702596c2-84bf-13ca-b014-8784bbb98...@web.de/ https://systeme.lip6.fr/pipermail/cocci/2020-February/006842.html Regards, Markus ___ Cocci mailing list Coc

Re: [Cocci] [PATCH v2 0/2] Align the C AST and Coccinelle AST for pointers

2020-02-09 Thread Julia Lawall
On Sun, 9 Feb 2020, Markus Elfring wrote: > > This series is to address … > > Under which circumstances would you choose an adjusted wording for the message > in the cover letter? Like what? If you are referring to something that occurs 5 lines below what you have quoted, please include the spec

Re: [Cocci] [PATCH v2 0/2] Align the C AST and Coccinelle AST for pointers

2020-02-09 Thread Markus Elfring
> This series is to address … Under which circumstances would you choose an adjusted wording for the message in the cover letter? Regards, Markus ___ Cocci mailing list Cocci@systeme.lip6.fr https://systeme.lip6.fr/mailman/listinfo/cocci

Re: [Cocci] [PATCH v2 2/2] tests: Add test case to match const pointer variants

2020-02-09 Thread Jaskaran Singh
On Sun, 2020-02-09 at 09:07 +0100, Julia Lawall wrote: > On Sun, 9 Feb 2020, Jaskaran Singh wrote: > > > On Sun, 2020-02-09 at 08:20 +0100, Julia Lawall wrote: > > > On Fri, 7 Feb 2020, Jaskaran Singh wrote: > > > > > > > Pointer to const pointer and its variants would not match > > > > previousl

Re: [Cocci] [PATCH v2 2/2] tests: Add test case to match const pointer variants

2020-02-09 Thread Julia Lawall
On Sun, 9 Feb 2020, Jaskaran Singh wrote: > On Sun, 2020-02-09 at 08:20 +0100, Julia Lawall wrote: > > On Fri, 7 Feb 2020, Jaskaran Singh wrote: > > > > > Pointer to const pointer and its variants would not match > > > previously. > > > Add a test case for matching these types. > > > > I don't get

Re: [Cocci] [PATCH v2 2/2] tests: Add test case to match const pointer variants

2020-02-09 Thread Jaskaran Singh
On Sun, 2020-02-09 at 08:20 +0100, Julia Lawall wrote: > On Fri, 7 Feb 2020, Jaskaran Singh wrote: > > > Pointer to const pointer and its variants would not match > > previously. > > Add a test case for matching these types. > > I don't get any matches for this test. If I split the semantic patc