Blame SOURCES/cscope-7-fscanner-swallow-function-as-parameters.patch

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