#Is there a compiler flag to tell me about dead code?
1 messages · Page 1 of 1 (latest)
There's no real way to do that
Because conditional compilation means you might have functions that are only used on certain platforms
That's not unsolvable though, right? It would be possible to see that the reason the dead code wasn't generated was that you weren't compiling for the platform it was used on and omit it from the report since that info is all known at compile time. I think there's a big conceptual difference between dead code because it's not used anywhere and dead code because it's not used here
This will be a class of error, according to this accepted proposal: https://github.com/ziglang/zig/issues/335
atm, only applying to unused private functions
it seems that it was also going to apply to unused pub functions that were not reachable from outside the package in a library, but that was crossed out, probably because of some technical limitation