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

📄 g++.1

📁 早期freebsd实现
💻 1
📖 第 1 页 / 共 2 页
字号:
execute in different places because they were moved out of loops.Nevertheless it proves possible to debug optimized output.  This makesit reasonable to use the optimizer for programs that might have bugs..TP.BI "\-I" "dir"\c\&Append directory \c.I dir\c\& to the list of directories searched for include files..TP.BI "\-L" "dir"\c\&Add directory \c.I dir\c\& to the list of directories to be searchedfor `\|\c.B \-l\c\&\|'..TP.BI \-l library\c\&Use the library named \c.I library\c\& when linking.  (C++ programs often require `\|\c\-lg++\c\&\|' for successful linking.).TP.B \-OOptimize.  Optimizing compilation takes somewhat more time, and a lotmore memory for a large function.Without `\|\c.B \-O\c\&\|', the compiler's goal is to reduce the cost ofcompilation and to make debugging produce the expected results.Statements are independent: if you stop the program with a breakpointbetween statements, you can then assign a new value to any variable orchange the program counter to any other statement in the function andget exactly the results you would expect from the source code.Without `\|\c.B \-O\c\&\|', only variables declared \c.B register\c\& areallocated in registers.  The resulting compiled code is a little worsethan produced by PCC without `\|\c.B \-O\c\&\|'.With `\|\c.B \-O\c\&\|', the compiler tries to reduce code size and executiontime..TP.BI "\-o " file\c\&Place output in file \c.I file\c\&..TP.B \-SStop after the stage of compilation proper; do not assemble.  The outputis an assembler code file for each non-assembler inputfile specified..TP.B \-staticOn systems that support dynamic linking, this prevents linking with the sharedlibraries.  On other systems, this option has no effect..TP.B \-traditionalAttempt to support some aspects of traditional C compilers.Specifically, for both C and C++ programs:.TP\ \ \ \(buIn the preprocessor, comments convert to nothing at all, rather thanto a space.  This allows traditional token concatenation..TP\ \ \ \(buIn the preprocessor, macro arguments are recognized within stringconstants in a macro definition (and their values are stringified,though without additional quote marks, when they appear in such acontext).  The preprocessor always considers a string constant to endat a newline..TP\ \ \ \(buThe preprocessor does not predefine the macro \c.B __STDC__\c\& when you use`\|\c.B \-traditional\c\&\|', but still predefines\c.B __GNUC__\c\& (since the GNU extensions indicated by .B __GNUC__\c\& are not affected by`\|\c.B \-traditional\c\&\|').  If you need to write header files that workdifferently depending on whether `\|\c.B \-traditional\c\&\|' is in use, bytesting both of these predefined macros you can distinguish foursituations: GNU C, traditional GNU C, other ANSI C compilers, andother old C compilers..TP\ \ \ \(buIn the preprocessor, comments convert to nothing at all, rather thanto a space.  This allows traditional token concatenation..TP\ \ \ \(buIn the preprocessor, macro arguments are recognized within stringconstants in a macro definition (and their values are stringified,though without additional quote marks, when they appear in such acontext).  The preprocessor always considers a string constant to endat a newline..TP\ \ \ \(buThe preprocessor does not predefine the macro \c.B __STDC__\c\& when you use`\|\c.B \-traditional\c\&\|', but still predefines\c.B __GNUC__\c\& (since the GNU extensions indicated by .B __GNUC__\c\& are not affected by`\|\c.B \-traditional\c\&\|').  If you need to write header files that workdifferently depending on whether `\|\c.B \-traditional\c\&\|' is in use, bytesting both of these predefined macros you can distinguish foursituations: GNU C, traditional GNU C, other ANSI C compilers, andother old C compilers..PP.TP\ \ \ \(buString ``constants'' are not necessarily constant; they are stored inwritable space, and identical looking constants are allocatedseparately.  (This is the same as the effect of`\|\c.B \-fwritable\-strings\c\&\|'.)For C++ programs only (not C), `\|\c.B \-traditional\c\&\|' has one additional effect: assignment to .B thisis permitted.  This is the same as the effect of `\|\c.B \-fthis\-is\-variable\c\&\|'..TP.BI \-U macroUndefine macro \c.I macro\c\&..TP.B \-WallIssue warnings for conditions which pertain to usage that we recommendavoiding and that we believe is easy to avoid, even in conjunctionwith macros. .TP.B \-Wenum\-clashWarn when converting between different enumeration types..TP.B \-Woverloaded\-virtualIn a derived class, the definitions of virtual functions must matchthe type signature of a virtual function declared in the base class.Use this option to request warnings when a derived class declares afunction that may be an erroneous attempt to define a virtualfunction: that is, warn when a function with the same name as avirtual function in the base class, but with a type signature thatdoesn't match any virtual functions from the base class..TP.B \-wInhibit all warning messages..PP.SH PRAGMASTwo `\|\c.B #pragma\c\&\|' directives are supported for GNU C++, to permit using the sameheader file for two purposes: as a definition of interfaces to a givenobject class, and as the full definition of the contents of that object class..TP.B #pragma interfaceUse this directive in header files that define object classes, to savespace in most of the object files that use those classes.  Normally,local copies of certain information (backup copies of inline memberfunctions, debugging information, and the internal tables thatimplement virtual functions) must be kept in each object file thatincludes class definitions.  You can use this pragma to avoid suchduplication.  When a header file containing `\|\c.B #pragma interface\c\&\|' is included in a compilation, this auxiliary informationwill not be generated (unless the main input source file itself uses`\|\c.B #pragma implementation\c\&\|').  Instead, the object files will contain references to beresolved at link time.  .tr !".TP.B #pragma implementation.TP.BI "#pragma implementation !" objects .h!Use this pragma in a main input file, when you want full output fromincluded header files to be generated (and made globally visible).The included header file, in turn, should use `\|\c.B #pragma interface\c\&\|'.  Backup copies of inline member functions, debugging information, andthe internal tables used to implement virtual functions are allgenerated in implementation files.If you use `\|\c.B #pragma implementation\c\&\|' with no argument, it applies to an include file with the samebasename as your source file; for example, in `\|\c.B allclass.cc\c\&\|', `\|\c.B #pragma implementation\c\&\|' by itself is equivalent to `\|\c.B #pragma implementation "allclass.h"\c\&\|'.  Use the string argument if you want a single implementationfile to include code from multiple header files.  There is no way to split up the contents of a single header file intomultiple implementation files. .SH FILES.ta \w'LIBDIR/g++\-include 'ufile.h	C header (preprocessor) file.brfile.i	preprocessed C source file.brfile.C	C++ source file.brfile.cc	C++ source file.brfile.cxx	C++ source file.brfile.s	assembly language file.brfile.o	object file.bra.out	link edited output.br\fITMPDIR\fR/cc\(**	temporary files.br\fILIBDIR\fR/cpp	preprocessor.br\fILIBDIR\fR/cc1plus	compiler.br\fILIBDIR\fR/collect	linker front end needed on some machines.br\fILIBDIR\fR/libgcc.a	GCC subroutine library.br/lib/crt[01n].o	start-up routine.br\fILIBDIR\fR/ccrt0	additional start-up routine for C++.br/lib/libc.a	standard C library, see.IR intro (3).br/usr/include	standard directory for .B #includefiles.br\fILIBDIR\fR/include	standard gcc directory for.B #includefiles.br\fILIBDIR\fR/g++\-include	additional g++ directory for.B #include.sp.I LIBDIRis usually.B /usr/local/lib/\c.IR machine / version ..br.I TMPDIRcomes from the environment variable .B TMPDIR(default.B /usr/tmpif available, else.B /tmp\c\&)..SH "SEE ALSO"gcc(1), cpp(1), as(1), ld(1), gdb(1), adb(1), dbx(1), sdb(1)..br.RB "`\|" gcc "\|', `\|" cpp \|', .RB `\| as \|', `\| ld \|',and .RB `\| gdb \|'entries in.B info\c\&..br.I Using and Porting GNU CC (for version 2.0)\c, Richard M. Stallman, November 1990; .IThe C Preprocessor\c, Richard M. Stallman, July 1990;.I Using GDB: A Guide to the GNU Source-Level Debugger\c, Richard M. Stallman and Roland H. Pesch, December 1991;.IUsing as: the GNU Assembler\c, Dean Elsner, Jay Fenlason & friends, March 1991;.Igld: the GNU linker\c, Steve Chamberlain and Roland Pesch, April 1991..SH BUGSReport bugs to.BR bug\-g++@prep.ai.mit.edu .Bugs tend actually to be fixed if they can be isolated, so it is in yourinterest to report them in such a way that they can be easily reproduced..SH COPYINGCopyright (c) 1991 Free Software Foundation, Inc..PPPermission is granted to make and distribute verbatim copies ofthis manual provided the copyright notice and this permission noticeare preserved on all copies..PPPermission is granted to copy and distribute modified versions of thismanual under the conditions for verbatim copying, provided that theentire resulting derived work is distributed under the terms of apermission notice identical to this one..PPPermission is granted to copy and distribute translations of thismanual into another language, under the above conditions for modifiedversions, except that this permission notice may be included intranslations approved by the Free Software Foundation instead of inthe original English..SH AUTHORSSee the GNU CC Manual for the contributors to GNU CC.

⌨️ 快捷键说明

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