Perhaps it would be better an explicit DONTKEEP, instead of KEEP
This way, the default behaviour would remain unchanged. Otherwise there is a big chance that existing apps would not work directly with a new B4A version implementing this feature if they make use of callsubs as
@sorex said
That is too much work for a lazy programmer like me.
It will be much easier to include (#Keep) the few Subs that use strings for a sub name than to explicitly exclude (#DONTKEEP) a dozens (hundred?) of regular subs that the compiler can optimally remove.
Think about the code maintenance involved.
#KEEP: Yes the programmer will have to Find all references to CallSub() that his app currently references, but once that is done he doesn't need to change anything.
#DONTKEEP: Every time a new Sub is added to a code module, every app that references that code module will need to be updated to exclude that new Sub. The #DONTKEEP list of subs will keep growing larger and larger. Maintenance will be a nightmare.
IMHO, it will be easier to maintain a list of exceptions (Subs that need to be included) rather than maintain a list of Subs to exclude which is the majority of Subs.
This "[ ] Exclude Unreferenced Subs/Variables" will be an option in the Project's Build Configuration will be turned off so it won't break anything. If you turn it on then it is your responsibility to add the exceptions to the #KEEP list.
At least that's how I see it.