[tor-bugs] #1824 [Tor Relay]: Remove unused prototypes from rephist.h et al.
Tor Bug Tracker & Wiki
torproject-admin at torproject.org
Fri Aug 13 15:59:09 UTC 2010
#1824: Remove unused prototypes from rephist.h et al.
-----------------------+----------------------------------------------------
Reporter: karsten | Owner: Sebastian
Type: defect | Status: new
Priority: normal | Milestone:
Component: Tor Relay | Version:
Keywords: | Parent:
-----------------------+----------------------------------------------------
Old description:
> rephist.h has some prototypes of functions that are not in rephist.c and
> that we don't use anymore, e.g., hs_usage_* . Is there a way to find all
> of these unused prototypes in all .h files and remove them?
New description:
rephist.h has some prototypes of functions that are not in rephist.c and
that we don't use anymore, e.g., hs_usage_* . Is there a way to find all
of these unused prototypes in all .h files and remove them?
--
Comment(by nickm):
So the way I'd do it is to write a script use gnu ctags (you want the gnu
one; it does more stuff) to parse the .h files and the .c files, and then
post-process the output to find identifiers that are in the .h files but
not defined in any .c file.
The incant for "all function prototypes and only function prototypes" is
ctags -n --c-kinds=p -f - ./src/*/*.[ch]
and the incant for "all function definitions" is
ctags -n --c-kinds=f -f - ./src/*/*.[ch]
.....
Oh heck, I've practically written the thing already. Finishing it up as a
script and attaching it. There are some false positives left, but it'll
still be useful, I hope.
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/1824#comment:1>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
More information about the tor-bugs
mailing list