Preface

This manual provides reference information for using the DEC C language on Digital systems. DEC C is an ISO/ANSI-compliant C compiler for OpenVMS VAX and Alpha systems and Digital UNIX[R] systems. Digital UNIX runs on Alpha processors.

Digital has changed the name of its UNIX operating system from DEC OSF/1 to Digital UNIX. The new name reflects Digital's commitment to UNIX and its conformance to UNIX standards.

DEC C is compliant with the International Standards Organization (ISO) C Standard (ISO 9899:1990[1992]), formerly the American National Standard for Information Systems-Programming Language C (document number: X3.159-1989). By the use of command-line options, DEC C is compatible with older dialects of C, including common usage C (Kernighan and Ritchie C) and VAX C.

This manual is based on the ISO C Standard (ISO 9899:1990[1992]), formerly the ANSI X3J11 committee's standard for the C programming language (called the ANSI C standard in this manual). [1] All library functions and language extensions to the ANSI C standard are also described.


[1] Digital would like to thank CBEMA and its Accredited Standards Committee X3 for use of the material derived in whole or in part from the American National Standard Programming Language C. The ANSI C standard may be purchased from the ANSI Sales Department by calling the United States telephone number 1-212-642-4900.

Intended Audience

This manual is intended for programmers who need reference information on the DEC C language. There is little task-oriented material or platform-specific material in this manual; for that type of information, see your platform-specific DEC C documentation (user's guide and online help for OpenVMS systems, programmer's guide and manpages for Digital UNIX systems.)

Purpose of the ANSI Standard

The ANSI C standard was developed by a committee of program developers and knowledgeable C users to address the problems caused by inexact specification of the C language. These problems were primarily related to portability of programs between different types of machines. The committee analyzed the language for areas where its syntax and semantics were vague or indeterminate, and then chose precise definitions for those C constructs. The result is an unambiguous, machine-independent definition.

The ANSI C standard states that it:

" specifies the form and establishes the interpretation of programs expressed in the programming language C. [The standard's] purpose is to promote portability, reliability, maintainability, and efficient execution of C language programs on a variety of computing systems. "

The standard specifies:

The ANSI C standard does not specify:

Manual Structure

This manual has the following chapters and appendixes:

Chapter 1 describes the elements of the C language.

Chapter 2 discusses some of the basic concepts underlying the C language.

Chapter 3 explains DEC C data types and type qualifiers.

Chapter 4 describes the declaration of identifiers in DEC C. The declaration of constants, variables, structures, unions, pointers, and arrays is covered.

Chapter 5 describes function calls, function declarations, function definitions, function parameters, and function arguments.

Chapter 6 discusses the types of expressions you can build in C. It also explains the effects of operators available in C, including unary, binary, conditional, primary, and postfix operators.

Chapter 7 describes the C statements that provide flow control, conditional executions, looping, and interruption.

Chapter 8 explains the purpose of the C preprocessor directives and predefined macros.

Chapter 9 lists and describes the functions, macros, and types in the ANSI C standard library, arranged by header file.

Appendix A provides a syntax summary of all C language constructs.

Appendix B describes the extent of Digital's ANSI conformance, including exceptions and extensions to the standard.

Appendix C provides the ASCII octal, decimal, and hexadecimal equivalents for each character in the ASCII character set.

Appendix D lists the common C extensions supported by DEC C using the common C compatibility option.

Appendix E lists the VAX C extensions supported by DEC C using the VAX C compatibility option.

Associated Documents

You may find the following documents useful when programming in DEC C:

The printed version of the Digital UNIX documentation set is color coded to help specific audiences quickly find the books that meet their needs. (You can order the printed documentation from Digital.) This color coding is reinforced with the use of an icon on the spines of books. The following list describes this convention:

Audience  Icon  Color Code 
General users  Blue 
System and network administrators  Red 
Programmers  Purple 
Device driver writers  Orange 
Reference page users  Green 

Some books in the Digital UNIX documentation set help meet the needs of several audiences. For example, the information in some system books is also used by programmers. Keep this in mind when searching for information on specific topics.

The Documentation Overview, Glossary, and Master Index provides information on all of the books in the Digital UNIX documentation set.


[2] Brian W. Kernighan and Dennis M. Ritchie, The C Programming Language (Englewood Cliffs, New Jersey: Prentice Hall, 1988).

Conventions Used in this Document

Convention  Meaning 
OpenVMS systems  Refers to OpenVMS VAX and OpenVMS Alpha systems unless otherwise specified. 
<Return>  The symbol <Return> represents a single stroke of the Return key on a terminal. 
<Ctrl/X>  The symbol <Ctrl/X>, where X represents a terminal control character, represents holding down the Ctrl key while pressing the specified terminal character key. 
DEC C also allows ... DEC C extensions to the ANSI C standard are shown in teal blue.
float x; . . . x = 5;   A vertical ellipsis indicates that not all of the text of a program or program output is shown. Only relevant material is shown in the example. 
option, . . .   A horizontal ellipsis indicates that additional parameters, options, or values can be entered. A comma preceding the ellipsis indicates that successive items must be separated by commas. 
syntax(opt)   Optional syntax elements are indicated with the subscripted abbreviation opt. Isolated syntax diagrams in individual sections of this manual may require reference to Appendix A to determine the complete syntax for a construct. For instance, the ANSI C standard syntax includes a constant as a potential assignment-expression
storage-class-specifier :
auto
static
register
 
In syntax definitions, items appearing on separate lines are mutually exclusive alternatives. 
The auto storage class . . . The fprintf function . . .   Monospaced type identifies language keywords, the names of independently compiled external functions and files, syntax summaries, and references to variables or identifiers introduced in an example.  

New and Changed Features

This manual was revised for DEC C Version 5.6 to reflect DEC C support for the __restrict data type qualifier on pointer declarations. See Section 3.7.4 for more information on restricted pointers.

Reader's Comments

Digital welcomes any comments and suggestions you have on this and other DIGITAL UNIX manuals. You can send your comments in the following ways:

Please include the following information along with your comments:

The DIGITAL UNIX Publications group cannot respond to system problems or technical support inquiries. Please address technical questions to your local system vendor or to the appropriate Digital technical support office. Information provided with the software media explains how to send problem reports to Digital.


Previous Page | Next Page | Table of Contents | Index