| United States-English |
|
|
|
![]() |
HP Itanium-based Systems: HP aC++/HP C Programmer's Guide > Chapter 2 Command-Line OptionsPreprocessor Options |
|
The following options are accepted by the preprocessor: -C Using the -C option prevents the preprocessor from stripping comments. This option is supported in aCC only if -tp is used. See the description of cpp in the cpp(1) manpage for details. -Dname[=def] name is the symbol name that is defined for the preprocessor. def is the definition of the symbol name (name). The -Dname option defines a symbol name (name) to the preprocessor, as if defined by the preprocessing directive #define. If no definition (def) is given, the name is defined as 1.
Example: The following example defines the preprocessor symbol DEBUGFLAG and gives it the value 1. aCC -DDEBUGFLAG file.C The following program uses this symbol:
-E Using the -E option runs only the preprocessor on the named C++ files and sends the result to standard output (stdout). An exception to this rule is when -E is used with either the +m[d] or +M[d] option, the only output is the make dependency information. Unlike the -P option, the output of -E contains #line entries indicating the original file and line numbers. +m[d] The +m[d] option directs a list of the quote enclosed (" ") header files upon which your source code depends to stdout. The list is in a format accepted by the make command. If +md is specified, the list is directed to a .d file. The .d file name prefix is the same as that of the object file. The .d file is created in the same directory as the object file. Usage: Use +m[d] when you also specify the -E or the -P option. When used with the -E option, only dependency information is generated. Table 2-5 “Examples” lists examples of the +m[d] option. Table 2-5 Examples
+M[d] The +M[d] option directs a list of both the quote enclosed (" ") and angle bracket enclosed (< >) header files upon which your source code depends to stdout. The list is in a format accepted by the make command. If +Md is specified, the list is directed to a .d file. The .d file name prefix is the same as that of the object file. The .d file is created in the same directory as the object file. Usage: Use +Md when you also specify the -E or the -P option. When used with the -E option, only dependency information is generated. Table 2-6 Examples
-P Using the -P option only preprocesses the files named on the command line without invoking further phases. It leaves the result in corresponding files with the suffix .i. For example, the following command preprocesses the file prog.C leaving the output in the file prog.i. It does not compile the program. aCC -P prog.C -Uname name is the symbol name whose definition is removed from the preprocessor. This option undefines any name that has initially been defined by the preprocessing stage of compilation. A name can be a definition set by the compiler. This is displayed when you specify the -v option. A name can also be a definition that you have specified with the -D option on the command line. The -D option has lower precedence than the -U option. If the same name is used in both, the -U option and the -D option, the name is undefined regardless of the order of the options on the command line. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||