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

梦想与她 提交于 2019-12-04 11:35:00

问题


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

__CC_ARM, __ICCARM__, __GNUC__, __TASKING__

Does anyone know what they mean?


回答1:


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



回答2:


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).




回答3:


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.



来源:https://stackoverflow.com/questions/17572519/what-do-the-cc-arm-iccarm-gnuc-and-tasking-macros-mean

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!