1.3 Compiling a DEC C Program

The DEC C compiler performs the following functions:

The following sections discuss the CC command and its qualifiers.

1.3.1 The CC Command

To invoke the DEC C compiler, enter the CC command at the DCL prompt ($). The CC command has the following format:

CC[/qualifier...][ file-spec [/qualifier...]],...

Note (VAX only)
This note applies to OpenVMS VAX systems that have both DEC C and VAX C installed. The CC command is used to invoke either the VAX C or DEC C compiler. If the DEC C installation procedure detects that your system already has a VAX C compiler installed on it, the installer is given the option to specify which compiler gets invoked by default whenever the CC command verb 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. Where the CC command appears in examples in this manual, CC/DECC is assumed to be the default.

/qualifier
An action to be performed by the compiler on all files or specific files listed. When a qualifier appears directly after the CC command, it affects all the files listed. When a qualifier appears after a file specification, it affects only the file that immediately precedes it. However, when files are concatenated, these rules do not apply.
file-spec
An input source file that contains the program or module to be compiled. You are not required to specify a file type if you give your file a .C file extension; the DEC C compiler adopts the default file type C.

You can include more than one file specification on the same command line by separating the file specifications with either a comma (,) or a plus sign (+). If you separate the file specifications with commas, you can control which source files are affected by each qualifier. In the following example, the DEC C compiler creates an object file for each source file but creates only a listing file for the source files PROG_1 and PROG_3:

$ CC /LIST PROG_1, PROG_2/NOLIST, PROG_3

If you separate file specifications with plus signs, the DEC C compiler concatenates each of the specified source files and creates one object file and one listing file. In the following example, only one object file is created, PROG_1.OBJ, and only one listing file is created, PROG_1.LIS. Both of these files are named after the first source file in the list, but contain all three modules.

$ CC PROG_1 + PROG_2/LIST + PROG_3

Any qualifiers specified for a single file within a list of files separated with plus signs affect all the files in the list. See the description of the /PLUS_LIST_OPTIMIZE qualifier for its affect on file concatenation.


Note
Concatenating source files without using the /PLUS_LIST_OPTIMIZE qualifier (Alpha only) is not recommended because potential conflicts in the name space of declared objects can result in compilation errors or incorrect runtime behavior.

A more common use of plus-list concatenation is for specifying text libraries. You can specify the name of a text library on the CC command line to compile a source program. A text library is a file that contains text organized into modules indexed by a table. Text libraries have a .TLB default file extension. In the following example, text libraries A.TLB and B.TLB are made available for searching for text library modules during the compilation of source file TEST.C:

$ CC TEST.C + A.TLB/LIB + B.TLB/LIB

1.3.1.1 Including Header Files

Header files are pieces of source code that typically contain declarations shared among C programs. A header file often declares a set of related functions, as well as defining any types and macros needed for their use.

To make the contents of a header file available to your program, include the header file using the #include preprocessor directive.

The #include directive has three forms. Two of the forms are defined by the ISO C standard and are portable:

The third form is the text-module form. It is specific to OpenVMS systems and is not portable. See Section 5.2.3 for more information on the text-module form of inclusion.

The form of the #include directive used determines where the compiler will look to find the file to be included. Generally, the compiler looks in the following places, in the order listed:

  1. Places named on the command line with the /INCLUDE_ DIRECTORY qualifier or the /LIBRARY qualifier

  2. Places identified through logical names, such as DECC$USER_INCLUDE, DECC$SYSTEM_INCLUDE, DECC$LIBRARY_INCLUDE, and DECC$TEXT_LIBRARY

  3. System- defined places such as the SYS$COMMON:[DECC$LIB.INCLUDE.*] directory and the SYS$LIBRARY:DECC$RTLDEF.TLB and SYS$LIBRARY:SYS$STARLET_C.TLB text libraries

See the /INCLUDE_DIRECTORY qualifier in Section 1.3.4 for a more complete description of the search- order rules that DEC C uses to locate included files.

See the DEC C Run-Time Library Reference Manual for OpenVMS Systems for information on the header files required to use DEC C Run-Time Library (RTL) functions and macros.

1.3.1.2 Listing Header Files

To list the names of system header files, use the following commands:

$ LIBRARY/LIST SYS$LIBRARY:SYS$STARLET_C.TLB
(OpenVMS Alpha and OpenVMS VAX Version 7.1 and higher)

$ LIBRARY/LIST SYS$LIBRARY:DECC$RTLDEF.TLB

$ DIR SYS$COMMON:[DECC$LIB.REFERENCE.SYS$STARLET_C]*.H;

$ DIR SYS$COMMON:[DECC$LIB.REFERENCE.DECC$RTLDEF]*.H;

$ DIR SYS$LIBRARY:*.H; 

These commands list, respectively:


Note
The SYS$COMMON:[DECC$LIB.REFERENCE.DECC$RTLDEF] and SYS$COMMON:[DECC$LIB.REFERENCE.SYS$STARLET_C] directories are only reference areas for your viewing. They are created during the compiler installation from the content of the text libraries. By default, the compiler searches only the text library files for headers; it does not search these reference directories.

Be aware that OpenVMS VAX operating systems prior to Version 7.1 do not have a file named SYS$LIBRARY:SYS$STARLET_ C.TLB. For these older versions of the operating system, the STARLET header files are generated during DEC C installation and placed in SYS$LIBRARY:DECC$RTLDEF.TLB and also in both SYS$COMMON:[DECC$LIB.REFERENCE.DECC$RTLDEF] and SYS$COMMON:[DECC$LIB.REFERENCE.SYS$STARLET_C].

1.3.2 Compilation Modes

DEC C has two complementary qualifiers that control which dialect of C is to be recognized by the compiler, and which messages are generated:

The /STANDARD qualifier causes the compiler to issue only those warnings appropriate for the dialect of C being compiled. For example, VAX C compatibility mode (/STANDARD=VAXC) does not issue warnings against VAX C extensions, while ANSI C mode does.

The DEC C compiler for OpenVMS systems provides several dialects of C, which are controlled by the /STANDARD qualifier:

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.

The /STANDARD qualifier is further described in Section 1.3.4.

1.3.3 Microsoft Compatibility Compilation Mode

The /STANDARD=MS qualifier instructs the DEC C compiler to interpret your source code according to certain language rules followed by the C compiler provided with the Microsoft Visual C++ compiler product. However, compatibility with this implementation is not complete. The following sections describe the compatibility situations that DEC C recognizes. In most cases, these situations consist of relaxing a standard behavior and suppressing a diagnostic message.

1.3.3.1 Unnamed Nested struct or union Members

Allow a declaration of a structure with no name within another structure. You can reference all members of the inner structure as members of the named outer structure. This is similar to the C++ treatment of nested unions lacking a name, but extended to both structures and unions. A similar capability is provided by the VAX C variant_struct and variant_union types.

For example:

struct{
  struct{
      int a;
      int b;
  };  /*No name here */
  int c;
}d;  /* d.a, d.b, and d.c are valid member names. */

1.3.3.2 Duplicate typedefs

Allow duplicate typedefs.

For example:

typedef int typedefname;
typedef int typedefname;

1.3.3.3 Compatible typedefs

Allow typedefs that are redeclared to a compatible type.

For example:

typedef enum {a,b,c} typedefname;
typedef enum {d,e,f} typedefname;

1.3.3.4 Structs with Trailing Incomplete Array

Allow declaration of a structure with a trailing incomplete array. This is useful if you are dealing with counted arrays, where the first element of the structure is used to hold a count of the array elements, the second element is an array of data, and the structure is always allocated dynamically. The sizeof operator treats the incomplete array as having a length of zero.

For example:

struct {
    int a;
    int b[];
}s;

1.3.3.5 Block Scope Declaration of static Functions

Allow a static function declaration in block scope (that is, inside another function).

For example:

f(){
   static int a(int b);
}

1.3.3.6 Treat &* as Having No Effect

ANSI C does not allow the & operator to produce an lvalue expression. The Microsoft relaxation allows & to produce an lvalue in certain cases.

For example:

int *a, *b;

f() {

  &*a=b;

}

1.3.3.7 Integer and Pointer Comparisons without a Cast

Allow integers and pointers to be compared without a cast.

For example:

int *a,b;

f(){
if (a==b)
   b=1;
}

1.3.3.8 char is Not Treated as a Unique Type

Treat the char type as either signed char or unsigned char, depending on the default in effect.

For example, a pointer to char can be assigned to a pointer to signed char, assuming the command-line default of /NOUNSIGNED_CHAR:

signed char *a;
char *b;

f() {
b=a;
}

1.3.3.9 Double Semicolons in Declarations

