Order Number: AA-PUNDC-TK
May 1997
This document is the language reference manual for DEC C.
Revision Update Information: | This revised manual supersedes the DEC C Language Reference Manual (Order No. AA-PUNDB-TK). |
Software Version: | DEC C Version 5.6 for
OpenVMS Systems
DEC C Version 5.2 for Digital UNIX Version 4.0 |
Digital Equipment Corporation
Maynard, Massachusetts
©Digital Equipment Corporation 1991, 1992, 1995, 1996, 1997. All Rights Reserved.
1 Lexicon
1.1.2 Digraph Sequences
1.3 Comments
1.4 Keywords
1.5 Operators
1.6 Punctuators
1.7 String Literals
1.8 Constants
1.8.2 Floating-Point Constants
1.8.3 Character Constants
1.8.3.2 Multibyte Characters
1.8.3.3 Character Escape Sequences
1.8.3.4 Numeric Escape Sequences
1.10 Limits
1.10.2 Numerical Limits
1.10.3 Character Display
2.3 Scope
2.3.2 Block Scope
2.3.3 Function Scope
2.3.4 Function Prototype Scope
2.5 Side Effects and Sequence Points
2.6 Incomplete Type
2.7 Compatible and Composite Types
2.8 Linkage
2.10 Storage Classes
2.10.2 The register Class
2.10.3 The static Class
2.10.4 The extern Class
2.12 Tags
2.13 lvalues and rvalues
2.14 Name Spaces
2.15 Preprocessing
2.16 Type Names
3.2 Integral Types
3.2.2 Character Types
3.4 Derived Types
3.4.2 Pointer Type
3.4.3 Array Type
3.4.4 Structure Type
3.4.5 Union Type
3.6 Enumerated Types
3.7 Type Qualifiers
3.7.2 volatile Type Qualifier
3.7.3 __unaligned Type Qualifier
3.7.4 __restrict Type Qualifier
3.7.4.1.2 Library Examples
3.7.4.1.3 Overlapping Objects
3.7.4.1.4 Restricted Pointer Prototype for memcpy
3.7.4.3 Examples
3.7.4.3.2 Function Parameters
3.7.4.3.3 Block Scope
3.7.4.3.4 Members of Structures
3.7.4.3.5 Type Definitions
3.7.4.3.6 Expressions Based on Restricted Pointers
3.7.4.3.7 Assignments between Restricted Pointers
3.7.4.3.8 Assignments to Unrestricted Pointers
3.7.4.3.9 Ineffective Uses of Type Qualifiers
3.7.4.3.10 Constraint Violations
4.2 Initialization
4.4.2 Declaring Integer Objects
4.4.3 Declaring Character Variables
4.4.4 Declaring Floating-Point Variables
4.6.2 Initializing Pointers
4.7.2 Pointers and Arrays
4.8.2 Differences Between Structures and Unions
4.8.3 Bit Fields
4.8.4 Initializing Structures
4.8.5 Initializing Unions
4.10 Declaring Type Definitions
5.2 Function Types
5.5.2 Scope and Conversions
5.6.2 Function and Array Identifiers as Arguments
5.6.3 Passing Arguments to the main Function
6.1.2 Constants
6.1.3 String Literals
6.1.4 Parenthesized Expressions
6.3.2 Function Calls
6.3.3 Structure and Union References
6.3.4 Postfix Increment and Decrement Operators
6.4.2 Logical Negation
6.4.3 Prefix Increment and Decrement Operators
6.4.4 Address Operator and Indirection
6.4.5 Bitwise Negation
6.4.6 The Cast Operator
6.4.7 The sizeof Operator
6.5.2 Additive Operators
6.5.3 Shift Operators
6.5.4 Relational Operators
6.5.5 Equality Operators
6.5.6 Bitwise Operators
6.5.7 Logical Operators
6.8 Comma Operator
6.9.2 Arithmetic Constant Expressions
6.9.3 Address Constants
6.10.1.2 Signed and Unsigned Integers
6.10.1.3 Floating and Integral
6.10.1.4 Floating Types
6.10.3 Function Argument Conversions
7.4 Null Statements
7.5.2 The switch Statement
7.6.2 The do Statement
7.6.3 The for Statement
7.7.2 The continue Statement
7.7.3 The break Statement
7.7.4 The return Statement
8 Preprocessor Directives and Predefined Macros
8.1.2 Function-Like Form
8.1.2.2 Rules for Specifying Macro References
8.1.2.3 Side Effects in Macro Arguments
8.1.4 Token Concatenation(##)
8.2.2 The #ifdef Directive
8.2.3 The #ifndef Directive
8.2.4 The #else Directive
8.2.5 The #elif Directive
8.2.6 The #endif Directive
8.2.7 The defined Operator
8.4 Explicit Line Numbering (#line)
8.5 Implementation-Specific Preprocessor Directive (#pragma)
8.8.2 The __FILE__ Macro
8.8.3 The __LINE__ Macro
8.8.4 The __TIME__ Macro
8.8.5 The __STDC__ Macro
8.8.6 System-Identification Macros
9.2 Character Processing (<ctype.h>)
9.4 ANSI C Limits (<limits.h> and <float.h>)
9.7 Nonlocal Jumps (<setjmp.h>)
9.8 Signal Handling (<signal.h>)
9.9 Variable Arguments (<stdarg.h>)
9.10 Common Definitions (<stddef.h>)
9.11 Standard Input/Output (<stdio.h>)
9.12 General Utilities (<stdlib.h>)
9.13 String Processing (<string.h>)
B.2 Hosted Environment (§2.1.2.2)
B.3 Multibyte Characters (§2.2.1.2)
B.5 Translation Limits (§2.2.4.1)
B.6 Numerical Limits (§2.2.4.2)
B.9 Linkages of Identifiers (§3.1.2.2)
B.10 Types (§3.1.2.5)
B.11 Integer Constants (§3.1.3.2)
B.12 Character Constants (§3.1.3.4)
B.14 Operators-Compound Assignment (§3.1.5)
B.15 Characters and Integers-Value-Preserving Promotions (§3.2.1.1)
B.16 Signed and Unsigned Integer Conversions (§3.2.1.2)
B.17 Floating and Integral Conversions (§3.2.1.3)
B.18 Pointer Conversions (§3.2.2.3)
B.19 Structure and Union Members (§3.3.2.3)
B.20 The sizeof Operator (§3.3.3.4)
B.22 Multiplicative Operators (§3.3.5)
B.23 Additive Operators (§3.3.6)
B.24 Bitwise Shift Operators (§3.3.7)
B.25 Storage-Class Specifiers (§3.5.1)
B.27 Structure and Union Specifiers (§3.5.2.1)
B.28 Variant Structures and Unions
B.29 Structure Alignment
B.30 Enumeration Specifiers (§3.5.2.2)
B.32 Declarators (§3.5.4)
B.34 The switch Statement (§3.6.4.2)
B.35 External Object Definitions (§3.7.2)
B.36 Conditional Inclusion (§3.8.1)
B.37 Source File Inclusion (§3.8.2)
B.38 Macro Replacement-Predefined Macro Names (§3.8.3)
B.39 The ## Operator (§3.8.3.3)
B.41 Pragma Directive (§3.8.6)
B.42 Function Inline Expansion
B.43 Linkage Pragmas
B.44 Other Pragmas
D Common C Extensions Supported by DEC C
D.2 Extensions Incompatible with ANSI C
E VAX C Extensions Supported by DEC C
E.2 Extensions Incompatible with ANSI C
Examples
5-1 Declaring Functions Passed as Arguments
7-1 Using switch to Count Blanks, Tabs, and New Lines
Figures
Tables
1-3 Keywords
1-4 Punctuators
1-6 Character Escape Sequences
3-1 Basic Data Types
3-2 Sizes and Ranges of Data Types
6-1 C Operators
9-1 File Modes
9-2 strftime Conversion Specifiers
B-1 Digital UNIX Predefined Macro Names
B-2 OpenVMS VAX and Alpha Predefined Macro Names
B-3 Library Routine Standards Conformance Macros-All platforms