annotate tradcpp.1 @ 136:59680a727e9d

Improve previous. Just in case we ever crash and reach cleanup() while processing an -include foo option, take the array entry for it out of the array to make sure it doesn't get freed twice. This case shouldn't be reachable, but it's better to be safe.
author David A. Holland
date Tue, 09 Jul 2013 13:38:43 -0400
parents 9f479b52364a
children f7814226906c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
110
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
1 .\"
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
2 .\" Copyright (c) 2013 The NetBSD Foundation, Inc.
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
3 .\" All rights reserved.
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
4 .\"
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
5 .\" This code is derived from software contributed to The NetBSD Foundation
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
6 .\" by David A. Holland.
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
7 .\"
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
8 .\" Redistribution and use in source and binary forms, with or without
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
9 .\" modification, are permitted provided that the following conditions
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
10 .\" are met:
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
11 .\" 1. Redistributions of source code must retain the above copyright
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
12 .\" notice, this list of conditions and the following disclaimer.
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
13 .\" 2. Redistributions in binary form must reproduce the above copyright
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
14 .\" notice, this list of conditions and the following disclaimer in the
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
15 .\" documentation and/or other materials provided with the distribution.
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
16 .\"
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
17 .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
18 .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
19 .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
20 .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
21 .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
22 .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
23 .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
24 .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
25 .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
26 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
27 .\" POSSIBILITY OF SUCH DAMAGE.
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
28 .\"
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
29 .Dd June 11, 2013
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
30 .Dt TRADCPP 1
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
31 .Os
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
32 .Sh NAME
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
33 .Nm tradcpp
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
34 .Nd traditional (K&R-style) C macro preprocessor
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
35 .Sh SYNOPSIS
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
36 .Nm tradcpp
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
37 .Op Fl options
121
103acee239e0 Man page fixes from wiz@.
David A. Holland
parents: 110
diff changeset
38 .Op Ar input-file Op Ar output-file
110
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
39 .Sh DESCRIPTION
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
40 The
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
41 .Nm
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
42 command provides a traditional K&R-style C macro preprocessor.
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
43 It is intended to be suitable for historical Unix uses of the
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
44 preprocessor, such as
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
45 .Xr imake 1 ,
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
46 particularly those that depend on preservation of whitespace.
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
47 .Pp
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
48 The chief ways in which traditional cpp differs from
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
49 Standard C are:
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
50 .Bl -bullet -offset indent
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
51 .It
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
52 Macro arguments are expanded within quoted strings.
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
53 There is no stringize operator.
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
54 .It
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
55 There is no token pasting operator; tokens can be concatenated by
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
56 placing comments between them.
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
57 This process is also not limited to valid C language tokens.
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
58 .It
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
59 Whitespace is preserved, and in particular tabs are not expanded into
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
60 spaces.
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
61 Furthermore, additional whitespace is not injected.
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
62 .El
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
63 .Sh OPTIONS
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
64 .Nm
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
65 has many options, many of which are defined for compatibility with
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
66 .Xr gcc 1
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
67 or other compilers.
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
68 Many of the options are not yet implemented.
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
69 .\" The option lists have been sorted in what I hope is a sensible
121
103acee239e0 Man page fixes from wiz@.
David A. Holland
parents: 110
diff changeset
70 .\" order. Please don't arbitrarily alphabetize them.
110
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
71 .Ss Common Options
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
72 .Bl -tag -width bubblebabble
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
73 .It Fl C
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
74 Retain comments in output.
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
75 .It Fl Dmacro[=expansion]
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
76 Provide a definition for the named macro.
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
77 If no expansion is provided, the value
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
78 .Dq 1
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
79 is used.
122
64c4de3709de Complain if -[DIU] is given an empty argument.
David A. Holland
parents: 121
diff changeset
80 Note that like many Unix compilers,
64c4de3709de Complain if -[DIU] is given an empty argument.
David A. Holland
parents: 121
diff changeset
81 .Nm
64c4de3709de Complain if -[DIU] is given an empty argument.
David A. Holland
parents: 121
diff changeset
82 does not accept a space between the
64c4de3709de Complain if -[DIU] is given an empty argument.
David A. Holland
parents: 121
diff changeset
83 .Dq D
64c4de3709de Complain if -[DIU] is given an empty argument.
David A. Holland
parents: 121
diff changeset
84 and the macro name.
121
103acee239e0 Man page fixes from wiz@.
David A. Holland
parents: 110
diff changeset
85 .It Fl Ipath
110
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
86 Add the specified path to the main list of include directories.
122
64c4de3709de Complain if -[DIU] is given an empty argument.
David A. Holland
parents: 121
diff changeset
87 Note that like many Unix compilers,
64c4de3709de Complain if -[DIU] is given an empty argument.
David A. Holland
parents: 121
diff changeset
88 .Nm
64c4de3709de Complain if -[DIU] is given an empty argument.
David A. Holland
parents: 121
diff changeset
89 does not accept a space between the
64c4de3709de Complain if -[DIU] is given an empty argument.
David A. Holland
parents: 121
diff changeset
90 .Dq I
64c4de3709de Complain if -[DIU] is given an empty argument.
David A. Holland
parents: 121
diff changeset
91 and the directory name.
110
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
92 .It Fl nostdinc
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
93 Do not search the standard system include directories.
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
94 .It Fl P
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
95 Suppress line number information in the output.
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
96 Currently line number information is not generated at all and this
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
97 option has no effect.
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
98 .It Fl Umacro
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
99 Remove any existing defintion for the named macro.
122
64c4de3709de Complain if -[DIU] is given an empty argument.
David A. Holland
parents: 121
diff changeset
100 Note that like many Unix compilers,
64c4de3709de Complain if -[DIU] is given an empty argument.
David A. Holland
parents: 121
diff changeset
101 .Nm
64c4de3709de Complain if -[DIU] is given an empty argument.
David A. Holland
parents: 121
diff changeset
102 does not accept a space between the
64c4de3709de Complain if -[DIU] is given an empty argument.
David A. Holland
parents: 121
diff changeset
103 .Dq U
64c4de3709de Complain if -[DIU] is given an empty argument.
David A. Holland
parents: 121
diff changeset
104 and the macro name.
110
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
105 .It Fl undef
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
106 Remove all predefined macros.
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
107 .El
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
108 .Ss Warning Options
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
109 Warning options can be disabled or enabled by inserting, or not, the
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
110 string
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
111 .Dq no-
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
112 between the
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
113 .Dq W
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
114 and the warning name.
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
115 Herein the
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
116 .Dq Fl Wno-
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
117 form is shown for options that are enabled by default.
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
118 .Bl -tag -width bubblebabble
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
119 .It Fl Wall
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
120 Turn on all warnings.
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
121 The option
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
122 .Fl Wno-all
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
123 disables only the warnings that are disabled by default.
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
124 .It Fl w
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
125 Turn off all warnings.
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
126 .It Fl Werror
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
127 Make warnings into fatal errors.
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
128 .It Fl Wcomment
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
129 Warn about nested comments.
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
130 .It Fl Wno-endif-labels
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
131 Don't warn about symbols attached to #endif directives.
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
132 (The warning is currently not implemented.)
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
133 .It Fl Wundef
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
134 Warn about undefined symbols appearing in #if and #elif expressions.
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
135 .It Fl Wunused-macros
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
136 Warn about macros that are defined and never used.
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
137 Not implemented.
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
138 .El
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
139 .Ss Depend Options
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
140 .Bl -tag -width bubblebabble
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
141 .It Fl M
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
142 Generate dependency information for
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
143 .Xr make 1
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
144 on the standard output, instead of preprocessing.
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
145 Not implemented.
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
146 .It Fl MD
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
147 Like
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
148 .Fl M
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
149 but skip system headers.
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
150 Not implemented.
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
151 .It Fl MM
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
152 Like
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
153 .Fl M
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
154 but write the dependency information to a file named after the input
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
155 file with extension
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
156 .Pa \.d
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
157 and preprocess normally to standard output.
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
158 Not implemented.
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
159 .It Fl MMD
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
160 Like
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
161 .Fl MM
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
162 but skip system headers.
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
163 Not implemented.
123
9f479b52364a Add a bunch more options I forgot earlier (!)
David A. Holland
parents: 122
diff changeset
164 .It Fl MF Ar file
9f479b52364a Add a bunch more options I forgot earlier (!)
David A. Holland
parents: 122
diff changeset
165 Send dependency output to the named file instead of the default
9f479b52364a Add a bunch more options I forgot earlier (!)
David A. Holland
parents: 122
diff changeset
166 location.
9f479b52364a Add a bunch more options I forgot earlier (!)
David A. Holland
parents: 122
diff changeset
167 Not implemented.
110
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
168 .It Fl MG
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
169 When generating dependency information, assume that missing files are
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
170 generated instead of failing.
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
171 Not implemented.
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
172 .It Fl MP
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
173 Issue dummy rules for all include files.
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
174 This prevents
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
175 .Xr make 1
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
176 from choking if an include file is removed.
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
177 Not implemented.
123
9f479b52364a Add a bunch more options I forgot earlier (!)
David A. Holland
parents: 122
diff changeset
178 .It Fl MQ Ar target
9f479b52364a Add a bunch more options I forgot earlier (!)
David A. Holland
parents: 122
diff changeset
179 Same as
9f479b52364a Add a bunch more options I forgot earlier (!)
David A. Holland
parents: 122
diff changeset
180 .Fl MT
9f479b52364a Add a bunch more options I forgot earlier (!)
David A. Holland
parents: 122
diff changeset
181 except that any
9f479b52364a Add a bunch more options I forgot earlier (!)
David A. Holland
parents: 122
diff changeset
182 .Xr make 1
9f479b52364a Add a bunch more options I forgot earlier (!)
David A. Holland
parents: 122
diff changeset
183 metacharacters appearing in the target are escaped.
9f479b52364a Add a bunch more options I forgot earlier (!)
David A. Holland
parents: 122
diff changeset
184 .It Fl MT Ar target
9f479b52364a Add a bunch more options I forgot earlier (!)
David A. Holland
parents: 122
diff changeset
185 Set the name of the
9f479b52364a Add a bunch more options I forgot earlier (!)
David A. Holland
parents: 122
diff changeset
186 .Xr make 1
9f479b52364a Add a bunch more options I forgot earlier (!)
David A. Holland
parents: 122
diff changeset
187 target appearing in the generated dependency information.
9f479b52364a Add a bunch more options I forgot earlier (!)
David A. Holland
parents: 122
diff changeset
188 The default is the name of the input file with its suffix replaced
9f479b52364a Add a bunch more options I forgot earlier (!)
David A. Holland
parents: 122
diff changeset
189 with the suffix for object files, normally
9f479b52364a Add a bunch more options I forgot earlier (!)
David A. Holland
parents: 122
diff changeset
190 .Pa .o .
9f479b52364a Add a bunch more options I forgot earlier (!)
David A. Holland
parents: 122
diff changeset
191 .\" If this option is given more than once, all named targets will
9f479b52364a Add a bunch more options I forgot earlier (!)
David A. Holland
parents: 122
diff changeset
192 .\" be emitted.
9f479b52364a Add a bunch more options I forgot earlier (!)
David A. Holland
parents: 122
diff changeset
193 .\" (The current operating mode framework doesn't support that.)
9f479b52364a Add a bunch more options I forgot earlier (!)
David A. Holland
parents: 122
diff changeset
194 .El
9f479b52364a Add a bunch more options I forgot earlier (!)
David A. Holland
parents: 122
diff changeset
195 .Ss More Include Path Options
9f479b52364a Add a bunch more options I forgot earlier (!)
David A. Holland
parents: 122
diff changeset
196 .Bl -tag -width bubblebabble
9f479b52364a Add a bunch more options I forgot earlier (!)
David A. Holland
parents: 122
diff changeset
197 .It Fl idirafter Ar path
9f479b52364a Add a bunch more options I forgot earlier (!)
David A. Holland
parents: 122
diff changeset
198 Add the specified path to the
9f479b52364a Add a bunch more options I forgot earlier (!)
David A. Holland
parents: 122
diff changeset
199 .Dq afterwards
9f479b52364a Add a bunch more options I forgot earlier (!)
David A. Holland
parents: 122
diff changeset
200 include path.
9f479b52364a Add a bunch more options I forgot earlier (!)
David A. Holland
parents: 122
diff changeset
201 This path is searched after all directories specified with
9f479b52364a Add a bunch more options I forgot earlier (!)
David A. Holland
parents: 122
diff changeset
202 .Fl I
9f479b52364a Add a bunch more options I forgot earlier (!)
David A. Holland
parents: 122
diff changeset
203 and the standard system directories.
9f479b52364a Add a bunch more options I forgot earlier (!)
David A. Holland
parents: 122
diff changeset
204 Directories on this path are treated as containing system include
9f479b52364a Add a bunch more options I forgot earlier (!)
David A. Holland
parents: 122
diff changeset
205 files.
9f479b52364a Add a bunch more options I forgot earlier (!)
David A. Holland
parents: 122
diff changeset
206 .It Fl imacros Ar file
9f479b52364a Add a bunch more options I forgot earlier (!)
David A. Holland
parents: 122
diff changeset
207 Read in
9f479b52364a Add a bunch more options I forgot earlier (!)
David A. Holland
parents: 122
diff changeset
208 .Ar file
9f479b52364a Add a bunch more options I forgot earlier (!)
David A. Holland
parents: 122
diff changeset
209 prior to reading the main input file, and preprocess it, but throw
9f479b52364a Add a bunch more options I forgot earlier (!)
David A. Holland
parents: 122
diff changeset
210 away the output and retain only the macro definitions.
9f479b52364a Add a bunch more options I forgot earlier (!)
David A. Holland
parents: 122
diff changeset
211 .It Fl include Ar file
9f479b52364a Add a bunch more options I forgot earlier (!)
David A. Holland
parents: 122
diff changeset
212 Read in and preprocess
9f479b52364a Add a bunch more options I forgot earlier (!)
David A. Holland
parents: 122
diff changeset
213 .Ar file
9f479b52364a Add a bunch more options I forgot earlier (!)
David A. Holland
parents: 122
diff changeset
214 prior to reading the main input file.
9f479b52364a Add a bunch more options I forgot earlier (!)
David A. Holland
parents: 122
diff changeset
215 .It Fl iprefix Ar prefix
9f479b52364a Add a bunch more options I forgot earlier (!)
David A. Holland
parents: 122
diff changeset
216 Set the path prefix used with the
9f479b52364a Add a bunch more options I forgot earlier (!)
David A. Holland
parents: 122
diff changeset
217 .Fl iwithprefix
9f479b52364a Add a bunch more options I forgot earlier (!)
David A. Holland
parents: 122
diff changeset
218 option.
9f479b52364a Add a bunch more options I forgot earlier (!)
David A. Holland
parents: 122
diff changeset
219 .It Fl iquote Ar path
9f479b52364a Add a bunch more options I forgot earlier (!)
David A. Holland
parents: 122
diff changeset
220 Add
9f479b52364a Add a bunch more options I forgot earlier (!)
David A. Holland
parents: 122
diff changeset
221 .Ar path
9f479b52364a Add a bunch more options I forgot earlier (!)
David A. Holland
parents: 122
diff changeset
222 to the list of directories searched for include directives written
9f479b52364a Add a bunch more options I forgot earlier (!)
David A. Holland
parents: 122
diff changeset
223 with quotes.
9f479b52364a Add a bunch more options I forgot earlier (!)
David A. Holland
parents: 122
diff changeset
224 This list is not searched for include directives written with angle
9f479b52364a Add a bunch more options I forgot earlier (!)
David A. Holland
parents: 122
diff changeset
225 brackets.
9f479b52364a Add a bunch more options I forgot earlier (!)
David A. Holland
parents: 122
diff changeset
226 .It Fl iremap Ar string:replacement
9f479b52364a Add a bunch more options I forgot earlier (!)
David A. Holland
parents: 122
diff changeset
227 Substitute
9f479b52364a Add a bunch more options I forgot earlier (!)
David A. Holland
parents: 122
diff changeset
228 .Ar replacement
9f479b52364a Add a bunch more options I forgot earlier (!)
David A. Holland
parents: 122
diff changeset
229 for
9f479b52364a Add a bunch more options I forgot earlier (!)
David A. Holland
parents: 122
diff changeset
230 .Ar string
9f479b52364a Add a bunch more options I forgot earlier (!)
David A. Holland
parents: 122
diff changeset
231 in the
9f479b52364a Add a bunch more options I forgot earlier (!)
David A. Holland
parents: 122
diff changeset
232 .Dv __FILE__
9f479b52364a Add a bunch more options I forgot earlier (!)
David A. Holland
parents: 122
diff changeset
233 built-in macro.
9f479b52364a Add a bunch more options I forgot earlier (!)
David A. Holland
parents: 122
diff changeset
234 Not supported.
9f479b52364a Add a bunch more options I forgot earlier (!)
David A. Holland
parents: 122
diff changeset
235 .It Fl isysroot Ar path
9f479b52364a Add a bunch more options I forgot earlier (!)
David A. Holland
parents: 122
diff changeset
236 Use
9f479b52364a Add a bunch more options I forgot earlier (!)
David A. Holland
parents: 122
diff changeset
237 .Ar path
9f479b52364a Add a bunch more options I forgot earlier (!)
David A. Holland
parents: 122
diff changeset
238 as the
9f479b52364a Add a bunch more options I forgot earlier (!)
David A. Holland
parents: 122
diff changeset
239 .Dq system root ,
9f479b52364a Add a bunch more options I forgot earlier (!)
David A. Holland
parents: 122
diff changeset
240 that is, the directory under which the standard system paths are found.
9f479b52364a Add a bunch more options I forgot earlier (!)
David A. Holland
parents: 122
diff changeset
241 .It Fl isystem Ar path
9f479b52364a Add a bunch more options I forgot earlier (!)
David A. Holland
parents: 122
diff changeset
242 Add
9f479b52364a Add a bunch more options I forgot earlier (!)
David A. Holland
parents: 122
diff changeset
243 .Ar path
9f479b52364a Add a bunch more options I forgot earlier (!)
David A. Holland
parents: 122
diff changeset
244 to the list of system include directories.
9f479b52364a Add a bunch more options I forgot earlier (!)
David A. Holland
parents: 122
diff changeset
245 This list is searched after the list given with
9f479b52364a Add a bunch more options I forgot earlier (!)
David A. Holland
parents: 122
diff changeset
246 .Ar I .
9f479b52364a Add a bunch more options I forgot earlier (!)
David A. Holland
parents: 122
diff changeset
247 Files found on this path are treated as system headers.
9f479b52364a Add a bunch more options I forgot earlier (!)
David A. Holland
parents: 122
diff changeset
248 .It Fl iwithprefix Ar dir
9f479b52364a Add a bunch more options I forgot earlier (!)
David A. Holland
parents: 122
diff changeset
249 Splice
9f479b52364a Add a bunch more options I forgot earlier (!)
David A. Holland
parents: 122
diff changeset
250 .Ar dir
9f479b52364a Add a bunch more options I forgot earlier (!)
David A. Holland
parents: 122
diff changeset
251 onto the prefix given with
9f479b52364a Add a bunch more options I forgot earlier (!)
David A. Holland
parents: 122
diff changeset
252 .Fl iprefix
9f479b52364a Add a bunch more options I forgot earlier (!)
David A. Holland
parents: 122
diff changeset
253 and add this directory as if it were specified with
9f479b52364a Add a bunch more options I forgot earlier (!)
David A. Holland
parents: 122
diff changeset
254 .Fl idirafter .
9f479b52364a Add a bunch more options I forgot earlier (!)
David A. Holland
parents: 122
diff changeset
255 .It Fl iwithprefixbefore
9f479b52364a Add a bunch more options I forgot earlier (!)
David A. Holland
parents: 122
diff changeset
256 Like
9f479b52364a Add a bunch more options I forgot earlier (!)
David A. Holland
parents: 122
diff changeset
257 -Fl iwithprefix
9f479b52364a Add a bunch more options I forgot earlier (!)
David A. Holland
parents: 122
diff changeset
258 but adds the result as if it were specified with
9f479b52364a Add a bunch more options I forgot earlier (!)
David A. Holland
parents: 122
diff changeset
259 .Fl I .
110
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
260 .El
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
261 .Ss Diagnostic Options
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
262 .Bl -tag -width bubblebabble
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
263 .It Fl dD
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
264 Dump all macro definitions, except for the predefined macros, after
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
265 the normal preprocessing output.
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
266 Not implemented.
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
267 .It Fl dI
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
268 Dump all include directives along with the normal preprocessing
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
269 output.
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
270 Not implemented.
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
271 .It Fl dM
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
272 Dump all macro definitions instead of the normal preprocessing
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
273 output.
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
274 Not implemented.
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
275 .It Fl dN
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
276 Like
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
277 .Fl dD
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
278 but emits only macro names and not the expansions.
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
279 Not implemented.
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
280 .It Fl H
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
281 Output a trace of the include tree as it gets processed.
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
282 Not implemented.
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
283 .El
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
284 .Ss Other Options
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
285 .Bl -tag -width bubblebabble
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
286 .It Fl CC
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
287 Retain comments in output.
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
288 Same as
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
289 .Fl C ,
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
290 accepted for compatibility with
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
291 .Xr gcc 1 .
121
103acee239e0 Man page fixes from wiz@.
David A. Holland
parents: 110
diff changeset
292 .It Fl fdollars-in-identifiers , Fl fno-dollars-in-identifiers
110
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
293 Enable
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
294 .Pq or disable, respectively
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
295 the use of the dollar sign in identifiers.
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
296 Not implemented.
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
297 .It Fl ftabstop=num
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
298 Set the tab width to the specified value, for reporting column
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
299 positions in diagnostics.
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
300 The default is 8.
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
301 Not implemented.
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
302 .It Fl std=standard
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
303 Ask
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
304 .Nm
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
305 to conform to the named standard.
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
306 The default, and the only supported value, is
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
307 .Dq krc .
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
308 .It Fl traditional
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
309 This option is accepted for compatibility with
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
310 .Xr gcc 1
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
311 and ignored.
123
9f479b52364a Add a bunch more options I forgot earlier (!)
David A. Holland
parents: 122
diff changeset
312 .It Fl x Ar lang
9f479b52364a Add a bunch more options I forgot earlier (!)
David A. Holland
parents: 122
diff changeset
313 Adjust the preprocessor for the given language.
9f479b52364a Add a bunch more options I forgot earlier (!)
David A. Holland
parents: 122
diff changeset
314 The only values accepted for
9f479b52364a Add a bunch more options I forgot earlier (!)
David A. Holland
parents: 122
diff changeset
315 .Ar lang
9f479b52364a Add a bunch more options I forgot earlier (!)
David A. Holland
parents: 122
diff changeset
316 are
9f479b52364a Add a bunch more options I forgot earlier (!)
David A. Holland
parents: 122
diff changeset
317 .Dq assembler-with-cpp
9f479b52364a Add a bunch more options I forgot earlier (!)
David A. Holland
parents: 122
diff changeset
318 and
9f479b52364a Add a bunch more options I forgot earlier (!)
David A. Holland
parents: 122
diff changeset
319 .Dq c ,
9f479b52364a Add a bunch more options I forgot earlier (!)
David A. Holland
parents: 122
diff changeset
320 neither of which have any effect on the behavior of
9f479b52364a Add a bunch more options I forgot earlier (!)
David A. Holland
parents: 122
diff changeset
321 .Nm .
110
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
322 .El
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
323 .Sh FILES
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
324 The default list of directories searched for include files is:
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
325 .Bl -item -offset indent -compact
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
326 .It
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
327 .Pa /usr/local/include
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
328 .It
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
329 .Pa /usr/include
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
330 .El
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
331 .Sh SEE ALSO
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
332 .Xr cc 1 ,
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
333 .Xr cpp 1 ,
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
334 .Xr make 1
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
335 .Sh STANDARDS
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
336 None.
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
337 The whole point of a traditional cpp is that it reflects practices
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
338 in pre-standardization implementations of C.
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
339 Some information is available from the first edition of Kernighan and
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
340 Ritchie.
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
341 Much of the rest of the behavior is based on lore, pragmatism,
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
342 material encountered in the wild, and comparison to other
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
343 implementations.
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
344 .Sh HISTORY
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
345 The original version of
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
346 .Nm
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
347 was written one evening in late 2010.
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
348 This version had some problems and was put aside.
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
349 The first working version was released in June 2013.
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
350 .\" .Sh AUTHORS
121
103acee239e0 Man page fixes from wiz@.
David A. Holland
parents: 110
diff changeset
351 .\" .An David A. Holland
110
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
352 .Sh BUGS
b2f2f30194b8 Add a man page.
David A. Holland
parents:
diff changeset
353 Probably plenty.