-Og
is a relatively new optimization option that is intended to improve the debugging experience while apply optimizations. If a user selects -Og
, then I'd like my source files to activate alternate code paths to enhance the debugging experience. GCC offers the __OPTIMIZE__
preprocessor macro, but its only set to 1 when optimizations are in effect.
Is there a way to learn the optimization level, like -O1
, -O3
or -Og
, for use with the preprocessor?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…