HP aC++/HP C Programmer's Guide (B3901-90036; A.06.26; September 2011)
4 Preprocessing Directives
HP aC++ has its own, internal, preprocessor which is similar to the HP C preprocessor
described in the HP C/HP-UX Reference Manual. When you issue the aCC command,
your source files are automatically preprocessed.
This Chapter discusses the following topics:
• “Overview of the Preprocessor” (page 146)
• “Syntax” (page 146)
• “Usage Guidelines” (page 147)
• “Source File Inclusion (#include, #include_next)” (page 147)
• “Macro Replacement (#define, #undef)” (page 148)
• “Assertions (#assert, #unassert)” (page 155)
• “Conditional Compilation (#if, #ifdef, .. #endif)” (page 156)
• “Line Control (#line)” (page 158)
• “IOSTREAM Performance Improvement Pragma” (page 159)
• “Pragma Directive (#pragma) and _Pragma Operator” (page 160)
• “Error Directive (#error)” (page 160)
• “Warning Directive” (page 161)
• “Trigraph Sequences” (page 161)
Overview of the Preprocessor
A preprocessor is a text-processing program that manipulates the text within your source
file. You enter preprocessing directives into your source file to direct the preprocessor to
perform certain actions on the source file. For example, the preprocessor can replace
tokens in the text, insert the contents of other files into the source file, or suppress the
compilation of part of the file by conditionally removing sections of the text. It also expands
preprocessor macros and conditionally strips out comments.
Syntax
The general syntax for a preprocessor directive is:
preprocessor-directive ::=
include-directive newline
macro-directive newline
conditional-directive newline
line-directive newline
pragma-directive newline
error-directive newline
146 Preprocessing Directives