Developer --> Technical Publications
PATH  Mac OS X Server Documentation > The GNU C Preprocessor

The GNU C Preprocessor

Previous | Contents | Next

Global Transformations

Most C preprocessor features are inactive unless you give specific commands to request their use. But there are three transformations that the preprocessor always makes on all the input it receives, even in the absence of commands:

The first two transformations are done before nearly all other parsing and before preprocessor commands are recognized. Thus, for example, you can split a line cosmetically with backslash-newline anywhere (except when trigraphs are in use; see below).

/*
*/ # /*
*/ defi\
ne FO\
O 10\
20

is equivalent to #define FOO 1020 . You can even split an escape sequence with backslash-newline. For example, you can split "foo\bar" between the backslash and the b to get

"foo\\
bar"

This behavior is unclean: in all other contexts, a backslash can be inserted in a string constant as an ordinary character by writing a double backslash, and this creates an exception. But the ANSI C standard requires it. (Strict ANSI C doesn't allow newlines in string constants, so this isn't considered a problem.)

There are a few exceptions to all three transformations:

This exception is relevant only if you use the -trigraphs option to enable trigraph processing.


The GNU C Preprocessor

Previous | Contents | Next