If you are using a USB to parallel or serial conversion cable, select the USB Virtual Printer Port that corresponds to your cable and port. If you see more than one, choose the one with the highest number. If it doesn't work, try a lower number subsequently.
Node:G++ and GCC,Next:Invoking GCC,Previous:Top,Up:TopCompile C, C++, Objective C, or FortranThe C, C++, and Objective C, and Fortran versions of the compiler areintegrated; this is why we use the name "GNU Compiler Collection". GCC can compile programs written in C, C++, Objective C, or Fortran. The Fortran compiler is described in a separate manual."GCC" is a common shorthand term for the GNU Compiler Collection. This is boththe most general name for the compiler, and the name used when theemphasis is on compiling C programs (as the abbreviation formerlystood for "GNU C Compiler").When referring to C++ compilation, it is usual to call the compiler"G++". Since there is only one compiler, it is also accurate to callit "GCC" no matter what the language context; however, the term"G++" is more useful when the emphasis is on compiling C++ programs.We use the name "GCC" to refer to the compilation system as awhole, and more specifically to the language-independent part of thecompiler. For example, we refer to the optimization options asaffecting the behavior of "GCC" or sometimes just "the compiler".Front ends for other languages, such as Ada 9X, Fortran, Modula-3, andPascal, are under development. These front-ends, like that for C++, arebuilt in subdirectories of GCC and link to it. The result is anintegrated compiler that can compile programs written in C, C++,Objective C, or any of the languages for which you have installed frontends.In this manual, we only discuss the options for the C, Objective-C, andC++ compilers and those of the GCC core. Consult the documentationof the other front ends for the options to use when compiling programswritten in other languages.G++ is a compiler, not merely a preprocessor. G++ builds objectcode directly from your C++ program source. There is no intermediate Cversion of the program. (By contrast, for example, some otherimplementations use a program that generates a C program from your C++source.) Avoiding an intermediate C representation of the program meansthat you get better object code, and better debugging information. TheGNU debugger, GDB, works with this information in the object code togive you comprehensive C++ source-level editing capabilities(see C).Node:Invoking GCC,Next:Installation,Previous:G++ and GCC,Up:TopGCC Command OptionsWhen you invoke GCC, it normally does preprocessing, compilation,assembly and linking. The "overall options" allow you to stop thisprocess at an intermediate stage. For example, the -c optionsays not to run the linker. Then the output consists of object filesoutput by the assembler.Other options are passed on to one stage of processing. Some optionscontrol the preprocessor and others the compiler itself. Yet otheroptions control the assembler and linker; most of these are notdocumented here, since you rarely need to use any of them.Most of the command line options that you can use with GCC are usefulfor C programs; when an option is only useful with another language(usually C++), the explanation says so explicitly. If the descriptionfor a particular option does not mention a source language, you can usethat option with all supported languages.See Compiling C++ Programs, for a summary of specialoptions for compiling C++ programs.The gcc program accepts options and file names as operands. Manyoptions have multiletter names; therefore multiple single-letter optionsmay not be grouped: -dr is very different from -d -r.You can mix options and other arguments. For the most part, the orderyou use doesn't matter. Order does matter when you use several optionsof the same kind; for example, if you specify -L more than once,the directories are searched in the order specified.Many options have long names starting with -f or with-W--for example, -fforce-mem,-fstrength-reduce, -Wformat and so on. Most ofthese have both positive and negative forms; the negative form of-ffoo would be -fno-foo. This manual documentsonly one of these two forms, whichever one is not the default.Option Summary: Brief list of all options, without explanations. Overall Options: Controlling the kind of output: an executable, object files, assembler files, or preprocessed source. Invoking G++: Compiling C++ programs. C Dialect Options: Controlling the variant of C language compiled. C++ Dialect Options: Variations on C++. Warning Options: How picky should the compiler be? Debugging Options: Symbol tables, measurements, and debugging dumps. Optimize Options: How much optimization? Preprocessor Options: Controlling header files and macro definitions. Also, getting dependency information for Make. Assembler Options: Passing options to the assembler. Link Options: Specifying libraries and so on. Directory Options: Where to find header files and libraries. Where to find the compiler executable files. Target Options: Running a cross-compiler, or an old version of GCC. Submodel Options: Specifying minor hardware or convention variations, such as 68010 vs 68020. Code Gen Options: Specifying conventions for function calls, data layout and register usage. Environment Variables: Env vars that affect GCC. Running Protoize: Automatically adding or removing function prototypes. Node:Option Summary,Next:Overall Options,Up:Invoking GCCOption SummaryHere is a summary of all the options, grouped by type. Explanations arein the following sections.Overall OptionsSee Options Controlling the Kind of Output.-c -S -E -o file -pipe -v --help -x languageC Language OptionsSee Options Controlling C Dialect.-ansi -fstd -fallow-single-precision -fcond-mismatch -fno-asm-fno-builtin -ffreestanding -fhosted -fsigned-bitfields -fsigned-char-funsigned-bitfields -funsigned-char -fwritable-strings-traditional -traditional-cpp -trigraphsC++ Language OptionsSee Options Controlling C++ Dialect.-fno-access-control -fcheck-new -fconserve-space -fdollars-in-identifiers-fno-elide-constructors -fexternal-templates -ffor-scope-fno-for-scope -fno-gnu-keywords -fguiding-decls -fhandle-signatures-fhonor-std -fhuge-objects -fno-implicit-templates -finit-priority-fno-implement-inlines -fname-mangling-version-n -fno-default-inline-foperator-names -fno-optional-diags -fpermissive -frepo -fstrict-prototype-fsquangle -ftemplate-depth-n -fthis-is-variable -fvtable-thunks-nostdinc++ -Wctor-dtor-privacy -Wno-deprecated -Weffc++-Wno-non-template-friend-Wnon-virtual-dtor -Wold-style-cast -Woverloaded-virtual-Wno-pmf-conversions -Wreorder -Wsign-promo -WsynthWarning OptionsSee Options to Request or Suppress Warnings.-fsyntax-only -pedantic -pedantic-errors-w -W -Wall -Waggregate-return -Wbad-function-cast-Wcast-align -Wcast-qual -Wchar-subscripts -Wcomment-Wconversion -Werror -Wformat-Wid-clash-len -Wimplicit -Wimplicit-int-Wimplicit-function-declaration -Wimport-Werror-implicit-function-declaration -Winline-Wlarger-than-len -Wlong-long-Wmain -Wmissing-declarations -Wmissing-noreturn-Wmissing-prototypes -Wmultichar -Wnested-externs -Wno-import-Wparentheses -Wpointer-arith -Wredundant-decls-Wreturn-type -Wshadow -Wsign-compare -Wstrict-prototypes-Wswitch -Wtraditional-Wtrigraphs -Wundef -Wuninitialized -Wunused -Wwrite-strings-Wunknown-pragmasDebugging OptionsSee Options for Debugging Your Program or GCC.-a -ax -dletters -fdump-unnumbered -fpretend-float-fprofile-arcs -ftest-coverage-g -glevel -gcoff -gdwarf -gdwarf-1 -gdwarf-1+ -gdwarf-2-ggdb -gstabs -gstabs+ -gxcoff -gxcoff+-p -pg -print-file-name=library -print-libgcc-file-name-print-prog-name=program -print-search-dirs -save-tempsOptimization OptionsSee Options that Control Optimization.-fbranch-probabilities -foptimize-register-moves-fcaller-saves -fcse-follow-jumps -fcse-skip-blocks-fdelayed-branch -fexpensive-optimizations-ffast-math -ffloat-store -fforce-addr -fforce-mem-fdata-sections -ffunction-sections -fgcse-finline-functions -finline-limit-n -fkeep-inline-functions-fno-default-inline -fno-defer-pop -fno-function-cse-fno-inline -fno-peephole -fomit-frame-pointer -fregmove-frerun-cse-after-loop -frerun-loop-opt -fschedule-insns-fschedule-insns2 -fstrength-reduce -fthread-jumps-funroll-all-loops -funroll-loops-fmove-all-movables -freduce-all-givs -fstrict-aliasing-O -O0 -O1 -O2 -O3 -OsPreprocessor OptionsSee Options Controlling the Preprocessor.-Aquestion(answer) -C -dD -dM -dN-Dmacro[=defn] -E -H-idirafter dir-include file -imacros file-iprefix file -iwithprefix dir-iwithprefixbefore dir -isystem dir -isystem-c++ dir-M -MD -MM -MMD -MG -nostdinc -P -trigraphs-undef -Umacro -Wp,optionAssembler OptionSee Passing Options to the Assembler.-Wa,optionLinker OptionsSee Options for Linking.object-file-name -llibrary-nostartfiles -nodefaultlibs -nostdlib-s -static -shared -symbolic-Wl,option -Xlinker option-u symbolDirectory OptionsSee Options for Directory Search.-Bprefix -Idir -I- -Ldir -specs=fileTarget OptionsSee Target Options.-b machine -V versionMachine Dependent OptionsSee Hardware Models and Configurations.M680x0 Options-m68000 -m68020 -m68020-40 -m68020-60 -m68030 -m68040-m68060 -mcpu32 -m5200 -m68881 -mbitfield -mc68000 -mc68020-mfpa -mnobitfield -mrtd -mshort -msoft-float-malign-intVAX Options-mg -mgnu -munixSPARC Options-mcpu=cpu type-mtune=cpu type-mcmodel=code model-malign-jumps=num -malign-loops=num-malign-functions=num-m32 -m64-mapp-regs -mbroken-saverestore -mcypress -mepilogue-mflat -mfpu -mhard-float -mhard-quad-float-mimpure-text -mlive-g0 -mno-app-regs -mno-epilogue-mno-flat -mno-fpu -mno-impure-text-mno-stack-bias -mno-unaligned-doubles-msoft-float -msoft-quad-float -msparclite -mstack-bias-msupersparc -munaligned-doubles -mv8Convex Options-mc1 -mc2 -mc32 -mc34 -mc38-margcount -mnoargcount-mlong32 -mlong64-mvolatile-cache -mvolatile-nocacheAMD29K Options-m29000 -m29050 -mbw -mnbw -mdw -mndw-mlarge -mnormal -msmall-mkernel-registers -mno-reuse-arg-regs-mno-stack-check -mno-storem-bug-mreuse-arg-regs -msoft-float -mstack-check-mstorem-bug -muser-registersARM Options-mapcs-frame -mno-apcs-frame-mapcs-26 -mapcs-32-mapcs-stack-check -mno-apcs-stack-check-mapcs-float -mno-apcs-float-mapcs-reentrant -mno-apcs-reentrant-msched-prolog -mno-sched-prolog-mlittle-endian -mbig-endian -mwords-little-endian-mshort-load-bytes -mno-short-load-bytes -mshort-load-words -mno-short-load-words-msoft-float -mhard-float -mfpe-mthumb-interwork -mno-thumb-interwork-mcpu= -march= -mfpe=-mstructure-size-boundary=-mbsd -mxopen -mno-symrename-mabort-on-noreturn-mno-sched-prologThumb Options-mtpcs-frame -mno-tpcs-frame-mtpcs-leaf-frame -mno-tpcs-leaf-frame-mlittle-endian -mbig-endian-mthumb-interwork -mno-thumb-interwork-mstructure-size-boundary=MN10200 Options-mrelaxMN10300 Options-mmult-bug-mno-mult-bug-mrelaxM32R/D Options-mcode-model=model type -msdata=sdata type-G numM88K Options-m88000 -m88100 -m88110 -mbig-pic-mcheck-zero-division -mhandle-large-shift-midentify-revision -mno-check-zero-division-mno-ocs-debug-info -mno-ocs-frame-position-mno-optimize-arg-area -mno-serialize-volatile-mno-underscores -mocs-debug-info-mocs-frame-position -moptimize-arg-area-mserialize-volatile -mshort-data-num -msvr3-msvr4 -mtrap-large-shift -muse-div-instruction-mversion-03.00 -mwarn-passed-structsRS/6000 and PowerPC Options-mcpu=cpu type-mtune=cpu type-mpower -mno-power -mpower2 -mno-power2-mpowerpc -mno-powerpc-mpowerpc-gpopt -mno-powerpc-gpopt-mpowerpc-gfxopt -mno-powerpc-gfxopt-mnew-mnemonics -mno-new-mnemonics-mfull-toc -mminimal-toc -mno-fop-in-toc -mno-sum-in-toc-maix64 -maix32 -mxl-call -mno-xl-call -mthreads -mpe-msoft-float -mhard-float -mmultiple -mno-multiple-mstring -mno-string -mupdate -mno-update-mfused-madd -mno-fused-madd -mbit-align -mno-bit-align-mstrict-align -mno-strict-align -mrelocatable-mno-relocatable -mrelocatable-lib -mno-relocatable-lib-mtoc -mno-toc -mlittle -mlittle-endian -mbig -mbig-endian-mcall-aix -mcall-sysv -mprototype -mno-prototype-msim -mmvme -mads -myellowknife -memb -msdata-msdata=opt -G numRT Options-mcall-lib-mul -mfp-arg-in-fpregs -mfp-arg-in-gregs-mfull-fp-blocks -mhc-struct-return -min-line-mul-mminimum-fp-blocks -mnohc-struct-returnMIPS Options-mabicalls -mcpu=cpu type -membedded-data-membedded-pic -mfp32 -mfp64 -mgas -mgp32 -mgp64-mgpopt -mhalf-pic -mhard-float -mint64 -mips1-mips2 -mips3 -mips4 -mlong64 -mlong32 -mlong-calls -mmemcpy-mmips-as -mmips-tfile -mno-abicalls-mno-embedded-data -mno-embedded-pic-mno-gpopt -mno-long-calls-mno-memcpy -mno-mips-tfile -mno-rnames -mno-stats-mrnames -msoft-float-m4650 -msingle-float -mmad-mstats -EL -EB -G num -nocpp-mabi=32 -mabi=n32 -mabi=64 -mabi=eabii386 Options-mcpu=cpu type-march=cpu type-mieee-fp -mno-fancy-math-387-mno-fp-ret-in-387 -msoft-float -msvr3-shlib-mno-wide-multiply -mrtd -malign-double-mreg-alloc=list -mregparm=num-malign-jumps=num -malign-loops=num-malign-functions=num -mpreferred-stack-boundary=num-mthreadsHPPA Options-march=architecture type-mbig-switch -mdisable-fpregs -mdisable-indexing-mfast-indirect-calls -mgas -mjump-in-delay-mlong-load-store -mno-big-switch -mno-disable-fpregs-mno-disable-indexing -mno-fast-indirect-calls -mno-gas-mno-jump-in-delay -mno-long-load-store-mno-portable-runtime -mno-soft-float -mno-space-mno-space-regs -msoft-float -mpa-risc-1-0-mpa-risc-1-1 -mpa-risc-2-0 -mportable-runtime-mschedule=cpu type -mspace -mspace-regsIntel 960 Options-mcpu type -masm-compat -mclean-linkage-mcode-align -mcomplex-addr -mleaf-procedures-mic-compat -mic2.0-compat -mic3.0-compat-mintel-asm -mno-clean-linkage -mno-code-align-mno-complex-addr -mno-leaf-procedures-mno-old-align -mno-strict-align -mno-tail-call-mnumerics -mold-align -msoft-float -mstrict-align-mtail-callDEC Alpha Options-mfp-regs -mno-fp-regs -mno-soft-float -msoft-float-malpha-as -mgas-mieee -mieee-with-inexact -mieee-conformant-mfp-trap-mode=mode -mfp-rounding-mode=mode-mtrap-precision=mode -mbuild-constants-mcpu=cpu type-mbwx -mno-bwx -mcix -mno-cix -mmax -mno-max-mmemory-latency=timeClipper Options-mc300 -mc400H8/300 Options-mrelax -mh -ms -mint32 -malign-300SH Options-m1 -m2 -m3 -m3e -mb -ml -mdalign -mrelaxSystem V Options-Qy -Qn -YP,paths -Ym,dirARC Options-EB -EL-mmangle-cpu -mcpu=cpu -mtext=text section-mdata=data section -mrodata=readonly data sectionTMS320C3x/C4x Options-mcpu=cpu -mbig -msmall -mregparm -mmemparm-mfast-fix -mmpyi -mbk -mti -mdp-isr-reload-mrpts=count -mrptb -mdb -mloop-unsigned-mparallel-insns -mparallel-mpy -mpreserve-floatV850 Options-mlong-calls -mno-long-calls -mep -mno-ep-mprolog-function -mno-prolog-function -mspace-mtda=n -msda=n -mzda=n-mv850 -mbig-switchNS32K Options-m32032 -m32332 -m32532 -m32081 -m32381 -mmult-add -mnomult-add-msoft-float -mrtd -mnortd -mregparam -mnoregparam -msb -mnosb-mbitfield -mnobitfield -mhimem -mnohimemCode Generation OptionsSee Options for Code Generation Conventions.-fcall-saved-reg -fcall-used-reg-fexceptions -ffixed-reg -finhibit-size-directive-fcheck-memory-usage -fprefix-function-name-fno-common -fno-ident -fno-gnu-linker-fpcc-struct-return -fpic -fPIC-freg-struct-return -fshared-data -fshort-enums-fshort-double -fvolatile -fvolatile-global -fvolatile-static-fverbose-asm -fpack-struct -fstack-check-fargument-alias -fargument-noalias-fargument-noalias-global-fleading-underscoreOverall Options: Controlling the kind of output: an executable, object files, assembler files, or preprocessed source. C Dialect Options: Controlling the variant of C language compiled. C++ Dialect Options: Variations on C++. Warning Options: How picky should the compiler be? Debugging Options: Symbol tables, measurements, and debugging dumps. Optimize Options: How much optimization? Preprocessor Options: Controlling header files and macro definitions. Also, getting dependency information for Make. Assembler Options: Passing options to the assembler. Link Options: Specifying libraries and so on. Directory Options: Where to find header files and libraries. Where to find the compiler executable files. Target Options: Running a cross-compiler, or an old version of GCC. Node:Overall Options,Next:Invoking G++,Previous:Option Summary,Up:Invoking GCCOptions Controlling the Kind of OutputCompilation can involve up to four stages: preprocessing, compilationproper, assembly and linking, always in that order. The first threestages apply to an individual source file, and end by producing anobject file; linking combines all the object files (those newlycompiled, and those specified as input) into an executable file.For any given input file, the file name suffix determines what kind ofcompilation is done:file.cC source code which must be preprocessed.file.iC source code which should not be preprocessed.file.iiC++ source code which should not be preprocessed.file.mObjective-C source code. Note that you must link with the librarylibobjc.a to make an Objective-C program work.file.hC header file (not to be compiled or linked).file.ccfile.cxxfile.cppfile.CC++ source code which must be preprocessed. Note that in .cxx,the last two letters must both be literally x. Likewise,.C refers to a literal capital C.file.sAssembler code.file.SAssembler code which must be preprocessed.otherAn object file to be fed straight into linking. Any file name with no recognized suffix is treated this way. You can specify the input language explicitly with the -x option:-x languageSpecify explicitly the language for the following input files(rather than letting the compiler choose a default based on the filename suffix). This option applies to all following input files untilthe next -x option. Possible values for language are:c objective-c c++c-header cpp-output c++-cpp-outputassembler assembler-with-cpp-x noneTurn off any specification of a language, so that subsequent files arehandled according to their file name suffixes (as they are if -xhas not been used at all). If you only want some of the stages of compilation, you can use-x (or filename suffixes) to tell gcc where to start, andone of the options -c, -S, or -E to say wheregcc is to stop. Note that some combinations (for example,-x cpp-output -E instruct gcc to do nothing at all.-cCompile or assemble the source files, but do not link. The linkingstage simply is not done. The ultimate output is in the form of anobject file for each source file.By default, the object file name for a source file is made by replacingthe suffix .c, .i, .s, etc., with .o.Unrecognized input files, not requiring compilation or assembly, areignored.-SStop after the stage of compilation proper; do not assemble. The outputis in the form of an assembler code file for each non-assembler inputfile specified.By default, the assembler file name for a source file is made byreplacing the suffix .c, .i, etc., with .s.Input files that don't require compilation are ignored.-EStop after the preprocessing stage; do not run the compiler proper. Theoutput is in the form of preprocessed source code, which is sent to thestandard output.Input files which don't require preprocessing are ignored.-o filePlace output in file file. This applies regardless to whateversort of output is being produced, whether it be an executable file,an object file, an assembler file or preprocessed C code.Since only one output file can be specified, it does not make sense touse -o when compiling more than one input file, unless you areproducing an executable file as output.If -o is not specified, the default is to put an executable filein a.out, the object file for source.suffix insource.o, its assembler file in source.s, andall preprocessed C source on standard output.-vPrint (on standard error output) the commands executed to run the stagesof compilation. Also print the version number of the compiler driverprogram and of the preprocessor and the compiler proper.-pipeUse pipes rather than temporary files for communication between thevarious stages of compilation. This fails to work on some systems wherethe assembler is unable to read from a pipe; but the GNU assembler hasno trouble.--helpPrint (on the standard output) a description of the command line optionsunderstood by gcc. If the -v option is also specifiedthen --help will also be passed on to the various processesinvoked by gcc, so that they can display the command line optionsthey accept. If the -W option is also specified then commandline options which have no documentation associated with them will alsobe displayed. Node:Invoking G++,Next:C Dialect Options,Previous:Overall Options,Up:Invoking GCCCompiling C++ ProgramsC++ source files conventionally use one of the suffixes .C,.cc, .cpp, .c++, .cp, or .cxx;preprocessed C++ files use the suffix .ii. GCC recognizesfiles with these names and compiles them as C++ programs even if youcall the compiler the same way as for compiling C programs (usually withthe name gcc).However, C++ programs often require class libraries as well as acompiler that understands the C++ language--and under somecircumstances, you might want to compile programs from standard input,or otherwise without a suffix that flags them as C++ programs. g++ is a program that calls GCC with the default languageset to C++, and automatically specifies linking against the C++library. On many systems, the script g++ is alsoinstalled with the name c++.When you compile C++ programs, you may specify many of the samecommand-line options that you use for compiling programs in anylanguage; or command-line options meaningful for C and relatedlanguages; or options that are meaningful only for C++ programs. See Options Controlling C Dialect, forexplanations of options for languages related to C. See Options Controlling C++ Dialect, forexplanations of options that are meaningful only for C++ programs.Node:C Dialect Options,Next:C++ Dialect Options,Previous:Invoking G++,Up:Invoking GCCOptions Controlling C DialectThe following options control the dialect of C (or languages derivedfrom C, such as C++ and Objective C) that the compiler accepts:-ansiIn C mode, support all ANSI standard C programs. In C++ mode,remove GNU extensions that conflict with ANSI C++.This turns off certain features of GCC that are incompatible with ANSIC (when compiling C code), or of ANSI standard C++ (when compiling C++ code),such as the asm and typeof keywords, andpredefined macros such as unix and vax that identify thetype of system you are using. It also enables the undesirable andrarely used ANSI trigraph feature. For the C compiler,it disables recognition of C++ style // comments as well asthe inline keyword. For the C++ compiler,-foperator-names is enabled as well.The alternate keywords __asm__, __extension__,__inline__ and __typeof__ continue to work despite-ansi. You would not want to use them in an ANSI C program, ofcourse, but it is useful to put them in header files that might be includedin compilations done with -ansi. Alternate predefined macrossuch as __unix__ and __vax__ are also available, with orwithout -ansi.The -ansi option does not cause non-ANSI programs to berejected gratuitously. For that, -pedantic is required inaddition to -ansi. See Warning Options.The macro __STRICT_ANSI__ is predefined when the -ansioption is used. Some header files may notice this macro and refrainfrom declaring certain functions or defining certain macros that theANSI standard doesn't call for; this is to avoid interfering with anyprograms that might use these names for other things.The functions alloca, abort, exit, and_exit are not builtin functions when -ansi is used.-fstd=Determine the language standard. A value for this option must be provided;possible values areiso9899:1990Same as -ansiiso9899:199409ISO C as modified in amend. 1iso9899:199xISO C 9xc89same as -std=iso9899:1990c9xsame as -std=iso9899:199xgnu89default, iso9899:1990 + gnu extensionsgnu9xiso9899:199x + gnu extensionsEven when this option is not specified, you can still use some of thefeatures of newer standards in so far as they do not conflict withprevious C standards. For example, you may use __restrict__ evenwhen -fstd=c9x is not specified.-fno-asmDo not recognize asm, inline or typeof as akeyword, so that code can use these words as identifiers. You can usethe keywords __asm__, __inline__ and __typeof__instead. -ansi implies -fno-asm.In C++, this switch only affects the typeof keyword, sinceasm and inline are standard keywords. You may want touse the -fno-gnu-keywords flag instead, as it also disables theother, C++-specific, extension keywords such as headof.-fno-builtinDon't recognize builtin functions that do not begin with __builtin_as prefix. Currently, the functions affected include abort,abs, alloca, cos, exit, fabs,ffs, labs, memcmp, memcpy, sin,sqrt, strcmp, strcpy, and strlen.GCC normally generates special code to handle certain builtin functionsmore efficiently; for instance, calls to alloca may become singleinstructions that adjust the stack directly, and calls to memcpymay become inline copy loops. The resulting code is often both smallerand faster, but since the function calls no longer appear as such, youcannot set a breakpoint on those calls, nor can you change the behaviorof the functions by linking with a different library.The -ansi option prevents alloca and ffs from beingbuiltin functions, since these functions do not have an ANSI standardmeaning.-fhostedAssert that compilation takes place in a hosted environment. This implies-fbuiltin. A hosted environment is one in which theentire standard library is available, and in which main has a returntype of int. Examples are nearly everything except a kernel. This is equivalent to -fno-freestanding.-ffreestandingAssert that compilation takes place in a freestanding environment. Thisimplies -fno-builtin. A freestanding environmentis one in which the standard library may not exist, and program startup maynot necessarily be at main. The most obvious example is an OS kernel. This is equivalent to -fno-hosted.-trigraphsSupport ANSI C trigraphs. You don't want to know about thisbrain-damage. The -ansi option implies -trigraphs.-traditionalAttempt to support some aspects of traditional C compilers. Specifically:All extern declarations take effect globally even if theyare written inside of a function definition. This includes implicitdeclarations of functions.The newer keywords typeof, inline, signed, constand volatile are not recognized. (You can still use thealternative keywords such as __typeof__, __inline__, andso on.)Comparisons between pointers and integers are always allowed.Integer types unsigned short and unsigned char promoteto unsigned int.Out-of-range floating point literals are not an error.Certain constructs which ANSI regards as a single invalid preprocessingnumber, such as 0xe-0xd, are treated as expressions instead.String "constants" are not necessarily constant; they are stored inwritable space, and identical looking constants are allocatedseparately. (This is the same as the effect of-fwritable-strings.)All automatic variables not declared register are preserved bylongjmp. Ordinarily, GNU C follows ANSI C: automatic variablesnot declared volatile may be clobbered.The character escape sequences \x and \a evaluate as theliteral characters x and a respectively. Without-traditional, \x is a prefix for the hexadecimalrepresentation of a character, and \a produces a bell. You may wish to use -fno-builtin as well as -traditionalif your program uses names that are normally GNU C builtin functions forother purposes of its own.You cannot use -traditional if you include any header files thatrely on ANSI C features. Some vendors are starting to ship systems withANSI C header files and you cannot use -traditional on suchsystems to compile files that include any system headers.The -traditional option also enables -traditional-cpp,which is described next.-traditional-cppAttempt to support some aspects of traditional C preprocessors. Specifically:Comments convert to nothing at all, rather than to a space. This allowstraditional token concatenation.In a preprocessing directive, the # symbol must appear as the firstcharacter of a line.Macro arguments are recognized within string constants in a macrodefinition (and their values are stringified, though without additionalquote marks, when they appear in such a context). The preprocessoralways considers a string constant to end at a newline.The predefined macro __STDC__ is not defined when you use-traditional, but __GNUC__ is (since the GNU extensionswhich __GNUC__ indicates are not affected by-traditional). If you need to write header files that workdifferently depending on whether -traditional is in use, bytesting both of these predefined macros you can distinguish foursituations: GNU C, traditional GNU C, other ANSI C compilers, and otherold C compilers. The predefined macro __STDC_VERSION__ is alsonot defined when you use -traditional. See Standard Predefined,for more discussion of these and other predefined macros.The preprocessor considers a string constant to end at a newline (unlessthe newline is escaped with \). (Without -traditional,string constants can contain the newline character as typed.) -fcond-mismatchAllow conditional expressions with mismatched types in the second andthird arguments. The value of such an expression is void.-funsigned-charLet the type char be unsigned, like unsigned char.Each kind of machine has a default for what char shouldbe. It is either like unsigned char by default or likesigned char by default.Ideally, a portable program should always use signed char orunsigned char when it depends on the signedness of an object. But many programs have been written to use plain char andexpect it to be signed, or expect it to be unsigned, depending on themachines they were written for. This option, and its inverse, let youmake such a program work with the opposite default.The type char is always a distinct type from each ofsigned char or unsigned char, even though its behavioris always just like one of those two.-fsigned-charLet the type char be signed, like signed char.Note that this is equivalent to -fno-unsigned-char, which isthe negative form of -funsigned-char. Likewise, the option-fno-signed-char is equivalent to -funsigned-char.You may wish to use -fno-builtin as well as -traditionalif your program uses names that are normally GNU C builtin functions forother purposes of its own.You cannot use -traditional if you include any header files thatrely on ANSI C features. Some vendors are starting to ship systems withANSI C header files and you cannot use -traditional on suchsystems to compile files that include any system headers.-fsigned-bitfields-funsigned-bitfields-fno-signed-bitfields-fno-unsigned-bitfieldsThese options control whether a bitfield is signed or unsigned, when thedeclaration does not use either signed or unsigned. Bydefault, such a bitfield is signed, because this is consistent: thebasic integer types such as int are signed types.However, when -traditional is used, bitfields are all unsignedno matter what.-fwritable-stringsStore string constants in the writable data segment and don't uniquizethem. This is for compatibility with old programs which assume they canwrite into string constants. The option -traditional also hasthis effect.Writing into string constants is a very bad idea; "constants" shouldbe constant.-fallow-single-precisionDo not promote single precision math operations to double precision,even when compiling with -traditional.Traditional K&R C promotes all floating point operations to doubleprecision, regardless of the sizes of the operands. On thearchitecture for which you are compiling, single precision may be fasterthan double precision. If you must use -traditional, but wantto use single precision operations when the operands are singleprecision, use this option. This option has no effect when compilingwith ANSI or GNU C conventions (the default).Node:C++ Dialect Options,Next:Warning Options,Previous:C Dialect Options,Up:Invoking GCCOptions Controlling C++ DialectThis section describes the command-line options that are only meaningfulfor C++ programs; but you can also use most of the GNU compiler optionsregardless of what language your program is in. For example, youmight compile a file firstClass.C like this:g++ -g -frepo -O -c firstClass.CIn this example, only -frepo is an option meantonly for C++ programs; you can use the other options with anylanguage supported by GCC.Here is a list of options that are only for compiling C++ programs:-fno-access-controlTurn off all access checking. This switch is mainly useful for workingaround bugs in the access control code.-fcheck-newCheck that the pointer returned by operator new is non-nullbefore attempting to modify the storage allocated. The current WorkingPaper requires that operator new never return a null pointer, sothis check is normally unnecessary.An alternative to using this option is to specify that youroperator new does not throw any exceptions; if you declare itthrow(), g++ will check the return value. See also new(nothrow).-fconserve-spacePut uninitialized or runtime-initialized global variables into thecommon segment, as C does. This saves space in the executable at thecost of not diagnosing duplicate definitions. If you compile with thisflag and your program mysteriously crashes after main() hascompleted, you may have an object that is being destroyed twice becausetwo definitions were merged.This option is no longer useful on most targets, now that support hasbeen added for putting variables into BSS without making them common.-fdollars-in-identifiersAccept $ in identifiers. You can also explicitly prohibit use of$ with the option -fno-dollars-in-identifiers. (GNU C allows$ by default on most target systems, but there are a few exceptions.) Traditional C allowed the character $ to form part ofidentifiers. However, ANSI C and C++ forbid $ in identifiers.-fno-elide-constructorsThe C++ standard allows an implementation to omit creating a temporarywhich is only used to initialize another object of the same type. Specifying this option disables that optimization, and forces g++ tocall the copy constructor in all cases.-fexternal-templatesCause template instantiations to obey #pragma interface andimplementation; template instances are emitted or not accordingto the location of the template definition. See Template Instantiation, for more information.This option is deprecated.-falt-external-templatesSimilar to -fexternal-templates, but template instances are emitted ornot according to the place where they are first instantiated. See Template Instantiation, for more information.This option is deprecated.-ffor-scope-fno-for-scopeIf -ffor-scope is specified, the scope of variables declared ina for-init-statement is limited to the for loop itself,as specified by the draft C++ standard. If -fno-for-scope is specified, the scope of variables declared ina for-init-statement extends to the end of the enclosing scope,as was the case in old versions of gcc, and other (traditional)implementations of C++.The default if neither flag is given to follow the standard,but to allow and give a warning for old-style code that wouldotherwise be invalid, or have different behavior.-fno-gnu-keywordsDo not recognize classof, headof, signature,sigof or typeof as a keyword, so that code can use thesewords as identifiers. You can use the keywords __classof__,__headof__, __signature__, __sigof__, and__typeof__ instead. -ansi implies-fno-gnu-keywords.-fguiding-declsTreat a function declaration with the same type as a potential functiontemplate instantiation as though it declares that instantiation, not anormal function. If a definition is given for the function later in thetranslation unit (or another translation unit if the target supportsweak symbols), that definition will be used; otherwise the template willbe instantiated. This behavior reflects the C++ language prior toSeptember 1996, when guiding declarations were removed.This option implies -fname-mangling-version-0, and will not workwith other name mangling versions. Like all options that change theABI, all C++ code, including libgcc.a must be built with the samesetting of this option.-fhandle-signaturesRecognize the signature and sigof keywords for specifyingabstract types. The default (-fno-handle-signatures) is not torecognize them. See Type Abstraction using Signatures.-fhonor-stdTreat the namespace std as a namespace, instead of ignoringit. For compatibility with earlier versions of g++, the compiler will,by default, ignore namespace-declarations,using-declarations, using-directives, andnamespace-names, if they involve std.-fhuge-objectsSupport virtual function calls for objects that exceed the sizerepresentable by a short int. Users should not use this flag bydefault; if you need to use it, the compiler will tell you so.This flag is not useful when compiling with -fvtable-thunks.Like all options that change the ABI, all C++ code, includinglibgcc must be built with the same setting of this option.-fno-implicit-templatesNever emit code for non-inline templates which are instantiatedimplicitly (i.e. by use); only emit code for explicit instantiations. See Template Instantiation, for more information.-fno-implicit-inline-templatesDon't emit code for implicit instantiations of inline templates, either. The default is to handle inlines differently so that compiles with andwithout optimization will need the same set of explicit instantiations.-finit-prioritySupport __attribute__ ((init_priority (n))) for controlling theorder of initialization of file-scope objects. On ELF targets, thisrequires GNU ld 2.10 or later.-fno-implement-inlinesTo save space, do not emit out-of-line copies of inline functionscontrolled by #pragma implementation. This will cause linkererrors if these functions are not inlined everywhere they are called.-fname-mangling-version-nControl the way in which names are mangled. Version 0 is compatiblewith versions of g++ before 2.8. Version 1 is the default. Version 1will allow correct mangling of function templates. For example,version 0 mangling does not mangle foo and foogiven this declaration:template void foo(T t);Like all options that change the ABI, all C++ code, includinglibgcc must be built with the same setting of this option.-foperator-namesRecognize the operator name keywords and, bitand,bitor, compl, not, or and xor assynonyms for the symbols they refer to. -ansi implies-foperator-names.-fno-optional-diagsDisable diagnostics that the standard says a compiler does not need toissue. Currently, the only such diagnostic issued by g++ is the one fora name having multiple meanings within a class.-fpermissiveDowngrade messages about nonconformant code from errors to warnings. Bydefault, g++ effectively sets -pedantic-errors without-pedantic; this option reverses that. This behavior and thisoption are superceded by -pedantic, which works as it does for GNU C.-frepoEnable automatic template instantiation. This option also implies-fno-implicit-templates. See Template Instantiation, for moreinformation.-fno-rttiDisable generation of the information used by C++ runtime typeidentification features (dynamic_cast and typeid). If youdon't use those parts of the language (or exception handling, which usesdynamic_cast internally), you can save some space by using thisflag.-fstrict-prototypeWithin an extern "C" linkage specification, treat a functiondeclaration with no arguments, such as int foo ();, as declaringthe function to take no arguments. Normally, such a declaration meansthat the function foo can take any combination of arguments, asin C. -pedantic implies -fstrict-prototype unlessoverridden with -fno-strict-prototype.Specifying this option will also suppress implicit declarations offunctions.This flag no longer affects declarations with C++ linkage.-fsquangle-fno-squangle-fsquangle will enable a compressed form of name mangling foridentifiers. In particular, it helps to shorten very long names by recognizingtypes and class names which occur more than once, replacing them with specialshort ID codes. This option also requires any C++ libraries being used tobe compiled with this option as well. The compiler has this disabled (theequivalent of -fno-squangle) by default.Like all options that change the ABI, all C++ code, includinglibgcc.a must be built with the same setting of this option.-ftemplate-depth-nSet the maximum instantiation depth for template classes to n. A limit on the template instantiation depth is needed to detectendless recursions during template class instantiation. ANSI/ISO C++conforming programs must not rely on a maximum depth greater than 17.-fthis-is-variablePermit assignment to this. The incorporation of user-definedfree store management into C++ has made assignment to this ananachronism. Therefore, by default it is invalid to assign tothis within a class member function; that is, GNU C++ treatsthis in a member function of class X as a non-lvalue oftype X *. However, for backwards compatibility, you can make itvalid with -fthis-is-variable.-fvtable-thunks=thunks-versionUse thunks to implement the virtual function dispatch table(vtable). The traditional (cfront-style) approach toimplementing vtables was to store a pointer to the function and twooffsets for adjusting the this pointer at the call site. Newerimplementations store a single pointer to a thunk function whichdoes any necessary adjustment and then calls the target function.The original implementation of thunks (version 1) had a bug regardingvirtual base classes; this bug is fixed with version 2 of the thunksimplementation. With setting the version to 2, compatibility to theversion 1 thunks is provided, at the cost of extra machine code. Version3 does not include this compatibility.This option also enables a heuristic for controlling emission ofvtables; if a class has any non-inline virtual functions, the vtablewill be emitted in the translation unit containing the first one ofthose.Like all options that change the ABI, all C++ code, includinglibgcc.a must be built with the same setting of this option. Sinceversion 1 and version 2 are also incompatible (for classes with virtualbases defining virtual functions), all code must also be compiled withthe same version.In this version of gcc, there are no targets for which version 2 thunksare the default. On all targets, not giving the option will use thetraditional implementation, and -fvtable-thunks will produce version 2thunks.-nostdinc++Do not search for header files in the standard directories specific toC++, but do still search the other standard directories. (This optionis used when building the C++ library.) In addition, these optimization, warning, and code generation optionshave meanings only for C++ programs:-fno-default-inlineDo not assume inline for functions defined inside a class scope. See Options That Control Optimization. Note that thesefunctions will have linkage like inline functions; they just won't beinlined by default.-Wctor-dtor-privacy (C++ only)Warn when a class seems unusable, because all the constructors ordestructors in a class are private and the class has no friends orpublic static member functions.-Wnon-virtual-dtor (C++ only)Warn when a class declares a non-virtual destructor that should probablybe virtual, because it looks like the class will be used polymorphically.-Wreorder (C++ only)Warn when the order of member initializers given in the code does notmatch the order in which they must be executed. For instance:struct A int i; int j; A(): j (0), i (1) ;Here the compiler will warn that the member initializers for iand j will be rearranged to match the declaration order of themembers. The following -W... options are not affected by -Wall.-Weffc++ (C++ only)Warn about violations of various style guidelines from Scott Meyers'Effective C++ books. If you use this option, you should be awarethat the standard library headers do not obey all of these guidelines;you can use grep -v to filter out those warnings.-Wno-deprecated (C++ only)Do not warn about usage of deprecated features. See Deprecated Features.-Wno-non-template-friend (C++ only)Disable warnings when non-templatized friend functions are declaredwithin a template. With the advent of explicit template specificationsupport in g++, if the name of the friend is an unqualified-id (ie,friend foo(int)), the C++ language specification demands that thefriend declare or define an ordinary, nontemplate function. (Section14.5.3). Before g++ implemented explicit specification, unqualified-idscould be interpreted as a particular specialization of a templatizedfunction. Because this non-conforming behavior is no longer the defaultbehavior for g++, -Wnon-template-friend allows the compiler tocheck existing code for potential trouble spots, and is on by default. This new compiler behavior can also be turned off with the flag-fguiding-decls, which activates the older, non-specificationcompiler code, or with -Wno-non-template-friend which keeps theconformant compiler code but disables the helpful warning.-Wold-style-cast (C++ only)Warn if an old-style (C-style) cast is used within a C++ program. Thenew-style casts (static_cast, reinterpret_cast, andconst_cast) are less vulnerable to unintended effects.-Woverloaded-virtual (C++ only)Warn when a derived class function declaration may be an error indefining a virtual function. In a derived class, thedefinitions of virtual functions must match the type signature of avirtual function declared in the base class. With this option, thecompiler warns when you define a function with the same name as avirtual function, but with a type signature that does not match anydeclarations from the base class.-Wno-pmf-conversions (C++ only)Disable the diagnostic for converting a bound pointer to member functionto a plain pointer.-Wsign-promo (C++ only)Warn when overload resolution chooses a promotion from unsigned orenumeral type to a signed type over a conversion to an unsigned type ofthe same size. Previous versions of g++ would try to preserveunsignedness, but the standard mandates the current behavior.-Wsynth (C++ only)Warn when g++'s synthesis behavior does not match that of cfront. Forinstance:struct A operator int (); A& operator = (int);;main () A a,b; a = b;In this example, g++ will synthesize a default A& operator =(const A&);, while cfront will use the user-defined operator =. Node:Warning Options,Next:Debugging Options,Previous:C++ Dialect Options,Up:Invoking GCCOptions to Request or Suppress WarningsWarnings are diagnostic messages that report constructions whichare not inherently erroneous but which are risky or suggest theremay have been an error.You can request many specific warnings with options beginning -W,for example -Wimplicit to request warnings on implicitdeclarations. Each of these specific warning options also has anegative form beginning -Wno- to turn off warnings;for example, -Wno-implicit. This manual lists only one of thetwo forms, whichever is not the default.These options control the amount and kinds of warnings produced by GCC:-fsyntax-onlyCheck the code for syntax errors, but don't do anything beyond that.-pedanticIssue all the warnings demanded by strict ANSI C and ISO C++;reject all programs that use forbidden extensions.Valid ANSI C and ISO C++ programs should compile properly with or withoutthis option (though a rare few will require -ansi). However,without this option, certain GNU extensions and traditional C and C++features are supported as well. With this option, they are rejected.-pedantic does not cause warning messages for use of thealternate keywords whose names begin and end with __. Pedanticwarnings are also disabled in the expression that follows__extension__. However, only system header files should usethese escape routes; application programs should avoid them. See Alternate Keywords.This option is not intended to be useful; it exists only to satisfypedants who would otherwise claim that GCC fails to support the ANSIstandard.Some users try to use -pedantic to check programs for strict ANSIC conformance. They soon find that it does not do quite what they want:it finds some non-ANSI practices, but not all--only those for whichANSI C requires a diagnostic.A feature to report any failure to conform to ANSI C might be useful insome instances, but would require considerable additional work and wouldbe quite different from -pedantic. We don't have plans tosupport such a feature in the near future.-pedantic-errorsLike -pedantic, except that errors are produced rather thanwarnings.-wInhibit all warning messages.-Wno-importInhibit warning messages about the use of #import.-Wchar-subscriptsWarn if an array subscript has type char. This is a common causeof error, as programmers often forget that this type is signed on somemachines.-WcommentWarn whenever a comment-start sequence /* appears in a /*comment, or whenever a Backslash-Newline appears in a // comment.-WformatCheck calls to printf and scanf, etc., to make sure thatthe arguments supplied have types appropriate to the format stringspecified.-Wimplicit-intWarn when a declaration does not specify a type.-Wimplicit-function-declaration-Werror-implicit-function-declarationGive a warning (or error) whenever a function is used before beingdeclared.-WimplicitSame as -Wimplicit-int and -Wimplicit-function-declaration.-WmainWarn if the type of main is suspicious. main should be afunction with external linkage, returning int, taking either zeroarguments, two, or three arguments of appropriate types.-WmulticharWarn if a multicharacter constant ('FOOF') is used. Usually theyindicate a typo in the user's code, as they have implementation-definedvalues, and should not be used in portable code.-WparenthesesWarn if parentheses are omitted in certain contexts, suchas when there is an assignment in a context where a truth valueis expected, or when operators are nested whose precedence peopleoften get confused about.Also warn about constructions where there may be confusion to whichif statement an else branch belongs. Here is an example ofsuch a case: if (a) if (b) foo (); else bar ();In C, every else branch belongs to the innermost possible ifstatement, which in this example is if (b). This is often notwhat the programmer expected, as illustrated in the above example byindentation the programmer chose. When there is the potential for thisconfusion, GNU C will issue a warning when this flag is specified. To eliminate the warning, add explicit braces around the innermostif statement so there is no way the else could belong tothe enclosing if. The resulting code would look like this: if (a) if (b) foo (); else bar (); -Wreturn-typeWarn whenever a function is defined with a return-type that defaultsto int. Also warn about any return statement with noreturn-value in a function whose return-type is not void.-WswitchWarn whenever a switch statement has an index of enumeral typeand lacks a case for one or more of the named codes of thatenumeration. (The presence of a default label prevents thiswarning.) case labels outside the enumeration range alsoprovoke warnings when this option is used.-WtrigraphsWarn if any trigraphs are encountered (assuming they are enabled).-WunusedWarn whenever a variable is unused aside from its declaration,whenever a function is declared static but never defined, whenever alabel is declared but not used, and whenever a statement computes aresult that is explicitly not used.In order to get a warning about an unused function parameter, you mustspecify both -W and -Wunused.To suppress this warning for an expression, simply cast it to void. Forunused variables, parameters and labels, use the unused attribute(see Variable Attributes).-WuninitializedAn automatic variable is used without first being initialized.These warnings are possible only in optimizing compilation,because they require data flow information that is computed onlywhen optimizing. If you don't specify -O, you simply won'tget these warnings.These warnings occur only for variables that are candidates forregister allocation. Therefore, they do not occur for a variable thatis declared volatile, or whose address is taken, or whose sizeis other than 1, 2, 4 or 8 bytes. Also, they do not occur forstructures, unions or arrays, even when they are in registers.Note that there may be no warning about a variable that is used onlyto compute a value that itself is never used, because suchcomputations may be deleted by data flow analysis before the warningsare printed.These warnings are made optional because GCC is not smartenough to see all the reasons why the code might be correctdespite appearing to have an error. Here is one example of howthis can happen: int x; switch (y) case 1: x = 1; break; case 2: x = 4; break; case 3: x = 5; foo (x);If the value of y is always 1, 2 or 3, then x isalways initialized, but GCC doesn't know this. Here isanother common case: int save_y; if (change_y) save_y = y, y = new_y; ... if (change_y) y = save_y;This has no bug because save_y is used only if it is set.Some spurious warnings can be avoided if you declare all the functionsyou use that never return as noreturn. See Function Attributes.-Wunknown-pragmasWarn when a #pragma directive is encountered which is not understood byGCC. If this command line option is used, warnings will even be issuedfor unknown pragmas in system header files. This is not the case ifthe warnings were only enabled by the -Wall command line option.-WallAll of the above -W options combined. This enables all thewarnings about constructions that some users consider questionable, andthat are easy to avoid (or modify to prevent the warning), even inconjunction with macros. The following -W... options are not implied by -Wall. Some of them warn about constructions that users generally do notconsider questionable, but which occasionally you might wish to checkfor; others warn about constructions that are necessary or hard to avoidin some cases, and there is no simple way to modify the code to suppressthe warning.-WPrint extra warning messages for these events:A nonvolatile automatic variable might be changed by a call tolongjmp. These warnings as well are possible only inoptimizing compilation.The compiler sees only the calls to setjmp. It cannot knowwhere longjmp will be called; in fact, a signal handler couldcall it at any point in the code. As a result, you may get a warningeven when there is in fact no problem because longjmp cannotin fact be called at the place which would cause a problem.
Winline Classic V9 Serial Number
2ff7e9595c
Comentarios