United States    
COMPAQ
C++
Compaq C++

Compaq C++
Using Compaq C++ for OpenVMS VAX


Previous Contents Index


Appendix A
Compiler Command Qualifiers

Table A-1 shows all the command qualifiers available to the cxx command and their defaults.

Table A-1 CXX Command Qualifiers
Command Qualifiers Defaults
/ASSUME=(option[,...]) See text.
/[NO]COMMENTS=option See text.
/[NO]COMPACT_VTBLS /NOCOMPACT_VTBLS
/[NO]DEBUG[=(option[,...])] /DEBUG=(TRACEBACK,NOINLINE,NOSYMBOLS)
/[NO]DEFINE=(identifier[=definition][,...]) /NODEFINE
/[NO]DIAGNOSTICS[=file-spec] /NODIAGNOSTICS
/[NO]DISTINGUISH_NESTED_ENUMS /NODISTINGUISH_NESTED_ENUMS
/[NO]ERROR_LIMIT[=n] /NOERROR_LIMIT
/EXTERN_MODEL=option /EXTERN_MODEL=RELAXED_REFDEF
/FLOAT=option /FLOAT=D_FLOAT
/[NO]G_FLOAT /NOG_FLOAT
/[NO]IMPLICIT_INCLUDE /NOIMPLICIT_INCLUDE
/[NO]INCLUDE_DIRECTORY=(pathname[,...]) /NOINCLUDE_DIRECTORY
/[NO]INSTANTIATE_TEMPLATES /NOINSTANTIATE_TEMPLATES
/INSTRUCTION_SET=floating_point //INSTRUCTION_SET=nofloating_point
/LIBRARY See text.
/[NO]LINE_DIRECTIVES /LINE_DIRECTIVES
/[NO]LIST[=file-spec] /NOLIST (interactive mode)
  /LIST (batch mode)
