Coccinelle archive on lore.kernel.org
 help / color / Atom feed
* Re: [Cocci] [PATCH v2 3/3] tests: Add test case for <macro> bool <ident>
@ 2020-01-21 10:22 Markus Elfring
  0 siblings, 0 replies; 2+ messages in thread
From: Markus Elfring @ 2020-01-21 10:22 UTC (permalink / raw)
  To: Jaskaran Singh, cocci; +Cc: linux-kernel-mentees

> …, 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

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

* [Cocci] [PATCH v2 3/3] tests: Add test case for <macro> bool <ident>
  2020-01-21  8:04 [Cocci] [PATCH v2 0/3] cocci: Improve management of macros before typedefs Jaskaran Singh
@ 2020-01-21  8:04 ` Jaskaran Singh
  0 siblings, 0 replies; 2+ messages in thread
From: Jaskaran Singh @ 2020-01-21  8:04 UTC (permalink / raw)
  To: cocci; +Cc: linux-kernel-mentees

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 <macro> bool.

Signed-off-by: Jaskaran Singh <jaskaransingh7654321@gmail.com>
---
 tests/macro_before_bool.c     | 4 ++++
 tests/macro_before_bool.cocci | 9 +++++++++
 tests/macro_before_bool.res   | 5 +++++
 3 files changed, 18 insertions(+)
 create mode 100644 tests/macro_before_bool.c
 create mode 100644 tests/macro_before_bool.cocci
 create mode 100644 tests/macro_before_bool.res

diff --git a/tests/macro_before_bool.c b/tests/macro_before_bool.c
new file mode 100644
index 00000000..a59cba5a
--- /dev/null
+++ b/tests/macro_before_bool.c
@@ -0,0 +1,4 @@
+static nokprobe_inline bool trace_kprobe_is_return(struct trace_kprobe *tk)
+{
+	return false;
+}
diff --git a/tests/macro_before_bool.cocci b/tests/macro_before_bool.cocci
new file mode 100644
index 00000000..53b2fd2e
--- /dev/null
+++ b/tests/macro_before_bool.cocci
@@ -0,0 +1,9 @@
+@@
+type t;
+identifier x;
+@@
+
+t x(...) {
++	t ret;
+	return false;
+}
diff --git a/tests/macro_before_bool.res b/tests/macro_before_bool.res
new file mode 100644
index 00000000..1b0ec319
--- /dev/null
+++ b/tests/macro_before_bool.res
@@ -0,0 +1,5 @@
+static nokprobe_inline bool trace_kprobe_is_return(struct trace_kprobe *tk)
+{
+	bool ret;
+	return false;
+}
-- 
2.21.1

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

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

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-21 10:22 [Cocci] [PATCH v2 3/3] tests: Add test case for <macro> bool <ident> Markus Elfring
  -- strict thread matches above, loose matches on Subject: below --
2020-01-21  8:04 [Cocci] [PATCH v2 0/3] cocci: Improve management of macros before typedefs Jaskaran Singh
2020-01-21  8:04 ` [Cocci] [PATCH v2 3/3] tests: Add test case for <macro> bool <ident> 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