home *** CD-ROM | disk | FTP | other *** search
/ Big Green CD 8 / BGCD_8_Dev.iso / OPENSTEP / UNIX / GNU / gcc-2.7.2.3.1-I / info / gcc.info-2 < prev    next >
Encoding:
GNU Info File  |  1997-09-12  |  38.4 KB  |  908 lines

  1. This is Info file gcc.info, produced by Makeinfo version 1.67 from the
  2. input file gcc.texi.
  3.  
  4.    This file documents the use and the internals of the GNU compiler.
  5.  
  6.    Published by the Free Software Foundation 59 Temple Place - Suite 330
  7. Boston, MA 02111-1307 USA
  8.  
  9.    Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995 Free Software
  10. Foundation, Inc.
  11.  
  12.    Permission is granted to make and distribute verbatim copies of this
  13. manual provided the copyright notice and this permission notice are
  14. preserved on all copies.
  15.  
  16.    Permission is granted to copy and distribute modified versions of
  17. this manual under the conditions for verbatim copying, provided also
  18. that the sections entitled "GNU General Public License," "Funding for
  19. Free Software," and "Protect Your Freedom--Fight `Look And Feel'" are
  20. included exactly as in the original, and provided that the entire
  21. resulting derived work is distributed under the terms of a permission
  22. notice identical to this one.
  23.  
  24.    Permission is granted to copy and distribute translations of this
  25. manual into another language, under the above conditions for modified
  26. versions, except that the sections entitled "GNU General Public
  27. License," "Funding for Free Software," and "Protect Your Freedom--Fight
  28. `Look And Feel'", and this permission notice, may be included in
  29. translations approved by the Free Software Foundation instead of in the
  30. original English.
  31.  
  32. 
  33. File: gcc.info,  Node: Option Summary,  Next: Overall Options,  Up: Invoking GCC
  34.  
  35. Option Summary
  36. ==============
  37.  
  38.    Here is a summary of all the options, grouped by type.  Explanations
  39. are in the following sections.
  40.  
  41. *Overall Options*
  42.      *Note Options Controlling the Kind of Output: Overall Options.
  43.           -c  -S  -E  -o FILE  -pipe  -v  -x LANGUAGE
  44.  
  45. *C Language Options*
  46.      *Note Options Controlling C Dialect: C Dialect Options.
  47.           -ansi  -fallow-single-precision -fcond-mismatch  -fno-asm
  48.           -fno-builtin  -fsigned-bitfields  -fsigned-char
  49.           -funsigned-bitfields  -funsigned-char  -fwritable-strings
  50.           -traditional  -traditional-cpp  -trigraphs
  51.  
  52. *C++ Language Options*
  53.      *Note Options Controlling C++ Dialect: C++ Dialect Options.
  54.           -fall-virtual  -fdollars-in-identifiers  -felide-constructors
  55.           -fenum-int-equiv -fexternal-templates  -ffor-scope -fno-for-scope
  56.           -fhandle-signatures -fmemoize-lookups  -fno-default-inline -fno-gnu-keywords
  57.           -fnonnull-objects  -foperator-names  -fstrict-prototype
  58.           -fthis-is-variable -nostdinc++ -traditional  +eN
  59.  
  60. *Warning Options*
  61.      *Note Options to Request or Suppress Warnings: Warning Options.
  62.           -fsyntax-only  -pedantic  -pedantic-errors
  63.           -w  -W  -Wall  -Waggregate-return  -Wbad-function-cast
  64.           -Wcast-align -Wcast-qual  -Wchar-subscript  -Wcomment
  65.           -Wconversion -Wenum-clash  -Werror  -Wformat
  66.           -Wid-clash-LEN  -Wimplicit  -Wimport  -Winline
  67.           -Wlarger-than-LEN  -Wmissing-declarations
  68.           -Wmissing-prototypes  -Wnested-externs
  69.           -Wno-import  -Woverloaded-virtual -Wparentheses
  70.           -Wpointer-arith  -Wredundant-decls -Wreorder -Wreturn-type -Wshadow
  71.           -Wstrict-prototypes  -Wswitch  -Wsynth  -Wtemplate-debugging
  72.           -Wtraditional  -Wtrigraphs -Wuninitialized  -Wunused
  73.           -Wwrite-strings
  74.  
  75. *Debugging Options*
  76.      *Note Options for Debugging Your Program or GCC: Debugging Options.
  77.           -a  -dLETTERS  -fpretend-float
  78.           -g  -gLEVEL -gcoff  -gdwarf  -gdwarf+
  79.           -ggdb  -gstabs  -gstabs+  -gxcoff  -gxcoff+
  80.           -p  -pg  -print-file-name=LIBRARY  -print-libgcc-file-name
  81.           -print-prog-name=PROGRAM  -print-search-dirs  -save-temps
  82.  
  83. *Optimization Options*
  84.      *Note Options that Control Optimization: Optimize Options.
  85.           -fcaller-saves  -fcse-follow-jumps  -fcse-skip-blocks
  86.           -fdelayed-branch   -fexpensive-optimizations
  87.           -ffast-math  -ffloat-store  -fforce-addr  -fforce-mem
  88.           -finline-functions  -fkeep-inline-functions
  89.           -fno-default-inline  -fno-defer-pop  -fno-function-cse
  90.           -fno-inline  -fno-peephole  -fomit-frame-pointer
  91.           -frerun-cse-after-loop  -fschedule-insns
  92.           -fschedule-insns2  -fstrength-reduce  -fthread-jumps
  93.           -funroll-all-loops  -funroll-loops
  94.           -fmove-all-movables  -freduce-all-givs  -frerun-loop-opt
  95.           -O  -O0  -O1  -O2  -O3
  96.  
  97. *Preprocessor Options*
  98.      *Note Options Controlling the Preprocessor: Preprocessor Options.
  99.           -AQUESTION(ANSWER)  -C  -dD  -dM  -dN
  100.           -DMACRO[=DEFN]  -E  -H
  101.           -idirafter DIR
  102.           -include FILE  -imacros FILE
  103.           -iprefix FILE  -iwithprefix DIR
  104.           -iwithprefixbefore DIR  -isystem DIR
  105.           -M  -MD  -MM  -MMD  -MG  -nostdinc  -P  -trigraphs
  106.           -undef  -UMACRO  -Wp,OPTION
  107.  
  108. *Assembler Option*
  109.      *Note Passing Options to the Assembler: Assembler Options.
  110.           -Wa,OPTION
  111.  
  112. *Linker Options*
  113.      *Note Options for Linking: Link Options.
  114.           OBJECT-FILE-NAME  -lLIBRARY
  115.           -nostartfiles  -nodefaultlibs  -nostdlib
  116.           -s  -static  -shared  -symbolic
  117.           -Wl,OPTION  -Xlinker OPTION
  118.           -u SYMBOL
  119.  
  120. *Directory Options*
  121.      *Note Options for Directory Search: Directory Options.
  122.           -BPREFIX  -IDIR  -I-  -LDIR
  123.  
  124. *Target Options*
  125.      *Note Target Options::.
  126.           -b MACHINE  -V VERSION
  127.  
  128. *Machine Dependent Options*
  129.      *Note Hardware Models and Configurations: Submodel Options.
  130.           *M680x0 Options*
  131.           -m68000  -m68020  -m68020-40  -m68030  -m68040  -m68881
  132.           -mbitfield  -mc68000  -mc68020  -mfpa  -mnobitfield
  133.           -mrtd  -mshort  -msoft-float
  134.           
  135.           *VAX Options*
  136.           -mg  -mgnu  -munix
  137.           
  138.           *SPARC Options*
  139.           -mapp-regs  -mcypress  -mepilogue  -mflat  -mfpu  -mhard-float
  140.           -mhard-quad-float  -mno-app-regs  -mno-flat  -mno-fpu
  141.           -mno-epilogue  -mno-unaligned-doubles
  142.           -msoft-float  -msoft-quad-float
  143.           -msparclite  -msupersparc  -munaligned-doubles  -mv8
  144.           
  145.           SPARC V9 compilers support the following options
  146.           in addition to the above:
  147.           
  148.           -mmedlow  -mmedany
  149.           -mint32  -mint64  -mlong32  -mlong64
  150.           -mno-stack-bias  -mstack-bias
  151.           
  152.           *Convex Options*
  153.           -mc1  -mc2  -mc32  -mc34  -mc38
  154.           -margcount  -mnoargcount
  155.           -mlong32  -mlong64
  156.           -mvolatile-cache  -mvolatile-nocache
  157.           
  158.           *AMD29K Options*
  159.           -m29000  -m29050  -mbw  -mnbw  -mdw  -mndw
  160.           -mlarge  -mnormal  -msmall
  161.           -mkernel-registers  -mno-reuse-arg-regs
  162.           -mno-stack-check  -mno-storem-bug
  163.           -mreuse-arg-regs  -msoft-float  -mstack-check
  164.           -mstorem-bug  -muser-registers
  165.           
  166.           *ARM Options*
  167.           -mapcs -m2 -m3 -m6 -mbsd -mxopen -mno-symrename
  168.           
  169.           *M88K Options*
  170.           -m88000  -m88100  -m88110  -mbig-pic
  171.           -mcheck-zero-division  -mhandle-large-shift
  172.           -midentify-revision  -mno-check-zero-division
  173.           -mno-ocs-debug-info  -mno-ocs-frame-position
  174.           -mno-optimize-arg-area  -mno-serialize-volatile
  175.           -mno-underscores  -mocs-debug-info
  176.           -mocs-frame-position  -moptimize-arg-area
  177.           -mserialize-volatile  -mshort-data-NUM  -msvr3
  178.           -msvr4  -mtrap-large-shift  -muse-div-instruction
  179.           -mversion-03.00  -mwarn-passed-structs
  180.           
  181.           *RS/6000 and PowerPC Options*
  182.           -mcpu=CPU  TYPE
  183.           -mpower  -mno-power  -mpower2  -mno-power2
  184.           -mpowerpc  -mno-powerpc
  185.           -mpowerpc-gpopt  -mno-powerpc-gpopt
  186.           -mpowerpc-gfxopt  -mno-powerpc-gfxopt
  187.           -mnew-mnemonics  -mno-new-mnemonics
  188.           -mfull-toc   -mminimal-toc  -mno-fop-in-toc  -mno-sum-in-toc
  189.           -msoft-float  -mhard-float -mmultiple -mno-multiple
  190.           -mstring -mno-string -mbit-align -mno-bit-align
  191.           -mstrict-align -mno-strict-align -mrelocatable -mno-relocatable
  192.           -mtoc -mno-toc -mtraceback -mno-traceback
  193.           -mlittle -mlittle-endian -mbig -mbig-endian
  194.           -mcall-aix -mcall-sysv -mprototype
  195.           
  196.           *RT Options*
  197.           -mcall-lib-mul  -mfp-arg-in-fpregs  -mfp-arg-in-gregs
  198.           -mfull-fp-blocks  -mhc-struct-return  -min-line-mul
  199.           -mminimum-fp-blocks  -mnohc-struct-return
  200.           
  201.           *MIPS Options*
  202.           -mabicalls  -mcpu=CPU  TYPE  -membedded-data
  203.           -membedded-pic  -mfp32  -mfp64  -mgas  -mgp32  -mgp64
  204.           -mgpopt  -mhalf-pic  -mhard-float  -mint64 -mips1
  205.           -mips2 -mips3  -mlong64  -mlong-calls  -mmemcpy
  206.           -mmips-as  -mmips-tfile  -mno-abicalls
  207.           -mno-embedded-data  -mno-embedded-pic
  208.           -mno-gpopt  -mno-long-calls
  209.           -mno-memcpy  -mno-mips-tfile  -mno-rnames  -mno-stats
  210.           -mrnames -msoft-float
  211.           -m4650 -msingle-float -mmad
  212.           -mstats  -EL  -EB  -G NUM  -nocpp
  213.           
  214.           *i386 Options*
  215.           -m486  -m386 -mieee-fp  -mno-fancy-math-387
  216.           -mno-fp-ret-in-387  -msoft-float  -msvr3-shlib
  217.           -mno-wide-multiply -mrtd -malign-double
  218.           -mreg-alloc=LIST -mregparm=NUM
  219.           -malign-jumps=NUM -malign-loops=NUM
  220.           -malign-functions=NUM
  221.           
  222.           *HPPA Options*
  223.           -mdisable-fpregs  -mdisable-indexing  -mfast-indirect-calls
  224.           -mgas  -mjump-in-delay -mlong-millicode-calls -mno-disable-fpregs
  225.           -mno-disable-indexing -mno-fast-indirect-calls -mno-gas
  226.           -mno-jump-in-delay -mno-millicode-long-calls
  227.           -mno-portable-runtime -mno-soft-float -msoft-float
  228.           -mpa-risc-1-0  -mpa-risc-1-1  -mportable-runtime -mschedule=LIST
  229.           
  230.           *Intel 960 Options*
  231.           -mCPU TYPE  -masm-compat  -mclean-linkage
  232.           -mcode-align  -mcomplex-addr  -mleaf-procedures
  233.           -mic-compat  -mic2.0-compat  -mic3.0-compat
  234.           -mintel-asm  -mno-clean-linkage  -mno-code-align
  235.           -mno-complex-addr  -mno-leaf-procedures
  236.           -mno-old-align  -mno-strict-align  -mno-tail-call
  237.           -mnumerics  -mold-align  -msoft-float  -mstrict-align
  238.           -mtail-call
  239.           
  240.           *DEC Alpha Options*
  241.           -mfp-regs  -mno-fp-regs  -mno-soft-float
  242.           -msoft-float
  243.           
  244.           *Clipper Options*
  245.           -mc300 -mc400
  246.           
  247.           *H8/300 Options*
  248.           -mrelax  -mh
  249.           
  250.           *System V Options*
  251.           -Qy  -Qn  -YP,PATHS  -Ym,DIR
  252.  
  253. *Code Generation Options*
  254.      *Note Options for Code Generation Conventions: Code Gen Options.
  255.           -fcall-saved-REG  -fcall-used-REG
  256.           -ffixed-REG  -finhibit-size-directive
  257.           -fno-common  -fno-ident  -fno-gnu-linker
  258.           -fpcc-struct-return  -fpic  -fPIC
  259.           -freg-struct-return  -fshared-data  -fshort-enums
  260.           -fshort-double  -fvolatile  -fvolatile-global
  261.           -fverbose-asm -fpack-struct -fstack-check +e0  +e1
  262.           -fargument-alias  -fargument-noalias
  263.           -fargument-noalias-global
  264.  
  265. * Menu:
  266.  
  267. * Overall Options::     Controlling the kind of output:
  268.                         an executable, object files, assembler files,
  269.                         or preprocessed source.
  270. * C Dialect Options::   Controlling the variant of C language compiled.
  271. * C++ Dialect Options:: Variations on C++.
  272. * Warning Options::     How picky should the compiler be?
  273. * Debugging Options::   Symbol tables, measurements, and debugging dumps.
  274. * Optimize Options::    How much optimization?
  275. * Preprocessor Options:: Controlling header files and macro definitions.
  276.                          Also, getting dependency information for Make.
  277. * Assembler Options::   Passing options to the assembler.
  278. * Link Options::        Specifying libraries and so on.
  279. * Directory Options::   Where to find header files and libraries.
  280.                         Where to find the compiler executable files.
  281. * Target Options::      Running a cross-compiler, or an old version of GNU CC.
  282.  
  283. 
  284. File: gcc.info,  Node: Overall Options,  Next: Invoking G++,  Prev: Option Summary,  Up: Invoking GCC
  285.  
  286. Options Controlling the Kind of Output
  287. ======================================
  288.  
  289.    Compilation can involve up to four stages: preprocessing, compilation
  290. proper, assembly and linking, always in that order.  The first three
  291. stages apply to an individual source file, and end by producing an
  292. object file; linking combines all the object files (those newly
  293. compiled, and those specified as input) into an executable file.
  294.  
  295.    For any given input file, the file name suffix determines what kind
  296. of compilation is done:
  297.  
  298. `FILE.c'
  299.      C source code which must be preprocessed.
  300.  
  301. `FILE.i'
  302.      C source code which should not be preprocessed.
  303.  
  304. `FILE.ii'
  305.      C++ source code which should not be preprocessed.
  306.  
  307. `FILE.m'
  308.      Objective-C source code.  Note that you must link with the library
  309.      `libobjc.a' to make an Objective-C program work.
  310.  
  311. `FILE.h'
  312.      C header file (not to be compiled or linked).
  313.  
  314. `FILE.cc'
  315. `FILE.cxx'
  316. `FILE.cpp'
  317. `FILE.C'
  318.      C++ source code which must be preprocessed.  Note that in `.cxx',
  319.      the last two letters must both be literally `x'.  Likewise, `.C'
  320.      refers to a literal capital C.
  321.  
  322. `FILE.s'
  323.      Assembler code.
  324.  
  325. `FILE.S'
  326.      Assembler code which must be preprocessed.
  327.  
  328. `OTHER'
  329.      An object file to be fed straight into linking.  Any file name
  330.      with no recognized suffix is treated this way.
  331.  
  332.    You can specify the input language explicitly with the `-x' option:
  333.  
  334. `-x LANGUAGE'
  335.      Specify explicitly the LANGUAGE for the following input files
  336.      (rather than letting the compiler choose a default based on the
  337.      file name suffix).  This option applies to all following input
  338.      files until the next `-x' option.  Possible values for LANGUAGE
  339.      are:
  340.           c  objective-c  c++
  341.           c-header  cpp-output  c++-cpp-output
  342.           assembler  assembler-with-cpp
  343.  
  344. `-x none'
  345.      Turn off any specification of a language, so that subsequent files
  346.      are handled according to their file name suffixes (as they are if
  347.      `-x' has not been used at all).
  348.  
  349.    If you only want some of the stages of compilation, you can use `-x'
  350. (or filename suffixes) to tell `gcc' where to start, and one of the
  351. options `-c', `-S', or `-E' to say where `gcc' is to stop.  Note that
  352. some combinations (for example, `-x cpp-output -E' instruct `gcc' to do
  353. nothing at all.
  354.  
  355. `-c'
  356.      Compile or assemble the source files, but do not link.  The linking
  357.      stage simply is not done.  The ultimate output is in the form of an
  358.      object file for each source file.
  359.  
  360.      By default, the object file name for a source file is made by
  361.      replacing the suffix `.c', `.i', `.s', etc., with `.o'.
  362.  
  363.      Unrecognized input files, not requiring compilation or assembly,
  364.      are ignored.
  365.  
  366. `-S'
  367.      Stop after the stage of compilation proper; do not assemble.  The
  368.      output is in the form of an assembler code file for each
  369.      non-assembler input file specified.
  370.  
  371.      By default, the assembler file name for a source file is made by
  372.      replacing the suffix `.c', `.i', etc., with `.s'.
  373.  
  374.      Input files that don't require compilation are ignored.
  375.  
  376. `-E'
  377.      Stop after the preprocessing stage; do not run the compiler
  378.      proper.  The output is in the form of preprocessed source code,
  379.      which is sent to the standard output.
  380.  
  381.      Input files which don't require preprocessing are ignored.
  382.  
  383. `-o FILE'
  384.      Place output in file FILE.  This applies regardless to whatever
  385.      sort of output is being produced, whether it be an executable file,
  386.      an object file, an assembler file or preprocessed C code.
  387.  
  388.      Since only one output file can be specified, it does not make
  389.      sense to use `-o' when compiling more than one input file, unless
  390.      you are producing an executable file as output.
  391.  
  392.      If `-o' is not specified, the default is to put an executable file
  393.      in `a.out', the object file for `SOURCE.SUFFIX' in `SOURCE.o', its
  394.      assembler file in `SOURCE.s', and all preprocessed C source on
  395.      standard output.
  396.  
  397. `-v'
  398.      Print (on standard error output) the commands executed to run the
  399.      stages of compilation.  Also print the version number of the
  400.      compiler driver program and of the preprocessor and the compiler
  401.      proper.
  402.  
  403. `-pipe'
  404.      Use pipes rather than temporary files for communication between the
  405.      various stages of compilation.  This fails to work on some systems
  406.      where the assembler is unable to read from a pipe; but the GNU
  407.      assembler has no trouble.
  408.  
  409. 
  410. File: gcc.info,  Node: Invoking G++,  Next: C Dialect Options,  Prev: Overall Options,  Up: Invoking GCC
  411.  
  412. Compiling C++ Programs
  413. ======================
  414.  
  415.    C++ source files conventionally use one of the suffixes `.C', `.cc',
  416. `cpp', or `.cxx'; preprocessed C++ files use the suffix `.ii'.  GNU CC
  417. recognizes files with these names and compiles them as C++ programs
  418. even if you call the compiler the same way as for compiling C programs
  419. (usually with the name `gcc').
  420.  
  421.    However, C++ programs often require class libraries as well as a
  422. compiler that understands the C++ language--and under some
  423. circumstances, you might want to compile programs from standard input,
  424. or otherwise without a suffix that flags them as C++ programs.  `g++'
  425. is a program that calls GNU CC with the default language set to C++,
  426. and automatically specifies linking against the GNU class library
  427. libg++.  (1) On many systems, the script `g++' is also installed with
  428. the name `c++'.
  429.  
  430.    When you compile C++ programs, you may specify many of the same
  431. command-line options that you use for compiling programs in any
  432. language; or command-line options meaningful for C and related
  433. languages; or options that are meaningful only for C++ programs.  *Note
  434. Options Controlling C Dialect: C Dialect Options, for explanations of
  435. options for languages related to C.  *Note Options Controlling C++
  436. Dialect: C++ Dialect Options, for explanations of options that are
  437. meaningful only for C++ programs.
  438.  
  439.    ---------- Footnotes ----------
  440.  
  441.    (1)  Prior to release 2 of the compiler, there was a separate `g++'
  442. compiler.  That version was based on GNU CC, but not integrated with
  443. it.  Versions of `g++' with a `1.XX' version number--for example, `g++'
  444. version 1.37 or 1.42--are much less reliable than the versions
  445. integrated with GCC 2.  Moreover, combining G++ `1.XX' with a version 2
  446. GCC will simply not work.
  447.  
  448. 
  449. File: gcc.info,  Node: C Dialect Options,  Next: C++ Dialect Options,  Prev: Invoking G++,  Up: Invoking GCC
  450.  
  451. Options Controlling C Dialect
  452. =============================
  453.  
  454.    The following options control the dialect of C (or languages derived
  455. from C, such as C++ and Objective C) that the compiler accepts:
  456.  
  457. `-ansi'
  458.      Support all ANSI standard C programs.
  459.  
  460.      This turns off certain features of GNU C that are incompatible
  461.      with ANSI C, such as the `asm', `inline' and `typeof' keywords, and
  462.      predefined macros such as `unix' and `vax' that identify the type
  463.      of system you are using.  It also enables the undesirable and
  464.      rarely used ANSI trigraph feature, disallows `$' as part of
  465.      identifiers, and disables recognition of C++ style `//' comments.
  466.  
  467.      The alternate keywords `__asm__', `__extension__', `__inline__'
  468.      and `__typeof__' continue to work despite `-ansi'.  You would not
  469.      want to use them in an ANSI C program, of course, but it is useful
  470.      to put them in header files that might be included in compilations
  471.      done with `-ansi'.  Alternate predefined macros such as `__unix__'
  472.      and `__vax__' are also available, with or without `-ansi'.
  473.  
  474.      The `-ansi' option does not cause non-ANSI programs to be rejected
  475.      gratuitously.  For that, `-pedantic' is required in addition to
  476.      `-ansi'.  *Note Warning Options::.
  477.  
  478.      The macro `__STRICT_ANSI__' is predefined when the `-ansi' option
  479.      is used.  Some header files may notice this macro and refrain from
  480.      declaring certain functions or defining certain macros that the
  481.      ANSI standard doesn't call for; this is to avoid interfering with
  482.      any programs that might use these names for other things.
  483.  
  484.      The functions `alloca', `abort', `exit', and `_exit' are not
  485.      builtin functions when `-ansi' is used.
  486.  
  487. `-fno-asm'
  488.      Do not recognize `asm', `inline' or `typeof' as a keyword, so that
  489.      code can use these words as identifiers.  You can use the keywords
  490.      `__asm__', `__inline__' and `__typeof__' instead.  `-ansi' implies
  491.      `-fno-asm'.
  492.  
  493.      In C++, this switch only affects the `typeof' keyword, since `asm'
  494.      and `inline' are standard keywords.  You may want to use the
  495.      `-fno-gnu-keywords' flag instead, as it also disables the other,
  496.      C++-specific, extension keywords such as `headof'.
  497.  
  498. `-fno-builtin'
  499.      Don't recognize builtin functions that do not begin with two
  500.      leading underscores.  Currently, the functions affected include
  501.      `abort', `abs', `alloca', `cos', `exit', `fabs', `ffs', `labs',
  502.      `memcmp', `memcpy', `sin', `sqrt', `strcmp', `strcpy', and
  503.      `strlen'.
  504.  
  505.      GCC normally generates special code to handle certain builtin
  506.      functions more efficiently; for instance, calls to `alloca' may
  507.      become single instructions that adjust the stack directly, and
  508.      calls to `memcpy' may become inline copy loops.  The resulting
  509.      code is often both smaller and faster, but since the function
  510.      calls no longer appear as such, you cannot set a breakpoint on
  511.      those calls, nor can you change the behavior of the functions by
  512.      linking with a different library.
  513.  
  514.      The `-ansi' option prevents `alloca' and `ffs' from being builtin
  515.      functions, since these functions do not have an ANSI standard
  516.      meaning.
  517.  
  518. `-trigraphs'
  519.      Support ANSI C trigraphs.  You don't want to know about this
  520.      brain-damage.  The `-ansi' option implies `-trigraphs'.
  521.  
  522. `-traditional'
  523.      Attempt to support some aspects of traditional C compilers.
  524.      Specifically:
  525.  
  526.         * All `extern' declarations take effect globally even if they
  527.           are written inside of a function definition.  This includes
  528.           implicit declarations of functions.
  529.  
  530.         * The newer keywords `typeof', `inline', `signed', `const' and
  531.           `volatile' are not recognized.  (You can still use the
  532.           alternative keywords such as `__typeof__', `__inline__', and
  533.           so on.)
  534.  
  535.         * Comparisons between pointers and integers are always allowed.
  536.  
  537.         * Integer types `unsigned short' and `unsigned char' promote to
  538.           `unsigned int'.
  539.  
  540.         * Out-of-range floating point literals are not an error.
  541.  
  542.         * Certain constructs which ANSI regards as a single invalid
  543.           preprocessing number, such as `0xe-0xd', are treated as
  544.           expressions instead.
  545.  
  546.         * String "constants" are not necessarily constant; they are
  547.           stored in writable space, and identical looking constants are
  548.           allocated separately.  (This is the same as the effect of
  549.           `-fwritable-strings'.)
  550.  
  551.         * All automatic variables not declared `register' are preserved
  552.           by `longjmp'.  Ordinarily, GNU C follows ANSI C: automatic
  553.           variables not declared `volatile' may be clobbered.
  554.  
  555.         * The character escape sequences `\x' and `\a' evaluate as the
  556.           literal characters `x' and `a' respectively.  Without
  557.           `-traditional', `\x' is a prefix for the hexadecimal
  558.           representation of a character, and `\a' produces a bell.
  559.  
  560.         * In C++ programs, assignment to `this' is permitted with
  561.           `-traditional'.  (The option `-fthis-is-variable' also has
  562.           this effect.)
  563.  
  564.      You may wish to use `-fno-builtin' as well as `-traditional' if
  565.      your program uses names that are normally GNU C builtin functions
  566.      for other purposes of its own.
  567.  
  568.      You cannot use `-traditional' if you include any header files that
  569.      rely on ANSI C features.  Some vendors are starting to ship
  570.      systems with ANSI C header files and you cannot use `-traditional'
  571.      on such systems to compile files that include any system headers.
  572.  
  573. `'
  574.      In the preprocessor, comments convert to nothing at all, rather
  575.      than to a space.  This allows traditional token concatenation.
  576.  
  577. `'
  578.      In preprocessing directive, the `#' symbol must appear as the first
  579.      character of a line.
  580.  
  581. `'
  582.      In the preprocessor, macro arguments are recognized within string
  583.      constants in a macro definition (and their values are stringified,
  584.      though without additional quote marks, when they appear in such a
  585.      context).  The preprocessor always considers a string constant to
  586.      end at a newline.
  587.  
  588. `'
  589.      The predefined macro `__STDC__' is not defined when you use
  590.      `-traditional', but `__GNUC__' is (since the GNU extensions which
  591.      `__GNUC__' indicates are not affected by `-traditional').  If you
  592.      need to write header files that work differently depending on
  593.      whether `-traditional' is in use, by testing both of these
  594.      predefined macros you can distinguish four situations: GNU C,
  595.      traditional GNU C, other ANSI C compilers, and other old C
  596.      compilers.  The predefined macro `__STDC_VERSION__' is also not
  597.      defined when you use `-traditional'.  *Note Standard Predefined
  598.      Macros: (cpp.info)Standard Predefined, for more discussion of
  599.      these and other predefined macros.
  600.  
  601. `'
  602.      The preprocessor considers a string constant to end at a newline
  603.      (unless the newline is escaped with `\').  (Without `-traditional',
  604.      string constants can contain the newline character as typed.)
  605.  
  606. `-traditional-cpp'
  607.      Attempt to support some aspects of traditional C preprocessors.
  608.      This includes the last five items in the table immediately above,
  609.      but none of the other effects of `-traditional'.
  610.  
  611. `-fcond-mismatch'
  612.      Allow conditional expressions with mismatched types in the second
  613.      and third arguments.  The value of such an expression is void.
  614.  
  615. `-funsigned-char'
  616.      Let the type `char' be unsigned, like `unsigned char'.
  617.  
  618.      Each kind of machine has a default for what `char' should be.  It
  619.      is either like `unsigned char' by default or like `signed char' by
  620.      default.
  621.  
  622.      Ideally, a portable program should always use `signed char' or
  623.      `unsigned char' when it depends on the signedness of an object.
  624.      But many programs have been written to use plain `char' and expect
  625.      it to be signed, or expect it to be unsigned, depending on the
  626.      machines they were written for.  This option, and its inverse, let
  627.      you make such a program work with the opposite default.
  628.  
  629.      The type `char' is always a distinct type from each of `signed
  630.      char' or `unsigned char', even though its behavior is always just
  631.      like one of those two.
  632.  
  633. `-fsigned-char'
  634.      Let the type `char' be signed, like `signed char'.
  635.  
  636.      Note that this is equivalent to `-fno-unsigned-char', which is the
  637.      negative form of `-funsigned-char'.  Likewise, the option
  638.      `-fno-signed-char' is equivalent to `-funsigned-char'.
  639.  
  640. `-fsigned-bitfields'
  641. `-funsigned-bitfields'
  642. `-fno-signed-bitfields'
  643. `-fno-unsigned-bitfields'
  644.      These options control whether a bitfield is signed or unsigned,
  645.      when the declaration does not use either `signed' or `unsigned'.
  646.      By default, such a bitfield is signed, because this is consistent:
  647.      the basic integer types such as `int' are signed types.
  648.  
  649.      However, when `-traditional' is used, bitfields are all unsigned
  650.      no matter what.
  651.  
  652. `-fwritable-strings'
  653.      Store string constants in the writable data segment and don't
  654.      uniquize them.  This is for compatibility with old programs which
  655.      assume they can write into string constants.  The option
  656.      `-traditional' also has this effect.
  657.  
  658.      Writing into string constants is a very bad idea; "constants"
  659.      should be constant.
  660.  
  661. `-fallow-single-precision'
  662.      Do not promote single precision math operations to double
  663.      precision, even when compiling with `-traditional'.
  664.  
  665.      Traditional K&R C promotes all floating point operations to double
  666.      precision, regardless of the sizes of the operands.   On the
  667.      architecture for which you are compiling, single precision may be
  668.      faster than double precision.   If you must use `-traditional',
  669.      but want to use single precision operations when the operands are
  670.      single precision, use this option.   This option has no effect
  671.      when compiling with ANSI or GNU C conventions (the default).
  672.  
  673. 
  674. File: gcc.info,  Node: C++ Dialect Options,  Next: Warning Options,  Prev: C Dialect Options,  Up: Invoking GCC
  675.  
  676. Options Controlling C++ Dialect
  677. ===============================
  678.  
  679.    This section describes the command-line options that are only
  680. meaningful for C++ programs; but you can also use most of the GNU
  681. compiler options regardless of what language your program is in.  For
  682. example, you might compile a file `firstClass.C' like this:
  683.  
  684.      g++ -g -felide-constructors -O -c firstClass.C
  685.  
  686. In this example, only `-felide-constructors' is an option meant only
  687. for C++ programs; you can use the other options with any language
  688. supported by GNU CC.
  689.  
  690.    Here is a list of options that are *only* for compiling C++ programs:
  691.  
  692. `-fno-access-control'
  693.      Turn off all access checking.  This switch is mainly useful for
  694.      working around bugs in the access control code.
  695.  
  696. `-fall-virtual'
  697.      Treat all possible member functions as virtual, implicitly.  All
  698.      member functions (except for constructor functions and `new' or
  699.      `delete' member operators) are treated as virtual functions of the
  700.      class where they appear.
  701.  
  702.      This does not mean that all calls to these member functions will
  703.      be made through the internal table of virtual functions.  Under
  704.      some circumstances, the compiler can determine that a call to a
  705.      given virtual function can be made directly; in these cases the
  706.      calls are direct in any case.
  707.  
  708. `-fcheck-new'
  709.      Check that the pointer returned by `operator new' is non-null
  710.      before attempting to modify the storage allocated.  The current
  711.      Working Paper requires that `operator new' never return a null
  712.      pointer, so this check is normally unnecessary.
  713.  
  714. `-fconserve-space'
  715.      Put uninitialized or runtime-initialized global variables into the
  716.      common segment, as C does.  This saves space in the executable at
  717.      the cost of not diagnosing duplicate definitions.  If you compile
  718.      with this flag and your program mysteriously crashes after
  719.      `main()' has completed, you may have an object that is being
  720.      destroyed twice because two definitions were merged.
  721.  
  722. `-fdollars-in-identifiers'
  723.      Accept `$' in identifiers.  You can also explicitly prohibit use of
  724.      `$' with the option `-fno-dollars-in-identifiers'.  (GNU C++
  725.      allows `$' by default on some target systems but not others.)
  726.      Traditional C allowed the character `$' to form part of
  727.      identifiers.  However, ANSI C and C++ forbid `$' in identifiers.
  728.  
  729. `-fenum-int-equiv'
  730.      Anachronistically permit implicit conversion of `int' to
  731.      enumeration types.  Current C++ allows conversion of `enum' to
  732.      `int', but not the other way around.
  733.  
  734. `-fexternal-templates'
  735.      Cause template instantiations to obey `#pragma interface' and
  736.      `implementation'; template instances are emitted or not according
  737.      to the location of the template definition.  *Note Template
  738.      Instantiation::, for more information.
  739.  
  740. `-falt-external-templates'
  741.      Similar to -fexternal-templates, but template instances are
  742.      emitted or not according to the place where they are first
  743.      instantiated.  *Note Template Instantiation::, for more
  744.      information.
  745.  
  746. `-ffor-scope'
  747. `-fno-for-scope'
  748.      If -ffor-scope is specified, the scope of variables declared in a
  749.      for-init-statement is limited to the `for' loop itself, as
  750.      specified by the draft C++ standard.  If -fno-for-scope is
  751.      specified, the scope of variables declared in a for-init-statement
  752.      extends to the end of the enclosing scope, as was the case in old
  753.      versions of gcc, and other (traditional) implementations of C++.
  754.  
  755.      The default if neither flag is given to follow the standard, but
  756.      to allow and give a warning for old-style code that would
  757.      otherwise be invalid, or have different behavior.
  758.  
  759. `-fno-gnu-keywords'
  760.      Do not recognize `classof', `headof', `signature', `sigof' or
  761.      `typeof' as a keyword, so that code can use these words as
  762.      identifiers.  You can use the keywords `__classof__',
  763.      `__headof__', `__signature__', `__sigof__', and `__typeof__'
  764.      instead.  `-ansi' implies `-fno-gnu-keywords'.
  765.  
  766. `-fno-implicit-templates'
  767.      Never emit code for templates which are instantiated implicitly
  768.      (i.e. by use); only emit code for explicit instantiations.  *Note
  769.      Template Instantiation::, for more information.
  770.  
  771. `-fhandle-signatures'
  772.      Recognize the `signature' and `sigof' keywords for specifying
  773.      abstract types.  The default (`-fno-handle-signatures') is not to
  774.      recognize them.  *Note Type Abstraction using Signatures: C++
  775.      Signatures.
  776.  
  777. `-fhuge-objects'
  778.      Support virtual function calls for objects that exceed the size
  779.      representable by a `short int'.  Users should not use this flag by
  780.      default; if you need to use it, the compiler will tell you so.  If
  781.      you compile any of your code with this flag, you must compile
  782.      *all* of your code with this flag (including libg++, if you use
  783.      it).
  784.  
  785.      This flag is not useful when compiling with -fvtable-thunks.
  786.  
  787. `-fno-implement-inlines'
  788.      To save space, do not emit out-of-line copies of inline functions
  789.      controlled by `#pragma implementation'.  This will cause linker
  790.      errors if these functions are not inlined everywhere they are
  791.      called.
  792.  
  793. `-fmemoize-lookups'
  794. `-fsave-memoized'
  795.      Use heuristics to compile faster.  These heuristics are not
  796.      enabled by default, since they are only effective for certain
  797.      input files.  Other input files compile more slowly.
  798.  
  799.      The first time the compiler must build a call to a member function
  800.      (or reference to a data member), it must (1) determine whether the
  801.      class implements member functions of that name; (2) resolve which
  802.      member function to call (which involves figuring out what sorts of
  803.      type conversions need to be made); and (3) check the visibility of
  804.      the member function to the caller.  All of this adds up to slower
  805.      compilation.  Normally, the second time a call is made to that
  806.      member function (or reference to that data member), it must go
  807.      through the same lengthy process again.  This means that code like
  808.      this:
  809.  
  810.           cout << "This " << p << " has " << n << " legs.\n";
  811.  
  812.      makes six passes through all three steps.  By using a software
  813.      cache, a "hit" significantly reduces this cost.  Unfortunately,
  814.      using the cache introduces another layer of mechanisms which must
  815.      be implemented, and so incurs its own overhead.
  816.      `-fmemoize-lookups' enables the software cache.
  817.  
  818.      Because access privileges (visibility) to members and member
  819.      functions may differ from one function context to the next, G++
  820.      may need to flush the cache.  With the `-fmemoize-lookups' flag,
  821.      the cache is flushed after every function that is compiled.  The
  822.      `-fsave-memoized' flag enables the same software cache, but when
  823.      the compiler determines that the context of the last function
  824.      compiled would yield the same access privileges of the next
  825.      function to compile, it preserves the cache.  This is most helpful
  826.      when defining many member functions for the same class: with the
  827.      exception of member functions which are friends of other classes,
  828.      each member function has exactly the same access privileges as
  829.      every other, and the cache need not be flushed.
  830.  
  831.      The code that implements these flags has rotted; you should
  832.      probably avoid using them.
  833.  
  834. `-fstrict-prototype'
  835.      Within an `extern "C"' linkage specification, treat a function
  836.      declaration with no arguments, such as `int foo ();', as declaring
  837.      the function to take no arguments.  Normally, such a declaration
  838.      means that the function `foo' can take any combination of
  839.      arguments, as in C.  `-pedantic' implies `-fstrict-prototype'
  840.      unless overridden with `-fno-strict-prototype'.
  841.  
  842.      This flag no longer affects declarations with C++ linkage.
  843.  
  844. `-fno-nonnull-objects'
  845.      Don't assume that a reference is initialized to refer to a valid
  846.      object.  Although the current C++ Working Paper prohibits null
  847.      references, some old code may rely on them, and you can use
  848.      `-fno-nonnull-objects' to turn on checking.
  849.  
  850.      At the moment, the compiler only does this checking for
  851.      conversions to virtual base classes.
  852.  
  853. `-foperator-names'
  854.      Recognize the operator name keywords `and', `bitand', `bitor',
  855.      `compl', `not', `or' and `xor' as synonyms for the symbols they
  856.      refer to.  `-ansi' implies `-foperator-names'.
  857.  
  858. `-fthis-is-variable'
  859.      Permit assignment to `this'.  The incorporation of user-defined
  860.      free store management into C++ has made assignment to `this' an
  861.      anachronism.  Therefore, by default it is invalid to assign to
  862.      `this' within a class member function; that is, GNU C++ treats
  863.      `this' in a member function of class `X' as a non-lvalue of type
  864.      `X *'.  However, for backwards compatibility, you can make it
  865.      valid with `-fthis-is-variable'.
  866.  
  867. `-fvtable-thunks'
  868.      Use `thunks' to implement the virtual function dispatch table
  869.      (`vtable').  The traditional (cfront-style) approach to
  870.      implementing vtables was to store a pointer to the function and two
  871.      offsets for adjusting the `this' pointer at the call site.  Newer
  872.      implementations store a single pointer to a `thunk' function which
  873.      does any necessary adjustment and then calls the target function.
  874.  
  875.      This option also enables a heuristic for controlling emission of
  876.      vtables; if a class has any non-inline virtual functions, the
  877.      vtable will be emitted in the translation unit containing the
  878.      first one of those.
  879.  
  880. `-nostdinc++'
  881.      Do not search for header files in the standard directories
  882.      specific to C++, but do still search the other standard
  883.      directories.  (This option is used when building libg++.)
  884.  
  885. `-traditional'
  886.      For C++ programs (in addition to the effects that apply to both C
  887.      and C++), this has the same effect as `-fthis-is-variable'.  *Note
  888.      Options Controlling C Dialect: C Dialect Options.
  889.  
  890.    In addition, these optimization, warning, and code generation options
  891. have meanings only for C++ programs:
  892.  
  893. `-fno-default-inline'
  894.      Do not assume `inline' for functions defined inside a class scope.
  895.      *Note Options That Control Optimization: Optimize Options.
  896.  
  897. `-Wenum-clash'
  898. `-Woverloaded-virtual'
  899. `-Wtemplate-debugging'
  900.      Warnings that apply only to C++ programs.  *Note Options to
  901.      Request or Suppress Warnings: Warning Options.
  902.  
  903. `+eN'
  904.      Control how virtual function definitions are used, in a fashion
  905.      compatible with `cfront' 1.x.  *Note Options for Code Generation
  906.      Conventions: Code Gen Options.
  907.  
  908.