cvs.gedasymbols.org/archives/browse.cgi   search  
Mail Archives: djgpp/1997/02/24/09:07:12

Date: Mon, 24 Feb 1997 15:46:46 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: "A.Appleyard" <A DOT APPLEYARD AT fs2 DOT mt DOT umist DOT ac DOT uk>
cc: DJGPP AT delorie DOT com
Subject: Re: How to find all references?
In-Reply-To: <331556E34ED@fs2.mt.umist.ac.uk>
Message-ID: <Pine.SUN.3.91.970224154030.4374E-100000@is>
MIME-Version: 1.0

On Mon, 24 Feb 1997, A.Appleyard wrote:

>   -Wall gets djgpp to warn about unused variables inside functions.

Only if you use -O or -O2, I think.  Even if I am wrong, using
optimization switches makes gcc warn about more unused stuff, so try it. 

>   So, how to find all unused zero-level variables and ordinary functions and
> class-member functions?

How about grep: can you look at all the places the variables and 
functions are mentioned, then see whether any of them is a function call 
(for a function) or if a variable is getting a value?

>   It would be useful if the linker had an option to warn of all unused
> references.

If it could, then you would be able to find out with NM; the linker 
doesn't know anything that NM doesn't.

>   (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.

See above: if the info is inside the *.o files, NM would have found it.

>   (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.

I think `cxxfilt' is the program which does that, no?  If not, then 
there's a function that you can pull out of the GDB sources; search for 
`demangle'.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019