[GSOC] Help regarding deleting unused functions

Sebastian Huber sebastian.huber at embedded-brains.de
Mon Jul 15 08:44:50 UTC 2013


On 07/14/2013 10:01 AM, Vipul Nayyar wrote:
> While doing my current task of removing legacy code, after compilation, I
> receive warnings for a certain function, that is defined but not used. As
> suggested by Sebastian, I delete it, after checking whether it's really been
> not called anywhere in the current file, and outside it. Most of the functions
> that I'm talking about right now are static, or supposed to be static.
>
> After re-compilation, warning for that deleted function is obviously gone, but
> there are new warnings of functions defined but not used. So, ultimately I have
> to delete these static functions who are inter-related(calling each other), in
> order to remove the warnings. Currently I was trying my hand on i386 pc386 BSP,
> where I encountered this thing.
>
> I really don't know whether deleting these multiple inter-related static
> functions is the right way to go or a horribly wrong one.

In case the unused functions appear due to the interrupt API changes you can 
recursively delete all defined but unused functions (you get this warning only 
for static functions).  You only have to make sure that you don't delete 
non-trivial on/off handlers.

-- 
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax     : +49 89 189 47 41-09
E-Mail  : sebastian.huber at embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.



More information about the devel mailing list