Options summary: C compiler

This page presents a summary of the C compiler options, grouped by type. The higher level groupings contain subgroups of options. In addition to a subgroup for basic translation of source code, one subgroup comprises options for special handling or control of the code, such as adding specialized debugging information. Another subgroup pertains to control of the linker and library search paths. Options related to performance and optimization are summarized in Getting started with optimization.

Basic translation

The options in this grouping have the broadest applicability for basic translation of source code. The subgroups of compiler options are generally concerned with:


Options related to basic translation of source code
Standards compliance Compilation mode or control of compiler driver
-qgenproto, -qnogenproto
-qlanglvl
-qlibansi, -qnolibansi

-#
-q32
-q64
-qabi_version=n,
-qaltivec, -qnoaltivec
-F
-qpath
-qproto, -qnoproto
-qsourcetype

Control of the preprocessor
-C
-D
-E
-P
-U

 
Source code generation
-qalloca
-qasm, -qnoasm
-qattr, -qnoattr
-B
-C
-qcpluscmt, -qnocpluscmt
-D
-qdbcs, -qnodbcs
-qdigraph, -qnodigraph
-qdirectstorage, -qnodirectstorage
-E
-qnoenablevmx
-qfuncsect, -qnofuncsect
-qignprag
-M

-qmakedep
-qmbcs, -qnombcs
-qminimaltoc, -qnominimaltoc
-P
-qsmallstack, -qnosmallstack
-qsyntaxonly
-t
-qtabsize
-qtrigraph, -qnotrigraph
-U
-qutf, -qnoutf
-qvrsave, -qnovrsave
-W

Diagnostics Compiled code
-qflag
-qinfo, -qnoinfo
-qmaxerr, -qnomaxerr
-qphsinfo, -qnophsinfo
-qprint, -qnoprint
-qshowinc, -qnoshowinc
-qsource, -qnosource
-qsuppress, -qnosuppress
-V
-v
-w
-qwarn64, -qnowarn64
-qxcall, -qnoxcall

-qbitfields
-c
-qchars
-qdataimported
-qdatalocal
-qdollar, -qnodollar
-o
-qprocimported
-qproclocal
-qprocunknown
-S
-qstatsym, -qnostatsym
-qtbtable
-qupconv, -qnoupconv

Specialized diagnostics

The options in this grouping control the ability to generate and display information related to the compilation process.

Options enabling specialized diagnostics
Diagnostics
-qflag
-qinfo, -qnoinfo
-qmaxerr, -qnomaxerr
-qphsinfo, -qnophsinfo
-qprint, -qnoprint
-qshowinc, -qnoshowinc
-qsource, -qnosource

-qsuppress, -qnosuppress
-V
-v
-w
-qwarn64, -qnowarn64
-qxcall, -qnoxcall

Special handling and control

The options in this grouping provide fine-grain control of the translation process and have less general applicability than basic translation options. The topics within this grouping of compiler options are generally concerned with:


Options for special handling, fine tuning, and debugging
Data alignment Parallelization
-qalign
-qenum

-qthreaded, -qnothreaded
-qtls, -qnotls (RedHat Linux only)

Floating-point and numerical features
Sizes
-qlonglit, -qnolonglit
-qlonglong, -qnolonglong
Rounding of floating-point values
-y
Single-precision values
None applicable for the Linux on pSeries platform
Other floating-point options
-qfloat
-qflttrap, -qnoflttrap
Debugging
-qcheck, -qnocheck
-qdbxextra, -qnodbxextra
-qfullpath, -qnofullpath
-g
-qhalt
-qinitauto, -qnoinitauto

-qkeepparm, -qnokeepparm
-qlinedebug, -qnolinedebug
-qlist, -qnolist
-qlistopt, -qnolistopt
-qsaveopt, -qnosaveopt
-qsymtab
-qxref, -qnoxref

Linking and library-related options

The options in this grouping are related to the linking phase of the compilation process. This grouping also contains options that provide specialized ways to specify search paths for finding libraries and header files. These compiler options are generally concerned with:


Options for controlling the ld command
Placing string literals and constants Static and dynamic linking and libraries
-qkeyword, -qnokeyword
-qro, -qnoro
-qroconst, -qnoroconst

-qstdinc, -qnostdinc

Search directories Other linker options
-I
-L
-l (lowercase el)
-qc_stdinc
-qcomplexgccincl, -qnocomplexgccincl
-qgcc_c_stdinc
-qidirfirst, -qnoidirfirst
-r

-qinlglue, -qnoinglue
-qcrt, -qnocrt
-qlib, -qnolib

Related References

IBM Copyright 2003