Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!pdx.mentor.com!mosurm From: mosurm@pdx.mentor.com (Mosur Mohan) Newsgroups: gnu.emacs.bug Subject: Etags bug Message-ID: <8911302149.AA04086@pdx.mentor.com> Date: 30 Nov 89 21:49:35 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 53 Emacs Version: GNU Emacs 18.52.1 of Thu Feb 16 1989 on daven (Domain/OS) Etags Version: this etags.c has C++ support, and was sent to me by RMS on 8 June 1989; it has the following header: /* Tags file maker to go with GNUmacs Copyright (C) 1984, 1987, 1988, 1989 Free Software Foundation, Inc. and Ken Arnold [... copyleft ...] * Authors: * Ctags originally by Ken Arnold. * FORTRAN added by Jim Kleckner. * Ed Pelegri-Llopart added C typedefs. * Gnu Emacs TAGS format and modifications by RMS? * Sam Kendall added C++. */ This bug has to do with C++ header files. Etags has trouble identifying function prototypes in header files; I traced the problem down to the ';' character being included in the string variable *notgd in etags.c. In function "consider_token", there is a test: if (! isgood (c)) goto badone; where isgood (c) returns _gd[c], which is defined by the string *notgd as follows in etags.c: *notgd = ",;"; /* non-valid after-function chars */ From the documentation, my understanding is that isgood(c) returns TRUE if character c is a valid character to follow a function's parenthesised parm-list, and FALSE otherwise; this is used to determine whether the token preceding the "(parm-list)" was a function, and therefore whether to make a tag out of this token. However, in a C++ header file, it is perfectly valid for the function header to have the following construct: void clear_set (); // Remove all types from the set In this example, () is followed by ';', but because ';' is in *notgd, all such function declarations are not tagged by etags. I would like to know whether there is any more up-to-date version available before I do any hacking here. Thanks. -- Mohan. {mosurm@pdx.mentor.com, uunet!mntgfx!mosurm} {Mosur Mohan, Mentor Graphics, Beaverton, OR} ------------------------------------------------------------ "Cogito ergo sum" ==> "I think, therefore I add." Brought to you by Super Global Mega Corp .com