News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

How to exclude unused functions

Started by joneewheelock, November 19, 2016, 02:21:29 AM

Previous topic - Next topic

Krice

Quote from: joneewheelock on November 19, 2016, 02:21:29 AMEverything is smooth except that code size is not optimized even after I opted for optimize size. I am not an expert. So  in my final object file how to exclude the functions that are not called.

If the program is extremely small then optimization flags (-Ox) are not that effective. More depends on how you write the code. Compiler optimization is mainly designed for "normal" projects and has varying results depending on a lot of stuff. Sometimes different levels of -O is giving surprising results both in speed and size of the program, so you should try every level. And the last tip, don't write functions that are not used in the project, it's considered bad design.