C/C++ and Fortran

C/C++ and Fortran

Connect, learn, share, and engage with IBM Power.

 View Only

GCC-Clang-XL compiler pragmas mapping quick reference

By Archive User posted Tue October 09, 2018 12:59 AM

  

Originally posted by: sumi_cj


IBM XL C/C++ for Linux for little endian distributions is leveraging Clang technology and supports a substantial amount of GCC and Clang pragmas. The following table shows the key GCC and Clang pragmas that are supported by XL C/C++ for Linux for little endian distributions.
xlc, xlC
Get the latest releases:
GNU Compiler Collection (GCC) 
Get the latest release:
 
Clang
Get the latest release: http://releases.llvm.org/
#pragma GCC dependency
 
#pragma GCC dependency
 
#pragma GCC dependency
  • #pragma GCC diagnostic kind option
  • #pragma clang diagnostic kind option
#pragma GCC diagnostic kind option
  • #pragma GCC diagnostic kind option
  • #pragma clang diagnostic kind option 
  • #pragma GCC diagnostic push
  • #pragma clang diagnostic push
  • #pragma GCC diagnostic pop
  • #pragma clang diagnostic pop 
 
  • #pragma GCC diagnostic push
  • #pragma GCC diagnostic pop
  • #pragma GCC diagnostic push
  • #pragma clang diagnostic push
  • #pragma GCC diagnostic pop
  • #pragma clang diagnostic pop
#pragma GCC error string
#pragma GCC error string
#pragma GCC error string
  • #pragma GCC poison
  • #pragma clang poison 
  • #pragma GCC poison
  • #pragma GCC poison
  • #pragma clang poison
  • #pragma GCC system_header 
  • #pragma clang system_header 
#pragma GCC system_header 
  • #pragma GCC system_header 
  • #pragma clang system_header 
  • #pragma GCC visibility push(visibility)
  • #pragma GCC visibility pop 
  • #pragma GCC visibility push(visibility)
  • #pragma GCC visibility pop 
  • #pragma GCC visibility push(visibility)
  • #pragma GCC visibility pop
  • #pragma GCC warning string
  • #pragma message string
  • #pragma GCC warning string
  • #pragma message string
  • #pragma GCC warning string
  • #pragma message string
#pragma once 
#pragma once 
#pragma once 
  • #pragma push_macro("macro_name") 
  • #pragma pop_macro("macro_name") 
  • #pragma push_macro("macro_name") 
  • #pragma pop_macro("macro_name") 
 
  • #pragma push_macro("macro_name") 
  • #pragma pop_macro("macro_name")
#pragma redefine_extname oldname newname 
#pragma redefine_extname oldname newname 
#pragma redefine_extname oldname newname

 

IBM XL C/C++ for Linux for little endian distributions also supplies IBM-proprietary pragmas that provide similar functions to GCC pragmas.

xlc, xlC
Get the latest releases:
 
GNU Compiler Collection (GCC) 
Get the latest release:
 
Clang
Get the latest release: http://releases.llvm.org
 
Note
#pragma option_override(<function _name>, "opt(level, n)")
#pragma GCC optimize (n)
#pragma GCC optimize (n)
  • #pragma GCC optimize (n) applies from the point at which it is specified until the end of the including compilation unit.
 
  • #pragma option_override(<function _name>, "opt(level, n)") applies only to the specified function.

 

 

 

 

0 comments
1 view

Permalink