DEC C
User's Guide for OpenVMS Systems


Previous Contents Index

For information about other compiler features that affect pointer size or warn about potential pointer size conflicts, see the following:

/PRECISION[=option]

Controls whether floating-point operations on float variables are performed in single or double precision. Table 1-17 shows the /PRECISION qualifier options.

Table 1-17 /PRECISION Qualifier Options
Option Usage
SINGLE Performs floating-point operations in single precision.
DOUBLE Performs floating-point operations in double precision.

Your code may execute faster if it contains float variables and is compiled with /PRECISION=SINGLE. However, the results of your floating-point operations will be less precise. See the DEC C Language Reference Manual for more information on floating-point variables.

The default is /PRECISION=DOUBLE for /STANDARD=VAXC and /STANDARD=COMMON compiler modes.

The default is /PRECISION=SINGLE for /STANDARD=ANSI89 and /STANDARD=RELAXED_ANSI89 compiler modes.

/[NO]PREFIX_LIBRARY_ENTRIES[=(option[,...])]

The DEC C Run-Time Library (RTL) shareable image, DECC$SHR.EXE, resides in SYS$LIBRARY with a DECC$ prefix for its entry points. The linker searches IMAGELIB.OLB to locate the shareable image. Every external name in IMAGELIB.OLB has a DECC$ prefix, and, therefore, has an OpenVMS conformant name space (a requirement for inclusion in IMAGELIB).

The /[NO]PREFIX_LIBRARY_ENTRIES qualifier lets you control the DEC C RTL name prefixing. Table 1-18 describes the /PREFIX_LIBRARY_ENTRIES qualifier options.

Table 1-18 /PREFIX_LIBRARY_ENTRIES Qualifier Options
Option Usage
EXCEPT = ( name,...) The names specified are not prefixed.
ALL_ENTRIES All DEC C RTL names are prefixed.
ANSI_C89_ENTRIES Only ANSI C library names are prefixed.
RTL=" name" Generates references to the C RTL indicated by the name keyword. (The name keyword has a length limit of 24 characters for OpenVMS VAX systems and 1017 characters for OpenVMS Alpha systems.) If no keyword is specified, then references to the DEC C RTL are generated by default. To use an alternate RTL, see its documentation for the name to use.

If you want no names prefixed, specify /NOPREFIX_LIBRARY_ENTRIES.

On OpenVMS Alpha systems:

On OpenVMS VAX systems, the default is /PREFIX_LIBRARY_ENTRIES=(ALL_ENTRIES), regardless of the /STANDARD setting.

/[NO]PREPROCESS_ONLY[=filename]

Gives the same functionality as the -e qualifier on UNIX C compilers. When specified, it performs only the actions of the preprocessor phase and writes the resulting processed text to a file. No semantic or syntax processing is done. Furthermore, no object file, diagnostic file, listing file, or analysis data file is produced.

If you do not specify a file name for the preprocessor output, the name of the output file defaults to the file name of the input file with a .I file type.

The default is /NOPREPROCESS_ONLY.

/PSECT_MODEL=[NO]MULTILANGUAGE (ALPHA ONLY)

Controls whether the compiler allocates the size of overlaid psects to ensure compatibility when the psect is shared by code created by other DEC compilers.

The problem this switch solves can occur when a psect generated by a Fortran COMMON block is overlaid with a psect consisting of a C struct. Because Fortran COMMON blocks are not padded, if the C struct is padded, the inconsistent psect sizes can cause linker error messages.

Compiling with /PSECT_MODEL=MULTILANGUAGE ensures that DEC C uses a consistent psect size allocation scheme. The corresponding Fortran switch is /ALIGN=COMMON=[NO]MULTILANGUAGE.

The default is /PSECT=NOMULTILANGUAGE, which is the old default behavior of the compiler, and is sufficient for most applications.

/REENTRANCY=option (ALPHA ONLY)

Controls the type of reentrancy that reentrant DEC C RTL routines will exhibit. (See the decc$set_reentrancy RTL routine.)

Table 1-19 describes the /REENTRANCY qualifier options.

