[comp.emacs] C function prototypes and tags

vinoski@apollo.COM (Stephen Vinoski) (06/22/89)

Today I tried to create a tags file for a large C program using 'etags -t' so as
to include typedefs in the tags.  The program uses function prototypes
throughout.  When I did a 'find-tag' for a typedef name it took me to one of the
function prototypes where the typedef was used to specify an argument type,
which is less than desirable.

Has anyone else seen this problem, and if so, does anybody have a fix?  Thanks
in advance.


-steve


-- 
# Steve Vinoski       ## Apollo, a Subsidiary of HP ## ARPA: vinoski@apollo.com #
# (508)256-6600 x5904 ## Chelmsford, MA  01824      ## UUCP: ...!apollo!vinoski #
# "...no hardware designer should be allowed to produce any piece of hardware   #
#  until 3 software guys have signed off for it."   -Andy Tanenbaum             #

raulmill@aludra.usc.edu (Raul) (06/24/89)

vinoski@apollo.COM (Stephen Vinoski) writes:
-> Today I tried to create a tags file for a large C program using
-> 'etags -t' so as to include typedefs in the tags.  The program uses
-> function prototypes throughout.  When I did a 'find-tag' for a
-> typedef name it took me to one of the function prototypes where the
-> typedef was used to specify an argument type, which is less than
-> desirable.

Put your function prototypes in include files.  When you specify your
arguments to etags, make sure that the include files are specified
last.  This way find-tag will locate the function definition before
the function prototype.  You can always use meta-comma to advance on
to the prototype if you really want to see it.
Raul Rockwell                                      |
INTERNET:   raulmill@usc.edu                       |
UUCP:       ...uunet!usc!raulmill                  |  55 mph = 82 nc
U.S.SNAIL:  721 E Windsor #4,  GLENDALE CA  91205  |