Developer Guide and Reference

Contents

GCC* Compatibility and Interoperability

This topic applies to Linux*
/
macOS*
.
The Intel® C++ Compiler is compatible with most versions of the GNU Compiler Collection (GCC*). The release notes contains a list of compatible versions.
C language object files created with the Intel® C++ Compiler are binary compatible with GCC* and C/C++ language library. You can use the Intel® C++ Compiler or the GCC compiler to pass object files to the linker.
To pass IPO mock object files or libraries of IPO mock object files produced by the Intel® C++ Compiler to the linker, use the linking tools provided with the Intel® C++ Compiler. Specifically:
Use
icc
,
icpc
,
ifort
,
xild
, and
xiar
.
When using an Intel software development product that includes an Intel® C++ Compiler with a Clang front-end, you can also use
icl
.
Link-time optimization using the
-ffat-lto-objects
compiler option is provided for GCC* compatibility. This implies that
ld
and
ar
can be used to link and archive object files, but by doing so you will lose cross-file optimizations. You can use the
-fno-fat-lto-objects
compiler option when linking using IPO mock object files, provided that you link the IPO mock object files with
xild
and archive them with
xiar
.
The Intel® C++ Compiler supports many of the language extensions provided by the GNU compilers. See http://www.gnu.org for more information.
Statement expressions are supported, except that the following are prohibited inside them:
  • dynamically-initialized local static variables
  • local non-POD class definitions
  • try/catch
  • variable length arrays
Branching out of a statement expression and statement expressions in constructor initializers are not allowed. Variable-length arrays are no longer allowed in statement expressions.
The Intel® C++ Compiler supports GCC-style inline ASM if the assembler code uses AT&T* System V/386 syntax.

GCC Interoperability

C++ compilers are interoperable if they can link object files and libraries generated by one compiler with object files and libraries generated by the second compiler, and the resulting executable runs successfully. The Intel® C++ Compiler is highly compatible with the GNU compilers.
The Intel® C++ Compiler and GNU GCC* compiler support the following predefined macros:
  • __GNUC__