BSD 4_4 release
[unix-history] / usr / src / old / pcc / cc / cc.1
index 5f119f6..81ba180 100644 (file)
@@ -1,29 +1,53 @@
-.\" Copyright (c) 1980 Regents of the University of California.
-.\" All rights reserved.  The Berkeley software License Agreement
-.\" specifies the terms and conditions for redistribution.
+.\" Copyright (c) 1980, 1990 The Regents of the University of California.
+.\" All rights reserved.
 .\"
 .\"
-.\"    @(#)cc.1        4.1 (Berkeley) %G%
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"    notice, this list of conditions and the following disclaimer in the
+.\"    documentation and/or other materials provided with the distribution.
+.\" 3. All advertising materials mentioning features or use of this software
+.\"    must display the following acknowledgement:
+.\"    This product includes software developed by the University of
+.\"    California, Berkeley and its contributors.
+.\" 4. Neither the name of the University nor the names of its contributors
+.\"    may be used to endorse or promote products derived from this software
+.\"    without specific prior written permission.
 .\"
 .\"
-.TH CC 1 4/1/81
-.UC 4
-.SH NAME
-cc \- C compiler
-.SH SYNOPSIS
-.B cc
-[ option ] ... file ...
-.SH DESCRIPTION
-.I Cc
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"    @(#)cc.1        6.7 (Berkeley) 8/9/91
+.\"
+.Dd August 9, 1991
+.Dt CC 1
+.Os BSD 4
+.Sh NAME
+.Nm cc
+.Nd C compiler
+.Sh SYNOPSIS
+.Nm cc
+.Op  option
+Ar ...
+.Ar file ...
+.Sh DESCRIPTION
+.Nm Cc
 is the UNIX C compiler.
 is the UNIX C compiler.
-.B N.B.:
-.I cc
-has been recently modified to accept arbitrary length identifiers
-and to produce a new object file format; see
-.IR old (8)
-for information on dealing with old format programs.
-.PP
-.I Cc
+.Nm Cc
 accepts several types of arguments:
 accepts several types of arguments:
-.PP
+.Pp
 Arguments whose names end with `.c' are taken to be
 C source programs; they are compiled, and
 each object program is left on the file
 Arguments whose names end with `.c' are taken to be
 C source programs; they are compiled, and
 each object program is left on the file
