On 9 January 2012 15:27, Trass3r <un@known.com> wrote:
static this() seems to be a problem. Unless there's powerful
whole-program-optimisation, how can it strip out any data that might be
initialised/touched in static this()?
It probably can't.

I'm sure it's possible, but it would need some pretty powerful global expression analysis.
Ie, if data initialised in static this() is only touched in one function lets say, and that function is never referenced, then it should surely be able to safely eliminate that function and associated data?

Why wouldn't dead code be eliminated effectively already?
Cause 1 section is created for each module. So if you use just 1 function the whole module is pulled in.

Why would it pull the whole module if only one function is used? And why can't a post-link strip process clean it up?