cc.1

来自「<B>Digital的Unix操作系统VAX 4.2源码</B>」· 1 代码 · 共 352 行

1
352
字号
.\" SCCSID: @(#)cc.1	3.1	11/23/87.TH cc 1 VAX.SH Namecc \- C compiler.SH Syntax.B cc[\|\fIoptions\fR...\|] \fIfile\fR....SH Description.NXS "C compiler" "cc compiler".NXA "cc compiler" "xstr command".NXA "cc compiler" "mkstr command".NXR "cc compiler"The.PN cccommand invokesthe ULTRIX C compiler and accepts the following types of arguments:.IP \(bu 5Arguments whose names end with .c .IP \(bu 5Arguments whose names end with .s .IP \(bu 5Other arguments that are interpreted as either loaderoption arguments or .brC-compatible object programs.PPArguments ending in .c are interpreted asC source programs. They are compiled, andeach object program is left on a filewhose name is the same as the source file except .o issubstituted for .c.  If a singleC program is compiled and loaded all at once, the .ofile is deleted..PPArguments ending with .s are interpreted asassembly source programs.  Theyare assembled, producing an .o file..PPArguments other than those ending with .c or .swere produced by previous .PN ccruns or by libraries of C-compatible routines..PPThe first argument passed to the.MS ld 1loader is always one of the three.PN crt0 files used for start up.  The compiler uses .PN /lib/mcrt0.owhen the \fB\-p\fR flag is given,.PN /usr/lib/gcrt0.owhen the \fB\-pg\fR is given, and .PN /lib/crt0.o otherwise.  If loading executables by hand, you must include theappropriate file.  .SH Options.NXR "cc compiler" "options"These options are accepted by.PN cc .See .MS ld 1for load-time options..TP 15.B \-bDoes not pass .B \-lcto .MS ld 1by default..TP .BI \-B stringFinds substitute compiler passes in the files named.I stringwith the suffixes cpp, ccom, and c2..TP.B \-bswitchInstructs the compiler to use discrete tests for switch casestatements rather than casel instructions..TP.B \-cSuppresses the loading phase of the compilation and forcesan object file to be produced even if only one program is compiled..TP.B \-CStops the macro preprocessor from omitting comments..TP.BI \-D name=def.br.ns.TP.BI \-D nameDefines the \fIname\fR to the processor, as if by #define.If no definition is given, the name is defined as 1..TP.B \-ERuns only the macro preprocessor on the named C programs andsends the result to the standard output..TP.B \-EmRuns only the macro preprocessor on the named C programs andproduces the makefile dependencies..IP \fB\-f\fR Specifies that computations involving only FFLOAT numbers bedone in single precision and not promoted to double.  Procedurearguments are still promoted to double.  Programs with alarge number of single-precision computations will run fasterwith this option; however, a slight loss in precision mayresult due to the saving of intermediate results in asingle-precision representation..IP \fB\-g\fR Directs the compiler to produce additional symbol table informationfor .MS dbx 1 .Also passes the.B \-lgflag to .MS ld 1 ..TP.BI \-I dirSearches first in the directory of the \fIdir\fR argument for\fH#include\fR files whose names do not begin with a slash (/),then in directories named in \fB\-I\fR options,and, finally, in directories on a standard list..TP.B \-JUses long branches to resolve jumps when byte-displacementbranches are insufficient.  This must be used when acompiler-generated assembly contains branches of more than32k bytes..TP.BI \-l xAbbreviates the library name/lib/lib\fIx\fR.a, where \fIx\fR is astring.  If that library name does not exist,.B ldsearches /usr/lib/lib\fIx\fR.a and then/usr/local/lib/lib\fIx\fR.a.  The placement of the \fB\-l\fR library option is significant because a libraryis searched when its name is encountered..TP.B \-MSpecifies the floating point type to be used for double-precisionfloating point and is passed on to .MS ld 1 as the map option..TP.B \-MdSpecifies the default DFLOAT and passes the \fB\-lc\fR flagto .MS ld 1 ..TP.B \-MgSpecifies GFLOAT and passes the \fB\-lcg\fR flag to .MS ld 1 ,causing the GFLOAT version of \fBlibc\fR to be used.  If the mathlibrary is used with code compiled with the \fB\-Mg\fR flag, it is linked to the GFLOAT version by specifying \fB\-lmg\fR onthe .MS cc 1or.MS ld 1command..TP.B "\-o \fIoutput\fR"Names the final output file \fIoutput\fR.  If this option isused, the file a.outis left alone.  If the named file has either .o or .aas a suffix, the following error message is displayed: \fB-o wouldoverwrite\fR..IP \fB\-O\fR Uses the object code optimizer.  .TP.B \-pArranges for the compiler to produce codewhich counts the number of times each routine is called.If loading takes place, the \fB\-p\fR option replaces the standard startuproutine with one that automatically calls .MS monitor 3 and that arranges to write out amon.outfile at normal termination of execution of the object program.An execution profile can then be generated using.MS prof 1 ..TP.B \-pgCauses the compiler to produce countingcode as with.B \-p,but invokes a run-time recorder that keeps more extensive statistics and produces a .PN gmon.out file.  Also, the \fB\-pg\fR option searchesa profiling library in lieu ofthe standard C library.An execution profile can then be generated by using.MS gprof 1 ..TP.B \-RPassed on to.I as,which makes initialized variables shared and read-only..TP.B \-SCompiles programs and writes output to .s files.  .TP.B "\-t [p02al]" Finds the designated compiler passes in thefiles whose names are constructed by a.B \-Boption.In the absence of a.B \-B option, the.I stringis taken to be /usr/c/..TP.BI \-U nameRemoves any initial definition of \fIname\fR..TP.B \-wSuppresses warning diagnostics..TP.BI \-Y environmentCompiles C programs for \fIenvironment\fP.  If \fIenvironment\fP isSYSTEM_FIVE or is omitted, it defines SYSTEM_FIVE for the preprocessor, .PN cpp .If the loader is invoked, itspecifies that the System V version of the C runtime library isused.  Also, if the math library is specified with the \fB\-lm\fRoption, the System V version is used.  If \fIenvironment\fP isPOSIX, it defines POSIX for the preprocessor.  If the environment variable PROG_ENV has the value SYSTEM_FIVE or POSIX, the effect is thesame as when specifyingthe corresponding \fB\-Y\fIenvironment\fR option to .PN cc .The \fB-Y\fP option overrides the PROG_ENV variable; \fB-YBSD\fP can beused to override all special actions..SS Default SymbolsThe ULTRIX C compiler provides the following default symbolsfor your use.  These symbols are useful in \fHifdef\fRstatements to isolate code for one of the particular cases. Thus, these symbols can be useful for ensuring portable code..PP.RS.nf.ta 1.5i\f(CWunix\fR	Any UNIX system\f(CWbsd4_2\fR	Berkeley UNIX Version 4.2\f(CWultrix\fR	ULTRIX only\f(CWvax\fR	VAX only (as opposed to PDP-11).fi.RE.SH Restrictions.NXR "cc compiler" "restricted"The compiler ignores advice to put \fBchar\fR, \fBunsigned char\fR,\fBshort\fR or \fBunsigned short\fR variables in registers..PPIf the.B \-Mgflag is used to produce GFLOAT code,it must be used when compilingall the modules which are to be linked.Use the.B \-Mgflag if you use the .B cccommandto invoke.MS ld 1indirectly to link the modules.  If.MS ld 1 is invoked directly, use the.B \-lcgflag rather than.B \-lc.If the math library is used, specify the.B \-lmgflag rather than the.B \-lmflag in order to use the GFLOAT version.	.PP The compiler and the linker .MS ld 1cannot detect the use of mixed double floatingpoint types.  If you use them, your program'sresults may be erroneous. .SH DiagnosticsThe diagnostics produced by C are intended to beself-explanatory.Occasional messages may be produced by the assembleror loader..SH Files.PD 0.TP 20.PN file.cinput file.TP.PN file.oobject file.TP.PN a.outloaded output.TP.PN /tmp/ctm?temporary.TP.PN /lib/cpppreprocessor.TP.PN /lib/ccomcompiler.TP.PN /lib/c2optional optimizer.TP.PN /lib/crt0.oruntime startoff.TP.PN /lib/mcrt0.ostartoff for profiling.TP.PN /usr/lib/gcrt0.ostartoff for gprof-profiling.TP.PN /lib/libc.astandard library, see intro(3).TP.PN /usr/libcg.aGFLOAT version of the standard library, see intro(3).TP.PN /usr/lib/libc_p.aprofiling library, see intro(3).TP.PN /usr/includestandard directory for \fH#include\fR files.TP.PN mon.outfile produced for analysis by prof(1).TP.PN gmon.outfile produced for analysis by gprof(1).PD.SH See Alsoadb(1), as(1), cpp(1), dbx(1), error(1), gprof(1), ld(1), prof(1), monitor(3)

⌨️ 快捷键说明

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