From d583e3395be3ad0d22e0971e6846dd44b34401aa06842ea42209c1f4ad02e8dc Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Mon, 5 Jan 2015 14:28:18 +0000 Subject: [PATCH] Accepting request 267282 from home:jirislaby:branches:devel:tools - support-fun-as-params.patch: swallow function as parameters - remove INSTALL from %doc, as suggested by the rpm checker OBS-URL: https://build.opensuse.org/request/show/267282 OBS-URL: https://build.opensuse.org/package/show/devel:tools/cscope?expand=0&rev=15 --- cscope.changes | 6 ++++++ cscope.spec | 6 ++++-- support-fun-as-params.patch | 42 +++++++++++++++++++++++++++++++++++++ 3 files changed, 52 insertions(+), 2 deletions(-) create mode 100644 support-fun-as-params.patch diff --git a/cscope.changes b/cscope.changes index cf6db1f..3a305fc 100644 --- a/cscope.changes +++ b/cscope.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Jan 5 13:44:49 UTC 2015 - jslaby@suse.com + +- support-fun-as-params.patch: swallow function as parameters +- remove INSTALL from %doc, as suggested by the rpm checker + ------------------------------------------------------------------- Thu Nov 20 21:31:00 UTC 2014 - Led diff --git a/cscope.spec b/cscope.spec index 66428b2..9a99a7b 100644 --- a/cscope.spec +++ b/cscope.spec @@ -1,7 +1,7 @@ # # spec file for package cscope # -# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -30,6 +30,7 @@ Patch3: %{name}-15.7-vpath.patch Patch4: %{name}-15.8a-fix-bashisms.patch Patch5: %{name}-cleanup_on_sigterm.patch Patch6: %{name}-egrep.out.patch +Patch7: support-fun-as-params.patch BuildRequires: bison BuildRequires: flex BuildRequires: ncurses-devel @@ -47,6 +48,7 @@ browse through C source code files for specified elements of code. %patch4 -p1 %patch5 %patch6 -p1 +%patch7 -p1 %build %configure @@ -64,7 +66,7 @@ popd %files %defattr(-,root,root) -%doc TODO COPYING ChangeLog AUTHORS README NEWS INSTALL +%doc TODO COPYING ChangeLog AUTHORS README NEWS %doc %{_mandir}/man1/cscope.1.gz %{_bindir}/cscope %{_bindir}/ocs diff --git a/support-fun-as-params.patch b/support-fun-as-params.patch new file mode 100644 index 0000000..28d8917 --- /dev/null +++ b/support-fun-as-params.patch @@ -0,0 +1,42 @@ +From 326dc66330c8497a9344ad03d4bc020de0528448 Mon Sep 17 00:00:00 2001 +From: Jiri Slaby +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 +Cc: Hans-Bernhard Bröker +Cc: Neil Horman +--- + src/fscanner.l | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/fscanner.l b/src/fscanner.l +index 5cb6abb275fb..1d9a2a77cba3 100644 +--- a/src/fscanner.l ++++ b/src/fscanner.l +@@ -507,7 +507,7 @@ if{wsnl}*\( { /* ignore 'if' */ + } + + { +-{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! */ +-- +2.1.3 +