pure/const function attributes in different compilers

  • GCC: pure/const function attributes
  • llvm-gcc: supports the GCC pure/const attributes
  • Clang: seems to support it (I tried on a simple example with the GCC style attributes and it worked.)
  • ICC: seems to adopt the GCC attributes (Sorry, only a forum post.)
  • MSVC: Seems not to support it. (discussion)

In general, it seems that almost all compilers support the GCC attributes. MSVC is so far the only compiler which does not support them (and which also doesn’t have any alternative).

Leave a Comment