home *** CD-ROM | disk | FTP | other *** search
/ OpenStep 4.2J (Developer) / os42jdev.iso / NextDeveloper / Source / GNU / gcc / gcc.info-2 (.txt) < prev    next >
GNU Info File  |  1995-11-26  |  39KB  |  739 lines

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