Coccinelle archive on lore.kernel.org
 help / color / Atom feed
* Re: [Cocci] [PATCH v2 0/3] cocci: Improve management of macros before typedefs
@ 2020-01-21  9:56 Markus Elfring
  2020-01-21 10:43 ` Julia Lawall
  0 siblings, 1 reply; 3+ messages in thread
From: Markus Elfring @ 2020-01-21  9:56 UTC (permalink / raw)
  To: Jaskaran Singh, cocci; +Cc: linux-kernel-mentees

> If <typedef> is a known typedef (such as u8 or *_t) then label <macro>
> as a CppMacro. Subsequent cases will label <typedef> 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 <macro> as a CppMacro if <typedef> is a known type definition
  (such as u8 or *_t).
  Subsequent cases will label <typedef> correctly as a type definition identifier.

  Add bool also to the list of known type definition identifiers so that cases of


Regards,
Markus
_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Cocci] [PATCH v2 0/3] cocci: Improve management of macros before typedefs
  2020-01-21  9:56 [Cocci] [PATCH v2 0/3] cocci: Improve management of macros before typedefs Markus Elfring
@ 2020-01-21 10:43 ` Julia Lawall
  0 siblings, 0 replies; 3+ messages in thread
From: Julia Lawall @ 2020-01-21 10:43 UTC (permalink / raw)
  To: Markus Elfring; +Cc: linux-kernel-mentees, cocci



On Tue, 21 Jan 2020, Markus Elfring wrote:

> > If <typedef> is a known typedef (such as u8 or *_t) then label <macro>
> > as a CppMacro. Subsequent cases will label <typedef> 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 <macro> as a CppMacro if <typedef> is a known type definition
>   (such as u8 or *_t).
>   Subsequent cases will label <typedef> correctly as a type definition identifier.

Actually, there is a piece of important information that is missing in
both of these messages.  It would be nice to say "Subsequent cases will
continue to label...".

julia


>
>   Add bool also to the list of known type definition identifiers so that cases of
>
>
> Regards,
> Markus
> _______________________________________________
> Cocci mailing list
> Cocci@systeme.lip6.fr
> https://systeme.lip6.fr/mailman/listinfo/cocci
>
_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Cocci] [PATCH v2 0/3] cocci: Improve management of macros before typedefs
@ 2020-01-21  8:04 Jaskaran Singh
  0 siblings, 0 replies; 3+ messages in thread
From: Jaskaran Singh @ 2020-01-21  8:04 UTC (permalink / raw)
  To: cocci; +Cc: linux-kernel-mentees

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 label <typedef> correctly as a
typedef ident.

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 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 |    9 +++++++++
 tests/macro_before_bool.res   |    5 +++++
 4 files changed, 54 insertions(+), 1 deletion(-)


_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-21  9:56 [Cocci] [PATCH v2 0/3] cocci: Improve management of macros before typedefs Markus Elfring
2020-01-21 10:43 ` Julia Lawall
  -- strict thread matches above, loose matches on Subject: below --
2020-01-21  8:04 Jaskaran Singh

Coccinelle archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/cocci/0 cocci/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 cocci cocci/ https://lore.kernel.org/cocci \
		cocci@systeme.lip6.fr
	public-inbox-index cocci

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/fr.lip6.systeme.cocci


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git