Suppress warning messages for declarations that contain two semicolons. (That is, allow completely empty declarations at file scope.)

For example:

int a;;

1.3.3.10 Declaration without a Type

Suppress warning messages for declarations that contain a variable name but no type.

For example:

b;

1.3.3.11 Enumerators in an Enumeration Declaration

Ignore any extra comma at the end of the last enumerator in an enumeration declaration.

For example:

enum E {a, b, c,};    /*  Ignore the comma after "c". /*

1.3.3.12 Useless Typedefs

Allow typedefs that have a type specifier but no identifier name declaring the new type.

For example:

typedef struct { int a; };

1.3.3.13 Unrecognized Pragmas Accepted

Suppress warning messages when one of the following unsupported Microsoft pragmas is encountered:

#pragma code_seg
#pragma optimize
#pragma warning

1.3.4 CC Command Qualifiers

The following list shows all the command qualifiers and their defaults available with the CC command. A description of each qualifier follows the list.

You can place command qualifiers either on the CC command line itself or on individual file specifications (with the exception of the /LIBRARY qualifier). If placed on a file specification, the qualifier affects only the compilation of the specified source file and all subsequent source files in the compilation unit. If placed on the CC command line, the qualifier affects all source files in all compilation units unless it is overridden by a qualifier on an individual file specification.

Table 1-1

Command Qualifiers  Default 
/[NO]ANALYSIS_DATA[=file-spec]  /NOANALYSIS_DATA 
/[NO]ANSI_ALIAS (Alpha only)  See text. 
/ASSUME=(option[, . . . ])  See text. 
/[NO]CHECK[=(option,...)] (Alpha only)  /NOCHECK 
/[NO]COMMENTS=option  See text. 
/[NO]DEBUG[=(option[, . . . ])]  /DEBUG=(TRACEBACK,NOSYMBOLS) (Alpha only) 
  /DEBUG=(TRACEBACK,NOINLINE,NOSYMBOLS) (VAX only) 
/DECC  See text. 
/[NO]DEFINE=(identifier[=definition][, . . . ])  /NODEFINE 
/[NO]DIAGNOSTICS[=file- spec]  /NODIAGNOSTICS 
/ENDIAN=option (Alpha only)  /ENDIAN=LITTLE 
/[NO]ERROR_LIMIT[=number]  /NOERROR_LIMIT (VAX only) 
/EXTERN_MODEL=option  /EXTERN_MODEL=RELAXED_ REFDEF 
/FLOAT=option  /FLOAT=G_FLOAT (Alpha only) 
  /FLOAT=D_ FLOAT (VAX only) 
/[NO]G_FLOAT  /G_FLOAT (Alpha only) 
  /NOG_FLOAT (VAX only) 
/GRANULARITY=option (Alpha only)  /GRANULARITY=QUADWORD 
/[NO]INCLUDE_ DIRECTORY=(pathname[, . . . ])  /NOINCLUDE_ DIRECTORY 
/IEEE_MODE=option (Alpha only)  IEEE_ MODE=FAST 
/INSTRUCTION_SET=[NO]FLOATING_ POINT (Alpha only)  /INSTRUCTION_SET=FLOATING_POINT 
/L_DOUBLE_SIZE=option (Alpha only)  /L_DOUBLE_SIZE=128 
/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   /MEMBER_ALIGNMENT (Alpha only) 
  /NOMEMBER_ALIGNMENT (VAX only) 
/[NO]MMS_DEPENDENCIES=option  /NOMMS_ DEPENDENCIES 
/NAMES=option  /NAMES=UPPERCASE 
/NESTED_ INCLUDE_DIRECTORY[=option]  /NESTED_ INCLUDE_DIRECTORY=INCLUDE_FILE 
/[NO]OBJECT[=file-spec]  /OBJECT 
/[NO]OPTIMIZE[=(option[, . . . ])]  /OPTIMIZE 
/PDSC_MASK=option (Alpha only)  See text. 
/[NO]PLUS_LIST_OPTIMIZE (Alpha only)  /NOPLUS_LIST_OPTIMIZE 
/[NO]POINTER_SIZE[=option] (Alpha only)  /NOPOINTER_SIZE 
/PRECISION[=option]  See text. 
/[NO]PREFIX_LIBRARY_ENTRIES[=(option[, . . . ])]   See text. 
/[NO]PREPROCESS_ ONLY[=filename]  /NOPREPROCESS_ONLY 
/REENTRANCY=option (Alpha only)  /REENTRANCY=TOLERANT 
/ROUNDING_MODE=option (Alpha only)  /ROUNDING_MODE=NEAREST 
/[NO]SHARE_GLOBALS  /NOSHARE_ GLOBALS 
/SHOW[=(option[, . . . ])]  /SHOW=(NODICTIONARY, 
  NOEXPANSION, 
  NOINCLUDE, 
  NOINTERMEDIATE, 
  NOSTATISTICS, 
  NOTRANSLATION, 
  SOURCE, 
  TERMINAL) 
/[NO]STANDARD[=(option[, . . . ])]  /NOSTANDARD (equivalent to /STANDARD=RELAXED_ANSI89 ) 
/[NO]TIE (Alpha only)  /NOTIE 
/[NO]UNDEFINE=(identifier[, . . . ])  /NOUNDEFINE 
/[NO]UNSIGNED_CHAR  /NOUNSIGNED_CHAR 
/VAXC (VAX only)  See text. 
/[NO]VERSION  /NOVERSION 
/[NO]WARNINGS[=(option[, . . . ])]  /WARNINGS 

/[NO]ANALYSIS_DATA[=file-spec]
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 .ANA. The .ANA file is reserved for use with Digital layered products. The default is /NOANALYSIS_DATA. For more information, see Appendix C.

/[NO]ANSI_ALIAS (Alpha only)
Directs the compiler to assume the ANSI C aliasing rules. By so doing, the compiler has the freedom to generate better optimized code.

The aliasing rules referred to are explained in Section 3.3, paragraphs 20 and 25 of the ANSI C Standard, reprinted as follows:

An object shall have its stored value accessed only by an lvalue that has one of the following types:

  • the declared type of the object,

  • a qualified version of the declared type of the object,

  • a type that is the signed or unsigned type corresponding to the declared type of the object,

  • a type that is the signed or unsigned type corresponding to a qualified version of the declared type of the object,

  • an aggregate or union type that includes one of the aforementioned types among its members (including, recursively, a member of a subaggregate or contained union), or

  • a character type.

If your program does not access the same data through pointers of a different type (and for this purpose, signed and qualified versions of an otherwise same type are considered to be the same type), then assuming ANSI C aliasing rules allows the compiler to generate better optimized code.

If your program does access the same data through pointers of a different type (for example, by a "pointer to int" and a "pointer to float"), then you must not allow the compiler to assume ANSI C aliasing rules. Otherwise, incorrect code might be generated.

The default is /NOANSI_ALIAS for the /STANDARD=VAXC and /STANDARD=COMMON compiler modes. The default is /ANSI_ALIAS for all other modes.

/ASSUME=(option,...)
Controls compiler assumptions. You can select one or more of the qualifier options described in Table 1-2.

Table 1-2 /ASSUME Qualifier Options

Option  Usage 
[NO]ACCURACY_SENSITIVE (Alpha only)  Specifies whether certain code transformations that affect floating-point operations are allowed. These changes may or may not affect the accuracy of the program's results. 
[NO]ALIGNED_OBJECTS (Alpha only)  Controls an optimization for dereferencing pointers. 
[NO]HEADER_TYPE_DEFAULT  Controls whether or not the default file-type mechanism for header files is enabled.  
[NO]POINTERS_TO_GLOBALS (Alpha only)  Controls whether or not the compiler can safely assume that global variables have not had their addresses taken in code that is not visible to the current compilation.  
[NO]WRITABLE_STRING_LITERALS  Stores string constants in a writable psect. Otherwise, such constants are placed in a nonwritable psect. 

[NO]ACCURACY_SENSITIVE (Alpha only)

The default is ACCURACY_SENSITIVE.

If you specify NOACCURACY_SENSITIVE, 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 default, ACCURACY_SENSITIVE, directs the compiler to use only certain scalar rules for calculations. This setting can prevent some optimizations.

If you use the /ASSUME=NOACCURACY_SENSITIVE qualifier, DEC C might reorder code (based on algebraic identities) to improve performance. The results can be different from the default (/ASSUME=ACCURACY_ SENSITIVE) because of how the intermediate results are rounded. However, the NOACCURACY_SENSITIVE results are not categorically less accurate than those gained by the default.

[NO]ALIGNED_OBJECTS (Alpha only)

The default is /ASSUME=ALIGNED_OBJECTS.

On OpenVMS Alpha systems, 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.

Since 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. Specifying /ASSUME=ALIGNED_OBJECTS (the default) allows the compiler to make such an assumption. With this assumption made, the compiler can generate more efficient code for pointer dereferences of aligned pointer types.

To prevent the compiler from assuming the pointer type's alignment for objects that it points to, use the /ASSUME=NOALIGNED_OBJECTS qualifier.

Before deciding whether to specify /ASSUME=NOALIGNED_OBJECTS or /ASSUME=ALIGNED_OBJECTS, you need to know what programming practices will affect your decision.

The compiler assumes that pointers point to objects that are aligned at least as much as the alignment of the pointer type. For example:

If your module breaks this rule, your program will suffer alignment faults at runtime that can seriously degrade performance. If you can identify the places in your code where the rule is broken, use the __unaligned type qualifier. Otherwise, the /ASSUME=NOALIGNED_ OBJECTS qualifier effectively treats all dereferences as if they were unaligned.

DEC C for OpenVMS Alpha Systems aligns all nonmember declarations on natural boundaries, so by default all objects do comply with the previous assumption. Also, the standard library routine malloc on OpenVMS systems returns quadword-aligned heap memory.

A program can violate the previous assumption in any of the following ways:

The following example explicitly specifies a lesser alignment for an object than the pointer type's alignment, which occurs when the address of an unaligned int member of a struct with #pragma nomember_alignment is used in a pointer dereference:

#pragma nomember_alignment
struct foo {
    char C;
    int i; /* i is unaligned because of char C */
};

