Skip to content

cocci: Improve management of macros before typedefs

Jaskaran Singh cocci linux-kernel-mentees 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest3 patches 1 replyIn review
  2. v23 patches 0 repliesSuperseded
  3. v11 patch 1 replySuperseded

Changes in v3 from the cover letter

--------------
- Change "subsequent cases will label" to "subsequent cases will continue to label" in commit messages of Patch 0/3 and Patch 1/3.
- Change the term "typedef ident" to "typedef identifier" wherever suitable.
- Add metavariable symbol false to tests/macro_before_bool.cocci to suppress warning.

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3parsing_c: Handle case of macro before typedefparsing_c/parsing_hacks.ml+35 -00 replies
2/3parsing_hacks: Add bool to list of known typedefsparsing_c/parsing_hacks.ml+1 -10 replies
3/3tests: Add test case for <macro> bool <ident>tests/macro_before_bool.c tests/macro_before_bool.cocci tests/macro_before_bool.res+19 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.

Read the v3 thread

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

This patch series is for improving the management of the following case:

<macro> <typedef> <ident>

If <typedef> is a known typedef (such as u8 or *_t) then label <macro> as a CppMacro. Subsequent cases will continue to label <typedef> correctly as a typedef identifier.

Also add bool to the list of known typedefs so that cases of

<macro> bool <ident>

are handled correctly just like any known typedef will be.

Changes in v3:
--------------
- Change "subsequent cases will label" to "subsequent cases will continue to label" in commit messages of Patch 0/3 and Patch 1/3.
- Change the term "typedef ident" to "typedef identifier" wherever suitable.
- Add metavariable symbol false to tests/macro_before_bool.cocci to suppress warning.

Changes in v2:
--------------
- Group these patches as a series for clarity
- Add a test case for <macro> bool <ident> (Patch 3/3)
- Explain what has been improved with Patch 2/3

 parsing_c/parsing_hacks.ml    |   37 ++++++++++++++++++++++++++++++++++++-
 tests/macro_before_bool.c     |    4 ++++
 tests/macro_before_bool.cocci |   10 ++++++++++
 tests/macro_before_bool.res   |    5 +++++
 4 files changed, 55 insertions(+), 1 deletion(-)

_______________________________________________
Linux-kernel-mentees mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees