...set the optimization level of a single function?
I have a source file that contains a number of functions and I want to set the optimization level of one of those functions to a different value. Is it possible to set the optimization level of a single function within a single source file?
No, the optimization level can only be set for the entire source file using the Compiler > Optimization Level project property. You will need to put the function into another source file and set the optimization level of this source file to the required value.
-
Is this for V2 Cross Studio? I'm using version 2.0.8 of Cross Studio for MSP430. There is no Compiler > Optimization level that I can find (doesn't mean it doesn't exist of course), although the compiler compiles the file I am interested in with -O+9 (max speed). How do I turn off the optimisation for 1 file? And how does the optimisation level number relate to the project code generation options (if at all?)
Please sign in to leave a comment.
Comments
2 comments