We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
µVision2 V2.14 Compiler : C51 V6.14 Target : 87C591 In my software, functions are not called. Which is the option of compilation which allows not to generate code for these functions? Even by using for the optimization of the code the level 1 " Dead codes elimination ", code is generated for the uncalled functions.
IMO, It would still be valuable to be able to remove uncalled functions, even if other functions in the same module were referenced. A library is just a list of object files. Dead code elimination should work the same whether I build a lib or list a string of .obj's for the link. Why is the dead code there? The project's not done yet, and that code will be live eventually. Perhaps it will be called soon. And for doing incremental testing, I'd sometimes like to be able to just comment routines out. If I do that, though, the uncalled functions become new roots of the overlay tree and the linker becomes unhappy over all the extra data space that's now "consumed" by the dead code. If the function disappeared entirely, the overlayer wouldn't get so concerned. Even if the warning is "harmless", it's good practice to avoid all build warnings so that the "harmless" ones don't bury real ones in a wall of text. Since the point of tools is to make your life easier instead of harder, avoiding these warnings and the code/data bloat shouldn't require lots of hacking around with OVERLAY directives and re-organization of your project structure every time you comment or uncomment a function call. Please add this option to the feature request list. I'd suggest you need perhaps three levels: the current style; a "warnings only" where the linker merely notes that the code has been removed to nag you into getting to the final code yet without adding to the "program size" counters; and a silent option where the code disappears without any warning.