/[NO]MACHINE_CODE[=option] /NOMACHINE_CODE
/[NO]MEMBER_ALIGNMENT /NOMEMBER_ALIGNMENT
/[NO]MMS_DEPENDENCIES=option /NOMMS_DEPENDENCIES
/NAMES=(option1,option2) /NAMES=(UPPERCASE,TRUNCATED)
/NESTED_INCLUDE_DIRECTORY[=option] /NESTED_INCLUDE_DIRECTORY=INCLUDE_FILE
/[NO]OBJECT[=file-spec] /OBJECT
/[NO]OPTIMIZE[=(option[,...])] /OPTIMIZE
/[NO]PREFIX_LIBRARY_ENTRIES[=(option[,...])] See text.
/[NO]PREPROCESS_ONLY[=filename] /NOPREPROCESS_ONLY
/REPOSITORY=option See text.
/[NO]SHARE_GLOBALS /NOSHARE_GLOBALS
/SHOW[=(option[,...])] /SHOW=(HEADER,SOURCE
/STANDARD=(option,...) None.
/[NO]TEMPLATE_DEFINE[=(option,...)] See text.
/[NO]UNDEFINE=(identifier[,...]) /NOUNDEFINE
/[NO]UNSIGNED_CHAR /NOUNSIGNED_CHAR
/[NO]USING_STD /USING_STD
/[NO]VERSION /NOVERSION
/[NO]WARNINGS[=(option[,...])] /WARNINGS
/[NO]XREF[=file-spec] /NOXREF

/assume=(option,...)

Controls compiler assumptions. The options are as follows:
Option Usage
[no]writable_string_literals Stores string constants in a writable psect. Otherwise, such constants are placed in a nonwritable psect.
[no]header_type_default Controls whether the compiler appends a file extension to a file name. The default is header_type_default . For files, such as STL header files, that must not have file extensions, specify /assume=noheader_type_default .

Writable String Literals

The /assume=writable_string_literals qualifier option forces all string literals (except const variables) to be allocated in writable memory. Use this option if your program relies on the ability to modify string literals. By default, or if you specify /assume=nowritable_string_literals , string literals are allocated in read-only memory. When this option is in effect, be wary of passing a string literal to any function that does not accept the argument as a const variable.

Accuracy Sensitive

If you specify the noaccuracy_sensitive option, the compiler is free to reorder floating-point operations, based on algebraic identities (inverses, associativity, and distribution). This allows the compiler to move divide operations outside of loops, which improves performance.

The accuracy_sensitive option is the default, which directs the compiler to use only certain scalar rules for calculations. This setting can prevent some optimizations.

Specifying the noaccuracy_sensitive option lets the compiler reorder code (based on algebraic identities) to improve performance. The results can be slightly different from those produced by the default /assume=accuracy_sensitive option; the difference is in the way that intermediate results are rounded. However, the accuracy_sensitive option results are not categorically less accurate than those attained by using the default.

Aligned Objects

Dereferencing a pointer to a longword- or quadword-aligned object is more efficient than dereferencing a pointer to a byte- or word-aligned object. Therefore, the compiler can generate more optimized code if it makes the assumption that a pointer object of an aligned pointer type does point to an aligned object.

Because the compiler determines the alignment of the dereferenced object from the type of the pointer, and the program is allowed to compute a pointer that references an unaligned object (even though the pointer type indicates that it references an aligned object), the compiler must assume that the dereferenced object's alignment matches or exceeds the alignment indicated by the pointer type. The aligned_objects option is the default. This tells the compiler to assume object alignment, so that the compiler can generate more efficient code for pointer dereferences of aligned pointer types.

Use the noaligned_objects option to prevent the compiler from assuming the pointer type's alignment for objects that it points to.

In determining whether to use the aligned_objects or the noaligned_objects option, consider the following programming practices:

/comments[=option]

/nocomments

Specifies whether comments appear in preprocessor output files. If comments do not appear, this qualifier specifies what replaces them. The options are:
Option Usage
as_is Specifies that the comment appear in the output file. This is the default if you use the /comments qualifier without specifying an option.
space Specifies that a single space replaces the comment in the output file. This is the default if you do not specify the /comments qualifier at all.

Specifying /nocomments tells the preprocessor that nothing replaces the comment in the output file. This may result in inadvertent token pasting.

The preprocessor may replace a comment at the end of a line or replace a line by itself with nothing, even if you specify /comments=space . Specifying /comments=space cannot change the meaning of the program.

/compact_vtbls

/nocompact_vtbls

Directs the compiler to implement the virtual function dispatch tables for a class in a way that reduces the size of object files, improves link times, and reduces executable image start-up times. If you are using a release of OpenVMS VAX prior to Version 6.1 and you experience problems calling virtual functions, you can revert to the virtual function table implementation that was used prior to Compaq C++ Version 5.0, by specifying the /nocompact_vtbls qualifier.

/debug[=(option,...)]

/nodebug

Includes information in the object module for use by the OpenVMS Debugger. If you do not specify this qualifier, the default is /debug=(traceback,nosymbols) . If you specify the /debug qualifier without specifying any options, the default is /debug=(traceback,symbols) . (Note the difference in options between symbols and nosymbols .) The options are as follows:
Option Usage
all Includes symbol table records and traceback records. This option is equivalent to specifying /debug=(traceback,symbols) .
inline Generates debug information to cause a step command to step into an inlined function call.
noinline Generates debug information to cause a step command to step over an inlined function call. This is the default.
none Excludes all debugging information. This option is equivalent to specifying /nodebug .
nosymbols Excludes symbol table records, which are needed only for symbolic debugging. This option is the default if you do not specify the /debug qualifier on the command line.
notraceback Excludes traceback records. This option is equivalent to specifying /nodebug and is used to avoid generating extraneous information from thoroughly debugged program modules.
symbols Includes symbol table records needed for symbolic debugging. This option is the default if you specify the /debug qualifier on the command line but do not specify any options.
traceback Includes only traceback records. This option is the default if you do not specify the /debug qualifier on the command line.

/define=(identifier[=definition][,...])

/nodefine

Performs the same function as the #define preprocessor directive, by defining a macro to be substituted for every occurrence of a given identifier in the compilation unit or units. When both the /define and /undefine qualifiers are present on the cxx command line, the compiler evaluates /define before /undefine .

Compatibility with the DIGITAL Command Language (DCL) standard imposes the following syntactic requirements on the /define qualifier to preserve equivalency with the #define preprocessor directive:

The default is /nodefine , which provides for compatibility with other DCL qualifiers. You may want to use the /nodefine qualifier to cancel a /define qualifier that you specified in a symbol you used to compile Compaq C++ programs.

/diagnostics[=file-spec]

/nodiagnostics

Creates a file containing compiler messages and diagnostic information. The default file type for a diagnostic file is .dia. The diagnostics file is used with the Language-Sensitive Editor (LSE). To display a diagnostics file, enter the command REVIEW/FILE=file-spec while in LSE. The default is /nodiagnostics .

/error_limit[=n]

/noerror_limit


Lets you specify the number of errors (n) acceptable during program compilation. Exceeding the limit ends the compilation. Only messages with a severity of error (E) count toward the limit. Specifying the /noerror_limit qualifier allows an unlimited number of errors. The default is /error_limit=100 .

/exceptions[=[no]cleanup]

/noexceptions

Controls whether support for C++ exceptions is enabled or disabled. If you want C++ exceptions enabled, you must specify /exceptions , which uses the cleanup option by default.

You specify the /exceptions qualifier to enable support for C++ exception handling. When the /exceptions qualifier is in effect, the compiler generates code for throw expressions, try blocks, and catch statements. The compiler also generates special code for main programs so that the terminate() routine is called for unhandled exceptions.

You can control the cleanup of automatic objects during exception processing by using the [no]cleanup option:

The default is /noexceptions , which disables C++ exceptions as follows:

If you want full exceptions support, you should compile all C++ files in your program with /exceptions . If any files in your program contain throw expressions, try blocks, or catch statements, or if any files in your program are compiled with /exceptions , then you must link your program using the CXXLINK facility.

/extern_model=(option)

Controls the initial extern model of the compiler in conjunction with the /share_globals qualifier. Conceptually, the compiler behaves as if the first line of the program is #pragma extern_model , with the model and psect name (if any) specified by the /extern_model qualifier and with the shr or noshr keyword specified by the /share_globals qualifier.

The /extern_model qualifier takes the following options, which have the same meaning as the #pragma extern_model directive:

common_block
relaxed_refdef
strict_refdef=["name"]
globalvalue

The default is relaxed_refdef.

Examples


/extern_model=common_block 

This specification appearing on the command line sets the extern model to common block (global overlaid psects), which is what VAX C uses.


/extern_model=strict_refdef="mydata"/noshare_globals 

This specification causes the compiler to act as if the program begins with the following line:


#pragma extern_model strict_refdef "mydata" noshr 

/float[=option]

Controls the format of floating-point variables. The options are as follows:
Option Usage
d_float Represent double variables in D-floating format. This the default.
g_float Represent double variables in G-floating format.

Support for the /[no]g_float qualifier is retained for compatibility with VAX C. The /g_float and /float qualifiers are mutually incompatible; do not specify both on the same compiler command.

If you do not specify either /float or /g_float , or if you specify /float without an option, the default is /float=d_float .)

