What do the __CC_ARM, __ICCARM__, __GNUC__ and __TASKING__ macros mean?

后端 未结 3 1218
陌清茗
陌清茗 2021-02-08 17:39

I am working on STM32l151rct6a by stm, I have stumbled upon these MACRO definitions

__CC_ARM, __ICCARM__, __GNUC__, __TASKING__

Does anyone kno

相关标签:
3条回答
  • 2021-02-08 18:38

    These are different compilers for ARM processors, probably these macros are used to hide compiler-dependent stuff in code that's compilable by several compilers.

    • ICCARM --> IAR (there will also be a macro __IAR_SYSTEMS_ICC__ that is set to the compiler platform version
    • __IMAGECRAFT__ --> Imagecraft C (also see Clifford's comments below - there's also a macro __ICC_VERSION__, see the pdf documentation)
    • TASKING --> Tasking
    • __CC_ARM --> ARM's (RealView) compiler
    • __GNUC__ --> gcc
    0 讨论(0)
  • 2021-02-08 18:40

    These are compiler specific MACROS and defined in compiler code.For example __ICC is for IAR and __GNU is for GNU compilers.There are some code given in BSP part for STM platform which have dependency on compilers.

    0 讨论(0)
  • 2021-02-08 18:45

    They are macros for identifying the compiler being used to build the code.

    A list of such macros, and others for identifying architecture and OS etc. can be found at http://sourceforge.net/p/predef/wiki/Home/. It does not however comprehensively cover many compilers from smaller embedded systems vendors (Tasking and Imagecraft for example).

    0 讨论(0)
提交回复
热议问题