xref: /freebsd/usr.bin/c89/c89.1 (revision c9f432b7ba4bf134850b4a5028fae94f63ca274c)
1.\"
2.\" Copyright (c) 1997 Joerg Wunsch
3.\"
4.\" All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright
10.\"    notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\"    notice, this list of conditions and the following disclaimer in the
13.\"    documentation and/or other materials provided with the distribution.
14.\"
15.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
16.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
19.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25.\"
26.\" $FreeBSD$
27.\"
28.Dd September 17, 1997
29.Dt C89 1
30.Os
31.Sh NAME
32.Nm c89
33.Nd POSIX.2 C language compiler
34.Sh SYNOPSIS
35.Nm
36.Op Fl cEgOs
37.Oo Fl D Ar name Ns Oo = Ns Ar value Oc Oc ...
38.Oo Fl I Ar directory Oc ...
39.Oo Fl L Ar directory Oc ...
40.Op Fl o Ar outfile
41.Oo Fl U Ar name Oc ...
42.Ar operand ...
43.Sh DESCRIPTION
44This is the name of the C language compiler as required by the
45.St -p1003.2
46standard.
47.Pp
48The
49.Nm
50compiler accepts the following options:
51.Bl -tag -width indent
52.It Fl c
53Suppress the link-edit phase of the compilation, and do not remove any
54object files that are produced.
55.It Fl D Ar name Ns Op = Ns Ar value
56Define name as if by a C-language
57.Ic #define
58directive.
59If no
60.Dq = Ns Ar value
61is given, a value of 1 will be used.
62Note that in order to request a
63translation as specified by
64.St -p1003.2
65you need to define
66.Dv _POSIX_SOURCE
67either in the source or using this option.
68The
69.Fl D
70option has lower precedence than the
71.Fl U
72option.
73That is, if
74.Ar name
75is used in both a
76.Fl U
77and a
78.Fl D
79option,
80.Ar name
81will be undefined regardless of the order of the options.
82The
83.Fl D
84option may be specified more than once.
85.It Fl E
86Copy C-language source files to the standard output, expanding all
87preprocessor directives; no compilation will be performed.
88.It Fl g
89Produce symbolic information in the object or executable files.
90.It Fl I Ar directory
91Change the algorithm for searching for headers whose names are not
92absolute pathnames to look in the directory named by the
93.Ar directory
94pathname before looking in the usual places.
95Thus, headers whose
96names are enclosed in double-quotes
97.Pq Qq
98will be searched for first
99in the directory of the file with the
100.Ic #include
101line, then in
102directories named in
103.Fl I
104options, and last in the usual places.
105For headers whose names are enclosed in angle brackets
106.Pq Aq ,
107the header
108will be searched for only in directories named in
109.Fl I
110options and then in the usual places.
111Directories named in
112.Fl I
113options shall be searched in the order specified.
114The
115.Fl I
116option may be specified more than once.
117.It Fl L Ar directory
118Change the algorithm of searching for the libraries named in the
119.Fl l
120objects to look in the directory named by the
121.Ar directory
122pathname before looking in the usual places.
123Directories named in
124.Fl L
125options will be searched in the order specified.
126The
127.Fl L
128option may be specified more than once.
129.It Fl o Ar outfile
130Use the pathname
131.Ar outfile ,
132instead of the default
133.Pa a.out ,
134for the executable file produced.
135.It Fl O
136Optimize the compilation.
137.It Fl s
138Produce object and/or executable files from which symbolic and other
139information not required for proper execution has been removed
140(stripped).
141.It Fl U Ar name
142Remove any initial definition of
143.Ar name .
144The
145.Fl U
146option may be specified more than once.
147.El
148.Pp
149An operand is either in the form of a pathname or the form
150.Fl l
151library.
152At least one operand of the pathname form needs to be specified.
153Supported operands are of the form:
154.Bl -tag -offset indent -width ".Fl l Ar library"
155.It Ar file Ns Pa .c
156A C-language source file to be compiled and optionally linked.
157The operand must be of this form if the
158.Fl c
159option is used.
160.It Ar file Ns Pa .a
161A library of object files, as produced by
162.Xr ar 1 ,
163passed directly to the link editor.
164.It Ar file Ns Pa .o
165An object file produced by
166.Nm Fl c ,
167and passed directly to the link editor.
168.It Fl l Ar library
169Search the library named
170.Pa lib Ns Ar library Ns Pa .a .
171A library will be searched when its name is encountered, so the
172placement of a
173.Fl l
174operand is significant.
175.El
176.Sh SEE ALSO
177.Xr ar 1 ,
178.Xr c99 1 ,
179.Xr cc 1
180.Sh STANDARDS
181The
182.Nm
183utility is believed to comply with
184.St -p1003.2 .
185