cpp 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. .TH CPP 1
  2. .SH NAME
  3. cpp \- C language preprocessor
  4. .SH SYNOPSIS
  5. .B cpp
  6. [
  7. .I option ...
  8. ]
  9. [
  10. .I ifile
  11. [
  12. .I ofile
  13. ]
  14. ]
  15. .SH DESCRIPTION
  16. .I Cpp\^
  17. interprets ANSI C preprocessor directives
  18. and does macro substitution.
  19. The input
  20. .I ifile
  21. and output
  22. .I ofile
  23. default to standard input and standard output respectively.
  24. .PP
  25. The options are:
  26. .TP
  27. .BI -D name\^
  28. .PD 0
  29. .TP
  30. .BI -D name=def\^
  31. .TP
  32. .BI -I dir\^
  33. Same as in
  34. .IR 2c "(1): add
  35. .I dir
  36. to the search for
  37. .CW search
  38. directives.
  39. .PD
  40. .TP
  41. .B -M
  42. Generate no output except a list of include files
  43. in a form suitable for specifying dependencies to
  44. .IR mk (1).
  45. Use twice to list files in angle brackets.
  46. .TP
  47. .B -N
  48. Turn off default include directories. All must be
  49. specified with
  50. .BR -I ,
  51. or in the environment variable
  52. .BR include .
  53. Without this option,
  54. .B /$objtype/include
  55. and
  56. .B /sys/include
  57. are used as the last two searched directories for include directives,
  58. where
  59. .B $objtype
  60. is read from the environment.
  61. .TP
  62. .B -V
  63. Print extra debugging information.
  64. .TP
  65. .B -P
  66. Do not insert
  67. .RB `` #line ''
  68. directives into the output.
  69. .TP
  70. .B -+
  71. Understand C++ comments.
  72. .TP
  73. .B -.
  74. Inhibit include search in the source's directory.
  75. .TP
  76. .B -i
  77. Print the list of directories searched when
  78. .I #include
  79. is found.
  80. Last listed are searched first.
  81. .PD
  82. .PP
  83. In the absence of the
  84. .B -P
  85. option, the processed text output is sprinkled
  86. with lines that show the original input line numbering:
  87. .IP
  88. .B #line
  89. .I linenumber
  90. .L
  91. "\fIifile\fP"
  92. .PP
  93. The command reads the environment variable
  94. .IR include
  95. and adds its (blank-separated) list of directories to
  96. the standard search path for
  97. .CW #include
  98. directives. They are looked at before any directories specified with
  99. .BR -I ,
  100. which are looked at before the default directories.
  101. .PP
  102. The input language is as described in the ANSI C standard.
  103. The standard Plan 9 C compilers do not use
  104. .IR cpp ;
  105. they contain their own simple but adequate preprocessor, so
  106. .I cpp
  107. is usually superfluous.
  108. .SH FILES
  109. .TF /objtype/include
  110. .TP
  111. .B /sys/include
  112. directory for machine-independent include files
  113. .TP
  114. .B /$objtype/include
  115. directory for machine-dependent include files
  116. .SH SOURCE
  117. .B /sys/src/cmd/cpp
  118. .SH SEE ALSO
  119. .IR 2c (1)