Mercurial > ~dholland > hg > tradcpp > index.cgi
annotate tradcpp.1 @ 122:64c4de3709de
Complain if -[DIU] is given an empty argument.
(Like many compilers over the years, we don't accept the argument
appearing in the next argv word.)
Warn about this in the man page too.
author | David A. Holland |
---|---|
date | Tue, 11 Jun 2013 18:32:41 -0400 |
parents | 103acee239e0 |
children | 9f479b52364a |
rev | line source |
---|---|
110 | 1 .\" |
2 .\" Copyright (c) 2013 The NetBSD Foundation, Inc. | |
3 .\" All rights reserved. | |
4 .\" | |
5 .\" This code is derived from software contributed to The NetBSD Foundation | |
6 .\" by David A. Holland. | |
7 .\" | |
8 .\" Redistribution and use in source and binary forms, with or without | |
9 .\" modification, are permitted provided that the following conditions | |
10 .\" are met: | |
11 .\" 1. Redistributions of source code must retain the above copyright | |
12 .\" notice, this list of conditions and the following disclaimer. | |
13 .\" 2. Redistributions in binary form must reproduce the above copyright | |
14 .\" notice, this list of conditions and the following disclaimer in the | |
15 .\" documentation and/or other materials provided with the distribution. | |
16 .\" | |
17 .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS | |
18 .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | |
19 .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
20 .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | |
21 .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
22 .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
23 .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
24 .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
25 .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
26 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
27 .\" POSSIBILITY OF SUCH DAMAGE. | |
28 .\" | |
29 .Dd June 11, 2013 | |
30 .Dt TRADCPP 1 | |
31 .Os | |
32 .Sh NAME | |
33 .Nm tradcpp | |
34 .Nd traditional (K&R-style) C macro preprocessor | |
35 .Sh SYNOPSIS | |
36 .Nm tradcpp | |
37 .Op Fl options | |
121 | 38 .Op Ar input-file Op Ar output-file |
110 | 39 .Sh DESCRIPTION |
40 The | |
41 .Nm | |
42 command provides a traditional K&R-style C macro preprocessor. | |
43 It is intended to be suitable for historical Unix uses of the | |
44 preprocessor, such as | |
45 .Xr imake 1 , | |
46 particularly those that depend on preservation of whitespace. | |
47 .Pp | |
48 The chief ways in which traditional cpp differs from | |
49 Standard C are: | |
50 .Bl -bullet -offset indent | |
51 .It | |
52 Macro arguments are expanded within quoted strings. | |
53 There is no stringize operator. | |
54 .It | |
55 There is no token pasting operator; tokens can be concatenated by | |
56 placing comments between them. | |
57 This process is also not limited to valid C language tokens. | |
58 .It | |
59 Whitespace is preserved, and in particular tabs are not expanded into | |
60 spaces. | |
61 Furthermore, additional whitespace is not injected. | |
62 .El | |
63 .Sh OPTIONS | |
64 .Nm | |
65 has many options, many of which are defined for compatibility with | |
66 .Xr gcc 1 | |
67 or other compilers. | |
68 Many of the options are not yet implemented. | |
69 .\" The option lists have been sorted in what I hope is a sensible | |
121 | 70 .\" order. Please don't arbitrarily alphabetize them. |
110 | 71 .Ss Common Options |
72 .Bl -tag -width bubblebabble | |
73 .It Fl C | |
74 Retain comments in output. | |
75 .It Fl Dmacro[=expansion] | |
76 Provide a definition for the named macro. | |
77 If no expansion is provided, the value | |
78 .Dq 1 | |
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 | 85 .It Fl Ipath |
110 | 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 | 92 .It Fl nostdinc |
93 Do not search the standard system include directories. | |
94 .It Fl P | |
95 Suppress line number information in the output. | |
96 Currently line number information is not generated at all and this | |
97 option has no effect. | |
98 .It Fl Umacro | |
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 | 105 .It Fl undef |
106 Remove all predefined macros. | |
107 .El | |
108 .Ss Warning Options | |
109 Warning options can be disabled or enabled by inserting, or not, the | |
110 string | |
111 .Dq no- | |
112 between the | |
113 .Dq W | |
114 and the warning name. | |
115 Herein the | |
116 .Dq Fl Wno- | |
117 form is shown for options that are enabled by default. | |
118 .Bl -tag -width bubblebabble | |
119 .It Fl Wall | |
120 Turn on all warnings. | |
121 The option | |
122 .Fl Wno-all | |
123 disables only the warnings that are disabled by default. | |
124 .It Fl w | |
125 Turn off all warnings. | |
126 .It Fl Werror | |
127 Make warnings into fatal errors. | |
128 .It Fl Wcomment | |
129 Warn about nested comments. | |
130 .It Fl Wno-endif-labels | |
131 Don't warn about symbols attached to #endif directives. | |
132 (The warning is currently not implemented.) | |
133 .It Fl Wundef | |
134 Warn about undefined symbols appearing in #if and #elif expressions. | |
135 .It Fl Wunused-macros | |
136 Warn about macros that are defined and never used. | |
137 Not implemented. | |
138 .El | |
139 .Ss Depend Options | |
140 .Bl -tag -width bubblebabble | |
141 .It Fl M | |
142 Generate dependency information for | |
143 .Xr make 1 | |
144 on the standard output, instead of preprocessing. | |
145 Not implemented. | |
146 .It Fl MD | |
147 Like | |
148 .Fl M | |
149 but skip system headers. | |
150 Not implemented. | |
151 .It Fl MM | |
152 Like | |
153 .Fl M | |
154 but write the dependency information to a file named after the input | |
155 file with extension | |
156 .Pa \.d | |
157 and preprocess normally to standard output. | |
158 Not implemented. | |
159 .It Fl MMD | |
160 Like | |
161 .Fl MM | |
162 but skip system headers. | |
163 Not implemented. | |
164 .It Fl MG | |
165 When generating dependency information, assume that missing files are | |
166 generated instead of failing. | |
167 Not implemented. | |
168 .It Fl MP | |
169 Issue dummy rules for all include files. | |
170 This prevents | |
171 .Xr make 1 | |
172 from choking if an include file is removed. | |
173 Not implemented. | |
174 .El | |
175 .Ss Diagnostic Options | |
176 .Bl -tag -width bubblebabble | |
177 .It Fl dD | |
178 Dump all macro definitions, except for the predefined macros, after | |
179 the normal preprocessing output. | |
180 Not implemented. | |
181 .It Fl dI | |
182 Dump all include directives along with the normal preprocessing | |
183 output. | |
184 Not implemented. | |
185 .It Fl dM | |
186 Dump all macro definitions instead of the normal preprocessing | |
187 output. | |
188 Not implemented. | |
189 .It Fl dN | |
190 Like | |
191 .Fl dD | |
192 but emits only macro names and not the expansions. | |
193 Not implemented. | |
194 .It Fl H | |
195 Output a trace of the include tree as it gets processed. | |
196 Not implemented. | |
197 .El | |
198 .Ss Other Options | |
199 .Bl -tag -width bubblebabble | |
200 .It Fl CC | |
201 Retain comments in output. | |
202 Same as | |
203 .Fl C , | |
204 accepted for compatibility with | |
205 .Xr gcc 1 . | |
121 | 206 .It Fl fdollars-in-identifiers , Fl fno-dollars-in-identifiers |
110 | 207 Enable |
208 .Pq or disable, respectively | |
209 the use of the dollar sign in identifiers. | |
210 Not implemented. | |
211 .It Fl ftabstop=num | |
212 Set the tab width to the specified value, for reporting column | |
213 positions in diagnostics. | |
214 The default is 8. | |
215 Not implemented. | |
216 .It Fl std=standard | |
217 Ask | |
218 .Nm | |
219 to conform to the named standard. | |
220 The default, and the only supported value, is | |
221 .Dq krc . | |
222 .It Fl traditional | |
223 This option is accepted for compatibility with | |
224 .Xr gcc 1 | |
225 and ignored. | |
226 .El | |
227 .Sh FILES | |
228 The default list of directories searched for include files is: | |
229 .Bl -item -offset indent -compact | |
230 .It | |
231 .Pa /usr/local/include | |
232 .It | |
233 .Pa /usr/include | |
234 .El | |
235 .Sh SEE ALSO | |
236 .Xr cc 1 , | |
237 .Xr cpp 1 , | |
238 .Xr make 1 | |
239 .Sh STANDARDS | |
240 None. | |
241 The whole point of a traditional cpp is that it reflects practices | |
242 in pre-standardization implementations of C. | |
243 Some information is available from the first edition of Kernighan and | |
244 Ritchie. | |
245 Much of the rest of the behavior is based on lore, pragmatism, | |
246 material encountered in the wild, and comparison to other | |
247 implementations. | |
248 .Sh HISTORY | |
249 The original version of | |
250 .Nm | |
251 was written one evening in late 2010. | |
252 This version had some problems and was put aside. | |
253 The first working version was released in June 2013. | |
254 .\" .Sh AUTHORS | |
121 | 255 .\" .An David A. Holland |
110 | 256 .Sh BUGS |
257 Probably plenty. |