Chapter 1. Overview
5
is no limit on the length of a character constant, but the value of a character constant that contains
more than one character is implementation-defined. Refer to Chapter 11 Implementation Details.
Header file names either look like string constants, ". . . ", or are written with angle brackets instead,
¢
£
. . .
. In either case, backslash is an ordinary character. There is no way to escape the closing quote
or angle bracket. The preprocessor looks for the header file in different places depending on which
form you use. Refer to Section 2.2 Include Operation.
In standard C, no string literal may extend past the end of a line. GNU CPP accepts multi-line string
constants, but not multi-line character constants or header file names. This extension is deprecated and
will be removed in GCC 3.1. You may use continued lines instead, or string constant concatenation.
Refer to Section 11.4 Differences from previous versions.
Punctuators are all the usual bits of punctuation which are meaningful to C and C++. All but three of
the punctuation characters in ASCII are C punctuators. The exceptions are
,
, and
. In addition,
@
$
'
all the two- and three-character operators are punctuators. There are also six digraphs, which the C++
standard calls alternative tokens, which are merely alternate ways to spell other punctuators. This is
a second attempt to work around missing punctuation in obsolete systems. It has no negative side
effects, unlike trigraphs, but does not cover as much ground. The digraphs and their corresponding
normal punctuators are:
¤
¥ ¦ ¤
¥
Digraph:
%
%
:
:
%:
%:%:
Punctuator:
{
}
[
]
#
##
Any other single character is considered "other." It is passed on to the preprocessor's output unmo-
lested. The C compiler will almost certainly reject source code containing "other" tokens. In ASCII,
the only other characters are
,
,
, and control characters other than NUL (all bits zero). (Note that
@
$
'
is normally considered a letter.) All characters with the high bit set (numeric range 0x7F-0xFF) are
$
also "other" in the present implementation. This will change when proper support for international
character sets is added to GCC.
NUL is a special case because of the high probability that its appearance is accidental, and because it
may be invisible to the user (many terminals do not display NUL at all). Within comments, NULs are
silently ignored, just as any other character would be. In running text, NUL is considered white space.
For example, these two directives have the same meaning.
#define X^@1
#define X 1
(where
is ASCII NUL). Within string or character constants, NULs are preserved. In the latter two
^@
cases the preprocessor emits a warning message.
1.3. The preprocessing language
After tokenization, the stream of tokens may simply be passed straight to the compiler's parser. How-
ever, if it contains any operations in the preprocessing language, it will be transformed first. This stage
corresponds roughly to the standard's "translation phase 4" and is what most people think of as the
preprocessor's job.
The preprocessing language consists of directives to be executed and macros to be expanded. Its
primary capabilities are:
Inclusion of header files. These are files of declarations that can be substituted into your program.
•
Need help?
Do you have a question about the ENTERPRISE LINUX 3 - USING CPP and is the answer not in the manual?
Questions and answers