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

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