Quick Search:

Mode

Context

Displaying the whole file. None | Less | More | Full

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.15
 
1.16
 
MAIN:plunky:20121108111403
 
cpp.1
_>11 .\"     $Id$
 22 .\"
 33 .\" Copyright (c) 2007 Jeremy C. Reed <reed@reedmedia.net>
 44 .\"
 55 .\" Permission to use, copy, modify, and/or distribute this software for any
 66 .\" purpose with or without fee is hereby granted, provided that the above
 77 .\" copyright notice and this permission notice appear in all copies.
 88 .\"
 99 .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR AND CONTRIBUTORS DISCLAIM
 1010 .\" ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
 1111 .\" WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL AUTHOR AND
 1212 .\" CONTRIBUTORS BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
 1313 .\" DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
 1414 .\" PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
 1515 .\" ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
 1616 .\" THIS SOFTWARE.
 1717 .\"
<>18 -.Dd August 31, 2011
  18+.Dd November 8, 2012
1919 .Dt CPP 1
 2020 .Os
 2121 .Sh NAME
 2222 .Nm cpp
 2323 .Nd C preprocessor
 2424 .Sh SYNOPSIS
 2525 .Nm
<>26 -.Op Fl CMPtVv
  26+.Op Fl CEMPtVv
2727 .Op Fl D Ar macro Ns Oo = Ns Ar value Oc
 2828 .Op Fl d Ar flags
 2929 .Op Fl I Ar path
 3030 .Op Fl i Ar file
 3131 .Op Fl S Ar path
 3232 .Op Fl U Ar macro
 3333 .Op Ar infile | -
 3434 .Op Ar outfile
 3535 .Sh DESCRIPTION
 3636 The
 3737 .Nm
 3838 utility is a macro preprocessor used by the
 3939 .Xr pcc 1
 4040 compiler.
 4141 It is mainly used to include header files,
 4242 expand macro definitions,
 4343 discard comments,
 4444 and perform conditional compilation.
 4545 .Nm
 4646 is written to comply with the
 4747 .St -isoC-99
 4848 specification.
 4949 .Pp
 5050 The
 5151 .Ar infile
 5252 input file is optional.
 5353 If not provided or the file name is
 5454 .Qq -
 5555 (dash),
 5656 .Nm
 5757 reads its initial file from standard input.
 5858 The
 5959 .Ar outfile
 6060 output file is also optional, with output written to standard
 6161 output if not provided.
 6262 .Pp
 6363 The options are as follows:
 6464 .Bl -tag -width Ds
 6565 .It Fl C
 6666 Do not discard comments.
 6767 .It Fl D Ar macro Ns Oo = Ns Ar value Oc
 6868 Create a macro definition before processing any input, as if a
 6969 .Lp
 7070 .Dl #define Ar macro Ar value
 7171 .Lp
 7272 directive had appeared in the source.
 7373 If
 7474 .Ar value
 7575 is not set on the command-line, then a value of 1 is used.
 7676 .It Fl d Ar flags
 7777 Modify output according to
 7878 .Ar flags ,
 7979 which can be a list of character flags.
 8080 The following flags are currently supported:
 8181 .Bl -tag -width ".Sy M"
 8282 .It Sy M
 8383 Do not process any input, but output a list of
 8484 .Dq #define
 8585 statements for all defined macros other than builtin macros
 8686 .Pq see below .
 8787 .El
 8888 .Lp
 8989 any unknown flags are ignored.
<> 90+.It Fl E
  91+Modify the exit code, if there were any warnings.
