Developer forums (C::B DEVELOPMENT STRICTLY!) > Development

How to exclude unused functions

<< < (4/4)

Krice:

--- Quote from: joneewheelock on November 19, 2016, 02:21:29 am ---Everything 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.
--- End quote ---

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.

Navigation

[0] Message Index

[*] Previous page

Go to full version