Table 1-19 /REENTRANCY Qualifier Options
Option Usage
AST Uses the __TESTBITSSI built-in function to perform simple locking around critical sections of RTL code, and may additionally disable asynchronous system traps (ASTs) in locked region of codes. This type of locking should be used when AST code contains calls to DEC C RTL I/O routines.
MULTITHREAD Designed to be used in conjunction with the DECthreads product. It performs DECthreads locking and never disables ASTs.
NONE Gives optimal performance in the RTL, but does absolutely no locking around critical sections of RTL code. It should only be used in a single threaded environment when there is no chance that the thread of execution will be interrupted by an AST that would call the DEC C RTL.
TOLERANT Uses the __TESTBITSSI built-in function to perform simple locking around critical sections of RTL code, but ASTs are not disabled. This type of locking should be used when ASTs are used and must be delivered immediately.

The default is /REENTRANCY=TOLERANT.

/REPOSITORY=option

Specifies a repository for the compiler to store shortened external name information. When /NAMES=SHORTENED is specified, the compiler stores to the repository any external names that were shortened. The demangler utility can then be used to map the shortened names back to the names used in the original C program.

By default, the qualifier is not active unless /NAMES=SHORTENED has been specified, in which case the default is /REPOSITORY=[.CXX_REPOSITORY].

The default name of the repository is the same as that used by the DEC C++ compiler for decoding mangled names. This is intentional. A C++ mangled name cannot match a shortened name, so a single repository can be used by both the DEC C and DEC C++ compilers.

/ROUNDING_MODE=option (ALPHA ONLY)

If /FLOAT=IEEE_MODE is specified, the /ROUNDING_MODE qualifier lets you select one of the following IEEE rounding modes:
Option Usage
NEAREST Sets the normal rounding mode (unbiased round to nearest). This is the default.
DYNAMIC Sets the rounding mode for IEEE floating-point instructions dynamically, as determined from the contents of the floating-point control register.
MINUS_INFINITY Rounds toward minus infinity.
CHOPPED Rounds toward 0.

If /FLOAT=G_FLOAT or /FLOAT=D_FLOAT is specified, then rounding defaults to /ROUNDING_MODE=NEAREST, with no other choice of rounding mode.

/[NO]SHARE_GLOBALS

Controls whether the compiler will treat declarations of objects with the globaldef keyword as shared or not shared.

