Next Index Doc Set Home


Making the Transition to ANSI C


Contents

Preface

1. Making the Transition to ANSI C

Basic Modes

A Mixture of Old- and New-Style Functions
Writing New Code
Updating Existing Code
Mixing Considerations

Functions with Varying Arguments

Promotions: Unsigned Versus Value Preserving
Background
Compilation Behavior
First Example: The Use of a Cast
Bit-fields
Second Example: Same Result
Integral Constants
Third Example: Integral Constants

Tokenization and Preprocessing
ANSI C Translation Phases
Old C Translation Phases
Logical Source Lines
Macro Replacement
Using Strings
Token Pasting

const and volatile
Types, Only for lvalues
Type Qualifiers in Derived Types
const Means readonly
Examples of const Usage
volatile Means Exact Semantics
Examples of volatile Usage

Multibyte Characters and Wide Characters
Asian Languages Require Multibyte Characters
Encoding Variations
Wide Characters
Conversion Functions
C Language Features

Standard Headers and Reserved Names
Balancing Process
Standard Headers
Names Reserved for Implementation Use
Names Reserved for Expansion
Names Safe to Use

Internationalization
Locales
The setlocale() Function
Changed Functions
New Functions

Grouping and Evaluation in Expressions
Definitions
The K&R C Rearrangement License
The ANSI C Rules
The Parentheses
The As If Rule

Incomplete Types
Types
Completing Incomplete Types
Declarations
Expressions
Justification
Examples

Compatible and Composite Types
Multiple Declarations
Separate Compilation Compatibility
Single Compilation Compatibility
Compatible Pointer Types
Compatible Array Types
Compatible Function Types
Special Cases
Composite Types

A. K&R Sun C / Sun ANSI C Differences

Index


Next Index Doc Set Home