The C preprocessor provides the ability to perform macro
substitution, conditional compilation, and inclusion of named files.
Preprocessor directives, lines beginning with #
and
possibly preceded by white space, are used to communicate with the
preprocessor.
The following sections describe the preprocessor directives and operators available with the DEC C compiler:
#define
and #undef
directives, and the #
and ##
operators
(Section 8.1)
#if
, #ifdef
,
#ifndef
, #else
, #elif
,
and #endif
directives, and the defined
operator (Section 8.2)
#include
directive (Section 8.3)
#line
directive (Section 8.4)
#pragma
directive (Section 8.5)
#error
directive (Section 8.6)
#
) (Section 8.7)
Preprocessor directives are independent of the usual scope rules; they remain in effect from their occurrence until the end of the compilation unit or until their effect is canceled.
See Section 8.2 for more information about conditional compilation. See your platform-specific DEC C documentation for implementation-defined information about preprocessor directives.
The ANSI standard allows only comments as text following a preprocessing directive. The DEC C compiler issues a warning if this syntax rule is violated in all modes but the strict ANSI mode, in which it issues an error message.