Can I use code optimization?

5 posts / 0 new
Last post
summer20100514
Offline
Last seen:4 years 2 months ago
Guru
加入:2014-12-30 05:01
Can I use code optimization?

Hi, everyone here. The code size is getting larger and larger because of more functionalities. So my question is, can I use code optimization, for example, -O3, to decrease code size? If there are some side effects, what are they?

summer20100514
Offline
Last seen:4 years 2 months ago
Guru
加入:2014-12-30 05:01
I need your kindness.

I need your kindness.

VesaN
Offline
Last seen:5 years 4 months ago
Guru Master
加入:2014-06-26 08:49
Hello summer20100514,

Hello summer20100514,

If you open the Options, then go to C/C++, you can see Language / Code Generation legend there. You should have Optimization option there. Probably it is already -O3, if not, then you can use it

summer20100514
Offline
Last seen:4 years 2 months ago
Guru
加入:2014-12-30 05:01
是的,我知道如何et code

是的,我知道如何et code optimization, but I want to know, are there any side effects after enabling code optimization? For example, there are so many global variables in the origin SDK project, so should I add keyword volatile to each of them?

summer20100514
Offline
Last seen:4 years 2 months ago
Guru
加入:2014-12-30 05:01
The default setting of code

The default setting of code optimization of SDK3.40.6 is -O3, so the problem is solved.