NetBSD Problem Report #6204

Received: (qmail 5712 invoked from network); 26 Sep 1998 16:41:40 -0000
Message-Id: <199809261644.SAA12097@RVC1.Informatik.BA-Stuttgart.DE>
Date: Sat, 26 Sep 1998 18:44:18 +0200 (CEST)
From: root@RVC1.Informatik.BA-Stuttgart.DE
Reply-To: root@RVC1.Informatik.BA-Stuttgart.DE
To: gnats-bugs@gnats.netbsd.org
Subject: ctags gets confused by typedef int (*f_t) ...
X-Send-Pr-Version: 3.95

>Number:         6204
>Category:       bin
>Synopsis:       ctags gets confused by typedef int (*f_t) ...
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Sep 26 09:50:01 +0000 1998
>Closed-Date:    
>Last-Modified:  Mon Jun 05 20:58:10 +0000 2000
>Originator:     Wolfgang Helbig
>Release:        1.3.2
>Organization:

>Environment:

System: NetBSD RVC1 1.3.2 NetBSD 1.3.2 (RVC1) #12: Mon Sep 21 01:52:18 CEST 1998 helbig@RVC1:/usr/src/sys/arch/i386/compile/RVC1 i386


>Description:
	if ctags(1) is working on a typedef whose declarator contains
	parenthesis, it won't recognize the typedef'd symbol and won't
	recognize the definition following the typedef statement.
>How-To-Repeat:
Run "ctags -t file.c" with file.c containing:

	typedef a (*b) _P((c *));
	struct s {
		int	i;
	};

This will give you the following tags file:

	a	test.h	/^typedef a (*b) _P((c *));$/
	^ Should be "b", because "b" is typedef'd not "a".
	i	test.h	/^};$/
	^ This entry shouldn't be there, instead the "s" should be listed.

>Fix:

Here is a patch that partially fixes the problem: The "struct b" will
be listed properly but the typedef'd symbol is still wrong, i. e.
you'll get from file.c the tags file:

	c	test.h	/^typedef a (*b) _P((c *));$/
	^ Still wrong.
	s	test.h	/^struct s {$/
	^ now correct.

--- /usr/src/usr.bin/ctags/C.c.orig	Sat Sep 26 17:57:37 1998
+++ usr.bin/ctags/C.c	Sat Sep 26 17:58:13 1998
@@ -146,7 +146,7 @@
 		 * level zero indicates a function.
 		 */
 		case '(':
-			if (!level && token) {
+			if (!level && token && !t_def) {
 				int	curline;

 				if (sp != tok)
>Release-Note:
>Audit-Trail:
>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.