There are predefined macros such as __OPTIMIZE__
(defined in all optimizing compilations) and __OPTIMIZE_SIZE__
(defined if the compiler is optimizing for size).
I use these macros to check if the correct optimization level is set for the release target, if not I print out a warning.
Is there a possibility to check whether the optimization level -Ofast
is set or not?
Possibly something like __OPTIMIZE_FAST__
or __OPTIMIZE_SPEED__
.