CPP(1) DOMAIN/IX SYS5 CPP(1)
NAME
cpp - the C language preprocessor
USAGE
/usr/lib/cpp [ option ... ] [ ifile [ ofile ] ]
DESCRIPTION
Cpp is a C language preprocessor. It is invoked by lint(1),
and is also available for general use. On DOMAIN/IX Sys-
tems, it plays no part in normal C program compilation.
The DOMAIN C compiler (/com/cc) has its own C preprocessor.
Refer to the DOMAIN C Language Reference for more informa-
tion.
Cpp optionally accepts two filenames as arguments. Ifile
and ofile are respectively the input and output for the
preprocessor. They default to standard input and standard
output if not supplied.
Note: When newline characters were found in argument lists
for macros to be expanded, previous versions of cpp produced
the new-lines as they were found and expanded. The current
version of the command replaces these newlines with blanks
to alleviate problems that previous versions had when this
occurred.
Cpp understands two special names. The name __LINE__ is
defined as the current line number (as a decimal integer) as
known by cpp, and __FILE__ is defined as the current
filename (as a C string) as known by cpp. They can be used
anywhere (including macros) just as any other defined name.
OPTIONS
-P Preprocess the input without producing the line
control information used by the next pass of the C
compiler.
-C Do not strip C-style comments (except those found
on cpp directive lines).
-Uname Remove any initial definition of name, where name
is a reserved symbol predefined by the particular
preprocessor. The current list of these possibly
reserved symbols includes the following:
operating system: ibm, gcos, os, tss, unix, aegis
hardware: interdata, pdp11, u370, u3b, u3b5, vax,
apollo
UNIX system variant: RES, RT
Printed 12/4/86 CPP-1
CPP(1) DOMAIN/IX SYS5 CPP(1)
lint(1): lint
-Dname
-Dname=def
Define name as if by a #define directive. If no
=def is given, define name as one (1). This
option has lower precedence than the -U option.
That is, if the same name is used in both a -U
option and a -D option, the name will be undefined
regardless of the order of the options.
-T Use only the first eight characters for distin-
guishing different preprocessor names. This
behavior is the same as previous preprocessors
with respect to the length of names. Included for
backward compatibility.
-Idir Change the algorithm used to search for #include
files with names not preceded by a slash (/) to
look in dir before looking in the directories on
the standard list. Thus, #include files with
names enclosed in double quotes (``'') will be
searched for first in the directory of the file
with the #include line, then in directories named
in -I options, and last in directories on a stan-
dard list. For #include with names enclosed in
<>, the directory of the file with the #include
line is not searched.
DIRECTIVES
All cpp directives start with lines beginning with a pound
sign (#). Any number of blanks and tabs are allowed between
the pound sign and the directive. The test directives and
the possible #else directives can be nested.
The valid directives are listed below. In addition to
these, the user may specify the following DOMAIN cpp direc-
tives: #attribute, #debug, #eject, #nolist, #list, #module,
#section, and #systype. For a description of each of these,
see the current revision of the DOMAIN C Language Reference.
#define name token-string
Replace subsequent instances of name with token-string.
#define name( arg, ..., arg ) token-string
Note that there can be no space between name and the
left parenthesis. Replace subsequent instances of name
followed by a left parenthesis, a list of comma-
separated set of tokens, and a right parenthesis by
token-string, where each occurrence of an arg in the
token-string is replaced by the corresponding set of
CPP-2 Printed 12/4/86
CPP(1) DOMAIN/IX SYS5 CPP(1)
tokens in the comma-separated list. When a macro with
arguments is expanded, the arguments are placed into
the expanded token-string unchanged. After the entire
token-string has been expanded, cpp restarts its scan
for names to expand at the beginning of the newly-
created token-string.
#undef name
Forget the definition of name (if any) from now on.
#include ``filename''
#include <filename>
Include, at this point, the contents of filename (which
will then be run through cpp). When the <filename>
notation is used, filename is only searched for in the
standard places. See the -I option above for more
detail.
#line integer-constant ``filename''
Generate line control information for the next pass of
the C compiler. Integer-constant is the line number of
the next line and filename is the file from which it is
derived. If ``filename'' is not given, the current
filename is unchanged.
#endif
End a section of lines started by a test directive
(#if, #ifdef, or #ifndef). Each test directive must
have a matching #endif.
#ifdef name
Include the lines following in the output only if name
has been the subject of a previous #define without
being the subject of an intervening #undef.
#ifndef name
Do not include the lines following in the output only
if name has been the subject of a previous #define
without being the subject of an intervening #undef.
#if constant-expression
Include the lines following in the output only if the
constant-expression evaluates to non-zero. All binary
non-assignment C operators, the ?: operator, the unary
-, !, and ~ operators are legal in constant-expression.
The precedence of the operators is the same as defined
by the C language. There is also a unary operator
defined, which can be used in constant-expression in
these two forms: defined ( name ) or defined name.
This allows the utility of #ifdef and #ifndef in a #if
Printed 12/4/86 CPP-3
CPP(1) DOMAIN/IX SYS5 CPP(1)
directive. Only those operators, integer constants,
and names known by cpp should be used in constant-
expression. In particular, the sizeof operator is not
available.
#else
Reverse the notion of the test directive that matches
this directive. If lines previous to this directive
are ignored, the following lines will appear in the
output (and vice versa).
FILES
/usr/include standard directory for #include files
DIAGNOSTICS
The error messages produced by cpp are intended to be self-
explanatory. The line number and filename where the error
occurred are printed along with the diagnostic.
RELATED INFORMATION
cc(1), m4(1).
CPP-4 Printed 12/4/86