Table B-1. AIX XLC/C++ and gcc/g++ Compiler Switches Comparison Table
C/C++ VisualAge for AIX Option[1] | GNU gcc Option[2] | Description (AIX-Based) |
---|
-+ | -x c++ | (C++) Compiles any file, filename.nnn, as a C++ language file, where nnn is any suffix other than .o, .a, or .s. |
-# | -### | Traces the compilation without doing anything. |
-q32 -q64 | -m32 -m64[3] | Selects 32- or 64-bit compiler mode. Additional m options for GCC are available. Refer to GNU. |
-qlanglvl=<option> | -fstd=<OPTION> | Specifies which language level to use when invoking the compiler. |
-qaggrcopy | None | Enables destructive copy operations for structures and unions. |
-qalias -qansialias | -fstrict-aliasing | Specifies which type-based aliasing is to be used during optimization. |
-qalign | -mstrict-align[3] | Specifies what aggregate alignment rules the compiler uses for file compilation. |
-qalloca -ma | None | Substitutes inline code for calls to function alloca as if #pragma alloca directives are in the source code. |
-qarch | -mcpu=cpu_type3 | Specifies the type of IBM architecture on which the executable program will be run. This refers to the RS6000 and POWER architecture. |
-qnoassert | None | Requests the compiler to apply aliasing assertions to your compilation unit. |
-qattr | None | Produces a compiler listing that includes an attribute listing for all identifiers. |
-B t | -B | -B: Determines substitute path names for the compiler, assembler, linkage editor, and preprocessor. |
| | -t: Adds the prefix specified by the -B option to designated programs. -tE replaces the CreateExportList script. |
-bdynamic -bshared | -shared fpic (or fPIC) -Bsharable or -Wl brt -shared | Instructs the linker to process subsequent shared objects as either dynamic or shared. |
-bstatic | -static -Bstatic -dn -non_shared | Links all referenced objects statically, although they may be shared objects. |
-qbitfields | -fsigned-bitfields (default) | Specifies whether bitfields are signed. |
-bmaxdata | Refer to Large Page Support section 6.13. | Sets the size of the heap in bytes. |
-brtl | -shared Wl | Enables runtime linking. |
-C | -C | Preserves comments in preprocessed output. |
-c | -c | Instructs the compiler to pass source files to the compiler only. |
-qcache | None | Specifies a cache configuration for a specific execution machine. |
-qchars=[signed or unsigned] | -fsigned-char funsigned-char | Instructs the compiler to treat all variables of type char as either signed or unsigned. |
-qcheck | None | Generates code that performs certain types of runtime checking. |
-qcinc | None | (C++) Include files from specified directories have the tokens extern " C " { inserted before the file and } appended after the file. |
-qcompact | -Os | When used with optimization, reduces code size where possible, at the expense of execution speed. |
-qcpluscmt | C++-style comments is turned on automatically in GNU C, unless ansi is turned on. | (C++) Use this option if you want C++ comments to be recognized in C source files. |
-D | -D | Defines the identifier name as in a #define preprocessor directive. |
-qdataimported | None | Marks data as imported. Used to import functions. |
-qdatalocal | None | Marks data as local. |
-qdbxextra | None | (C only) Specifies that all typedef declarations, struct, union, and enum type definitions are included for debugger processing. |
-qdigraph | None | Allows the use of digraph character sequences in your program. |
-qdollar | fdollars-in-identifiers This is the default behavior of GNU on most platforms. | Allows the $ symbol to be used in the names of identifiers. |
-qdpcl | None | Generates block scopes to support the IBM Dynamic Probe Class Library. |
-E | -E | Runs the source files named in the compiler invocation through the preprocessor. |
-eLabel | -e Label entry=Label Refer to Linker section | Specifies the entry name for the shared object. Equivalent to using ld -e name. See your system documentation for additional information about ld options. Used only with qmkshrobj. |
-qeh | -fexceptions | (C++) Controls exception handling. |
-qenum | Use keyword __attribute__[4] | Specifies the amount of storage occupied by the enumerations. |
-qexpfile | None | Saves all exported symbols in a file. |
-qextchk | None | Generates bind-time type checking information and checks for compile- time consistency. |
-F | None | Names an alternative configuration file for xlC. |
-f | None | Names a file to store a list of object files. |
-qfpdr | None | Collects program information for use with the AIX fdpr performance-tuning utility. |
-qflag | None | Specifies the minimum severity level of diagnostic messages to be reported. |
-qfloat | None (Accuracy of floating point is different on differing platforms.) | Specifies various floating-point options to speed up or improve the accuracy of floating-point operations. |
-qflttrap | -mfp-trap-mode= trap mode | Generates extra instructions to detect and trap floating-point exceptions. |
-qfold | None | Specifies that constant floating-point expressions are to be evaluated at compile time. |
-qfullpath | None | Specifies what path information is stored for files when you use -g and the distributed graphical debugger. |
-qfuncsect | None | Places instructions for each function in a separate object file, control section, or csect. |
-G | -shared Bshareable | Linkage editor (ld command) option only. Used to generate a dynamic library file. |
-g | -g | Generates debugging information used by a debugger such as the Distributed Debugger. |
-qgenproto | None | Produces ANSI prototypes from K&R function definitions. |
-qhalt | None | Instructs the compiler to stop after the compilation phase when it encounters errors of specified severity or greater. |
-qhaltonmsg | None | Enables debug versions of memory management functions. |
-qhot | None | Instructs the compiler to perform high-order transformations on loops and array language during optimization, and to pad array dimensions and data objects to avoid cache misses. |
-qhsflt | None | Speeds up calculations by removing range checking on single-precision float results and on conversions from floating point to integer. |
-qhssngl | None | Specifies that single-precision expressions are rounded only when the results are stored into float memory locations. |
-I | -I | Specifies an additional search path if the file name in the #include directive is not specified using its absolute path name. |
-qidirfirst | None | Specifies the search order for files included with the #include "file_name" directive. |
-qignerrno | None | Allows the compiler to perform optimizations that assume errno is not modified by system calls. |
-qignprag | None | Instructs the compiler to ignore certain pragma statements. |
-qinfo | None | Produces informational messages. |
-qinitauto | None | Initializes automatic storage to a specified two-digit hexadecimal byte value. |
-qinlglue | None | Generates fast external linkage by inlining the pointer glue code necessary to make a call to an external function or a call through a function pointer. |
-qinline | -finline-functions | Attempts to inline functions instead of generating calls to a function. |
-qipa | None | Turns on or customizes a class of optimizations known as interprocedural analysis (IPA). |
-qisolated_call | None | Specifies functions in the source file that have no side effects. |
-qkeepinlines | -fkeep-inline- functions | (C++) Instructs the compiler to keep or discard definitions for unreferenced extern inline functions. |
-qkeyword | None | Controls whether a specified string is treated as a keyword or an identifier. |
-L | -L | Searches the specified directory for library files specified by the -l option. |
-l | -l | Searches a specified library for linking. |
-qlanglvl | -ansi flang-isoc9x | Selects the C or C++ language level for compilation. |
-qlargepage | Refer to Large Page Support section | Instructs the compiler to exploit large page heaps available on POWER4 systems running AIX v5.1D or later. |
-qldbl128 -qlongdouble | None | Increases the size of the long double type from 64 bits to 128 bits. |
-qlibansi | None | Assumes that all functions with the name of an ANSI C library function are in fact the system functions. |
-qlinedebug | None | Generates abbreviated line number and source file name information for the debugger. |
-qlist | None | Produces a compiler listing that includes an object listing. |
-qlistopt | None | Produces a compiler listing that displays all options in effect. |
-qlonglit | None | Makes unsuffixed literals the long type for 64-bit mode. |
-qlonglong | -mlong64 (Refer to the m options for your targeted platform) | Allows long long types in your program. |
-M | -M | Creates an output file that contains targets suitable for inclusion in a description file for the AIX make command. |
-ma | Refer to alloc | (C only) Substitutes inline code for calls to function alloca as if #pragma alloca directives are in the source code. |
-qmacpstr | None | (C only) Converts Pascal string literals into null-terminated strings where the first byte contains the length of the string. |
-qmaf | None | Specifies whether the floating-point multiply-add instructions are to be generated. |
-qmakedep | -M | Creates an output file that contains targets suitable for inclusion in a description file for the AIX make command. |
-qmaxerr | None | Instructs the compiler to halt compilation when a specified number of errors of specified or greater severity is reached. |
-qmaxmem | None | Limits the amount of memory used for local tables of specific, memory-intensive optimizations. |
-qmbcs, dbcs | LANG[5] | Use the -qmbcs option if your program contains multibyte characters. |
-qmkshrobj | -shared or libtool[6] | Creates a shared object from generated object files. |
-qnamemangling | None | Selects the name mangling scheme for external symbol names generated from C++ source code. |
-O -qoptimize | -O | Optimizes code at a choice of levels during compilation. |
-o | -o | Specifies a name or directory for the output executable file(s) created by either the compiler or the linkage editor. |
-qobjmodel | None | (C++) Sets the type of object model. |
-qoldpassbyvalue | None | (C++) Specifies how classes containing const or reference members are passed in function arguments. |
-P | -E | Preprocesses the C or C++ source files named in the compiler invocation and creates an output preprocessed source file for each input source file. |
-p | None | Sets up the object files produced by the compiler for profiling. |
-qpascal | None | (C only) Ignores the word pascal in in type specifiers and function declarations. |
-qpath | None | Constructs alternate program and path names. |
-qpdf1 -qpdf2 | None | Tunes optimizations through Profile-Directed Feedback. |
-pg | -fprofile-generate | Sets up the object files for profiling, but provides more information than is provided by the -p option. |
-qphsinfo | gcov[7] | Reports the time taken in each compilation phase. |
-qprint | None | Suppresses listings. |
-qpriority | None | (C++) Specifies the priority level for the initialization of static constructors. |
-qproclocal -qprocimported -qprocunknown | None | Marks functions as local, imported, or unknown. |
-qproto | None | (C only) Assumes all functions are prototyped. |
-Q | -O3 | Attempts to inline functions instead of generating calls to a function. |
-r | -mrelocatable | Produces a relocatable object. |
-qreport | None | Instructs the compiler to produce transformation reports that show how program loops are parallelized and optimized. |
-qrndflt | None | Controls the compile-time rounding mode of constant floating-point expressions. |
-qrndsngl | None | Specifies that the result of each single-precision float operation is to be rounded to single precision. |
-qro | None | Specifies the storage type for string literals. |
-qroconst | None | Specifies the storage location for constant values. |
-qrrm | None | Prevents floating-point optimizations that are incompatible with runtime rounding to plus and minus infinity modes. |
-qrtti | None | (C++) Generates runtime type identification (RTTI) information for the typeid operator and the dynamic_cast operator. |
-S | -S | Generates an assembly language file (.s) for each source file. |
-s | None | Strips the symbol table. |
-qshowinc | None | If used with -qsource, all the include files are included in the source listing. |
-qsmallstack | None | Instructs the compiler to reduce the size of the stack frame. |
-qsmp | None | Enables parallelization of IBM SMP-compliant program code. |
-qsource | None | Produces a compiler listing and includes source code. |
-qspill | None | Specifies the size of the register allocation spill area. |
-qspnans | None | Generates extra instructions to detect signaling NaN on conversion from single precision to double precision. |
-qsrcmsg | None | (C only) Adds the corresponding source code lines to the diagnostic messages in the stderr file. |
-qstaticinline | None | (C ++) Controls whether inline functions are treated as static or extern. |
-qstatsym | None | Adds user-defined, nonexternal names that have a persistent storage class to the name list. |
-qstdinc | -nostdinc (nostdinc++ for C++ source) | Specifies which files are included with #include <file_name> and #include "file_name" directives. |
-qstrict | None | Turns off aggressive optimizations of the -O3 option that have the potential to alter the semantics of your program. |
-qstrict_induction | None | Disables loop induction variable optimizations that have the potential to alter the semantics of your program. |
-qsuppress | None | Specifies compiler message numbers to be suppressed. |
-qsymtab | None | Sets symbol tables for unreferenced variables or xcoff objects. |
-qsyntaxonly | -fsyntax-only | (C only) Causes the compiler to perform syntax checking without generating an object file. |
-qtabsize | None | Changes the length of tabs as perceived by the compiler. |
-qtbtable | None | Sets traceback table characteristics. |
-qtempinc | -frepo | (C++) Generates separate include files for template functions and class declarations and places these files in a directory that can be optionally specified. |
-qtemplaterecompile | -frepo | (C ++) Helps manage dependencies between compilation units that have been compiled using the -qtemplateregistry compiler option. |
-qtemplateregistry | -frepo | (C++) Maintains records of all templates as they are encountered in the source and ensures that only one instantiation of each template is made. |
-qtempmax | None | (C++) Specifies the maximum number of template include files to be generated by the tempinc option for each header file. |
-qthreaded | -lpthread -D_REENTRANT | Indicates that the program will run in a multithreaded environment. |
-qtmplparse | None | (C++) Controls whether parsing and semantic checking are applied to template definition implementations. |
-qtocdata | None | Marks data as local. |
-qtocmerge | None | Enables TOC merging to reduce TOC pointer loads and improves the scheduling of external loads. |
-qtune | -b | Specifies the architecture for which the executable program is optimized. |
-qtwolink | None | (C++) Minimizes the number of static constructors included from libraries. |
-U | -U | Undefines a specified identifier defined by the compiler or by the -D option. |
-qunique | None | (C++) Generates unique names for static constructor/deconstructor file compilation units. |
-qunroll | -funroll-loops | Unrolls inner loops in the program. |
-qunwind | None | Informs the compiler that the application does not rely on any program stack unwinding mechanism. |
-qupconv | None | Preserves the unsigned specification when performing integral promotions. |
-V | None | Instructs the compiler to report information on the progress of the compilation in a command-like format. |
-v | -v | Instructs the compiler to report information on the progress of the compilation. |
-qvftable | -fvtable-thunks | (C++) Controls the generation of virtual function tables. |
-W | None | Passes the listed words to a designated compiler program. |
-w | -w | Requests that warning messages be suppressed. |
-qwarn64 | None | Enables warning of possible long to integer data truncations. |
-qxcall | None | Generates code to static routines within a compilation unit as if they were external calls. |
-qxref | None | Produces a compiler listing that includes a cross-reference listing of all identifiers. |
-y | None | Specifies the compile-time rounding mode of constant floating-point expressions. See also rndflt. |