µVISION: Changing optimization level for a project/group/file/function
Information in this knowledgebase article applies to:
In µVision is it possible to assign a different optimization level to individual group or source file? And within a C file, is it possible to assign different optimization levels to different functions? If yes, how could I do that?
Yes, within µVision it is quite flexible to change optimization levels for different groups, C files, or functions in a C file.
Please note: without #pragma push and #pragma pop, only using #pragma O3 will set up the optimization level for all of the functions following this #pragma O3 directive. Thus, if you put this #pragma O3 directive at the beginning of the C file, then all of the functions in this C file will have optimization level O3.
The following Discussion Forum threads may provide information related to this topic.
Last Reviewed: Wednesday, January 25, 2017
of your data.