xref: /freebsd/usr.bin/c89/c89.1 (revision 96950419f15510287080c557174e0d8409f06956)
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.Dd September 17, 1997
27.Dt C89 1
28.Os
29.Sh NAME
30.Nm c89
31.Nd POSIX.2 C language compiler
32.Sh SYNOPSIS
33.Nm
34.Op Fl cEgOs
35.Oo Fl D Ar name Ns Oo = Ns Ar value Oc Oc ...
36.Oo Fl I Ar directory Oc ...
37.Oo Fl L Ar directory Oc ...
38.Op Fl o Ar outfile
39.Oo Fl U Ar name Oc ...
40.Ar operand ...
41.Sh DESCRIPTION
42This is the name of the C language compiler as required by the
43.St -p1003.2
44standard.
45.Pp
46The
47.Nm
48compiler accepts the following options:
49.Bl -tag -width indent
50.It Fl c
51Suppress the link-edit phase of the compilation, and do not remove any
52object files that are produced.
53.It Fl D Ar name Ns Op = Ns Ar value
54Define name as if by a C-language
55.Ic #define
56directive.
57If no
58.Dq = Ns Ar value
59is given, a value of 1 will be used.
60Note that in order to request a
61translation as specified by
62.St -p1003.2
63you need to define
64.Dv _POSIX_SOURCE
65either in the source or using this option.
66The
67.Fl D
68option has lower precedence than the
69.Fl U
70option.
71That is, if
72.Ar name
73is used in both a
74.Fl U
75and a
76.Fl D
77option,
78.Ar name
79will be undefined regardless of the order of the options.
80The
81.Fl D
82option may be specified more than once.
83.It Fl E
84Copy C-language source files to the standard output, expanding all
85preprocessor directives; no compilation will be performed.
86.It Fl g
87Produce symbolic information in the object or executable files.
88.It Fl I Ar directory
89Change the algorithm for searching for headers whose names are not
90absolute pathnames to look in the directory named by the
91.Ar directory
92pathname before looking in the usual places.
93Thus, headers whose
94names are enclosed in double-quotes
95.Pq Qq
96will be searched for first
97in the directory of the file with the
98.Ic #include
99line, then in
100directories named in
101.Fl I
102options, and last in the usual places.
103For headers whose names are enclosed in angle brackets
104.Pq Aq ,
105the header
106will be searched for only in directories named in
107.Fl I
108options and then in the usual places.
109Directories named in
110.Fl I
111options shall be searched in the order specified.
112The
113.Fl I
114option may be specified more than once.
115.It Fl L Ar directory
116Change the algorithm of searching for the libraries named in the
117.Fl l
118objects to look in the directory named by the
119.Ar directory
120pathname before looking in the usual places.
121Directories named in
122.Fl L
123options will be searched in the order specified.
124The
125.Fl L
126option may be specified more than once.
127.It Fl o Ar outfile
128Use the pathname
129.Ar outfile ,
130instead of the default
131.Pa a.out ,
132for the executable file produced.
133.It Fl O
134Optimize the compilation.
135.It Fl s
136Produce object and/or executable files from which symbolic and other
137information not required for proper execution has been removed
138(stripped).
139.It Fl U Ar name
140Remove any initial definition of
141.Ar name .
142The
143.Fl U
144option may be specified more than once.
145.El
146.Pp
147An operand is either in the form of a pathname or the form
148.Fl l
149library.
150At least one operand of the pathname form needs to be specified.
151Supported operands are of the form:
152.Bl -tag -offset indent -width ".Fl l Ar library"
153.It Ar file Ns Pa .c
154A C-language source file to be compiled and optionally linked.
155The operand must be of this form if the
156.Fl c
157option is used.
158.It Ar file Ns Pa .a
159A library of object files, as produced by
160.Xr ar 1 ,
161passed directly to the link editor.
162.It Ar file Ns Pa .o
163An object file produced by
164.Nm Fl c ,
165and passed directly to the link editor.
166.It Fl l Ar library
167Search the library named
168.Pa lib Ns Ar library Ns Pa .a .
169A library will be searched when its name is encountered, so the
170placement of a
171.Fl l
172operand is significant.
173.El
174.Sh SEE ALSO
175.Xr ar 1 ,
176.Xr c99 1 ,
177.Xr cc 1
178.Sh STANDARDS
179The
180.Nm
181utility is believed to comply with
182.St -p1003.2 .
183