struct foo st;
int        *i_p;

i_p = &st.i;

... *i_p ...    /* An expression containing a dereferenced i_p */

This example casts a pointer to a pointer type with stricter alignment:

int        *i_p;
char       *c_p;

.......
.......

i_p = (int *)c_p;

... *i_p ...    /* An expression containing a dereferenced i_p */

The following example encloses a member-aligned object inside a nonmember-aligned object:

#pragma member_alignment
struct inside {
    int i;  /* this type asserts that its objects have at least
               longword alignment (int is a longword)... */
};

#pragma nomember_alignment
struct outside {
    char C;
    struct inside s; /* ...but foo_ptr -> s is only byte-aligned! */
} *foo_ptr;

The expression foo_ptr -> s has a type whose alignment is explicitly specified to be longword (because longword is the strictest alignment of the structure's members), but the expression type is only guaranteed to be byte-aligned.

Also note that just as the pointer type information can direct the compiler to generate the appropriate code to dereference the pointer (code that does not cause alignment faults), it can also direct the compiler to generate even better code if it indicates that the object is at least longword-aligned.

[NO]HEADER_TYPE_DEFAULT

The default is /ASSUME=HEADER_TYPE_DEFAULT.

In previous versions of DEC C, the #include directive always supplied a default file type of .h for C compilations. Similarly, DEC C++ supplied a default file type of .hxx for C++ compilations.

However, the ANSI C++ standard requires that, for example, #include <iostream> be distinguishable from #include <iostream.hxx>. This is not possible with the header file-type default mechanism in effect.

You can disable the type default mechanism for either DEC C or DEC C++ by specifying /ASSUME=NOHEADER_TYPE_DEFAULT.

With /ASSUME=NOHEADER_TYPE_DEFAULT specified, an #include directive written with the standard syntax for header name (enclosed in quotes or angle brackets) will use the filename as specified, without supplying a default file type. More precisely stated, the default file type will be empty (just ".").

For example, a directory might contain three files named IOSTREAM., IOSTREAM.HXX, and IOSTREAM.H. By default, the C++ compiler processes #include <iostream> such that the file IOSTREAM.HXX is found, while the C compiler would find IOSTREAM.H.

However, if /ASSUME=NOHEADER_TYPE_DEFAULT is specified, the same directive causes the file IOSTREAM. to be found by both compilers, and the only way to include the file named IOSTREAM.HXX or IOSTREAM.H is to specify the .hxx or .h file type explicitly in the #include directive. Be aware that while the OpenVMS operating system treats filenames as case-insensitive and normally displays them in uppercase, filenames in #include directives should use lowercase for best portability. This is more in keeping with other C and C++ implementations.

[NO]POINTERS_TO_GLOBALS (Alpha only)

The default is /ASSUME=POINTER_TO_GLOBALS, which directs the compiler to assume that global variables have had their addresses taken in separately compiled modules and that, in general, any pointer dereference could be accessing the same memory as any global variable. This is often a significant barrier to optimization.

The /ANSI_ALIAS command-line qualifier allows some resolution based on data type, but /ASSUME=NOPOINTER_TO_GLOBALS provides significant additional resolution and improved optimization in many cases.

/ASSUME=NOPOINTER_TO_GLOBALS tells the compiler that any global variable accessed through a pointer in the compilation must have had its address taken within that compilation. The compiler can see any code that takes the address of an extern variable. If it does not see the address of the variable being taken, the compiler can assume that no pointer points to the variable.

Consider the following code sequence:

extern int x;
...
int *p;
...
*p = 3;

Under /ASSUME=NOPOINTERS_TO_GLOBALS, the compiler can assume that x is not changed by the assignment through p when generating code. This can lead to faster code.

In combination with the /PLUS_LIST_OPTIMIZE qualifier, several source modules can be treated as a single compilation for the purpose of this analysis. Because run-time libraries such as the DEC C RTL do not take the addresses of global variables defined in user programs, source modules can often be combined into a single compilation that allows /ASSUME=NOPOINTER_TO_GLOBALS to be used effectively.

Be aware that /ASSUME=NOPOINTERS_TO_GLOBALS does not tell the compiler that the compilation never uses pointers to access global variables (which is seldom true of real C programs).

[NO]WRITABLE_STRING_LITERALS

For /STANDARD=VAXC or /STANDARD=COMMON, the default is /ASSUME=WRITABLE_STRING_LITERALS.

For all other compiler modes, the default is /ASSUME=NOWRITABLE_ STRING_LITERALS.

/[NO]CHECK[=([NO]UNINITIALIZED_VARIABLES, [NO]POINTER_SIZE[=(option,...)])] (Alpha only)
This qualifier is for use as a debugging aid.

Use /CHECK=UNINITIALIZED_VARIABLES to initialize all automatic variables to the value 0xfffa5a5afffa5a5a. This value is a floating NaN and, if used, causes a floating-point trap. If used as a pointer, this value is likely to cause an ACCVIO.

Use /CHECK=POINTER_SIZE to direct the compiler to generate code that checks 64-bit pointer values (used in certain contexts where 32-bit pointers are also present) to make sure they will fit in a 32-bit pointer. If such a value cannot be represented by a 32-bit pointer, the run-time code signals a range error (SS$_RANGEERR).

To control the types of pointer-size checks you want made, use one or more of the POINTER_SIZE option keywords shown in Table 1-3.

Table 1-3 /CHECK=POINTER_SIZE Qualifier Options

Option  Usage 
[NO]ASSIGNMENT  Check whenever a 64-bit pointer is assigned to a 32-bit pointer (including use as an actual argument). 
[NO]CAST  Check whenever a 64-bit pointer is cast to a 32-bit pointer. 
[NO]PARAMETER  Check all formal parameters at function startup to make sure that all formal parameters declared to be 32-bit pointers are 32-bit values. 
ALL  Do all checks. 
NONE  Do no checks. 

Omitting this qualifier defaults to /NOCHECK, which equates to /CHECK=(NOUNINITIALIZED_VARIABLE,NOPOINTER_SIZE).

Specifying /CHECK=POINTER_SIZE defaults to /CHECK=POINTER_ SIZE=(ASSIGNMENT,PARAMETER).

Specifying /CHECK defaults to /CHECK=(UNINITIALIZED_VARIABLES, POINTER_SIZE), which equates to /CHECK=(UNINITIALIZED_VARIABLES, POINTER_SIZE=(ASSIGNMENT,PARAMETER)).

For information about compiler features that affect pointer size, see the following:

The following contrived program contains a number of pointer assignments. The comment on each line indicates what /CHECK=POINTER_ SIZE keyword to specify to enable checking for that line.

    #pragma required_pointer_size long
    int *a;
    char *b;
    typedef char * l_char_ptr;

    #pragma required_pointer_size short
    char *c;
    int *d;

    foo(int * e)              /* Check e if PARAMETER is specified. */
    {
        d = a;                /* Check a if ASSIGNMENT is specified. */
        c = (char *) a;       /* Check a if CAST is specified. */
        c = (char *) d;       /* No checking ever. */
        foo( a );             /* Check a if ASSIGNMENT is specified. */
        bar( a );             /* No checking ever - no prototype */
        b = (l_char_ptr) a;   /* No checking ever. */
        c = (l_char_ptr) a;   /* Check a if ASSIGNMENT is specified */
        b = (char *) a;       /* Check if CAST is specified. */
    }

/[NO]COMMENTS=option
Governs whether or not comments appear in preprocess output files and, if they are to appear, whether they appear themselves or are replaced by a single space.

Table 1-4 shows the /COMMENTS qualifier options.

Table 1-4 /COMMENTS Qualifier Options

Option  Usage 
AS_ IS  Specifies that the comment appears in the output file. 
SPACE  Specifies that a single space replaces the comment in the output file. 

/NOCOMMENTS specifies that nothing replaces the comment in the output file. This can result in inadvertent token pasting.

The DEC C preprocessor might replace a comment at the end of a line or on a line by itself with nothing, even if /COMMENTS=SPACE is specified. Doing so does not change the meaning of the program.

The default is /COMMENTS=SPACE for the ANSI89, RELAXED_ANSI89, and MIA modes of the compiler. The default is /NOCOMMENTS for all other compiler modes.

Specifying /COMMENTS on the command line defaults to /COMMENTS=AS_IS.

/[NO]DEBUG[=(option[, . . . ])]
Includes information in the object module for use by the OpenVMS Debugger.

The default on Alpha systems is /DEBUG=(TRACEBACK,NOSYMBOLS).

The default on VAX systems is /DEBUG=(TRACEBACK,NOINLINE, NOSYMBOLS).

Table 1-5 describes the debugger options.

Table 1-5 Debugger Compilation Options

Option  Usage 
ALL  Includes symbol table records and traceback records. This is equivalent to /DEBUG=INLINE. 
INLINE (VAX only)  Generates debug information to cause a STEP command to STEP/INTO an inlined function call. 
NOINLINE (VAX only)  Generates debug information to cause a STEP command to STEP/OVER an inlined function call. 
NONE  Does not include any debugging information. This is equivalent to /NODEBUG.  
NOTRACEBACK  Does not include traceback records. This option is used to exclude all extraneous information from thoroughly debugged program modules. This option is equivalent to /NODEBUG.  
NOSYMBOLS  Includes only traceback records. This is the default if the /DEBUG qualifier is not present on the command line.  
SYMBOLS  Includes symbol table records, but not the traceback records.  
TRACEBACK  Includes only traceback records. This is the default if the /DEBUG qualifier is not present on the command line. 

/DECC
Invokes the DEC C compiler.

On OpenVMS VAX systems, the CC command is used to invoke either the VAX C or DEC C compiler. If your system has a VAX C compiler already 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.

On OpenVMS Alpha systems, specifying /DECC is equivalent to not specifying it; this qualifier is supported to provide compatibility with DEC C on OpenVMS VAX systems.

/[NO]DEFINE=(identifier[=definition][, . . . ])
Performs the same functions as the #define and #undef preprocessor directives. The /DEFINE qualifier defines a macro to be substituted for every occurrence of a given identifier in the compilation unit or units. The /UNDEFINE qualifier cancels a previous definition (but not subsequent ones). When both /DEFINE and /UNDEFINE are present in a compilation unit or on the CC command line, /DEFINE is evaluated before /UNDEFINE.

Since /DEFINE and /UNDEFINE are not part of the source file, they are not associated with a listing line number or source line number. Therefore, when an error occurs in a command-line definition, the message displayed at the terminal does not indicate a line number. In the listing file, these diagnostic messages are placed before the source listing in the order that they were encountered. When the expansion of a definition causes an error at a specific source line in the program, the diagnostics-both at the terminal and in the listing file-are associated with that source line.

A command line containing the /DEFINE and the /UNDEFINE qualifiers can be long. Continuation characters cannot appear within quotes or they will be included in the macro stream. The length of a CC command line cannot exceed the maximum length allowed by DCL.

The /NODEFINE and /NOUNDEFINE qualifiers are provided for compatibility with other DCL qualifiers. You can use these qualifiers to cancel /DEFINE or /UNDEFINE qualifiers that you have specified in a symbol that you use to compile DEC C programs.

The defaults are /NODEFINE and /NOUNDEFINE.

Usage and Examples

Since the CC command line must be compatible with DCL, the syntax of the /DEFINE and /UNDEFINE qualifiers differs from the syntax of the #define and #undef preprocessor directives in the following way:

You can pass an equal sign to the compiler in any of the following ways:

$ CC/DEFINE=(EQU==,"equ =","equal==")

In the first definition, the first equal sign is removed by DCL as the delimiter; the second equal sign is passed to the compiler. In the second example, the space is recognized as a delimiter because the definition is inside quotes; therefore, only one equal sign is required. In the third definition, the first equal sign is recognized as the delimiter and is removed; the second equal sign is passed to the compiler.

You can pass quotation marks in any of the following ways:

$ CC/DEFINE=(QUOTES="""","funct(b)=printf(")")

In both examples, DCL removes the first and last quotation marks before passing the definition to the compiler.

Here is a simple use of the /UNDEFINE qualifier to cancel a previous definition of TRUE:

$ CC/UNDEFINE=TRUE

The /UNDEFINE qualifier is useful for undefining the predefined DEC C preprocessor constants. For example, if you use a preprocessor system identification macro (such as __vaxc, __VAXC, __DECC, or __vms) to conditionally compile segments of DEC C specific code, you can undefine that constant to see how the portable sections of your program execute. Consider the following program:

main()
{
#if __DECC
printf("I'm being compiled with DEC C on an OpenVMS system.");
#else
printf("I'm being compiled on some other compiler.");
#endif
}

This program produces the following output:

$ CC  EXAMPLE.C<Return>
$ LINK  EXAMPLE.OBJ<Return>
$ RUN  EXAMPLE.EXE<Return>
I'm being compiled with DEC C on an OpenVMS system.

$ CC/UNDEFINE="__DECC" EXAMPLE <Return>

$ LINK  EXAMPLE.OBJ<Return>

$ RUN  EXAMPLE.EXE<Return>
I'm being compiled on some other compiler.

/[NO]DIAGNOSTICS[=file-spec]
Creates a file containing compiler messages and diagnostic information. The default file extension for a diagnostics file is .DIA. The diagnostics file is used with the DEC Language- Sensitive Editor (LSE). To display a diagnostics file, enter the command REVIEW/FILE=file-spec while in LSE. For more information, see Appendix C. The default is /NODIAGNOSTICS.

/ENDIAN=option (Alpha only)
This qualifier takes the options BIG or LITTLE.

It controls whether big or little endian ordering of bytes is carried out in character constants. For example, consider the following declaration:

int foo = 'ABCD';

Specifying /ENDIAN=LITTLE places 'A' in the first byte, 'B' in the second byte, and so on.

Specifying /ENDIAN=BIG places 'D' in the first byte, 'C' in the second byte, and so on.

The default is /ENDIAN=LITTLE.

/[NO]ERROR_LIMIT[=option] (VAX only)
This qualifier limits the number of E-level diagnostics allowed before DEC C stops a compilation. The default is /NOERROR_ LIMIT, which is some large number greater that 124.

/EXTERN_MODEL=option
In conjunction with the /[NO]SHARE_GLOBALS qualifier, controls the initial compiler model for external objects. Conceptually, the compiler behaves as if the first line of the program being compiled was a #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 /[NO]SHARE_GLOBALS qualifier.

For example, assume the command line contains the following qualifiers:

/EXTERN_MODEL=STRICT_REFDEF="MYDATA"/NOSHARE

The compiler will behave as if the program begins with the following line:

#pragma extern_model strict_refdef "MYDATA" noshr

Table 1-6 describes the /EXTERN_MODEL qualifier options.

Table 1-6 /EXTERN_MODEL Qualifier Options

Option  Usage 
COMMON_BLOCK  Sets the compiler's extern_model to the common_block model. This is the model traditionally used for extern data by VAX C. 
RELAXED_ REFDEF  Sets the compiler's extern_model to the relaxed_refdef model. Some declarations are references and some are definitions. Multiple uninitialized definitions for the same object are allowed and are resolved into one by the linker. However, a reference requires that at least one definition exist.

This is the model used by the portable C compiler (pcc) on UNIX systems. 

STRICT_REFDEF [="name"]  Sets the compiler's extern_model to the strict_refdef model. Some declarations are references and some are definitions. There must be exactly one definition in the program for any symbol referenced. The optional name, in quotation marks, is the name of the psect for any definitions.

This is the model specified by ANSI C. Use it in a program that is to be a strict ANSI C conforming program.

This model is the preferred alternative to the nonstandard storage- class keywords globaldef and globalref. 

GLOBALVALUE  Sets the compiler's extern_model to the globalvalue model. This model is similar to the strict_refdef model except that these global objects have no storage; instead, they are link-time constant values. There are two cases:

  • If the declaration is an ANSI C reference, the same object file records are produced as VAX C would produce for an uninitialized globalvalue.

  • If the declaration is an ANSI C definition, the same object records are produced as VAX C would produce for an initialized globalvalue.

This model is the preferred alternative to the nonstandard storage- class keyword globalvalue. 

The default is /EXTERN_MODEL=RELAXED_REFDEF. This is different from VAX C, which uses the common block model for external objects.

/FLOAT=option
Controls the format of floating-point variables.

On OpenVMS Alpha systems, representation of double variables defaults to G_floating format if not overridden by another format specified with the /FLOAT or /[NO]G_FLOAT qualifier.

If you are linking against object-module libraries, and /PREFIX=ALL is not specified on the command line:

The VAXCRTLX.OLB, VAXCRTLDX.OLB, and VAXCRTLTX.OLB libraries are used for the same floating-point formats, respectively, but include support for X_FLOAT format (/L_DOUBLE_SIZE=128). (Alpha only)

If /PREFIX=ALL is specified, then there is no need to link to the above- mentioned *.OLB object libraries. All the symbols you need are in STARLET.OLB. (Alpha only)

On OpenVMS VAX systems, representation of double variables defaults to D_floating format if not overridden by another format specified with the /FLOAT or /[NO]G_FLOAT qualifier. There is one exception: if /STANDARD=MIA is specified, G_floating is the default. If you are linking against object-module libraries, a program compiled with G_ floating format must be linked with the object library DECCRTLG.OLB. (VAX only)

Table 1-7 describes the /FLOAT qualifier options.

Table 1-7 /FLOAT Qualifier Options

Option  Usage 
D_ FLOAT  double variables are represented in D_floating format. 
G_FLOAT  double variables are represented in G_floating format. 
IEEE_FLOAT (Alpha only)  float and double variables are represented in IEEE floating-point format (S_float and T_float, respectively). Use the /IEEE_MODE qualifier for controlling the handling of IEEE exceptional values. If /IEEE_MODE is not specified, the default behavior is /IEEE_MODE=FAST.  

/[NO]G_FLOAT
Controls the format of floating-point variables. The /[NO]G_ FLOAT qualifier is replaced by the /FLOAT qualifier, but is retained for compatibility.

If you specify /G_FLOAT, double variables are represented in G_ floating format.

If you specify /NOG_FLOAT, double variables are represented in D_ floating format. (See Section 4.5 for more information on the floating formats.)

On OpenVMS Alpha systems, representation of double variables defaults to G_floating format if not overridden by another format specified with the /FLOAT or /[NO]G_FLOAT qualifier.

If you are linking against object-module libraries, and /PREFIX=ALL is not specified on the command line:

The VAXCRTLX.OLB, VAXCRTLDX.OLB, and VAXCRTLTX.OLB libraries are used for the same floating-point formats, respectively, but include support for X_FLOAT format (/L_DOUBLE_SIZE=128). (Alpha only)

If /PREFIX=ALL is specified, then there is no need to link to the above- mentioned *.OLB object libraries. All the symbols you need are in STARLET.OLB. (Alpha only)

On OpenVMS VAX systems, representation of double variables defaults to D_floating format if not overridden by another format specified with the /FLOAT or /[NO]G_FLOAT qualifier. There is one exception: if /STANDARD=MIA is specified, G_floating is the default. If you are linking against object-module libraries, a program compiled with G_floating format must be linked with the object library DECCRTLG.OLB. (VAX only)

/GRANULARITY=option (Alpha only)
Determines how much memory to effectively cache for memory reference, depending on the compiler and the underlying system. For example, quadword granularity may require that the system cache quadword values in registers. If access to data in the same granularity unit occurs simultaneously, corruption (by storing back stale values) can occur.

Granularity has two aspects: references inside a particular data segment and references between data segments.

The options are:


BYTE
LONGWORD
QUADWORD

The default is /GRANULARITY=QUADWORD.

/IEEE_MODE=option (Alpha only)
Selects the IEEE floating-point mode to be used if /FLOAT=IEEE_ FLOAT is specified.

Table 1-8 describes the /IEEE_ MODE options.

Table 1-8 /IEEE_MODE Options

Option  Usage 
FAST  During program execution, only finite values (no infinities, NaNs, or denorms) are created. Underflows and denormal values are flushed to zero. Exceptional conditions, such as floating-point overflow, divide-by-zero, or use of an IEEE exceptional operand are fatal. This is the default option. 
UNDERFLOW_TO_ZERO  Generate infinities and NaNs. Flush denormalized results and underflow to zero without exceptions. 
DENORM_RESULTS  Same as UNDERFLOW_TO_ ZERO, except that denorms are generated. 
INEXACT  Same as DENORM_RESULTS, except that inexact values are trapped. This is the slowest mode, and is not appropriate for any sort of general-purpose computations. 

The default is /IEEE_MODE=FAST.

/[NO]INCLUDE_DIRECTORY=(pathname[, . . . ])
Provides similar functionality to the -I option of the cc command on Digital UNIX systems. This qualifier allows you to specify additional places to search for include files. A place can be one of the following:

If one of the places is specified as an empty string, the compiler does not search any of its conventionally-named places:


DECC$USER_INCLUDE
DECC$SYSTEM_INCLUDE
DECC$LIBRARY_INCLUDE
SYS$COMMON:[DECC$LIB.INCLUDE.*]
DECC$TEXT_LIBRARY
SYS$LIBRARY:DECC$RTLDEF.TLB
SYS$LIBRARY:SYS$STARLET_C.TLB

Instead, it searches only places specified explicitly on the command line by the /INCLUDE_DIRECTORY and /LIBRARY qualifiers (or by the location of the primary source file, depending on the /NESTED_ INCLUDE_DIRECTORY qualifier). This behavior is similar to that obtained by specifying -I without a directory name to the Digital UNIX cc command.

The basic search order depends on the form of the header-file name (after macro expansion). Additional aspects of the search order are controlled by other command-line qualifiers and the presence or absence of logical name definitions.

Only the portable forms of the #include directive are affected by the pathnames specified on an /INCLUDE_DIRECTORY qualifier:

However, an empty string also affects the text-module form specific to OpenVMS systems (example: #include stdio).

Except where otherwise specified, searching a "place" means that the string designating the place is used as the default file-spec in a call to an RMS system service (for example, $SEARCH/$PARSE). The file-spec consists of the name in the #include directive without enclosing delimiters. The search terminates successfully as soon as a file can be opened for reading.


Note
Prior to OpenVMS VAX Version 7.1, the operating system did not provide a SYS$LIBRARY:SYS$STARLET_ C.TLB nor the headers contained therein. Instead, the compiler installation generated these headers and placed them in SYS$LIBRARY:DECC$RTLDEF.TLB.

Quoted Form

For the quoted form of inclusion, the search order is:

  1. One of the following:

    • If /NESTED_INCLUDE_DIRECTORY=INCLUDE_FILE (the default) is in effect, search the directory containing the file in which the #include directive itself occurred. The directory containing means the RMS resultant string obtained when the file in which the #include occurred was opened, except that the filename and subsequent components are replaced by the default file type for headers (".h", or just "." if /ASSUME=NOHEADER_TYPE_DEFAULT is in effect). The resultant string will not have translated any concealed device logical.

    • If /NESTED_INCLUDE_DIRECTORY=PRIMARY_FILE is in effect, search the default file type for headers using the context of the primary source file. This means that just the file type (".h" or ".") is used for the default file-spec but, in addition, the chain of "related file-specs" used to maintain the sticky defaults for processing the next top-level source file is applied when searching for the include file. This most closely matches the behavior of the VAX C compiler.

    • If /NESTED_INCLUDE_DIRECTORY=NONE is in effect, this entire step (Step 1) is bypassed.

  2. Search the places specified in the /INCLUDE_DIRECTORY qualifier, if any. A place that can be parsed successfuly as an OpenVMS file-spec and that does not contain an explicit file type or version specification is edited to append the default header file type specification (".h" or ".").

    A place containing a "/" character is considered to be a UNIX- style name. If the name in the #include directive also contains a "/" character that is not the first character and is not preceded by a "!" character (it is not an absolute UNIX-style pathname), then the name in the #include directive is appended to the named place, separated by a "/" character, before applying the decc$to_ vms pathname translation function. The result of the decc$to_vms translation is then used as the filespec to try to open.

  3. If DECC$USER_INCLUDE is defined as a logical name, search DECC$USER_INCLUDE:.H, or just DECC$USER_INCLUDE:. if /ASSUME=NOHEADER_TYPE_DEFAULT is in effect.

  4. If the file is not found, follow the steps for the angle- bracketed form of inclusion.

Angle-Bracketed Form

For the angle-bracketed form of inclusion, the search order is:

  1. Search the place "/". This is a UNIX-style name that can combine only with UNIX names specified explicitly in the #include directive. It causes a specification like <sys/types.h> to be considered first as /sys/types.h, which is translated by decc$to_ vms to SYS:TYPES.H.

  2. Search the places specified in the /INCLUDE_DIRECTORY qualifier, exactly as in Step 2 for the quoted form of inclusion.

  3. If DECC$SYSTEM_INCLUDE is defined as a logical name, search DECC$SYSTEM_INCLUDE:.H, or just DECC$SYSTEM_INCLUDE:. if /ASSUME=NOHEADER_TYPE_DEFAULT is in effect.

  4. If DECC$LIBRARY_INCLUDE is defined as a logical name and DECC$SYSTEM_INCLUDE is not defined as a logical name, search DECC$LIBRARY_INCLUDE:.H, or just DECC$LIBRARY_INCLUDE:. if /ASSUME=NOHEADER_TYPE_DEFAULT is in effect.

  5. If neither DECC$LIBRARY_INCLUDE nor DECC$SYSTEM_INCLUDE are defined as logical names, then search the default list of places for plain text-file copies of compiler header files as follows:
    SYS$COMMON:[DECC$LIB.INCLUDE.DECC$RTLDEF].H
    SYS$COMMON:[DECC$LIB.INCLUDE.SYS$STARLET_C].H

    Note
    The compiler installation does not create these directories of header files. Instead, it creates [DECC$LIB.REFERENCE] for your convenience. But if you choose to create and populate SYS$COMMON:[DECC$LIB.INCLUDE.DECC$RTLDEF] or SYS$COMMON:[DECC$LIB.INCLUDE.SYS$STARLET_C].H, the compiler will search them.

    If the file is not found, perform the text library search described in the next step.

  6. Extract the simple filename and file type from the #include specification and use the filename as the module name to search a list of text libraries associated with that file type.

    For any file type, the initial text libraries searched consist of those named on the command line with /LIBRARY qualifiers, searched in left-to-right order.

    If the /INCLUDE_DIRECTORY qualifier contained an empty string, no further text libraries are searched. Otherwise, DECC$TEXT_LIBRARY is searched for all file types.

    If DECC$LIBRARY_INCLUDE is defined as a logical name, then no further text libraries are searched. Otherwise, the subsequent libraries searched for each file type are:

    • For a file type of ".h" or ".":
      SYS$LIBRARY:DECC$RTLDEF.TLB
      SYS$LIBRARY:SYS$STARLET_C.TLB

    • For a file type other then ".h" or ".":
      SYS$LIBRARY:SYS$STARLET_C.TLB

  7. If the previous step fails, search the following:
    SYS$LIBRARY:.H

    Under /ASSUME=NOHEADER_TYPE_DEFAULT, the default file type is modified as usual.

Text-Module Form

For the text-module (nonportable) form of inclusion, the name can only be an identifier. It, therefore, has no associated file type.

The identifier is used as a module name to search the following:

  1. The text libraries named on the command line with /LIBRARY qualifiers, in left-to-right order.

  2. The following list of text libraries in the order shown (unless the /INCLUDE_DIRECTORY qualifier contains an empty string, in which case no further text libraries are searched):
    DECC$TEXT_LIBRARY
    SYS$LIBRARY:DECC$RTLDEF.TLB
    SYS$LIBRARY:SYS$STARLET_C.TLB

The default for this qualifer is /NOINCLUDE_DIRECTORY.

/INSTRUCTION_SET=[NO]FLOATING_POINT (Alpha only)
The /INSTRUCTION_SET=NOFLOATING_POINT qualifier suppresses the generation of floating-point instructions for integer operations.

The default is /INSTRUCTION_SET=FLOATING_POINT.

/L_DOUBLE_SIZE=option (Alpha only)
Determines how the compiler interprets the long double type. The qualifier options are 64 and 128.

Specifying /L_DOUBLE_SIZE=64 treats all long double references as G_FLOAT, D_FLOAT, or T_FLOAT, depending on the value of the /FLOAT qualifier.

Specifying /L_DOUBLE_SIZE=128 treats all long double references as X_FLOAT.

The default is /L_DOUBLE_SIZE=128.

/LIBRARY
Indicates that the associated input file is a library containing modules of DEC C source text. If the library specification does not include a file extension, the CC command line assumes the .TLB default type. You must join the /LIBRARY qualifier with a file specification in a compilation unit using a plus sign (+); you cannot place the qualifier at other places on the CC command line. No matter where you place the /LIBRARY qualifier in a compilation unit, all files in the unit may make reference to modules within that library. Consider the following example:
$ CC  ONE + TWO + THREE/LIBRARY<Return>

Files ONE.C and TWO.C can contain references to modules in THREE.TLB. Consider the following example:

$ CC  ONE + TWO + THREE/LIBRARY, FOUR<Return>

The file FOUR.C cannot contain references to modules in THREE.TLB since FOUR.C is located in a separate compilation unit separated by a comma. The placement of the library file specification does not matter. The following command lines are equivalent:

$ CC  THREE/LIBRARY + ONE + TWO<Return>
$ CC  ONE + THREE/LIBRARY + TWO<Return>
$ CC  ONE + TWO + THREE/LIBRARY<Return>

/[NO]LINE_DIRECTIVES
Governs whether or not #line directives appear in preprocess output files.

The default is /LINE_DIRECTIVES.

/[NO]LIST[=file-spec]
Produces a source program listing. You must specify this qualifier to get a listing. None of the other qualifiers use /LIST by default.

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.)

/[NO]MACHINE_CODE[=option]
Lists the generated machine code in the listing file. To produce the listing file, you must also specify /LIST.

On OpenVMS VAX systems, several formats exist to list machine code. Table 1-9 describes the /MACHINE_ CODE qualifier options.

Table 1-9 /MACHINE_CODE Qualifier Options (VAX only)

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.  

On OpenVMS Alpha sytems, the format of the generated machine code listing is similar to what you would get using the AFTER keyword on OpenVMS VAX systems.

The default is /NOMACHINE_CODE.

/[NO]MEMBER_ALIGNMENT
Controls whether the compiler naturally aligns data structure members. Natural alignment means that data structure members are aligned on the next boundary appropriate to the type of the member, rather than on the next byte. For instance, a long variable member is aligned on the next longword boundary; a short variable member is aligned on the next word boundary.

Any use of the #pragma member_alignment or #pragma nomember_ alignment directives within the source code overrides the setting established by this qualifier. Specifying /NOMEMBER_ALIGNMENT causes data structure members to be byte-aligned (with the exception of bit-field members).

On OpenVMS Alpha systems, the default is /MEMBER_ALIGNMENT.

On OpenVMS VAX systems, the default is /NOMEMBER_ALIGNMENT.

See the description of #pragma [no]member_alignment in Section 5.4.9.

/[NO]MMS_DEPENDENCIES[=(option[, . . . ])]
Directs the compiler to produce a dependency file. Dependency files list all source files and included files for each object module. The dependency file format is:
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>)

Table 1-10 shows the /MMS_ DEPENDENCIES qualifier options.

Table 1-10 /MMS_DEPENDENCIES Qualifier Options

Option  Usage 
FILE[=filespec]  Specifies where to save the dependency file. The default file extension for a dependency file is .mms. Other than using this different default extension, /MMS_DEPENDENCY uses the same procedure that the /OBJECT and /LIST qualifiers do for determining the name of the output file. 
[NO]SYSTEM_INCLUDE_FILES  Specifies whether or not to include dependency information about system include files (those included with #include <filename>.) If omitted, this option defaults to including dependency information about system include files. 

The default is /NOMMS_DEPENDENCY.

/NAMES=option
Converts all definitions and references of external symbols and psects to the specified case. Table 1-11 describes the /NAMES qualifier options.

Table 1-11 /NAMES Qualifier Options

Option  Usage 
UPPERCASE  Converts to uppercase. 
LOWERCASE  Converts to lowercase. 
AS_IS  Leaves the case as specified in the source. 

The default is /NAMES=UPPERCASE. This provides the same behavior as VAX C does.


Note
On OpenVMS VAX systems, the /NAMES qualifier does not affect the names of the $CODE and $DATA psects.

On OpenVMS Alpha systems, the /NAMES qualifier does not affect the names of the $ABS$, $BSS$, $CODE$, $DATA$, $LINK$, $LITERAL$, and $READONLY$ psects.


/NESTED_INCLUDE_DIRECTORY[=option]
Controls the first step in the compiler's search algorithm for finding files that are included using the quoted form of the #include preprocessing directive:
#include "file-spec"

Table 1-12 describes the /NESTED_ INCLUDE_DIRECTORY qualifier options.

Table 1-12 /NESTED_INCLUDE_DIRECTORY Qualifier Options

Option  Usage 
PRIMARY_FILE  Directs the compiler to search the default file type for headers using the context of the primary source file (the .C file). This means that just the file type (".h" or ".") is used for the default file-spec, but the chain of "related file-specs" used to maintain the sticky defaults for processing the next top-level source file is also applied when searching for the include file. This most closely matches the behavior of VAX C. 
INCLUDE_FILE  Directs the compiler to first search the directory of the source file containing the #include directive. If the file to be included is not found, the compiler continues searching by following normal inclusion rules. 
NONE  Directs the compiler to skip the first step of processing #include "file.h" directives. The compiler starts its search for the include file in the /INCLUDE_DIRECTORY directories. It does not start by looking in the directory containing the including file or in the directory containing the top level source file.  

The default is /NESTED_INCLUDE_DIRECTORY=INCLUDE_FILE.

/[NO]OBJECT[=file-spec]
Produces an object module. By default, /OBJECT creates an object module file with the same name as that of the first source file of a compilation unit and with the .OBJ file extension. If you include a file specification with /OBJECT, the compiler uses that specification instead.

The compiler executes faster if it does not have to produce an object module. Use the /NOOBJECT qualifier when you need only a listing of a program or when you want the compiler to check a source file for errors. The default is /OBJECT.

/[NO]OPTIMIZE[=(option[, . . . ])]
Determines whether DEC C performs code optimizations.

You can specify the options described in Table 1-13.

Table 1-13 /OPTIMIZE Qualifier Options

Option  Usage 
[NO]DISJOINT (VAX only)  Optimizes the generated machine code. For example, the compiler eliminates common subexpressions, removes invariant expressions from loops, collapses arithmetic operations into 3-operand instructions, and places local variables in registers.

When debugging DEC C programs, use the /OPTIMIZE=NODISJOINT option if you need minimal optimization; if optimization during debugging is not important, use the /NOOPTIMIZE qualifier. 

[NO]INLINE (VAX only)  Provides automatic inline expansion of functions that yield optimized code when they are expanded. Whether or not a function is a candidate for inline expansion is based on its size, the number of times it is called, and whether it conforms to the rules specified in Section 5.4.6
[NO]INLINE[=keyword] (Alpha only)  Provides inline expansion of functions that yield optimized code when they are expanded. Whether or not a function is a candidate for inline expansion is based on its size, the number of times it is called, and whether it conforms to the rules specified in Section 5.4.6. On OpenVMS Alpha systems, you can specify one of the following keywords to control inlining:
NONE  No inlining is done, even if requested by a #pragma inline preprocessor directive. /OPTIMIZE=INLINE=NONE is equivalent to /OPTIMIZE=NOINLINE. 
MANUAL  Inlines only those function calls explicitly requested for inlining by a #pragma inline directive.  
AUTOMATIC  Inlines all of the function calls in the MANUAL category, plus any additional calls that the compiler determines would improve run-time performance. This is the default. 
ALL  Inlines every call that can be inlined while still generating correct code. Recursive routines, however, will not cause an infinite loop at compile time. 
SIZE  Provides behavior similar to that of the keyword AUTOMATIC in versions of DEC C before 5.0, although it is somewhat more conservative in most cases. For DEC C Version 5.0 and higher, AUTOMATIC is treated as a synonym for SIZE. SIZE inlines functions when the compiler determines that it can improve run-time performance without significantly increasing the size of the program. 
SPEED  Performs more aggressive inlining for run-time performance, even when it might significantly increase the size of the program. 

The #pragma noinline preprocessor directive can be used to prevent inlining of any particular functions under the compiler-selected forms of inlining (SPEED, SIZE, or AUTOMATIC).

The #pragma inline preprocessor directive (or the __inline storage- class modifier for OpenVMS Alpha systems) can be used to request inlining of specific functions under the AUTOMATIC or MANUAL forms of inlining.  

LEVEL=n (Alpha only)  Selects the level of optimization. Specify an integer from 0 (no optimization) to 4 (full optimization):
Disables all optimizations. Does not check for unassigned variables.  
Enables local optimizations and recognition of some common subexpressions. The call graph determines the order of compilation of procedures.  
Includes level 1 optimizations. Enables global optimization. This includes data-flow analysis, code motion, strength reduction and test replacement, split lifetime analysis, and code scheduling. 
Includes level 2 optimizations. Enables additional global optimizations that improve speed (at the cost of extra code size), for example: integer multiplication and division expansion (using shifts), loop unrolling, and code replication to eliminate branches.  
Includes level 3 optimizations. Enables interprocedural analysis and automatic inlining of small procedures (with heuristics limiting the amount of extra code). This is the default. 
Includes level 4 optimizations. Activates software pipelining, which is a specialized form of loop unrolling that in certain cases improves run-time performance. Software pipelining uses instruction scheduling to eliminate instruction stalls within loops, rearranging instructions between different unrolled loop iterations to improve performance.

For this version of DEC C, loops chosen for software pipelining are always innermost loops and do not contain branches or procedure calls. To determine whether using level 5 benefits your particular program, you should time program execution for the same program compiled at levels 4 and 5. For programs that contain loops that exhaust available registers, longer execution times may result with level 5.  

 
UNROLL=n (Alpha only)  Controls loop unrolling done by the optimizer. UNROLL=n means to unroll loop bodies n times, where n is between 0 and 16. UNROLL=0 means the optimizer will use its own default unroll amount. Specify UNROLL only at level 3 or higher.  
TUNE=keyword (Alpha only)  Selects processor-specific instruction tuning for implementations of the Alpha architecture. Regardless of the setting of the /OPTIMIZE=TUNE flag, the generated code will run correctly on all implementations of the Alpha architecture. Tuning for a specific implementation can provide improvements in run-time performance. Code tuned for a specific target might run slower on another target.

You can specify one of the following keywords:
GENERIC  Selects instruction tuning that is appropriate for all implementations of the Alpha architecture. This option is the default. 
HOST  Selects instruction tuning that is appropriate for the machine on which the code is being compiled.  
EV4  Selects instruction tuning for the 21064, 21064A, 21066, and 21068 implementations of the Alpha architecture.  
EV5  Selects instruction tuning for the 21164 implementation of the Alpha architecture.  
 

For OpenVMS VAX systems the default, /OPTIMIZE, is equivalent to /OPTIMIZE=(DISJOINT,INLINE).

For OpenVMS Alpha systems the default, /OPTIMIZE, is equivalent to /OPTIMIZE=(INLINE=AUTOMATIC,LEVEL=4,UNROLL=0,TUNE=GENERIC).

Use /NOOPTIMIZE or /OPTIMIZE=LEVEL=0 (Alpha only) for a debugging session to ensure that the debugger has sufficient information to locate errors in the source program.

In most cases, using /OPTIMIZE will make the program execute faster. As a side effect of getting the fastest execution speeds, using /OPTIMIZE can produce larger object modules and longer compile times than /NOOPTIMIZE.

Loop Unrolling (Alpha only)

At optimization level 3 or above, DEC C attempts to unroll certain loops to minimize the number of branches and group more instructions together to allow efficient overlapped instruction execution (instruction pipelining). The best candidates for loop unrolling are innermost loops with limited control flow.

As more loops are unrolled, the average size of basic blocks increases. Loop unrolling generates multiple loop code iterations in a manner that allows efficient instruction pipelining.

The loop body is replicated a certain number of times, substituting index expressions. An initialization loop may be created to align the first reference with the main series of loops. A remainder loop may be created for leftover work.

The number of times a loop is unrolled can be determined by the optimizer or the user can specify the limit for loop unrolling using the /OPTIMIZE=UNROLL qualifier. Unless the user specifies a value, the optimizer unrolls a loop 4 times for most loops or 2 times for certain loops (large estimated code size or branches out the loop).

Software Pipelining (Alpha only)

Software pipelining and additional software dependence analysis are enabled by using /OPTIMIZE=LEVEL=5, which in certain cases improves run-time performance.

Loop unrolling (enabled at /OPTIMIZE=LEVEL=3 or higher) is constrained in that it cannot schedule across iterations of a loop. Because software pipelining can schedule across loop iterations, it can perform more efficient scheduling that eliminates instruction stalls within loops, by rearranging instructions between different unrolled loop iterations to improve performance.

For example, if software dependence analysis of data flow reveals that certain calculations can be done before or after that iteration of the unrolled loop, software pipelining reschedules those instructions ahead of or behind that loop iteration, at places where their execution can prevent instruction stalls or otherwise improve performance.

For this version of DEC C, loops chosen for software pipelining:

By modifying the unrolled loop and inserting instructions as needed before and/or after the unrolled loop, software pipelining generally improves run-time performance, except for cases where the loops contain a large number of instructions with many existing overlapped operations. In this case, software pipelining may not have enough registers available to effectively improve execution performance, and run-time performance using level 5 may not improve as compared to using level 4.

To determine whether using level 5 benefits your particular program, time program execution for the same program compiled at levels 4 and 5. For programs that contain loops that exhaust available registers, longer execution times may result with level 5.

In cases where performance does not improve, consider compiling using /OPTIMIZE=(UNROLL=1, LEVEL=5) to possibly improve the effects of software pipelining.

/PDSC_MASK=option (Alpha only)
Forces the compiler to set the PDSC$V_EXCEPTION_MODE field of the procedure descriptor for each function in the compilation unit to the specified value, regardless of the setting of any other qualifiers.

Ordinarily the PDSC$V_EXCEPTION_MODE field gets set automatically by the compiler, depending on the /IEEE_MODE qualifier setting. The /PDSC_MASK qualifier overrides the /IEEE_MODE qualifier setting of this field.


Note
This qualifier is a low-level systems-programming feature that is seldom necessary. Its usage can produce object modules that do not conform to the VMS common language environment and, within C, it can produce nonstandard and seemingly incorrect floating-point behaviors at runtime.

As shown in Table 1-14, the qualifier option keywords are exactly the allowed values defined in the OpenVMS Calling Standard for this field, stripped of the PDSC$V_EXCEPTION_ MODE prefix (for example, /PDSC_MASK=SIGNAL sets the field to PDSC$V_EXCEPTION_MODE_SIGNAL).

Table 1-14 /PDSC_MASK Qualifier Options

Option  Maps to  Meaning 
SIGNAL  PDSC$K_ EXCEPTION_MODE_SIGNAL  Raise exceptions for all except underflow (which is flushed to 0). 
SIGNAL_ALL  PDSC$K_EXCEPTION_MODE_SIGNAL_ ALL  Raise exceptions for all. 
SILENT  PDSC$K_EXCEPTION_MODE_SILENT  Raise no exceptions. Create only finite values: no infinities, no denorms, no NaNs. 
FULL_IEEE  PDSC$K_EXCEPTION_MODE_FULL_IEEE  Raise no exceptions except as controlled by separate IEEE exception- enabling bits. Create exceptional values according to the IEEE standard. 
CALLER  PDSC$K_ EXCEPTION_MODE_CALLER  Emulate the same mode as the caller. This is useful primarily for writing libraries that can be called from languages other than C. 

In the absence of the /PDSC_MASK qualifier, the compiler sets the PDSC$V_EXCEPTION_MODE field automatically, depending on the /IEEE_ MODE qualifier setting:

/[NO]PLUS_LIST_OPTIMIZE (Alpha only)
Provides improved optimization and code generation across file boundaries that would not be available if the files were compiled separately.

When you specify /PLUS_LIST_OPTIMIZE on the command line in conjunction with a series of file specifications separated by plus signs, the compiler does not concatenate each of the specified source files together; such concatenation is generally not correct for C code because a C source file defines a scope.

Instead, each file is treated separately for purposes of parsing, except that the compiler issues diagnostics about conflicting external declarations and function definitions that occur in different files. For purposes of code generation, the compiler treats the files as one application and can perform optimizations across the source files.

The default is /NOPLUS_LIST_OPTIMIZE.

/[NO]POINTER_SIZE[=option] (Alpha only)
Controls whether or not pointer-size features are enabled and whether pointers are 32-bits or 64 bits.

The default is /NOPOINTER_SIZE, which disables pointer-size features, such as the ability to use #pragma pointer_size, and directs the compiler to assume that all pointers are 32-bit pointers. This default represents no change over previous versions of DEC C.

Table 1-15 shows the /POINTER_SIZE qualifier options.

Table 1-15 /POINTER_SIZE Qualifier Options

Option  Usage 
{SHORT|32}  The compiler assumes 32-bit pointers. 
{LONG|64}  The compiler assumes 64-bit pointers. 

Specifying /POINTER_SIZE=32 enables pointer-size features and directs the compiler to assume that all pointers are 32-bit pointers.

Specifying /POINTER_SIZE=64 enables pointer-size features and directs the compiler to assume that all pointers are 64-bit pointers.

Specifying /POINTER_SIZE either alone or with a keyword value (32, 64, SHORT, or LONG) has the following effects:

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-16 shows the /PRECISION qualifier options.

Table 1-16 /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-17 describes the /PREFIX_LIBRARY_ENTRIES qualifier options.

Table 1-17 /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.

/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-18 describes the /REENTRANCY qualifier options.

Table 1-18 /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.

/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_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 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-19 describes the /SHOW qualifier options.

Table 1-19 /SHOW Qualifier Options

Option  Usage 
ALL  Prints all listing information. 
[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]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-20 describes the /STANDARD qualifier options.

Table 1-20 /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. 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-21 describes the /WARNING qualifier options.

Table 1-21 /WARNINGS Qualifier Options

Option  Usage 
DISABLE=(message-list Suppresses the issuance of the message identifiers or message group names listed. See the ENABLE option description for a description of message- list and a list of message group names.

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 message identifiers or message group names listed.

The message-list can be any one of the following:

  • A single message identifier. The message identifier is the name following the severity at the start of a line when a message is issued. For example, in the following message, the message identifier is GLOBALEXT:
    %CC-W-GLOBALEXT, a storage class of globaldef,
    globalref, or globalvalue is a language extension.
    

  • The name of a single message group. Message group names are:

    • ALL-All the messages in the compiler

    • CHECK-All the messages about potentially poor coding practices

    • PORTABLE-All the messages about portability

  • A single message identifier enclosed in parentheses.

  • A single message group name enclosed in parentheses.

  • A comma-separated list of message identifiers or group names, freely mixed, enclosed in parentheses.
 
NOINFORMATIONALS  Suppresses informational messages. 

The SUMMARY informational message cannot be suppressed with /NOWARNINGS or /WARNINGS=NOINFORMATIONALS, but can be suppressed with the DISABLE option.

The default is /WARNINGS. This enables all diagnostic messages for the selected compiler mode except those in the PORTABLE and CHECK groups. The PORTABLE and CHECK groups must be explicitly enabled before their messages can be generated.

1.3.5 Compiler Diagnostic Messages

If there are errors in your source file when you compile your program, the DEC C compiler signals these errors and displays diagnostic messages. Reference the message, locate the error, and, if necessary, correct the error. See Appendix D or the online help for a list if all compiler diagnostic messages.

To display a particular compiler diagnostic message online, enter the following command:

$ HELP CC/DECC MESSAGE mnemonic<Return>  (VAX only)
$ HELP CC MESSAGE mnemonic<Return>  (Alpha only)

To display a list of all message mnemonics, enter the following command:

$ HELP CC/DECC MESSAGE<Return>  (VAX only)
$ HELP CC MESSAGE<Return>  (Alpha only)

Diagnostic messages have the following format:

%CC-s-ident, message-text
               Listing line number m
               At line number n in name
%CC
The facility or program name of the DEC C compiler. This portion indicates that the message is being issued by DEC C.
s
The severity of the error, represented in the following way:
Fatal error. The compiler stops executing when a fatal error occurs and does not produce an object module. You must correct the error before you can compile the program.  
Error. The compiler continues, but does not produce an object module. You must correct the error before you can successfully compile the program.  
Warning. The compiler produces an object module. It attempts to correct the error in the statement, but you should verify that the compiler's action is acceptable. Otherwise, your program may produce unexpected results.  
Information. This message usually appears with other messages to inform you of specific actions taken by the compiler. No action is necessary on your part. 
ident
The message identification. This is a descriptive abbreviation (mnemonic) of the message text.
message-text
The compiler's message. In many cases, it consists of more than one line of output. A message generally provides you with enough information to determine the cause of the error so that you can correct it.
Listing line number m
The integer m, which gives you the line number in the listing file where the error occurs. This information is given when you specify the /LIST qualifier.
At line number n in name
The integer n, which gives you the number of the line where the error occurs. The number is relative to the beginning of the file or text library module specified by name. You can use the #line directive to change both the line number and name that appear in the message.


Previous Page | Next Page | Table of Contents | Index