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

Preprocessor define when migrating code from Compiler Version 5 to 6

I want to migrate my projects from Keil Arm Compiler V5 to V6.

According to this tutorial the language extensions need to be revised in the code.

https://www.keil.com/appnotes/files/apnt_298.pdf

What will be the recommended preprocessor definition to identfy the compiler?

Example:

#if defined(__ARM_COMPILER_V5__)

#define __WEAK__ __weak

#define __PACKED__ __packed

#endif

#if defined(__ARM_COMPILER_V6__)

#define __WEAK__ __attribute__((weak))

#define __PACKED__  __attribute__((packed))

#endif