source: mainline/uspace/app/pcc/cc/cpp/cpp.1@ 7ab6fc2

lfn serial ticket/834-toolchain-update topic/msim-upgrade topic/simplify-dev-export
Last change on this file since 7ab6fc2 was a7de7182, checked in by Jiří Zárevúcky <zarevucky.jiri@…>, 14 years ago

Added pcc source tree (contents of pcc-1.0.0.tgz)

  • Property mode set to 100644
File size: 5.0 KB
Line 
1.\" $Id: cpp.1,v 1.11 2010/04/05 13:13:57 reed Exp $
2.\" $NetBSD$
3.\" $OpenBSD$
4.\"
5.\" Copyright (c) 2007 Jeremy C. Reed <reed@reedmedia.net>
6.\"
7.\" Permission to use, copy, modify, and/or distribute this software for any
8.\" purpose with or without fee is hereby granted, provided that the above
9.\" copyright notice and this permission notice appear in all copies.
10.\"
11.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR AND CONTRIBUTORS DISCLAIM
12.\" ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
13.\" WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL AUTHOR AND
14.\" CONTRIBUTORS BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
15.\" DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
16.\" PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
17.\" ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
18.\" THIS SOFTWARE.
19.\"
20.Dd September 17, 2007
21.Dt CPP 1
22.Os
23.Sh NAME
24.Nm cpp
25.Nd C preprocessor
26.Sh SYNOPSIS
27.Nm
28.\" TODO also document -Dvar and below without spaces?
29.Op Fl CdMtVv
30.Op Fl D Ar macro[=value]
31.Op Fl I Ar path
32.Op Fl i Ar file
33.Op Fl S Ar path
34.Op Fl U Ar macro
35.Op Ar infile | -
36.Op Ar outfile
37.Sh DESCRIPTION
38The
39.Nm
40utility is a macro preprocessor used by the
41.Xr pcc 1
42compiler.
43It is used to include header files,
44expand macro definitions,
45and perform conditional compilation.
46.Pp
47The
48.Ar infile
49input file is optional.
50If not provided or the file name is
51.Qq -
52(dash),
53.Nm
54reads its initial file from standard input.
55The
56.Ar outfile
57output file is also optional.
58It writes by default to standard output.
59.Pp
60.\" TODO: document MAXARG 250 args to a macro, limited by char value
61.\" TODO: Include order:
62.\" For "..." files, first search "current" dir, then as <...> files.
63.\" For <...> files, first search -I directories, then system directories.
64.\"
65The options are as follows:
66.Bl -tag -width Ds
67.It Fl ?
68Show command line usage for
69.Nm .
70.It Fl C
71Do not discard comments.
72.It Fl D Ar macro[=value]
73Fake a definition at the beginning by using
74.Do #define
75.Ar macro=value Dc .
76If
77.Ar value
78is not set on command-line, then define it as 1.
79.\" TODO: show example
80.It Fl dM
81Print list of
82.Dq #define
83statements to standard output for all defined macros other than
84builtin macros (see below).
85The normal results of preprocessing are not output.
86.\" TODO this doesn't show predefined macros
87.\" other -d options are ignored
88.It Fl I Ar path
89Add
90.Ar path
91to the list of directories containing needed header files.
92This may be used to override system include directories
93(see
94.Fl S
95option).
96.Fl I
97may be specified multiple times.
98.It Fl i Ar file
99Include a file at the beginning by using
100.Do #include
101.Ar file Dc .
102.\" Note: I did not use the .In macro above
103.It Fl M
104Generate dependencies for
105.Xr make 1 .
106.\" TODO: explain and show example?
107.It Fl P
108Inhibit generation of line markers. This is sometimes useful when
109running the preprocessor on something other than C code.
110.It Fl S Ar path
111Add
112.Ar path
113to the list of system directories containing needed header files.
114The
115.Fl S
116option may be specified multiple times.
117Note:
118.Nm
119does not have a default include directory defined.
120.\" TODO: explain difference between -I and -S
121.\" The directories listed by -I are searched first?
122.It Fl t
123Traditional cpp syntax.
124Do not define the
125.Dv __TIME__ ,
126.Dv __DATE__ ,
127.Dv __STDC__ ,
128and
129.Dv __STDC_VERSION__
130macros.
131.\"
132.It Fl U Ar macro
133Undefine a macro at the beginning by using
134.Do #undef
135.Ar macro Dc .
136.It Fl V
137Verbose debugging output.
138.Fl V
139can be repeated for further details.
140.\" -V only available if cpp source built with CPP_DEBUG, which is the default.
141.It Fl v
142Display version.
143.El
144.Ss Builtin Macros
145A few macros are interpreted inside the
146.Nm cpp
147program:
148.Bl -diag
149.It __DATE__
150Expands to the date in abbreviated month, day, and year format from
151.Xr ctime 3
152in quotes.
153.\" TODO: is that ctime(3) format output change according to locale?
154.It __FILE__
155Expands to the name of the current input file in quotes.
156When read from standard input, it expands to
157.Qq Aq stdin .
158.It __LINE__
159Expands to the line number of the current line containing the macro.
160.It __STDC__
161Expands to the constant 1.
162This means the compiler conforms to
163.St -isoC
164.Po also known as
165.Do C90 Dc Pc .
166.It __STDC_VERSION__
167Expands to
168.Dq 199901L
169which indicates that
170.Nm
171supports
172.St -isoC-99
173.Po commonly referred to as
174.Do C99 Dc Pc .
175.It __TIME__
176Expands to the time in hour, minutes, and seconds from
177.Xr ctime 3
178in quotes.
179.El
180.Pp
181Also see the
182.Fl t
183option.
184.Sh EXIT STATUS
185The
186.Nm
187utility exits with one of the following values:
188.Bl -tag -width Ds
189.It 0
190Successfully finished.
191.It 1
192An error occurred.
193.El
194.Sh SEE ALSO
195.Xr as 1 ,
196.Xr ccom 1 ,
197.Xr pcc 1
198.\"
199.Sh HISTORY
200The
201.Nm
202command comes from the original Portable C Compiler by S. C. Johnson,
203written in the late 70's.
204The code originates from the V6 preprocessor with some additions
205from V7 cpp and ansi/c99 support.
206.Pp
207A lot of the PCC code was rewritten by Anders Magnusson.
208.Pp
209This product includes software developed or owned by Caldera
210International, Inc.
Note: See TracBrowser for help on using the repository browser.