ID:2902953
 
Applies to:DM Language
Status: Open

Issue hasn't been assigned a status value.
Can there be a flag/setting for DM to throw warnings whenever it detects completely unused/dead procs? It would help with optimizing certain projects heavily as currently those functions are still compiled into the final dmb.

It could be implemented the same way DEBUG is implemented, as a flag in the .dme
#define WARN_UNUSED_PROCS

or as a compiler flag, like -wunused-proc
++
the problem is you can call procs dynamically
Personally, if this was implemented and I turned it on in a project and I had a proc that I only called dynamically, I'd be fine seeing a warning that it's unused. I can't expect the compiler to be smart enough to know that I'm calling a proc dynamically.
In response to Spevacus
Spevacus wrote:
I'd be fine seeing a warning that it's unused.

I suppose you could do
#pragma ignore unused_proc
or similar then.

I can't expect the compiler to be smart enough to know that I'm calling a proc dynamically.

I could expect it for trivial cases where you're not doing runtime string-building of the proc name.