Package: cscope
Version: 15.8a-2
Severity: wishlist
Tags: patch

Hi,
Jiri has prepared a patch (attached) which fixes a long term
inefficiency of function parameters handling by cscope which doesn't
cope with function parameters.
I am using the patch for quite some time on the linux kernel tree where
function parameters are not that unusual (e.g. kthread_create_on_node
definition wouldn't be found without it). I haven't observed any
misbehavior so far.
The upstream doesn't seem to be particularly alive so I would really
appreciate if you can pick it up. I do not have problem to stay with
my local package but I think other people might benefit from this change
as well.

Thanks!

-- System Information:
Debian Release: 8.0
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 3.18.0 (SMP w/2 CPU cores; PREEMPT)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)

Versions of packages cscope depends on:
ii  ed           1.10-2
ii  libc6        2.19-13
ii  libncurses5  5.9+20140913-1+b1
ii  libtinfo5    5.9+20140913-1+b1

cscope recommends no packages.

Versions of packages cscope suggests:
pn  cscope-el  <none>

-- no debconf information

-- 
Michal Hocko
>From 326dc66330c8497a9344ad03d4bc020de0528448 Mon Sep 17 00:00:00 2001
From: Jiri Slaby <[email protected]>
Date: Fri, 5 Dec 2014 19:15:53 +0100
Subject: [PATCH 1/1] fscanner: swallow function as parameters
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Some functions take as a parameter a pointer to another function. This
causes troubles in the cscope scanner and such function definition is
dropped on the floor.

Instead of choking and skipping the definition/declaration, teach the
scanner about this case. So now cscope will not skip those and put
them properly in the index.

I carry this patch for a couple of months and using cscope daily on
the Linux kernel and see no problems.

Signed-off-by: Jiri Slaby <[email protected]>
Cc: Hans-Bernhard Bröker <[email protected]>
Cc: Neil Horman <[email protected]>
---
 src/fscanner.l | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: cscope-15.8a/src/fscanner.l
===================================================================
--- cscope-15.8a.orig/src/fscanner.l
+++ cscope-15.8a/src/fscanner.l
@@ -536,7 +536,7 @@ if{wsnl}*\(	{ 	/* ignore 'if' */
 		}
 
 <WAS_IDENTIFIER>{       
-{ws}*\(({wsnl}|{identifier}|{number}|[*&[\]=,.:])*\)([()]|{wsnl})*[:a-zA-Z_#{]	{
+{ws}*\(({wsnl}|{identifier}|\({ws}*\*{ws}*{identifier}{ws}*\){ws}*\([^()]*\)|{number}|[*&[\]=,.:])*\)([()]|{wsnl})*[:a-zA-Z_#{]	{
 			/* a function definition */
 			/* note: "#define a (b) {" and "#if defined(a)\n#" 
 			 * are not fcn definitions! */

Reply via email to