Vladis Dronov fd733a0
From e1b4cbc93529b07b3217928e8f9b1f43b80f9b06 Mon Sep 17 00:00:00 2001
Vladis Dronov fd733a0
From: Jiri Slaby <jslaby@suse.cz>
Vladis Dronov fd733a0
Date: Fri, 5 Dec 2014 19:15:53 +0100
Vladis Dronov fd733a0
Subject: [PATCH 8/9] fscanner: swallow function as parameters
Vladis Dronov fd733a0
MIME-Version: 1.0
Vladis Dronov fd733a0
Content-Type: text/plain; charset=UTF-8
Vladis Dronov fd733a0
Content-Transfer-Encoding: 8bit
Vladis Dronov fd733a0
Vladis Dronov fd733a0
Some functions take as a parameter a pointer to another function. This
Vladis Dronov fd733a0
causes troubles in the cscope scanner and such function definition is
Vladis Dronov fd733a0
dropped on the floor.
Vladis Dronov fd733a0
Vladis Dronov fd733a0
Instead of choking and skipping the definition/declaration, teach the
Vladis Dronov fd733a0
scanner about this case. So now cscope will not skip those and put
Vladis Dronov fd733a0
them properly in the index.
Vladis Dronov fd733a0
Vladis Dronov fd733a0
I carry this patch for a couple of months and using cscope daily on
Vladis Dronov fd733a0
the Linux kernel and see no problems.
Vladis Dronov fd733a0
Vladis Dronov fd733a0
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Vladis Dronov fd733a0
Cc: Hans-Bernhard Bröker <broeker@users.sourceforge.net>
Vladis Dronov fd733a0
Cc: Neil Horman <nhorman@users.sourceforge.net>
Vladis Dronov fd733a0
Signed-off-by: Vladis Dronov <vdronov@redhat.com>
Vladis Dronov fd733a0
---
Vladis Dronov fd733a0
 src/fscanner.l | 2 +-
Vladis Dronov fd733a0
 1 file changed, 1 insertion(+), 1 deletion(-)
Vladis Dronov fd733a0
Vladis Dronov fd733a0
diff --git a/src/fscanner.l b/src/fscanner.l
Vladis Dronov fd733a0
index 8a93192..43880bf 100644
Vladis Dronov fd733a0
--- a/src/fscanner.l
Vladis Dronov fd733a0
+++ b/src/fscanner.l
Vladis Dronov fd733a0
@@ -505,7 +505,7 @@ if{wsnl}*\(	{ 	/* ignore 'if' */
Vladis Dronov fd733a0
 		}
Vladis Dronov fd733a0
 
Vladis Dronov fd733a0
 <WAS_IDENTIFIER>{       
Vladis Dronov fd733a0
-{ws}*\(({wsnl}|{identifier}|{number}|[*&[\]=,.:])*\)([()]|{wsnl})*[:a-zA-Z_#{]	{
Vladis Dronov fd733a0
+{ws}*\(({wsnl}|{identifier}|\({ws}*\*{ws}*{identifier}{ws}*\){ws}*\([^()]*\)|{number}|[*&[\]=,.:])*\)([()]|{wsnl})*[:a-zA-Z_#{]	{
Vladis Dronov fd733a0
 			/* a function definition */
Vladis Dronov fd733a0
 			/* note: "#define a (b) {" and "#if defined(a)\n#" 
Vladis Dronov fd733a0
 			 * are not fcn definitions! */
Vladis Dronov fd733a0
-- 
Vladis Dronov fd733a0
2.26.2
Vladis Dronov fd733a0