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

2020-02-11 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 v5 1/3] parsing_c: Align C AST and Cocci AST for pointer

2020-02-11 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 v5 0/3] cocci: Align the C AST and Cocci AST for pointer

2020-02-11 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

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

2020-02-11 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