@@ -31,188 +55,226 @@ whose name is that of the source with `.o' substituted
 for `.c'.
 The `.o' file is normally deleted, however, if a single
 C program is compiled and loaded all at one go.
 for `.c'.
 The `.o' file is normally deleted, however, if a single
 C program is compiled and loaded all at one go.
-.PP
+.Pp
 In the same way,
 arguments whose names end with `.s' are taken to be assembly source programs
 and are assembled, producing a `.o' file.
 In the same way,
 arguments whose names end with `.s' are taken to be assembly source programs
 and are assembled, producing a `.o' file.
-.PP
+.Pp
 The following options are interpreted by
 The following options are interpreted by
-.IR cc .
+.Nm cc .
 See
 See
-.IR ld (1)
+.Xr ld 1
 for load-time options.
 for load-time options.
-.TP 8
-.B \-c
+.Bl -tag -width Ds
+.It Fl c
 Suppress the loading phase of the compilation, and force
 an object file to be produced even if only one program is compiled.
 Suppress the loading phase of the compilation, and force
 an object file to be produced even if only one program is compiled.
-.TP
-.B \-g
+.It Fl g
+Have the compiler produce additional symbol table information
+for
+.Xr dbx 1
+Also pass the
+.Fl lg
+flag to
+.Xr ld 1 .
+.It Fl go
 Have the compiler produce additional symbol table information
 Have the compiler produce additional symbol table information
-for 
-.IR sdb (1).
+for the obsolete debugger
+.Xr sdb 1 .
 Also pass the
 Also pass the
-.B \-lg
+.Fl lg
 flag to
 flag to
-.IR ld (1).
-.TP
-.B \-w
+.Xr ld 1 .
+.It Fl w
 Suppress warning diagnostics.
 Suppress warning diagnostics.
-.TP
-.B \-p
+.It Fl p
 Arrange for the compiler to produce code
 Arrange for the compiler to produce code
-which counts the number of times each routine is called;
-also, if loading takes place, replace the standard startup
+which counts the number of times each routine is called.
+If loading takes place, replace the standard startup
 routine by one which automatically calls
 routine by one which automatically calls
-.IR monitor (3)
+.Xr monitor 3
 at the start and arranges to write out a
 at the start and arranges to write out a
-.I mon.out
+.Pa mon.out
 file at normal termination of execution of the object program.
 An execution profile can then be generated by
 use of
 file at normal termination of execution of the object program.
 An execution profile can then be generated by
 use of
-.IR  prof (1).
-.TP
-.SM
-.B \-O
+.Xr prof 1 .
+.It Fl pg
+Causes the compiler to produce counting code in the manner of
+.Fl p
+but invokes a run-time recording mechanism that keeps more
+extensive statistics and produces a
+.Pa gmon.out
+file at normal termination.
+Also, a profiling library is searched, in lieu of the standard C library.
+An execution profile can then be generated by  use of
+.Xr gprof 1 .
+.It Fl O
 Invoke an
 object-code improver.
 Invoke an
 object-code improver.
-.TP
-.SM
-.B \-R
+.It Fl R
 Passed on to
 Passed on to
-.I as,
+.Xr as 1
 making initialized variables shared and read-only.
 making initialized variables shared and read-only.
-.TP
-.SM
-.B \-S
+.It Fl S
 Compile the named C programs, and leave the
 assembler-language output on corresponding files suffixed `.s'.
 Compile the named C programs, and leave the
 assembler-language output on corresponding files suffixed `.s'.
-.TP
-.SM
-.B \-E
+.It Fl M
+Run only the macro preprocessor
+on the named C programs,
+requesting it to generate Makefile dependencies
+and send the result to the standard output.
+.It Fl E
 Run only the macro preprocessor
 on the named C programs, and send the result to the
 standard output.
 Run only the macro preprocessor
 on the named C programs, and send the result to the
 standard output.
-.TP
-.SM
-.B \-C
+.It Fl C
 prevent the macro preprocessor from eliding comments.
 prevent the macro preprocessor from eliding comments.
-.TP
-.BI \-o " output"
+.It Fl o Ns Ar output 
 Name the final output file
 Name the final output file
-.IR output .
+.Ar output .
 If this option is used the file `a.out' will be left undisturbed.
 If this option is used the file `a.out' will be left undisturbed.
-.TP
-.SM
-.BI \-D name=def
-.br
-.ns
-.TP
-.SM
-.BI \-D \*Sname
+.El
+.Bl -tag -width Ds -compact
+.It Fl D Ns Ar name=def 
+.It Fl D Ns Ar name 
 Define the
 Define the
-.I name
+.Ar name
 to the preprocessor,
 to the preprocessor,
-as if by
-`#define'.
+as if by `#define'.
 If no definition is given, the name is defined as "1".
 If no definition is given, the name is defined as "1".
-.TP
-.SM
-.BI \-U \*Sname
+.El
+.Bl -tag -width Ds
+.It Fl U Ns Ar name 
 Remove any initial definition of
 Remove any initial definition of
-.IR name .
-.TP
-.SM
-.BI \-I \*Sdir
+.Ar name .
+.It Fl I Ns Ar dir 
 `#include' files
 `#include' files
-whose names do not begin with `/' are always
-sought first in the directory 
+whose names do not begin with `/'
+are always
+sought first in the directory
 of the
 of the
-.I file
+.Ar file
 argument,
 argument,
-then in directories named in 
-.B \-I
+then in directories named in
+.Fl I
+options,
+then in directories on a standard list.
+.It Fl L Ns Ar dir 
+Library archives are sought first in
+directories named in
+.Fl L
 options,
 then in directories on a standard list.
 options,
 then in directories on a standard list.
-.TP
-.SM
-.BI \-B \*Sstring
-Find substitute compiler passes in the files named
-.I string
+.It Fl f
+Use an alternate compiler which does not convert expressions involving
+only floats to double. This does not conform to the standard which states
+that all intermediate results should be converted to double but does
+provide a speed improvement for programs which don't require full double
+precision.  This option also makes
+.Sy register float
+variables work appropriately.
+.It Fl B Ns Ar path 
+Find substitute compiler passes in the named path
 with the suffixes cpp, ccom and c2.
 with the suffixes cpp, ccom and c2.
-If 
-.I string 
-is empty, use a standard backup version.
-.TP
-.BR \-t [ p012 ]
+.It Fl t Ns Op p012 
 Find only the designated compiler passes in the
 files whose names are constructed by a
 Find only the designated compiler passes in the
 files whose names are constructed by a
-.B \-B
+.Fl B
 option.
 option.
-In the absence of a
-.B \-B 
-option, the
-.I string
-is taken to be `/usr/c/'.
-.PP
+.El
+.Pp
 Other arguments
 are taken
 to be either loader option arguments, or C-compatible
 object programs, typically produced by an earlier
 Other arguments
 are taken
 to be either loader option arguments, or C-compatible
 object programs, typically produced by an earlier
