Quick Search:

Mode

Context

Displaying 3 lines of context. None | Less | More | Full

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.14
 
1.15
 
MAIN:plunky:20110831083400
 
cpp.1
_>1515 .\" ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
 1616 .\" THIS SOFTWARE.
 1717 .\"
<>18 -.Dd September 17, 2007
  18+.Dd August 31, 2011
1919 .Dt CPP 1
 2020 .Os
 2121 .Sh NAME
 2222 .Nm cpp
 2323 .Nd C preprocessor
 2424 .Sh SYNOPSIS
 2525 .Nm
<>26 -.\" TODO also document -Dvar and below without spaces?
 27 -.Op Fl CdMtVv
 28 -.Op Fl D Ar macro[=value]
  26+.Op Fl CMPtVv
  27+.Op Fl D Ar macro Ns Oo = Ns Ar value Oc
  28+.Op Fl d Ar flags
2929 .Op Fl I Ar path
 3030 .Op Fl i Ar file
 3131 .Op Fl S Ar path
     
 !
3838 utility is a macro preprocessor used by the
 3939 .Xr pcc 1
 4040 compiler.
<>41 -It is used to include header files,
  41+It is mainly used to include header files,
4242 expand macro definitions,
<> 43+discard comments,
4344 and perform conditional compilation.
<> 45+.Nm
  46+is written to comply with the
  47+.St -isoC-99
  48+specification.
4449 .Pp
 4550 The
 4651 .Ar infile
     
 !
5257 reads its initial file from standard input.
 5358 The
 5459 .Ar outfile
<>55 -output file is also optional.
 56 -It writes by default to standard output.
  60+output file is also optional, with output written to standard
  61+output if not provided.
5762 .Pp
<>58 -.\" TODO: document MAXARG  250 args to a macro, limited by char value
 59 -.\" TODO: Include order:
 60 -.\" For "..." files, first search "current" dir, then as <...> files.
 61 -.\" For <...> files, first search -I directories, then system directories.
 62 -.\"
6363 The options are as follows:
 6464 .Bl -tag -width Ds
<>65 -.It Fl ?
 66 -Show command line usage for
 67 -.Nm .
6865 .It Fl C
 6966 Do not discard comments.
<>70 -.It Fl D Ar macro[=value]
 71 -Fake a definition at the beginning by using
 72 -.Do #define
 73 -.Ar macro=value Dc .
  67+.It Fl D Ar macro Ns Oo = Ns Ar value Oc
  68+Create a macro definition before processing any input, as if a
  69+.Lp
  70+.Dl #define Ar macro Ar value
  71+.Lp
  72+directive had appeared in the source.
7473 If
 7574 .Ar value
<>76 -is not set on command-line, then define it as 1.
 77 -.\" TODO: show example
 78 -.It Fl dM
 79 -Print list of
  75+is not set on the command-line, then a value of 1 is used.
  76+.It Fl d Ar flags
  77+Modify output according to
  78+.Ar flags ,
  79+which can be a list of character flags.
  80+The following flags are currently supported:
  81+.Bl -tag -width ".Sy M"
  82+.It Sy M
  83+Do not process any input, but output a list of
8084 .Dq #define
<>81 -statements to standard output for all defined macros other than
 82 -builtin macros (see below).
 83 -The normal results of preprocessing are not output.
 84 -.\" TODO this doesn't show predefined macros
 85 -.\" other -d options are ignored
  85+statements for all defined macros other than builtin macros
  86+.Pq see below .
  87+.El
  88+.Lp
  89+any unknown flags are ignored.
8690 .It Fl I Ar path
 8791 Add
 8892 .Ar path
<>89 -to the list of directories containing needed header files.
  93+to the list of directories searched by the
  94+.Dq #include
  95+directive.
9096 This may be used to override system include directories
<>91 -(see
 92 -.Fl S
 93 -option).
  97+.Pq see Fl S No option .
9498 .Fl I
<>95 -may be specified multiple times.
  99+may be specified multiple times and is cumulative.
96100 .It Fl i Ar file
<>97 -Include a file at the beginning by using
 98 -.Do #include
 99 -.Ar file Dc .
 100 -.\" Note: I did not use the .In macro above
  101+Include a file before processing any input, as if a
  102+.Lp
  103+.Dl #include Qo Ar file Qc
  104+.Lp
  105+directive had appeared in the source.
  106+.Fl i
  107+may be specified multiple times to include several files.
101108 .It Fl M
<>102 -Generate dependencies for
 103 -.Xr make 1 .
 104 -.\" TODO: explain and show example?
  109+Instead of producing a processed C code file, output a list
  110+of dependencies for
  111+.Xr make 1 ,
  112+detailing the files that need to be processed when compiling
  113+the input.
105114 .It Fl P
 106115 Inhibit generation of line markers.  This is sometimes useful when
 107116 running the preprocessor on something other than C code.
 108117 .It Fl S Ar path
 109118 Add
 110119 .Ar path