9092 .It Fl I Ar path
 9193 Add
 9294 .Ar path
 9395 to the list of directories searched by the
 9496 .Dq #include
 9597 directive.
 9698 This may be used to override system include directories
 9799 .Pq see Fl S No option .
 98100 .Fl I
 99101 may be specified multiple times and is cumulative.
 100102 .It Fl i Ar file
 101103 Include a file before processing any input, as if a
 102104 .Lp
 103105 .Dl #include Qo Ar file Qc
 104106 .Lp
 105107 directive had appeared in the source.
 106108 .Fl i
 107109 may be specified multiple times to include several files.
 108110 .It Fl M
 109111 Instead of producing a processed C code file, output a list
 110112 of dependencies for
 111113 .Xr make 1 ,
 112114 detailing the files that need to be processed when compiling
 113115 the input.
 114116 .It Fl P
 115117 Inhibit generation of line markers.  This is sometimes useful when
 116118 running the preprocessor on something other than C code.
 117119 .It Fl S Ar path
 118120 Add
 119121 .Ar path
 120122 to the list of system directories searched by the
 121123 .Dq #include
 122124 directive.
 123125 The
 124126 .Fl S
 125127 option may be specified multiple times and is cumulative.
 126128 .It Fl t
 127129 Traditional cpp syntax.
 128130 Do not define the
 129131 .Dv __TIME__ ,
 130132 .Dv __DATE__ ,
 131133 .Dv __STDC__ ,
 132134 and
 133135 .Dv __STDC_VERSION__
 134136 macros.
 135137 .It Fl U Ar macro
 136138 Undefine a macro before processing any input, as if a
 137139 .Lp
 138140 .Dl #undef Ar macro
 139141 .Lp
 140142 directive had appeared in the source.
 141143 .It Fl V
 142144 Verbose debugging output.
 143145 .Fl V
 144146 can be repeated for greater detail.
 145147 .Po
 146148 This is only available if the
 147149 .Nm
 148150 program was built with
 149151 .Dv PCC_DEBUG
 150152 defined, which is the default
 151153 .Pc .
 152154 .It Fl v
 153155 Display version.
 154156 .El
 155157 .Pp
 156158 The
 157159 .Fl D ,
 158160 .Fl i
 159161 and
 160162 .Fl U
 161163 options are processed in the order that they appear on the command
 162164 line, before any input is read but after the command line options
 163165 have been scanned.
 164166 .Pp
 165167 Files referenced by the
 166168 .Dq #include
 167169 directive as
 168170 .Qq ... ,
 169171 are first looked for in the current directory, then as per
 170172 .Aq ...
 171173 files, which are first looked for in the list of
 172174 directories provided by any
 173175 .Fl I
 174176 options, then in the list of system directories provided by any
 175177 .Fl S
 176178 options.
 177179 Note that
 178180 .Nm
 179181 does not define any include directories by default; if no
 180182 .Fl I
 181183 or
 182184 .Fl S
 183185 options are given, then only the current directory will be
 184186 searched and no system files will be found.
 185187 .Ss Builtin Macros
 186188 A few macros are interpreted inside the
 187189 .Nm cpp
 188190 program:
 189191 .Bl -diag
 190192 .It __DATE__
 191193 Expands to a quoted string literal containing the date in the form
 192194 .Qq Mmm dd yyyy ,
 193195 where the names of the months are the same as those generated by the
 194196 .Xr asctime 3
 195197 function, and the first character of dd is a space character if
 196198 the value is less than 10.
 197199 .It __FILE__
 198200 Expands to a quoted string literal containing the presumed name of
 199201 the current source file.
 200202 When reading source from standard input, it expands to
 201203 .Qq Aq stdin .
 202204 .It __LINE__
 203205 Expands to an integer constant representing the presumed line number
 204206 of the source line containing the macro.
 205207 .It __STDC__
 206208 Expands to the integer constant
 207209 .Dq 1 ,
 208210 meaning that the compiler conforms to
 209211 .St -isoC .
 210212 .It __STDC_VERSION__
 211213 Expands to the integer constant
 212214 .Dq 199901L ,
 213215 indicating that
 214216 .Nm
 215217 conforms to
 216218 .St -isoC-99 .
 217219 .It __TIME__
 218220 Expands to a quoted string literal containing the time in the form
 219221 .Qq hh:mm:ss
 220222 as generated by the
 221223 .Xr asctime 3
 222224 function.
 223225 .El
 224226 .Pp
 225227 Also see the
 226228 .Fl t
 227229 option.
 228230 .Sh EXIT STATUS
 229231 The
 230232 .Nm
 231233 utility exits with one of the following values:
<>232 -.Bl -tag -width Ds
  234+.Lp
  235+.Bl -tag -width Ds -offset indent -compact
233236 .It 0
 234237 Successfully finished.
 235238 .It 1
 236239 An error occurred.
<> 240+.It 2
  241+The
  242+.Fl E
  243+option was given, and warnings were issued.
<_237244 .El
 238245 .Sh SEE ALSO
 239246 .Xr as 1 ,
 240247 .Xr ccom 1 ,
 241248 .Xr make 1 ,
 242249 .Xr pcc 1 ,
 243250 .Xr asctime 3
 244251 .Sh HISTORY
 245252 The
 246253 .Nm
 247254 command comes from the original Portable C Compiler by
 248255 .An "S. C. Johnson" ,
 249256 written in the late 70's.
 250257 The code originates from the V6 preprocessor with some additions
 251258 from V7 cpp and ansi/c99 support.
 252259 .Pp
 253260 A lot of the PCC code was rewritten by
 254261 .An "Anders Magnusson" .
 255262 .Pp
 256263 This product includes software developed or owned by Caldera
 257264 International, Inc.
FishEye: Open Source License registered to PCC.
Atlassian FishEye, CVS analysis. (Version:1.6.3 Build:build-336 2008-11-04) - Administration - Page generated 2014-12-22 14:31 +0100