Quick Search:

Mode

Context

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

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.16
 
1.17
 
MAIN:plunky:20130226192738
 
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 November 8, 2012
  18+.Dd February 26, 2013
1919 .Dt CPP 1
 2020 .Os
 2121 .Sh NAME
 2222 .Nm cpp
 2323 .Nd C preprocessor
 2424 .Sh SYNOPSIS
 2525 .Nm
<>26 -.Op Fl CEMPtVv
  26+.Op Fl ACEMPtVv
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
<> 65+.It Fl A
  66+For assembler-with-cpp input: treat non-directive lines starting
  67+with a # as comments.
<_6568 .It Fl C
 6669 Do not discard comments.
 6770 .It Fl D Ar macro Ns Oo = Ns Ar value Oc
 6871 Create a macro definition before processing any input, as if a
 6972 .Lp
 7073 .Dl #define Ar macro Ar value
 7174 .Lp
 7275 directive had appeared in the source.
 7376 If
 7477 .Ar value
 7578 is not set on the command-line, then a value of 1 is used.
 7679 .It Fl d Ar flags
 7780 Modify output according to
 7881 .Ar flags ,
 7982 which can be a list of character flags.
 8083 The following flags are currently supported:
 8184 .Bl -tag -width ".Sy M"
 8285 .It Sy M
 8386 Do not process any input, but output a list of
 8487 .Dq #define
 8588 statements for all defined macros other than builtin macros
 8689 .Pq see below .
 8790 .El
 8891 .Lp
 8992 any unknown flags are ignored.
 9093 .It Fl E
 9194 Modify the exit code, if there were any warnings.
 9295 .It Fl I Ar path
 9396 Add
 9497 .Ar path
 9598 to the list of directories searched by the
 9699 .Dq #include
 97100 directive.
 98101 This may be used to override system include directories
 99102 .Pq see Fl S No option .
 100103 .Fl I
 101104 may be specified multiple times and is cumulative.
 102105 .It Fl i Ar file
 103106 Include a file before processing any input, as if a
 104107 .Lp
 105108 .Dl #include Qo Ar file Qc
 106109 .Lp
 107110 directive had appeared in the source.
 108111 .Fl i
 109112 may be specified multiple times to include several files.
 110113 .It Fl M
 111114 Instead of producing a processed C code file, output a list
 112115 of dependencies for
 113116 .Xr make 1 ,
 114117 detailing the files that need to be processed when compiling
 115118 the input.
 116119 .It Fl P
 117120 Inhibit generation of line markers.  This is sometimes useful when
 118121 running the preprocessor on something other than C code.
 119122 .It Fl S Ar path
 120123 Add
 121124 .Ar path
 122125 to the list of system directories searched by the
 123126 .Dq #include
 124127 directive.
 125128 The
 126129 .Fl S
 127130 option may be specified multiple times and is cumulative.
 128131 .It Fl t
 129132 Traditional cpp syntax.
 130133 Do not define the
 131134 .Dv __TIME__ ,
 132135 .Dv __DATE__ ,
 133136 .Dv __STDC__ ,
 134137 and
 135138 .Dv __STDC_VERSION__
 136139 macros.
 137140 .It Fl U Ar macro
 138141 Undefine a macro before processing any input, as if a
 139142 .Lp
 140143 .Dl #undef Ar macro
 141144 .Lp
 142145 directive had appeared in the source.
 143146 .It Fl V
 144147 Verbose debugging output.
 145148 .Fl V
 146149 can be repeated for greater detail.
 147150 .Po
 148151 This is only available if the
 149152 .Nm
 150153 program was built with
 151154 .Dv PCC_DEBUG
 152155 defined, which is the default
 153156 .Pc .
 154157 .It Fl v
 155158 Display version.
 156159 .El
 157160 .Pp
 158161 The
 159162 .Fl D ,
 160163 .Fl i
 161164 and
 162165 .Fl U
 163166 options are processed in the order that they appear on the command
 164167 line, before any input is read but after the command line options
 165168 have been scanned.
 166169 .Pp
 167170 Files referenced by the
 168171 .Dq #include
 169172 directive as
 170173 .Qq ... ,
 171174 are first looked for in the current directory, then as per
 172175 .Aq ...
 173176 files, which are first looked for in the list of
 174177 directories provided by any
 175178 .Fl I
 176179 options, then in the list of system directories provided by any
 177180 .Fl S
 178181 options.
 179182 Note that
 180183 .Nm
 181184 does not define any include directories by default; if no
 182185 .Fl I
 183186 or
 184187 .Fl S
 185188 options are given, then only the current directory will be
 186189 searched and no system files will be found.
 187190 .Ss Builtin Macros
 188191 A few macros are interpreted inside the
 189192 .Nm cpp
 190193 program:
 191194 .Bl -diag
 192195 .It __DATE__
 193196 Expands to a quoted string literal containing the date in the form
 194197 .Qq Mmm dd yyyy ,
 195198 where the names of the months are the same as those generated by the
 196199 .Xr asctime 3
 197200 function, and the first character of dd is a space character if
 198201 the value is less than 10.
 199202 .It __FILE__
 200203 Expands to a quoted string literal containing the presumed name of
 201204 the current source file.
 202205 When reading source from standard input, it expands to
 203206 .Qq Aq stdin .
 204207 .It __LINE__
 205208 Expands to an integer constant representing the presumed line number
 206209 of the source line containing the macro.
 207210 .It __STDC__
 208211 Expands to the integer constant
 209212 .Dq 1 ,
 210213 meaning that the compiler conforms to
 211214 .St -isoC .
 212215 .It __STDC_VERSION__
 213216 Expands to the integer constant
 214217 .Dq 199901L ,
 215218 indicating that
 216219 .Nm
 217220 conforms to
 218221 .St -isoC-99 .
 219222 .It __TIME__
 220223 Expands to a quoted string literal containing the time in the form
 221224 .Qq hh:mm:ss
 222225 as generated by the
 223226 .Xr asctime 3
 224227 function.
 225228 .El
 226229 .Pp
 227230 Also see the
 228231 .Fl t
 229232 option.
 230233 .Sh EXIT STATUS
 231234 The
 232235 .Nm
 233236 utility exits with one of the following values:
 234237 .Lp
 235238 .Bl -tag -width Ds -offset indent -compact
 236239 .It 0
 237240 Successfully finished.
 238241 .It 1
 239242 An error occurred.
 240243 .It 2
 241244 The
 242245 .Fl E
 243246 option was given, and warnings were issued.
 244247 .El
 245248 .Sh SEE ALSO
 246249 .Xr as 1 ,
 247250 .Xr ccom 1 ,
 248251 .Xr make 1 ,
 249252 .Xr pcc 1 ,
 250253 .Xr asctime 3
 251254 .Sh HISTORY
 252255 The
 253256 .Nm
 254257 command comes from the original Portable C Compiler by
 255258 .An "S. C. Johnson" ,
 256259 written in the late 70's.
 257260 The code originates from the V6 preprocessor with some additions
 258261 from V7 cpp and ansi/c99 support.
 259262 .Pp
 260263 A lot of the PCC code was rewritten by
 261264 .An "Anders Magnusson" .
 262265 .Pp
 263266 This product includes software developed or owned by Caldera
 264267 International, Inc.
FishEye: Open Source License registered to PCC.
Your maintenance has expired. You can renew your license at http://www.atlassian.com/fisheye/renew
Atlassian FishEye, CVS analysis. (Version:1.6.3 Build:build-336 2008-11-04) - Administration - Page generated 2014-11-01 12:56 +0100