Hi all,
In the KDS, i can set the project optimization level as -O0 -O1 -O2 or - O3.
But i want to modify the optimization level for one file in this project, i right click the file, select properties->c/c++ build->setting, but no optimization level here.
How an i set the optimization for a file, is it already support in KDS?
已解决! 转到解答。
I have used the following #pragma using GCC ARM in Atmel Studio and I am hoping to re-use the technique with my KDS development:
//------------------------------------------------------------------------
//------ Set optimization level for this module ------------------------
//------ Overrides global settings -------------------------------------
//------------------------------------------------------------------------
//Values are 0 for no optimization, to 3 for most. "s" is for size
#pragma GCC optimize ("Os")
There is more than one way to express this to GCC, but this is the form I have been using successfully for some time now.
BTW - I am looking for feedback as to the difference between the "Cross ARM Compiler" in KDS and the "GNU ARM Compiler" - Difference between the "Cross ARM C++ Compiler" and the "GNU ARM C++ Compiler"?