<>111 -to the list of system directories containing needed header files.
  120+to the list of system directories searched by the
  121+.Dq #include
  122+directive.
112123 The
 113124 .Fl S
<>114 -option may be specified multiple times.
 115 -Note:
 116 -.Nm
 117 -does not have a default include directory defined.
 118 -.\" TODO: explain difference between -I and -S
 119 -.\" The directories listed by -I are searched first?
  125+option may be specified multiple times and is cumulative.
120126 .It Fl t
 121127 Traditional cpp syntax.
 122128 Do not define the
     
 !
126132 and
 127133 .Dv __STDC_VERSION__
 128134 macros.
<>129 -.\"
130135 .It Fl U Ar macro
<>131 -Undefine a macro at the beginning by using
 132 -.Do #undef
 133 -.Ar macro Dc .
  136+Undefine a macro before processing any input, as if a
  137+.Lp
  138+.Dl #undef Ar macro
  139+.Lp
  140+directive had appeared in the source.
134141 .It Fl V
 135142 Verbose debugging output.
 136143 .Fl V
<>137 -can be repeated for further details.
 138 -.\" -V only available if cpp source built with PCC_DEBUG, which is the default.
  144+can be repeated for greater detail.
  145+.Po
  146+This is only available if the
  147+.Nm
  148+program was built with
  149+.Dv PCC_DEBUG
  150+defined, which is the default
  151+.Pc .
139152 .It Fl v
 140153 Display version.
 141154 .El
<> 155+.Pp
  156+The
  157+.Fl D ,
  158+.Fl i
  159+and
  160+.Fl U
  161+options are processed in the order that they appear on the command
  162+line, before any input is read but after the command line options
  163+have been scanned.
  164+.Pp
  165+Files referenced by the
  166+.Dq #include
  167+directive as
  168+.Qq ... ,
  169+are first looked for in the current directory, then as per
  170+.Aq ...
  171+files, which are first looked for in the list of
  172+directories provided by any
  173+.Fl I
  174+options, then in the list of system directories provided by any
  175+.Fl S
  176+options.
  177+Note that
  178+.Nm
  179+does not define any include directories by default; if no
  180+.Fl I
  181+or
  182+.Fl S
  183+options are given, then only the current directory will be
  184+searched and no system files will be found.
142185 .Ss Builtin Macros
 143186 A few macros are interpreted inside the
 144187 .Nm cpp
 145188 program:
 146189 .Bl -diag
 147190 .It __DATE__
<>148 -Expands to the date in abbreviated month, day, and year format from
 149 -.Xr ctime 3
 150 -in quotes.
 151 -.\" TODO: is that ctime(3) format output change according to locale?
  191+Expands to a quoted string literal containing the date in the form
  192+.Qq Mmm dd yyyy ,
  193+where the names of the months are the same as those generated by the
  194+.Xr asctime 3
  195+function, and the first character of dd is a space character if
  196+the value is less than 10.
152197 .It __FILE__
<>153 -Expands to the name of the current input file in quotes.
 154 -When read from standard input, it expands to
  198+Expands to a quoted string literal containing the presumed name of
  199+the current source file.
  200+When reading source from standard input, it expands to
155201 .Qq Aq stdin .
 156202 .It __LINE__
<>157 -Expands to the line number of the current line containing the macro.
  203+Expands to an integer constant representing the presumed line number
  204+of the source line containing the macro.
158205 .It __STDC__
<>159 -Expands to the constant 1.
 160 -This means the compiler conforms to
 161 -.St -isoC
 162 -.Po also known as
 163 -.Do C90 Dc Pc .
  206+Expands to the integer constant
  207+.Dq 1 ,
  208+meaning that the compiler conforms to
  209+.St -isoC .
164210 .It __STDC_VERSION__
<>165 -Expands to
 166 -.Dq 199901L
 167 -which indicates that
  211+Expands to the integer constant
  212+.Dq 199901L ,
  213+indicating that
168214 .Nm
<>169 -supports
 170 -.St -isoC-99
 171 -.Po commonly referred to as
 172 -.Do C99 Dc Pc .
  215+conforms to
  216+.St -isoC-99 .
173217 .It __TIME__
<>174 -Expands to the time in hour, minutes, and seconds from
 175 -.Xr ctime 3
 176 -in quotes.
  218+Expands to a quoted string literal containing the time in the form
  219+.Qq hh:mm:ss
  220+as generated by the
  221+.Xr asctime 3
  222+function.
177223 .El
 178224 .Pp
 179225 Also see the
     
 !
192238 .Sh SEE ALSO
 193239 .Xr as 1 ,
 194240 .Xr ccom 1 ,
<>195 -.Xr pcc 1
 196 -.\"
  241+.Xr make 1 ,
  242+.Xr pcc 1 ,
  243+.Xr asctime 3
<_197244 .Sh HISTORY
 198245 The
 199246 .Nm
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-09-22 14:16 +0200