[Cocci] [PATCH v3 1/3] parsing_c: Handle case of macro before typedef

2020-01-21 Thread Jaskaran Singh
For the following case: A case in parsing_hacks.ml sometimes mislabels as a typedef identifier. If typedef is a known typedef (such as u8 or *_t), then label as a CppMacro. Subsequent cases will continue to label correctly as a typedef identifier. Following are results of --parse-c on

[Cocci] [PATCH v3 3/3] tests: Add test case for bool

2020-01-21 Thread Jaskaran Singh
This would previously yield pretty printing errors, i.e. bool would be printed on the next line, followed by ret on the next to next line. The metatype should be only bool and not bool. Signed-off-by: Jaskaran Singh --- tests/macro_before_bool.c | 4 tests/macro_before_bool.cocci |

[Cocci] [PATCH v3 2/3] parsing_hacks: Add bool to list of known typedefs

2020-01-21 Thread Jaskaran Singh
bool is widely used in the Linux kernel. Certain cases of parsing_hacks.ml would mislabel bool. Add bool to the list of known typedefs. Stats of --parse-c on Linux v5.5-rc4 are as follows: Before: nb good = 18956150, nb passed = 134062 => 0.70% passed After: nb good = 18956150,

[Cocci] [PATCH v3 0/3] cocci: Improve management of macros before typedefs

2020-01-21 Thread Jaskaran Singh
This patch series is for improving the management of the following case: If is a known typedef (such as u8 or *_t) then label as a CppMacro. Subsequent cases will continue to label correctly as a typedef identifier. Also add bool to the list of known typedefs so that cases of bool are

Re: [Cocci] [PATCH v2 2/3] parsing_hacks: Add bool to list of known typedefs

2020-01-21 Thread Julia Lawall
On Tue, 21 Jan 2020, Jaskaran Singh wrote: > On Tue, 2020-01-21 at 11:10 +0100, Markus Elfring wrote: > > > Before: > > > passed:bool > > > > I wonder if subsequent duplicate information can really help to > > achieve a better understanding > > by the suggested description of a software

Re: [Cocci] [PATCH v2 2/3] parsing_hacks: Add bool to list of known typedefs

2020-01-21 Thread Jaskaran Singh
On Tue, 2020-01-21 at 11:10 +0100, Markus Elfring wrote: > > Before: > > passed:bool > > I wonder if subsequent duplicate information can really help to > achieve a better understanding > by the suggested description of a software situation. > Hm, I thought it would but you're probably right.

Re: [Cocci] [PATCH v2 0/3] cocci: Improve management of macros before typedefs

2020-01-21 Thread Julia Lawall
On Tue, 21 Jan 2020, Markus Elfring wrote: > > If is a known typedef (such as u8 or *_t) then label > > as a CppMacro. Subsequent cases will label correctly as a > > typedef ident. > > > > Also add bool to the list of known typedefs so that cases of > > Can a wording like the following be

Re: [Cocci] [PATCH v2 3/3] tests: Add test case for bool

2020-01-21 Thread Markus Elfring
> …, followed by ret on > the next to next line. Would you like to improve this wording? Regards, Markus ___ Cocci mailing list Cocci@systeme.lip6.fr https://systeme.lip6.fr/mailman/listinfo/cocci

Re: [Cocci] [PATCH v2 2/3] parsing_hacks: Add bool to list of known typedefs

2020-01-21 Thread Markus Elfring
> Before: > passed:bool I wonder if subsequent duplicate information can really help to achieve a better understanding by the suggested description of a software situation. Regards, Markus ___ Cocci mailing list Cocci@systeme.lip6.fr

Re: [Cocci] [PATCH v2 0/3] cocci: Improve management of macros before typedefs

2020-01-21 Thread Markus Elfring
> If is a known typedef (such as u8 or *_t) then label > as a CppMacro. Subsequent cases will label correctly as a > typedef ident. > > Also add bool to the list of known typedefs so that cases of Can a wording like the following be nicer for such a change description? Label as a CppMacro

Re: [Cocci] [PATCH] parsing_c: Handle case of macro before typedef

2020-01-21 Thread Markus Elfring
> A case in parsing_hacks.ml sometimes mislabels as a > typedef ident. Can a wording like “as a type definition identifier” be nicer for this description of a software situation? Regards, Markus ___ Cocci mailing list Cocci@systeme.lip6.fr

[Cocci] [PATCH v2 3/3] tests: Add test case for bool

2020-01-21 Thread Jaskaran Singh
This would previously yield pretty printing errors, i.e. bool would be printed on the next line, followed by ret on the next to next line. The metatype should be only bool and not bool. Signed-off-by: Jaskaran Singh --- tests/macro_before_bool.c | 4 tests/macro_before_bool.cocci | 9

[Cocci] [PATCH v2 2/3] parsing_hacks: Add bool to list of known typedefs

2020-01-21 Thread Jaskaran Singh
bool is widely used in the Linux kernel. Certain cases of parsing_hacks.ml would mislabel bool. Add bool to the list of known typedefs. Stats of --parse-c on Linux v5.5-rc4 are as follows: Before: nb good = 18956150, nb passed = 134062 => 0.70% passed After: nb good = 18956150,

[Cocci] [PATCH v2 1/3] parsing_c: Handle case of macro before typedef

2020-01-21 Thread Jaskaran Singh
For the following case: A case in parsing_hacks.ml sometimes mislabels as a typedef ident. If typedef is a known typedef (such as u8 or *_t), then label as a CppMacro. Subsequent cases will then label correctly. Following are results of --parse-c on the Linux Kernel v5.5-rc4: Before:

[Cocci] [PATCH v2 0/3] cocci: Improve management of macros before typedefs

2020-01-21 Thread Jaskaran Singh
This patch series is for improving the management of the following case: If is a known typedef (such as u8 or *_t) then label as a CppMacro. Subsequent cases will label correctly as a typedef ident. Also add bool to the list of known typedefs so that cases of bool are handled