Re: [PATCH] Generic dead function optimisation

From: Bill Wendling (wendling@ganymede.isdn.uiuc.edu)
Date: Tue Apr 25 2000 - 10:13:08 EST


Also sprach Andi Kleen:
}
} 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.)
}
Sure, there are hacks around it. But the original statement should still
hold. If you have a static function, don't try to EXPORT_SYMBOL it out of
the file.

I prefer a mixture of both. Functions for a particular module should have
unique prefixes but, if they are only used for that module, they should
be declared static. The compiler doesn't have to optimize across files
then (hard). :)

-- 
|| Bill Wendling			wendling@ganymede.isdn.uiuc.edu

- 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