/g_float

/nog_float

Controls the format of floating-point variables. Specifying /g_float causes the compiler to represent all variables declared as double in G-floating format (a total of 64 bits with a range of approximately 0.56*10-308 to 0.899*10308 ). The default is /nog_float ). For more information, see the description of the /float qualifier.

/implicit_include

/noimplicit_include

) /IMPLICIT_INCLUDE enables inclusion of source files as a method of finding definitions of template entities. By default it is enabled for normal compilation, and disabled for preprocessing only. The search rules for finding template definition files is the same as for include files.

/NOIMPLICIT_INCLUDE disables inclusion of source files as a method of finding definitions of template entities. You might want to use this option in conjunction with the /STANDARD=MS command line option, to match more closely the behavior on Microsoft C++.

/include_directory=(pathname[,...])

/noinclude_directory

Provides an additional level of search for user-defined include files. Each pathname argument can be either a logical name or a legal UNIX style directory in a quoted string. The default is /noinclude_directory .

The /include_directory qualifier provides similar functionality to the -I option of the cxx command on DIGITAL UNIX systems. This qualifier allows you to specify additional locations to search for files to include. Putting an empty string in the specification prevents the compiler from searching any of the locations it normally searches but directs it to search only in locations you identify explicitly on the command line with the /include_directory and /library qualifiers (or by way of the specification of the primary source file, depending on the /nested_include_directory qualifier).

