CPP( 1) USER COMMANDS CPP(l) 0 An escaped newline (that is, a backslash immediately followed by a newline) may be used in the body of a '#define' statement to continue the definition onto the next line. The escaped new- line is not included in the macro body. Comments are removed (unless the -C option is used on the command line). Comments are also ignored, except that a comment terminates a token. Af acro formal parameters are recognized in '#define' bodies even inside character constants and quoted strings. The output from: #define foo(a) '\a' foo(bar) is the seven characters '\bar' (space, single-quote, escape character, b, a, r, single-quote).
Macro names are not recognized inside character constants or quoted strings during the regular scan. Thus: #define foo bar printf("foo "); does not expand 'foo' in the second line, because it is inside a quoted string which is not part of a '#define' macro definition. Macros are not expanded while processing a '#define' or '#under'. Thus: #define roo bletch #define bar foo #under foo bar produces 'foo'. The token appearing immediately after a '#if def' or '#ifndef' is not expanded. Macros are not expanded during the scan which determines the actual parameters to another macro call. Thus:
#define reverse(first,second)second first #define greeting hello reverse(greeting, #define greeting goodbye ) produces ' goodbye' (and warns about the redefinition of 'greeting'). Incompatibility-. The slash '/' in 'a=/*b' is interpreted as the first character of the pair '/*' which introduces a comment, rather than as the second character of the divide-and-replace operator '=/'. This incompatibility reflects the change in the C language which made 'a/=*b' the preferred way to write such a statement if the meaning 'a=a/ *b' is intended. 0 FILES /usr /include standard directory for #Include files SEE ALSO cc(l), m4(1).
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. NOTES When newline characters were found in argument lists for macros to be expanded, previous ver- sions or cpp put out the newlines as they were found and expanded. The current version of cpp replaces these newlines with blanks to alleviate problems that the previous versions had when this occurred. 0 Sun Release 1.4 Last change: g August 1984 57