Re: [PATCH] Generic dead function optimisation

From: Andi Kleen (ak@suse.de)
Date: Tue Apr 25 2000 - 06:57:22 EST


On Tue, Apr 25, 2000 at 06:20:45AM -0500, Jesse Pollard wrote:
> >funca and funcb can be called from outside the module. They are still
> >declared static. If you trust static to mean ``cannot be called from outside''
> >you'll quickly fall flat onto your face.
> >Overall you want a flat name space anyways, to make tools like cscope or
> >[ce]tags work, so it is a good idea to use explicit bla_* prefixes anyways.
> >With that static is rather useless for most cases (except special
> >hacks like putting local symbols via macros into ELF segments etc.)
>
> This is not a symbolic "called from outside". sorry. does not correspond.

The static functions are effectively called from outside. Who cares if
it is symbolic or via a pointer? - the end effect counts: another unit does
a function call and your static function is invoked. If you ignore that
you miss a significant part of the program flow. If you trust static
to guarantee that this does not happen you will lose.

-Andi

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Apr 30 2000 - 21:00:09 EST