The affected forms of inclusion are #include " file-spec " and #include < file-spec > . See Section 2.3.19 for information on the order of search.

/instantiate_templates

/noinstantiate_templates

Synonymous with the /template_define qualifier and is supported only for compatability with the previous release of the compiler.

/library

Indicates that the associated input file is a text library containing modules of Compaq C++ source text. See the OpenVMS Librarian Utility Manual for details. If the library specification does not include a file type, the default type .tlb is assumed. Use a plus sign (+) to associate source-file specifications in a compilation unit with the /library qualifier, as in the following example:


cxx leaf + twig + stem/library 

All files in the unit may make reference to modules within that library no matter where you place the /library qualifier. In the previous example, files leaf.cxx and twig.cxx can contain references to stem.tlb.

A comma (,) is used to separate compilation units. In the following example, trunk.cxx is in a separate compilation unit and cannot contain references to modules in stem.tlb:


cxx leaf + twig + stem/library, trunk 

/line_directives

/noline_directives

Specifies whether or not #line directives appear in preprocess output files. The default is /line_directives .

/list[=file-spec]

/nolist

Produces a listing file containing, by default, a source program listing. To get any type of listing output pertaining to the /machine_code qualifier or to the /show qualifier you must specify the /list qualifier. In interactive mode, the default is /nolist ; in batch mode, the default is /list .

For example, to interactively generate a listing file use the following command:

cxx/list name-of-source-file

If you do not supply a file specification with the /list qualifier, the compiler uses the name of the first source file to name the listing file and .lis as the file type.

The following qualifiers can affect the contents of the listing file:

/machine_code
/show

A compiler listing generated by the /list qualifier has the following parts:
Source program listing Contains the source code and line numbers that the compiler generates.
Compilation summary Shows the qualifiers used with the cxx command. If you specified the /show=statistics qualifier, this part of the listing also displays compilation statistics.

Example:


 
        Source Listing    24-JUL-1999 13:28:14    Compaq C++ V5.6C-000   Page   1 
                          24-JUL-1999 13:19:52    D$:[TEAM.WORK]LISTEXAMPLE.CXX;1 
 
          1 // This is a sample program to show the format 
          2 // of the compiler listing, as well as the effect of 
          3 // the /show=include qualifier value. 
          4 
          5 #include "messages.h" 
   I1     6 // Notice that the include level is shown by I1 in the column 
   I1     7 #ifdef __cplusplus 
   I1     8 #define NULL 0L 
   I1     9 #include "cpp_messages.h" 
   I2    10 
   I2    11 #if defined (__unix) 
   I2X   12     /* Note that the lines not selected have an X in the column. */ 
   I2X   13     const char *message_file_name = "messages_example"; 
   I2X   14     const char *message_file_location = "%N.cat"; 
   I2X   15     int message_set_example = 1; 
   I2X   16 #else 
   I2    17     const char *message_file_name = (const char *)(NULL); 
   I2    18     const char *message_file_location = (const char *)(NULL); 
   I2    19     extern "C" int EXAMPLE_SET; 
   I2    20     int message_set_example = EXAMPLE_SET; 
   I2    21 #endif 
   I1    22 #else 
   I1X   23 #define NULL (void *)0; 
   I1X   24 #include "c_messages.h" 
   I1X   25 #endif 
         26 
         27 extern "C" printf(const char *, ...); 
         28 
         29 // Unrecognized pragmas generate messages in listing file. 
         30 #pragma messages_on 
  ........1           
%CXX-W-PREUNRPRA, (1) The pragma "messages_on" is unrecognized. 
 
         31 
         32 main() 
         33 { 
         34     printf("message file default value %d\n", message_set_example); 
         35     return 0; 
         36 } 
 
 
Command Line 
------- ---- 
 
cxx/list name-of-source-file

At the top of the listing is the date and time of the compilation, the version of the compiler used, and the page numbers of the listing file. On the next line are the date and time of the source file's creation and the name of the module being compiled.

The left margin of the source listing contains information arranged into fields in the following format:

i mm nnnnn

i

