cpp.1 (2010 09)
c
cpp(1) cpp(1)
NAME
cpp - the C language preprocessor
SYNOPSIS
/usr/ccs/lbin/cpp
[option ]... [ifile [ofile]]
DESCRIPTION
cpp is the C language preprocessor which is invoked as the first pass of any C compilation using the
cc
command (see cc(1)). Its purpose is to process
#include and conditional compilation instructions and
macros. Thus the output of
cpp is designed to be in a form acceptable as input to the next pass of the C
compiler. As the C language evolves, cpp and the rest of the C compilation package will be modified to
follow these changes. Therefore, the use of cpp
in other than this framework is not suggested. The pre-
ferred way to invoke
cpp is through the
cc command, since the functionality of
cpp may someday be
moved elsewhere. See m4(1) for a general macro processor.
cpp optionally accepts two file names as arguments. ifile and ofile are respectively the input and output
for the preprocessor. They default to standard input and standard output if not specified.
Options
The following options are recognized by
cpp:
-A Remove all predefined symbols that begin with a letter and _HPUX_SOURCE. The user
is expected to define _POSIX_SOURCE
or _XOPEN_SOURCE when using this option.
-C By default, cpp strips C-style comments. If the -C option is specified, all comments
(except those found on cpp directive lines) are passed along.
-Dname
-Dname=def Define name as if by a #define directive. If no =
def is given, name is defined as 1. The
-D option has lower precedence than the -U option. Thus, if the same name is used in
both a -U option and a -D option, the name is undefined regardless of the order of the
options.
-Hnnn Change the internal macro definition table to be nnn bytes in size. The default buffer
size is at least 8 188 bytes. This option serves to eliminate "Macro param too large",
"Macro invocation too large", "Macro param too large after substitution", "Quoted macro
param too large", "Macro buffer too small", "Input line too long", and "Catenated input line
too long" errors.
-h[ inclfile ] Generates included files and sents the results to the file inclfile. If the argument inclfile
is omitted, the result is sent to the standard error.
-Idir Change the algorithm for searching for #include files whose names do not begin with
/
to look in dir before looking in the directories on the standard list. Thus, #include
files whose names are enclosed in double quotes ("") are searched for first in the direc-
tory of the file containing the #include line, then in directories named in -I options in
left-to-right order, and last in directories on a standard list. For #include files whose
names are enclosed in angle brackets (<>), the directory of the file containing the
#include line is not searched. However, directory dir is still searched.
-M[ makefile ] Generates makefile dependencies and sends the results to the file makefile. If the argu-
ment makefile is omitted, the result is sent to the standard error.
-P Preprocess the input without producing the line-control information used by the next
pass of the C compiler.
-T HP-UX no longer restricts preprocessor symbols to eight characters. The -T option forces
cpp to use only the first eight characters for distinguishing different preprocessor names.
This behavior is the same as preprocessors on some other systems with respect to the
length of names, and is included for backward compatibility.
HP-UX 11i Version 3: September 2010 − 1 − Hewlett-Packard Company 1