This guide contains the information necessary for developing and debugging DEC C programs on the OpenVMS operating system. DEC C is compliant with the International Standards Organization (ISO) C Standard (ISO 9899:1990[1992]), formerly the American National Standard for Information (ANSI) Systems-Programming Language C (document number: X3.159-1989), called the ANSI C Standard in this guide. DEC C is an ANSI compliant C compiler for the OpenVMS operating system on VAX and Alpha processors and for the Digital UNIX operating system on Alpha processors. Through use of command-line options, DEC C is compatible with older dialects of C, including common usage C and VAX C.
This guide also includes DEC C language features specific to OpenVMS systems, as well as information about porting C programs to and from OpenVMS and other operating systems. For more information about porting programs to and from other operating systems, see the DEC C Run-Time Library Reference Manual for OpenVMS Systems.
You may send comments or suggestions regarding this guide or any DEC C document by filling out one of the Reader's Comments forms at the back of this guide or by sending electronic mail to the following Internet address:
decc_docs@bookie.enet.dec.com
This guide is intended for experienced programmers who need to develop DEC C programs on OpenVMS systems, for users who need to know the difference between DEC C and other implementations, and for experienced C users who need to reference language information specific to OpenVMS systems. You should be familiar with one high- level language and should have some familiarity with the DIGITAL Command Language (DCL). If you are not familiar with or need to reference information about the DCL, see Chapter 1.
This guide has the following chapters and appendixes:
You may find the following documents useful when programming in DEC C:
Table 1 lists the conventions used in this guide.
Convention | Meaning |
---|---|
<Return> | The symbol <Return> represents a single stroke of the Return key on a terminal. |
Ctrl/X | The symbol Ctrl/X, where the letter X represents a terminal control character, is generated by holding down the Ctrl key while pressing the key of the specified terminal character. |
switch statement fprintf function auto storage class | In syntax definitions, items appearing in monospaced type identify language keywords and the names of OpenVMS and DEC C Run-Time Library functions. |
arg1 | Italic type indicates a placeholder, such as an argument or parameter name, and the introduction of new terms. |
$ RUN CPROG <Return> | Interactive examples show user input in boldface type. |
float x; . . . x = 5; | A vertical ellipsis indicates that not all of the text of a program or program output is illustrated. Only relevant material is shown in the example. |
option, . . . | A horizontal ellipsis indicates that additional parameters, options, or values can be entered. A comma that precedes the ellipsis indicates that successive items must be separated by commas. |
[output- source, . . . ] | Square brackets, in function synopses and a few other contexts, indicate that a syntactic element is optional. Square brackets are not optional, however, when used to delimit a directory name in an OpenVMS file specification or when used to delimit the dimensions of an array in DEC C source code. |
sc-specifier ::= auto static [extern] register | In syntax definitions, items appearing on separate lines are mutually exclusive alternatives. |
{a|b} | Braces surrounding two or more items separated by a vertical bar (|) indicate a choice; you must choose one of the two syntactic elements. |
A delta symbol is used in some contexts to indicate a single ASCII space character. | |
[1] Brian W. Kernighan and Dennis M. Ritchie, The C Programming Language, Second Edition (Englewood Cliffs, New Jersey: Prentice Hall, 1988). |
A platform is a combination of operating system and hardware that provides a distinct environment. This guide contains information applicable to the OpenVMS operating system on both the VAX and Alpha architectures.
The information in this guide applies to both of these platforms, except when specifically labeled, as follows:
Label | Explanation |
---|---|
(Alpha only) | Specific to an Alpha processor running the OpenVMS operating system. |
(VAX only) | Specific to a VAX processor running the OpenVMS operating system. |
DEC C Version 5.5 includes the following new features:
DEC C Version 5.5 accepts the __restrict pointer type qualifier as proposed for inclusion in the ongoing revision to the C standard. The __restrict qualifier is checked for correct usage but no additional optimization is performed in Version 5.5.
This qualifier 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.
This qualifier instructs the DEC C compiler to interpret your source code according to certain language rules followed by the C compiler in the Microsoft Visual C++ compiler product.
This option controls whether or not the compiler can safely assume that global variables have not had their addresses taken in a separately compiled module.
This option controls whether or not the default file-type mechanism (.h) for header files is enabled.
This macro is defined when /STANDARD=MS is specified. (Section 6.1.5)
DEC C V5.5 has slighlty revised #include file search-order rules for OpenVMS VAX Version 7.1 and higher, making them the same as for OpenVMS Alpha systems. These rules are documented under the /INCLUDE_DIRECTORY qualifier (Section 1.3.4).
Also see Appendix A for a summary of features that distinguish DEC C for OpenVMS Systems from VAX C Version 3.2. 1