-.I cc
+.Nm cc
 run,
 or perhaps libraries of C-compatible routines.
 These programs, together with the results of any
 compilations specified, are loaded (in the order
 given) to produce an executable program with name
 run,
 or perhaps libraries of C-compatible routines.
 These programs, together with the results of any
 compilations specified, are loaded (in the order
 given) to produce an executable program with name
-.B a.out.
-.SH FILES
-.ta \w'/usr/c/occom  'u
-file.c input file
-.br
-file.o object file
-.br
-a.out  loaded output
-.br
-/tmp/ctm?      temporary
-.br
-/lib/cpp       preprocessor
-.br
-/lib/ccom      compiler
-.br
-/usr/c/occom   backup compiler
-.br
-/usr/c/ocpp    backup preprocessor
-.br
-/lib/c2        optional optimizer
-.br
-/lib/crt0.o    runtime startoff
-.br
-/lib/mcrt0.o   startoff for profiling
-.br
-/lib/libc.a    standard library, see (3)
-.br
-/usr/include   standard directory for `#include' files
-.SH "SEE ALSO"
-B. W. Kernighan and D. M. Ritchie,
-.I The C Programming Language,
-Prentice-Hall,
-1978
-.br
-B. W. Kernighan,
-.I
-Programming in C\(ema tutorial
-.br
-D. M. Ritchie,
-.I
-C Reference Manual
-.br
-monitor(3), prof(1), adb(1), ld(1), sdb(1), old(8)
-.SH DIAGNOSTICS
+.Pa a.out .
+.Sh FILES
+.Bl -tag -width /usr/libexec/sccom -compact
+.It Pa file.c
+Input file.
+.It Pa file.o
+Object file.
+.It Pa a.out
+Loaded output.
+.It Pa ctm?
+Temporary.
+.It Pa /usr/bin/cpp
+Preprocessor.
+.It Pa /usr/libexec/ccom
+Compiler.
+.It Pa /usr/libexec/ccom
+Compiler for single precision floats.
+.It Pa /usr/libexec/c2
+Optional optimizer.
+.It Pa /usr/lib/crt0.o
+Runtime startoff.
+.It Pa /usr/lib/mcrt0.o
+Startoff for profiling.
+.It Pa /usr/lib/gcrt0.o
+Startoff for gprof-profiling.
+.It Pa /usr/lib/libc.a
+Standard library, see.
+.Xr intro 3 .
+.It Pa /usr/lib/libc_p.a
+Profiling library, see
+.Xr intro 3 .
+.It Pa /usr/include
+Standard directory for `#include' files.
+.It Pa mon.out
+File produced for analysis by
+.Xr prof 1 .
+.It Pa gmon.out
+File produced for analysis by
+.Xr gprof 1 .
+.El
+.Sh SEE ALSO
+.Xr monitor 3 ,
+.Xr prof 1 ,
+.Xr gprof 1 ,
+.Xr adb 1 ,
+.Xr ld 1 ,
+.Xr dbx 1 ,
+.Xr as 1
+.Rs
+.%A B. W. Kernighan
+.%A D. M. Ritchie
+.%T "The Programming Language"
+.%I Prentice-Hall
+.%D 1978
+.Re
+.Rs
+.%A B. W. Kernighan
+.%T "Programming in C \- a tutorial"
+.Re
+.Rs
+.%A D. M. Ritchie
+.%T "C Reference Manual"
+.Re
+.Sh DIAGNOSTICS
 The diagnostics produced by C itself are intended to be
 self-explanatory.
 Occasional messages may be produced by the assembler
 or loader.
 The diagnostics produced by C itself are intended to be
 self-explanatory.
 Occasional messages may be produced by the assembler
 or loader.
-.SH BUGS
-The compiler currently ignores advice to put \fBchar\fR, \fBunsigned char\fR,
-\fBshort\fR or \fBunsigned short\fR variables in registers.  It previously
+.Sh HISTORY
+The
+.Nm \&cc
+compiler was distributed with
+.At v6 .
+.Sh BUGS
+The compiler currently ignores advice to put
+.Ic char ,
+.Ic unsigned char ,
+.Ic short ,
+.Ic unsigned short ,
+.Ic float ,
+or
+.Ic double
+variables in registers, except as noted above.  It previously
 produced poor, and in some cases incorrect, code for such declarations.
 produced poor, and in some cases incorrect, code for such declarations.