This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Predefined symbols are not defined.

I am trying to use predefined symbols such as __OPTIMISE_LEVEL, __TARGET_ARCH_ARM, __TARGET_ARCH_THUMB on the evaluation version of the MDK and I find that they are not defined.  I tried to list all the defined symbols using the command line switch --list_macros but that is not recognised. 

Have I missed something or is this the normal behaviour of the evaluation compiler?

Parents
  • Hi John,

    I'm Paul Black, Product Manager for the Arm Compiler. I think the answer here very much depends on which compiler you're using: MDK ships with both Arm Compiler 5 and Arm Compiler 6.

    Arm Compiler 5 supported, for example, the __OPTIMISE_LEVEL macro. This would resolve to an integer relating to the optimization level being used (1 for -O1 etc). For Compiler 6 there's a small change in behaviour, and there are now 2 macros: __OPTIMIZE__ is defined if any optimization level other than -O0 is specified, and __OPTIMIZE_SIZE__ is defined if the size-optimizing options -Os or -Oz are used. The change in operation here partly reflects user feedback, partly reflects the wider range of optimization options available in AC6, and partly aligns more closely with a number of other widely-used compilers such as GCC. The change in functionality enables more widely portable code to be written, by reducing the number of compiler-specific macros.

    For similar reasons, __TARGET_ARCH_ARM is replaced by __ARM_ARCH, and __TARGET_ARCH_THUMB by __thumb__. The downside of course, is that there's a change in operation between AC5 and AC6, so not all code will migrate between the two with zero effort. We hope that by adopting more widely used constructs to promote more widely portable code, we got the balance about right.

    Regards,

    Paul.

Reply
  • Hi John,

    I'm Paul Black, Product Manager for the Arm Compiler. I think the answer here very much depends on which compiler you're using: MDK ships with both Arm Compiler 5 and Arm Compiler 6.

    Arm Compiler 5 supported, for example, the __OPTIMISE_LEVEL macro. This would resolve to an integer relating to the optimization level being used (1 for -O1 etc). For Compiler 6 there's a small change in behaviour, and there are now 2 macros: __OPTIMIZE__ is defined if any optimization level other than -O0 is specified, and __OPTIMIZE_SIZE__ is defined if the size-optimizing options -Os or -Oz are used. The change in operation here partly reflects user feedback, partly reflects the wider range of optimization options available in AC6, and partly aligns more closely with a number of other widely-used compilers such as GCC. The change in functionality enables more widely portable code to be written, by reducing the number of compiler-specific macros.

    For similar reasons, __TARGET_ARCH_ARM is replaced by __ARM_ARCH, and __TARGET_ARCH_THUMB by __thumb__. The downside of course, is that there's a change in operation between AC5 and AC6, so not all code will migrate between the two with zero effort. We hope that by adopting more widely used constructs to promote more widely portable code, we got the balance about right.

    Regards,

    Paul.

Children