Also, in conjunction with the /EXTERN_MODEL qualifier, controls whether the initial extern_model is shared or not shared (for those extern_model s 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 qualifiers.

The default value is /NOSHARE_GLOBALS. This default value is different from VAX C, which treats external objects as shared by default. As a result, you may experience the following impact:

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

Sets or cancels listing options. You must use the /LIST qualifier with the /SHOW qualifier to use any of the /SHOW options. Table 1-20 describes the /SHOW qualifier options.

Table 1-20 /SHOW Qualifier Options
Option Usage
ALL Prints all listing information.
[NO]BRIEF Creates the same listing as the option SYMBOLS except that BRIEF eliminates from the list any identifiers that are not referenced in the program, and are not members of a structure or union that is referenced in the program.

The NOBRIEF option is the default.

[NO]CROSS_REFERENCE Specifies whether the compiler generates cross-references. If you specify /SHOW=CROSS_REFERENCE, the compiler lists, for each variable referenced in the procedure, the line numbers of the lines on which the variable is referenced.

You may use /SHOW=CROSS_REFERENCE with /SHOW=SYMBOLS. Otherwise, specifying /SHOW=CROSS_REFERENCE also gives you /SHOW=BRIEF. To obtain any type of listing, you must specify /LIST. Specifying /SHOW=CROSS_REFERENCE is the same as specifying /[NO]CROSS_REFERENCE.

The NOCROSS_REFERENCE option is the default.

[NO]DICTIONARY Places CDD/Repository definitions---included in the program with the #pragma dictionary preprocessor directive---into the listing file. These data definitions are marked in the listing file with an uppercase letter D in the listing margin.

The NODICTIONARY option is the default.

[NO]EXPANSION Places final macro expansions in the program listing. When you specify this option, the number printed in the margin indicates the maximum depth of macro substitutions that occur on each line.

The NOEXPANSION option is the default.

[NO]HEADER Produces the header lines at the top of each page of a listing.

The HEADER option is the default.

[NO]INCLUDE Places the contents of #include files and modules in the program listing.

The NOINCLUDE option is the default.

[NO]INTERMEDIATE (VAX ONLY) Places all intermediate and final macro expansions in the program listing.

The NOINTERMEDIATE option is the default.

NONE Creates an empty listing file with only the header. If you specify this option on a CC command line that contains /LIST and /MACHINE_CODE, the compiler places machine code in the listing file.
[NO]SOURCE Places the source program statements in the program listing.

The SOURCE option is the default.

[NO]STATISTICS Places compiler performance statistics in the program listing.

The NOSTATISTICS option is the default.

[NO]SYMBOLS Places the symbol table of the compiled program in the program listing. The symbol table includes a list of all functions, the sizes and attributes of all variables referenced in the program, and a program section summary and function definition map.

The NOSYMBOLS option is the default.

[NO]TERMINAL (VAX ONLY) Displays compiler messages to the terminal. Use /SHOW=NOTERMINAL to suppress compiler messages to the terminal or to a batch log file.

The TERMINAL option is the default.

[NO]TRANSLATION (VAX ONLY) Places into the listing file all UNIX system file specifications that the compiler translates to OpenVMS file specifications. See the DEC C Run-Time Library Reference Manual for OpenVMS Systems for more information on file translation.

The NOTRANSLATION option is the default.

/[NO]STANDARD[=(option[,...])]

Defines the compilation mode. Table 1-21 describes the /STANDARD qualifier options.

Table 1-21 /STANDARD Qualifier Options
Option Usage
ANSI89 Places the compiler in strict ANSI C Standard mode.
RELAXED_ANSI89 Places the compiler in relaxed ANSI C Standard mode.
MS Interprets source programs according to certain language rules followed by Microsoft's Visual C++ compiler.
ISOC94 Places the compiler in ISO C 94 mode, which enables digraph processing and defines the macro __stdc_version__=199409l .

Digraphs are pairs of characters that translate into a single character, much like trigraphs, except that trigraphs get replaced inside string literals, but digraphs do not. The digraphs are:
Digraph Character Represented
<: [
:> ]
<% {
%> }
%: #
%:%: ##

The ISOC94 option can be specified alone or in combination with any other option except VAXC. If specified alone, ISOC94 provides a default major mode of RELAXED_ANSI89.

COMMON Places the compiler in common C mode.
VAXC Places the compiler in VAX C mode.
PORTABLE Places the compiler in RELAXED_ANSI89 mode, and enables the issuance of diagnostics that warn about any nonportable usages encountered.

/STANDARD=PORTABLE is supported for VAX C compatibility only. It is equivalent to the recommended combination of qualifiers /STANDARD=RELAXED_ANSI89 /WARNINGS=ENABLE=PORTABLE.

MIA Places the compiler in strict ANSI C Standard mode with some behavior differences, as required by the MIA standard:
  • On OpenVMS VAX systems, G_floating becomes the default floating-point format for double variables. (VAX ONLY)

    On OpenVMS Alpha systems, G_floating is the default in any case.

  • In structures, zero-length bit fields cause the next bit field to start on an integer boundary, rather than on a character boundary.

Compiling a program with /STANDARD=MIA sets the __mia predefined macro to 1.

This qualifier directs the compiler to flag certain DEC C-specific constructs and DEC C relaxations of conventional C language constructs and rules. For example, the conversions from pointer to integer and back again are subject to more stringent tests when you specify /STANDARD=ANSI89.

The /STANDARD qualifier options are mutually exclusive. Do not combine them.

If you specify /STANDARD without an option, the default is /STANDARD= ANSI89.

The default is /NOSTANDARD, which is equivalent to /STANDARD= RELAXED_ANSI89.

With one exception, the /STANDARD qualifier options are mutually exclusive. Do not combine them. The exception is that you can specify /STANDARD=ISOC94 with any other option except VAXC.

DEC C modules compiled in different modes can be linked and executed together.

/[NO]TIE (ALPHA ONLY)

Enables the compiled code to be used in combination with translated images, either because the code might call into a translated image or might be called from a translated image. The default is /NOTIE.

/[NO]UNDEFINE=(identifier[,...])

See /[NO]DEFINE in this section.

/[NO]UNSIGNED_CHAR

By default, char is a signed character type. The /UNSIGNED_CHAR qualifier lets you change this default to an unsigned character type, which causes all plain char declarations to have the same representation and set of values as unsigned char declarations. The default is /NOUNSIGNED_CHAR.

/VAXC (VAX ONLY)

Invokes the VAX C compiler.

The CC command is used to invoke either the VAX C or DEC C compiler. If your system has a VAX C compiler installed on it, the DEC C installation procedure provides the option of specifying which compiler will be invoked by default when just the CC command is used. To invoke the compiler that is not the default, use the CC command with the appropriate qualifier: CC/DECC for the DEC C compiler, or CC/VAXC for the VAX C compiler.

If your system does not have a VAX C compiler installed on it, the CC command will invoke the DEC C compiler, and the /VAXC qualifier is not supported.

/[NO]VERSION

Directs the compiler to print out the compiler version and platform. The compiler version is the same as in the listing file.

This qualifier makes it easier for you to report what compiler you are using.

Note

To display the compiler version and platform when issuing the CC command for a source file that does not exist, enter:


CC/DECC/VERSION NL: 

/[NO]WARNINGS[=(option[,...])]

Controls the issuance of compiler diagnostic messages or groups of messages. It also allows for the severity of messages to be modified. The default qualifier, /WARNINGS, enables all warning and informational messages for the compiler mode you are using. The /NOWARNINGS qualifier suppresses the warning and informational messages. Also see the #pragma message preprocessor directive.

Table 1-22 describes the /WARNING qualifier options.

Table 1-22 /WARNINGS Qualifier Options
Option Usage
DISABLE= message-list Suppresses the issuance of the specified messages.

A description of message-list follows this table.

Only messages of severity Warning (W) or Information (I) can be disabled. If the message has severity of Error (E) or Fatal (F), it is issued regardless of any attempt to disable it.

ENABLE= message-list Enables issuance of the specified messages.
NOINFORMATIONALS Suppresses informational messages.
EMIT_ONCE= message-list Emits the specified messages only once per compilation.

Certain messages are emitted only the first time the compiler encounters the causal condition. When the compiler encounters the same condition later in the program, no message is emitted. Messages about the use of language extensions are an example of this kind of message. To emit one of these messages every time the causal condition is encountered, use the EMIT_ALWAYS option.

Errors and Fatals are always emitted. You cannot set them to EMIT_ONCE.

EMIT_ALWAYS= message-list Emits the specified messages at every occurrence of the causal condition.
ERRORS= message-list Sets the severity of the specified messages to Error.

Supplied Error messages and Fatal messages cannot be made less severe. (Exception: A message can be upgraded from Error to Fatal, then later downgraded to Error again, but it can never be downgraded from Error.)

Warnings and Informationals can be made any severity.

FATALS= message-list Sets the severity of the specified messages to Fatal.
INFORMATIONALS= message-list Sets the severity of the specified messages to Informational. Note that Fatal and Error messages cannot be made less severe.
WARNINGS= message-list Sets the severity of the specified messages to Warning. Note that Fatal and Error messages cannot be made less severe.

For a description of what to specify for the message-list, see the #pragma message preprocessor directive (Section 5.4.11).

Notes

  • If a message is on both the enabled and disabled list, it is disabled.
  • If a message is on both the EMIT_ONCE and the EMIT_ALWAYS list, it is considered to be on the EMIT_ONCE list.
  • If a message is on more than one of the FATALS, ERRORS, WARNINGS, or INFORMATIONALS lists, the message is given the least severe level.
  • The NOINFORMATIONALS option is not the negation of INFORMATIONALS=msg-list. It is valid to specify:


    /WARNINGS=(INFORMATIONALS=message_list,NOINFORMATIONALS) 
    


    This has the effect of making the messages on the message_list informationals, and causing the compiler to suppress any informational messages.

The default is /WARNINGS=ENABLE=LEVEL3.


Previous Next Contents Index