Is the level of nesting of lines read from included files. This field is present only if you specified the /show=include qualifier on the command line. Level 0 , which appears as a blank, indicates lines read from the source file or files specified on the command line. An X appearing immediately after this field means that the compiler is ignoring the source line after a conditional directive (such as #if or #ifdef ).

/machine_code

/nomachine_code

Lists the generated machine code in the listing file if you also specify the /list qualifier. The default is /nomachine_code .

By default, /LIST creates a listing file with the same name as the source file and with a file extension of .LIS. If you include a file specification with the /LIST qualifier, the compiler uses that specification to name the listing file.

In interactive mode, the default is /NOLIST. In batch mode, the default is /LIST. See the descriptions of the qualifiers /[NO]MACHINE_CODE, and /SHOW for related information. (For example, to suppress compiler messages to the terminal or to a batch log file, use the /SHOW=NOTERMINAL qualifier.)

Several formats exist to list machine code. Table A-2 describes the /MACHINE_CODE qualifier options.

Table A-2 /MACHINE_CODE Qualifier Options
Option Usage
AFTER Causes the lines of machine code produced during compilation to print after all the source code in the listing.
BEFORE Causes lines of machine code produced during compilation to print before any source code in the listing.
INTERSPERSED Produces a listing consisting of lines of source code followed by the corresponding lines of machine code. This is the default option.

/member_alignment

/[no]member_alignment

Determines how the compiler aligns structure members. The /member_alignment qualifier aligns members on the next boundary appropriate to the type of the member; that is, bytes are aligned on the next byte boundary, words are aligned on the next word boundary, and so forth. The default is /no member_alignment . When /nomember_alignment is in effect, structure members start on the next byte no matter what alignment that member has.

You also can align structure members with the #pragma member_alignment preprocessor directive.

/mms_dependencies[=(file[=filespec] | [no]system_include_files, ...)]

/nomms_dependencies

Instructs the compiler to produce a dependency file. The format of the dependency file is as follows:

object_file_name:<tab><source file name>
object_file_name:<tab><full path to first include file>
object_file_name:<tab><full path to second include file>

The file subqualifier specifies where to save the dependency file. The default file type for a dependency file is .mms. Other than using the different default type, this qualifier uses the same procedure as the /object and /list qualifiers for determining the name of the output file.

The system_include_files subqualifier specifies whether to include dependency information about system include files, that is, those file included with #include <filename> . The default is to include dependency information about system include files.

The default is /nomms_dependencies .

/names=(option1,option2)

Specifies whether the compiler translates all external symbol names to uppercase, lowercase, or leaves the case unchanged, and whether the names are truncated to 31 characters or shortened by special encoding. /NAMES=UPPERCASE causes all external names to be converted to uppercase. /NAMES=LOWERCASE causes all external names to be converted to lowercase. /NAMES=AS_IS leaves the case of external names unchanged. /NAMES=TRUNCATED truncates long external names to the first 31 characters. If external names are identical up to 31 characters, you can specify /NAMES=SHORTENED to create specially encoded 31-character names. All modules in an application containing long external names must be compiled consistently with either /NAMES=TRUNCATED or /NAMES=SHORTENED .

/nested_include_directory[=option]

Controls the directories that the compiler searches when looking for nested include files that are included using the quoted form of the #include preprocessor directive ( #include "file-spec"). The options are as follows:

For more information on the search order for included files, see the /INCLUDE_DIRECTORY qualifier.
Option Usage
primary_file Directs the compiler to first search the directory containing the top-level source file for any nested include files.
include_file Directs the compiler to first search the directory of the source file containing the #include directive.
none Directs the compiler to skip the first step of processing #include "file.h" directives. Instead, the compiler starts by looking for the included file in the directories specified by /INCLUDE_DIRECTORY.

The default is /nested_include_directory=include_file . Thus, specifying /nested_include_directory is equivalent to specifying
/nested_include_directory=include_file .

/object[=file-spec]

/noobject

Determines whether the compiler produces an object module. The default is /object . If you do not supply a file specification with the /object qualifier, the compiler creates an object file with the same name as that of the first source file of a compilation unit and with .obj as the file type.

Producing an object module takes additional time. Use the /noobject qualifier when you need only a program listing or when you are looking for compile-time errors.

/optimize[=option]

/nooptimize

Controls the level of code optimization that the compiler performs. The options are as follows:
Option Usage
all Performs all optimizations
[no]common_subexpressions Optimizes common subexpressions
[no]disjoint Calculates disjoint lifetimes
[no]hoist Hoists simple references out of conditional expressions
[no]inline Inlines function bodies at the call site
[no]invariant_expression Hoists invariant expressions out of loops
[no]locals_in_registers Allocates variables to registers if possible
none Performs no optimizations
[no]peephole Performs peephole optimization
[no]result_incorporation Performs result incorporation

The default is /optimize=all .

Optimization may make debugging a program more difficult. For example, the compiler might optimize away a variable whose value could show where a program's bug resides, if the value were examined during debugging. Therefore, for debugging you should consider using the /nooptimize qualifier. If at least partial optimization is important during debugging, choose the /optimize=nodisjoint option.

/[no]prefix_library_entries=(option,...)

Controls name prefixing. For user programs that do not include ANSI/ISO C header files but call the ANSI/ISO C library, the compiler automatically adds a DECC$ prefix to all DEC C Run-Time Library (RTL) calls just before the name for the external reference or global definition is put into the object file. The options are as follows:
Option Usage
except= (name ,...) The names specified are not prefixed.
all_entries All Compaq C++ names are prefixed.
ansi_c89_entries Only ANSI/ISO C library names are prefixed.
rtl= name References to the C RTL specified by name are generated. If you do not supply this option, references to the DEC C RTL are generated by default. This option is supplied for use with other C RTL implementations.

On VAX systems the limit is 24.

Note that the all_entries and ansi_c89_entries options are mutually exclusive. Do not use both options with the same qualifier.

Use the /prefix_library_entries qualifier when you want to supply a function that redefines a standard DEC C RTL function, an ANSI/ISO predefined function, or the C++ operators new and delete . By default, references and definitions of these names will have the prefix DECC$ prepended.

The /prefix_library_entries qualifier overrides the DECC$ prefixing. Specify this qualifier when compiling modules that redefine a DEC C RTL function or the operators new or delete . Also specify this qualifier when compiling all the modules that reference the redefined version of the DEC C RTL function. This gives you a reliable way of controlling the function definitions that are linked into your program.

To specify that no C RTL prefix be used for the new and delete operators, enter the following command:


$ cxx/prefix=except=(__nw__xui, __dl__xpv) file.cxx

See Chapter 7 for information about using the new and delete operators.

If you are linking against the DEC C RTL object library (OLB), you can choose not to use the /noprefix_library_entries qualifier. Depending on the order that the object files are specified to the linker, the redefined function may be used instead of the run-time function.

When linking against the DEC C RTL as a shared image (which is the default), linking in your version of the new function and that of the library is undefined. The linker will emit warnings about the multiple definition of names. This is why use of the /prefix_library_entries qualifier is recommended when compiling the source files that define and reference the redefined DEC C RTL entry or the operators new and delete .

/preprocess_only[=file-spec]

/nopreprocess_only

Determines whether the compiler performs only the actions of the preprocessor phase. The default is /nopreprocess_only . When specified, the /preprocess_only qualifier writes the resulting processed text to a file with .ixx as the file type. The compiler does no semantic or syntax processing nor does it produce any object, diagnostic, or listing files. If you do not supply a file name for the preprocessor output, the compiler uses the name of the input file with .ixx as the file type.

/share_globals

/noshare_globals

Controls whether the initial extern_model is shared or not shared (for those extern_models where it is allowed). The initial extern_model of the compiler is a fictitious pragma constructed from the settings of the /EXTERN_MODEL and /SHARE_GLOBALS.

The default value is /noshare_globals, which has the following impact:

/show[=(option,...)]

Sets or cancels listing options if you also specify the /list qualifier. The options are as follows:
Option Usage
all Print all listing information.
[no]header Place header lines at the top of each page in the program listing. The default is the header option.
[no]include List the contents of #include files and modules. The default is the noinclude option.
none Create an empty listing file, with only the header. If you specify this option together with the /list and /machine_code qualifiers, the compiler puts machine code in the listing file.
[no]source List the source program statements. The default is the source option.
[no]statistics List compiler performance statistics. The default is the nostatistics option.

/standard=(option[,...])

The compiler implements the C++ International Standard. The /STANDARD qualifier directs the compiler to interpret source code according to certain nonstandard syntax conventions followed by other implementations of the C++ language. The options are:
Option Usage
cfront Interpret source programs according to certain language rules followed by AT&T's "cfront" compiler.
ms Interpret source programs according to certain language rules followed by Microsoft's Visual C++ compiler.

For more information on the effect of the /standard qualifier on Compaq C++ compile-time error checking, see Section 2.1.

/template_define[=(option,...)]

/notemplate_define

Controls compiler behavior pertaining to the instantiation of C++ templates. See Chapter 5 for details on how to instantiate templates using this qualifier. The options are as follows:
Option Usage
[no]automatic Directs Compaq C++ to turn on or off automatic instantiation of C++ templates. The default is /template_define=automatic .
[no]all Instantiates all function templates that are used and all member functions and static data members of any class templates that are used during this compilation. For /template_define=all , the template definition must be present before the point of each instantiation in the source file. The default is /template_define=noall .

Note that compile-time instantiation is generally not practical for larger applications. Template entities are instantiated with external linkage when /template_define=all is in effect, which results in multiply defined symbol errors at link time if the same template entities are instantiated in different modules.

local Instantiate only the template entities that are used in this compilation, and force those entities to be local to this compilation. The default is /template_define=nolocal .
used Instantiate only the template entities that are used in this compilation. The template entities are instantiated with external linkage. The default is /template_define=noused .
[no]pragma Determines whether Compaq C++ ignores
#pragma define_template directives encountered during the compilation. This option lets you quickly switch to automatic instantiation without having to remove all the pragma directives from your program's code base. The default is /template_define=pragma , which enables #pragma define_template .
definition_file_type= Specifies a string that contains a list of file types that are valid for template definition files. Items in the list must be separated by commas and preceded by a period. A file type is not allowed to exceed the OpenVMS limit of 39 characters. This option is applicable only when automatic instantiation has been specified. The default is /template_define=file_def=".CXX,.C,.CC,.CPP" .

To preserve compatability with releases prior to Version 5.3, the behavior is unchanged if you specify /template_define or /notemplate_define without options. Thus:
Qualifier Default for Options
/template_define /template_define= -
(noauto,all,nolocal,noused,pragma)
/notemplate_define /template_define= -
(noauto,noall,nolocal,noused,pragma)

If you do not specify /template_define or /notemplate_define , the default is to perform automatic instantiation. Thus:
Qualifier Default for Options
/None. /template_define= -
(auto,noall,nolocal,noused,pragma, -
definition_file_type=".CXX,.C,.CC,.CPP")

If you specify /template_define with some options, the defaults for non-specified options are the same as previously listed. For example, if you specify /template_define=definition_file_type=".CXX" , the options in effect are as follows:


/template_define= - 
(automatic,noall,nolocal,noused,pragma,definition_file_type=".CXX") 

/undefine=(identifier[,...])

/noundefine

Performs the same function as the #undefine preprocessor directive by canceling a previous definition (but not subsequent ones). When both the /define and /undefine qualifiers are present on the cxx command line, the compiler evaluates /define before /undefine .

The /undefine qualifier is useful for undefining the predefined Compaq C++ preprocessor constants. For example, if you use a preprocessor constant to conditionally compile segments of Compaq C++ specific code, you can undefine that constant to see how the portable sections of your program execute.

The default is /noundefine , which provides compatibility with other DCL qualifiers. You may want to use the /noundefine qualifier to cancel an /undefine qualifier that you have specified in a DCL symbol you use to compile Compaq C++ programs.

/unsigned_char

/nounsigned_char

Gives all char declarations the same representation and set of values as unsigned char declarations. The default is /nounsigned_char .

/version

/noversion

Instructs the compiler to print out its version and operating system. The compiler version is the same as in the listing file. The default is /noversion .

/xref[=file-spec]

/noxref

Controls whether the compiler generates a file of source code analysis information. The default file name is the file name of the primary source file; the default file type is .xref . Use the SCA import command to convert an .xref file into an analysis data file that is ready for loading into an SCA library.


Previous Next Contents Index
  

1.800.AT.COMPAQ

privacy and legal statement