Mail Archives: djgpp/1997/02/24/07:26:48
I have resubscribed to djgpp.
I have written a big multi-file djgpp Gnu C++ program (a text editor). I
want to weed it, ie. to remove all unused variables and ordinary functions and
class-member functions.
-Wall gets djgpp to warn about unused variables inside functions. OK.
If I declare functions and zero-level variables as `static', djgpp (at least
with -Wall) will moan if they are unused; but as they are `static' they can
only be used in that file, which is no use to me with a multi-file program,
and anyway it doesn't seem to work with unused class-member functions.
So, how to find all unused zero-level variables and ordinary functions and
class-member functions?
I can't do this with DJGPP\BIN\NM.EXE: I've tried.
It would be useful if the linker had an option to warn of all unused
references.
Failing either of those:-
(1) Where among the source forms of the assembler and linker, or elsewhere,
is a description of the internal format of a djgpp *.O file?, so I can write
my own program to read a set of *.O files and list all references found in
them and which of them are unused.
(2) Is there a specific `demangle' function anywhere in djgpp? I.e. e.g. int
demangle(char*x,char*y); which puts into y a demangled form of the name in x.
- Raw text -