⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 invoke.texi

📁 理解和实践操作系统的一本好书
💻 TEXI
📖 第 1 页 / 共 5 页
字号:
@c Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,@c 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008@c Free Software Foundation, Inc.@c This is part of the GCC manual.@c For copying conditions, see the file gcc.texi.@ignore@c man begin INCLUDE@include gcc-vers.texi@c man end@c man begin COPYRIGHTCopyright @copyright{} 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008Free Software Foundation, Inc.Permission is granted to copy, distribute and/or modify this documentunder the terms of the GNU Free Documentation License, Version 1.2 orany later version published by the Free Software Foundation; with theInvariant Sections being ``GNU General Public License'' and ``FundingFree Software'', the Front-Cover texts being (a) (see below), and withthe Back-Cover Texts being (b) (see below).  A copy of the license isincluded in the gfdl(7) man page.(a) The FSF's Front-Cover Text is:     A GNU Manual(b) The FSF's Back-Cover Text is:     You have freedom to copy and modify this GNU Manual, like GNU     software.  Copies published by the Free Software Foundation raise     funds for GNU development.@c man end@c Set file name and title for the man page.@setfilename gcc@settitle GNU project C and C++ compiler@c man begin SYNOPSISgcc [@option{-c}|@option{-S}|@option{-E}] [@option{-std=}@var{standard}]    [@option{-g}] [@option{-pg}] [@option{-O}@var{level}]    [@option{-W}@var{warn}@dots{}] [@option{-pedantic}]    [@option{-I}@var{dir}@dots{}] [@option{-L}@var{dir}@dots{}]    [@option{-D}@var{macro}[=@var{defn}]@dots{}] [@option{-U}@var{macro}]    [@option{-f}@var{option}@dots{}] [@option{-m}@var{machine-option}@dots{}]    [@option{-o} @var{outfile}] [@@@var{file}] @var{infile}@dots{}Only the most useful options are listed here; see below for theremainder.  @samp{g++} accepts mostly the same options as @samp{gcc}.@c man end@c man begin SEEALSOgpl(7), gfdl(7), fsf-funding(7),cpp(1), gcov(1), as(1), ld(1), gdb(1), adb(1), dbx(1), sdb(1)and the Info entries for @file{gcc}, @file{cpp}, @file{as},@file{ld}, @file{binutils} and @file{gdb}.@c man end@c man begin BUGSFor instructions on reporting bugs, see@w{@value{BUGURL}}.@c man end@c man begin AUTHORSee the Info entry for @command{gcc}, or@w{@uref{http://gcc.gnu.org/onlinedocs/gcc/Contributors.html}},for contributors to GCC@.@c man end@end ignore@node Invoking GCC@chapter GCC Command Options@cindex GCC command options@cindex command options@cindex options, GCC command@c man begin DESCRIPTIONWhen 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 @option{-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.@cindex C compilation optionsMost 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.@cindex C++ compilation options@xref{Invoking G++,,Compiling C++ Programs}, for a summary of specialoptions for compiling C++ programs.@cindex grouping options@cindex options, groupingThe @command{gcc} program accepts options and file names as operands.  Manyoptions have multi-letter names; therefore multiple single-letter optionsmay @emph{not} be grouped: @option{-dr} is very different from @w{@samp{-d-r}}.@cindex order of options@cindex options, orderYou can mix options and other arguments.  For the most part, the orderyou use doesn't matter.  Order does matter when you use severaloptions of the same kind; for example, if you specify @option{-L} morethan once, the directories are searched in the order specified.  Also,the placement of the @option{-l} option is significant.Many options have long names starting with @samp{-f} or with@samp{-W}---for example,@option{-fmove-loop-invariants}, @option{-Wformat} and so on.  Most ofthese have both positive and negative forms; the negative form of@option{-ffoo} would be @option{-fno-foo}.  This manual documentsonly one of these two forms, whichever one is not the default.@c man end@xref{Option Index}, for an index to GCC's options.@menu* 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++.* Objective-C and Objective-C++ Dialect Options:: Variations on Objective-C                        and Objective-C++.* Language Independent Options:: Controlling how diagnostics should be                        formatted.* 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.* Spec Files::          How to pass switches to sub-processes.* 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.* Precompiled Headers:: Compiling a header once, and using it many times.* Running Protoize::    Automatically adding or removing function prototypes.@end menu@c man begin OPTIONS@node Option Summary@section Option SummaryHere is a summary of all the options, grouped by type.  Explanations arein the following sections.@table @emph@item Overall Options@xref{Overall Options,,Options Controlling the Kind of Output}.@gccoptlist{-c  -S  -E  -o @var{file}  -combine  -pipe  -pass-exit-codes  @gol-x @var{language}  -v  -###  --help@r{[}=@var{class}@r{]}  --target-help  @gol--version @@@var{file}}@item C Language Options@xref{C Dialect Options,,Options Controlling C Dialect}.@gccoptlist{-ansi  -std=@var{standard}  -fgnu89-inline @gol-aux-info @var{filename} @gol-fno-asm  -fno-builtin  -fno-builtin-@var{function} @gol-fhosted  -ffreestanding -fopenmp -fms-extensions @gol-trigraphs  -no-integrated-cpp  -traditional  -traditional-cpp @gol-fallow-single-precision  -fcond-mismatch -flax-vector-conversions @gol-fsigned-bitfields  -fsigned-char @gol-funsigned-bitfields  -funsigned-char}@item C++ Language Options@xref{C++ Dialect Options,,Options Controlling C++ Dialect}.@gccoptlist{-fabi-version=@var{n}  -fno-access-control  -fcheck-new @gol-fconserve-space  -ffriend-injection @gol-fno-elide-constructors @gol-fno-enforce-eh-specs @gol-ffor-scope  -fno-for-scope  -fno-gnu-keywords @gol-fno-implicit-templates @gol-fno-implicit-inline-templates @gol-fno-implement-inlines  -fms-extensions @gol-fno-nonansi-builtins  -fno-operator-names @gol-fno-optional-diags  -fpermissive @gol-frepo  -fno-rtti  -fstats  -ftemplate-depth-@var{n} @gol-fno-threadsafe-statics -fuse-cxa-atexit  -fno-weak  -nostdinc++ @gol-fno-default-inline  -fvisibility-inlines-hidden @gol-fvisibility-ms-compat @gol-Wabi  -Wctor-dtor-privacy @gol-Wnon-virtual-dtor  -Wreorder @gol-Weffc++  -Wno-deprecated  -Wstrict-null-sentinel @gol-Wno-non-template-friend  -Wold-style-cast @gol-Woverloaded-virtual  -Wno-pmf-conversions @gol-Wsign-promo}@item Objective-C and Objective-C++ Language Options@xref{Objective-C and Objective-C++ Dialect Options,,Options ControllingObjective-C and Objective-C++ Dialects}.@gccoptlist{-fconstant-string-class=@var{class-name} @gol-fgnu-runtime  -fnext-runtime @gol-fno-nil-receivers @gol-fobjc-call-cxx-cdtors @gol-fobjc-direct-dispatch @gol-fobjc-exceptions @gol-fobjc-gc @gol-freplace-objc-classes @gol-fzero-link @gol-gen-decls @gol-Wassign-intercept @gol-Wno-protocol  -Wselector @gol-Wstrict-selector-match @gol-Wundeclared-selector}@item Language Independent Options@xref{Language Independent Options,,Options to Control Diagnostic Messages Formatting}.@gccoptlist{-fmessage-length=@var{n}  @gol-fdiagnostics-show-location=@r{[}once@r{|}every-line@r{]}  @gol-fdiagnostics-show-option}@item Warning Options@xref{Warning Options,,Options to Request or Suppress Warnings}.@gccoptlist{-fsyntax-only  -pedantic  -pedantic-errors @gol-w  -Wextra  -Wall  -Waddress  -Waggregate-return  -Warray-bounds @gol-Wno-attributes -Wc++-compat -Wc++0x-compat -Wcast-align  -Wcast-qual  @gol-Wchar-subscripts -Wclobbered  -Wcomment @gol-Wconversion  -Wcoverage-mismatch  -Wno-deprecated-declarations @gol-Wdisabled-optimization  -Wno-div-by-zero  @gol-Wempty-body  -Wno-endif-labels @gol-Werror  -Werror=* @gol-Wfatal-errors  -Wfloat-equal  -Wformat  -Wformat=2 @gol-Wno-format-extra-args -Wformat-nonliteral @gol-Wformat-security  -Wformat-y2k -Wignored-qualifiers @gol-Wimplicit  -Wimplicit-function-declaration  -Wimplicit-int @gol-Wimport  -Wno-import  -Winit-self  -Winline @gol-Wno-int-to-pointer-cast -Wno-invalid-offsetof @gol-Winvalid-pch -Wlarger-than-@var{len}  -Wunsafe-loop-optimizations @gol-Wlogical-op -Wlong-long @gol-Wmain  -Wmissing-braces  -Wmissing-field-initializers @gol-Wmissing-format-attribute  -Wmissing-include-dirs @gol-Wmissing-noreturn @gol-Wno-multichar  -Wnonnull  -Wno-overflow @gol-Woverlength-strings  -Wpacked  -Wpadded @gol-Wparentheses  -Wpointer-arith  -Wno-pointer-to-int-cast @gol-Wredundant-decls @gol-Wreturn-type  -Wsequence-point  -Wshadow @gol-Wsign-compare  -Wsign-conversion  -Wstack-protector @gol-Wstrict-aliasing -Wstrict-aliasing=n @gol-Wstrict-overflow -Wstrict-overflow=@var{n} @gol-Wswitch  -Wswitch-default  -Wswitch-enum @gol-Wsystem-headers  -Wtrigraphs  -Wtype-limits  -Wundef  -Wuninitialized @gol-Wunknown-pragmas  -Wno-pragmas -Wunreachable-code @gol-Wunused  -Wunused-function  -Wunused-label  -Wunused-parameter @gol-Wunused-value  -Wunused-variable @gol-Wvariadic-macros -Wvla @gol-Wvolatile-register-var  -Wwrite-strings}@item C and Objective-C-only Warning Options@gccoptlist{-Wbad-function-cast  -Wmissing-declarations @gol-Wmissing-parameter-type  -Wmissing-prototypes  -Wnested-externs @gol-Wold-style-declaration  -Wold-style-definition @gol-Wstrict-prototypes  -Wtraditional  -Wtraditional-conversion @gol-Wdeclaration-after-statement -Wpointer-sign}@item Debugging Options@xref{Debugging Options,,Options for Debugging Your Program or GCC}.@gccoptlist{-d@var{letters}  -dumpspecs  -dumpmachine  -dumpversion @gol-fdbg-cnt-list -fdbg-cnt=@var{counter-value-list} @gol-fdump-noaddr -fdump-unnumbered  -fdump-translation-unit@r{[}-@var{n}@r{]} @gol-fdump-class-hierarchy@r{[}-@var{n}@r{]} @gol-fdump-ipa-all -fdump-ipa-cgraph -fdump-ipa-inline @gol-fdump-tree-all @gol-fdump-tree-original@r{[}-@var{n}@r{]}  @gol-fdump-tree-optimized@r{[}-@var{n}@r{]} @gol-fdump-tree-cfg -fdump-tree-vcg -fdump-tree-alias @gol-fdump-tree-ch @gol-fdump-tree-ssa@r{[}-@var{n}@r{]} -fdump-tree-pre@r{[}-@var{n}@r{]} @gol-fdump-tree-ccp@r{[}-@var{n}@r{]} -fdump-tree-dce@r{[}-@var{n}@r{]} @gol-fdump-tree-gimple@r{[}-raw@r{]} -fdump-tree-mudflap@r{[}-@var{n}@r{]} @gol-fdump-tree-dom@r{[}-@var{n}@r{]} @gol-fdump-tree-dse@r{[}-@var{n}@r{]} @gol-fdump-tree-phiopt@r{[}-@var{n}@r{]} @gol-fdump-tree-forwprop@r{[}-@var{n}@r{]} @gol-fdump-tree-copyrename@r{[}-@var{n}@r{]} @gol-fdump-tree-nrv -fdump-tree-vect @gol-fdump-tree-sink @gol-fdump-tree-sra@r{[}-@var{n}@r{]} @gol-fdump-tree-salias @gol-fdump-tree-fre@r{[}-@var{n}@r{]} @gol-fdump-tree-vrp@r{[}-@var{n}@r{]} @gol-ftree-vectorizer-verbose=@var{n} @gol-fdump-tree-storeccp@r{[}-@var{n}@r{]} @gol-feliminate-dwarf2-dups -feliminate-unused-debug-types @gol-feliminate-unused-debug-symbols -femit-class-debug-always @gol-fmem-report -fpre-ipa-mem-report -fpost-ipa-mem-report -fprofile-arcs @gol-frandom-seed=@var{string} -fsched-verbose=@var{n} @gol-ftest-coverage  -ftime-report -fvar-tracking @gol-g  -g@var{level}  -gcoff -gdwarf-2 @gol-ggdb  -gstabs  -gstabs+  -gvms  -gxcoff  -gxcoff+ @gol-fno-merge-debug-strings -fdebug-prefix-map=@var{old}=@var{new} @gol-femit-struct-debug-baseonly -femit-struct-debug-reduced @gol-femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]} @gol-p  -pg  -print-file-name=@var{library}  -print-libgcc-file-name @gol-print-multi-directory  -print-multi-lib @gol-print-prog-name=@var{program}  -print-search-dirs  -Q @gol-print-sysroot-headers-suffix @gol-save-temps  -time}@item Optimization Options@xref{Optimize Options,,Options that Control Optimization}.@gccoptlist{-falign-functions[=@var{n}] -falign-jumps[=@var{n}] @gol-falign-labels[=@var{n}] -falign-loops[=@var{n}] -fassociative-math @gol-fauto-inc-dec -fbranch-probabilities -fbranch-target-load-optimize @gol

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -