Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Look up keyword
Like this
36Activity
0 of .
Results for:
No results containing your search query
P. 1
ansi_c

ansi_c

Ratings: (0)|Views: 719|Likes:
Published by api-3804187
ANSI C
ANSI C

More info:

Published by: api-3804187 on Oct 17, 2008
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

05/09/2014

pdf

text

original

ANSI C SPECIFICATION (C89) - DRAFT
TABLE OF CONTENTS - 1.

TABLE OF CONTENTS.............................................................1 ORIGIN OF THIS DRAFT..........................................................9 FOREWARD.....................................................................10 1. INTRODUCTION..............................................................15

1.1 PURPOSE...............................................................15 1.2 SCOPE.................................................................15 1.3 REFERENCES............................................................15 1.4 ORGANIZATION OF THE DOCUMENT..........................................16 1.5 BASE DOCUMENTS........................................................16 1.6 DEFINITIONS OF TERMS..................................................16 1.7 COMPLIANCE............................................................18 1.8 FUTURE DIRECTIONS.....................................................18 1.9 ABOUT THIS DRAFT......................................................19

2. ENVIRONMENT...............................................................19

2.1 CONCEPTUAL MODELS.....................................................19
2.1.1 Translation environment..........................................19
2.1.1.1 Program structure...........................................19
2.1.1.2 Translation phases..........................................19
2.1.1.3 Diagnostics.................................................20
2.1.2 Execution environments...........................................20
2.1.2.1 Freestanding environment....................................20
2.1.2.2 Hosted environment..........................................20
2.1.2.3 Program execution...........................................21

2.2 ENVIRONMENTAL CONSIDERATIONS..........................................23
2.2.1 Character sets...................................................23
2.2.1.1 Trigraph sequences..........................................24
2.2.1.2 Multibyte characters........................................24
2.2.2 Character display semantics......................................25
2.2.3 Signals and interrupts...........................................25
2.2.4 Environmental limits.............................................26
2.2.4.1 Translation limits..........................................26
2.2.4.2 Numerical limits............................................27

3. LANGUAGE..................................................................30

3.1 LEXICAL ELEMENTS......................................................31
3.1.1 Keywords.........................................................32
3.1.2 Identifiers......................................................32
3.1.2.1 Scopes of identifiers.......................................33
3.1.2.2 Linkages of identifiers.....................................34
3.1.2.3 Name spaces of identifiers..................................34
3.1.2.4 Storage durations of objects................................35
3.1.2.5 Types.......................................................35
3.1.2.6 Compatible type and composite type..........................38
3.1.3 Constants........................................................39
3.1.3.1 Floating constants..........................................39
3.1.3.2 Integer constants...........................................40
3.1.3.3 Enumeration constants.......................................41
3.1.3.4 Character constants.........................................41
3.1.4 String literals..................................................43
3.1.5 Operators........................................................44
3.1.6 Punctuators......................................................44
3.1.7 Header names.....................................................45
3.1.8 Preprocessing numbers............................................46
3.1.9 Comments.........................................................46

1
3.2 - TABLE OF CONTENTS

3.2 CONVERSIONS...........................................................46
3.2.1 Arithmetic operands..............................................46
3.2.1.1 Characters and integers.....................................46
3.2.1.2 Signed and unsigned integers................................47
3.2.1.3 Floating and integral.......................................47
3.2.1.4 Floating types..............................................47
3.2.1.5 Usual arithmetic conversions................................47
3.2.2 Other operands...................................................48
3.2.2.1 Lvalues and function designators............................48
3.2.2.2 void........................................................49
3.2.2.3 Pointers....................................................49

3.3 EXPRESSIONS...........................................................49
3.3.1 Primary expressions..............................................50
3.3.2 Postfix operators................................................50
3.3.2.1 Array subscripting..........................................51
3.3.2.2 Function calls..............................................51
3.3.2.3 Structure and union members.................................53
3.3.2.4 Postfix increment and decrement operators...................54
3.3.3 Unary operators..................................................54
3.3.3.1 Prefix increment and decrement operators....................54
3.3.3.2 Address and indirection operators...........................55
3.3.3.3 Unary arithmetic operators..................................55
3.3.3.4 The sizeof operator.........................................56
3.3.4 Cast operators...................................................56
3.3.5 Multiplicative operators.........................................57
3.3.6 Additive operators...............................................58
3.3.7 Bitwise shift operators..........................................59
3.3.8 Relational operators.............................................60
3.3.9 Equality operators...............................................60
3.3.10 Bitwise AND operator............................................60
3.3.11 Bitwise exclusive OR operator...................................61
3.3.12 Bitwise inclusive OR operator...................................61
3.3.13 Logical AND operator............................................61
3.3.14 Logical OR operator.............................................62
3.3.15 Conditional operator............................................62
3.3.16 Assignment operators............................................63
3.3.16.1 Simple assignment..........................................63
3.3.16.2 Compound assignment........................................64
3.3.17 Comma operator..................................................64

3.4 CONSTANT EXPRESSIONS..................................................65

3.5 DECLARATIONS..........................................................66
3.5.1 Storage-class specifiers.........................................67
3.5.2 Type specifiers..................................................67
3.5.2.1 Structure and union specifiers..............................68
3.5.2.2 Enumeration specifiers......................................70
3.5.2.3 Tags........................................................71
3.5.3 Type qualifiers..................................................72
3.5.4 Declarators......................................................73
3.5.4.1 Pointer declarators.........................................74
3.5.4.2 Array declarators...........................................75
3.5.4.3 Function declarators (including prototypes).................76
3.5.5 Type names.......................................................77
3.5.6 Type definitions.................................................78
3.5.7 Initialization...................................................79

2
TABLE OF CONTENTS - 3.6

3.6 STATEMENTS............................................................82
3.6.1 Labeled statements...............................................83
3.6.2 Compound statement, or block.....................................83
3.6.3 Expression and null statements...................................84
3.6.4 Selection statements.............................................84
3.6.4.1 The if statement............................................85
3.6.4.2 The switch statement........................................85
3.6.5 Iteration statements.............................................85
3.6.5.1 The while statement.........................................86
3.6.5.2 The do statement............................................86
3.6.5.3 The for statement...........................................86
3.6.6 Jump statements..................................................86
3.6.6.1 The goto statement..........................................87
3.6.6.2 The continue statement......................................87
3.6.6.3 The break statement.........................................87
3.6.6.4 The return statement........................................87

3.7 EXTERNAL DEFINITIONS..................................................88 3.7.1 Function definitions.............................................88 3.7.2 External object definitions......................................90

3.8 PREPROCESSING DIRECTIVES..............................................91
3.8.1 Conditional inclusion............................................92
3.8.2 Source file inclusion............................................93
3.8.3 Macro replacement................................................94
3.8.3.1 Argument substitution.......................................96
3.8.3.2 The # operator..............................................96
3.8.3.3 The ## operator.............................................96
3.8.3.4 Rescanning and further replacement..........................96
3.8.3.5 Scope of macro definitions..................................97
3.8.4 Line control.....................................................99
3.8.5 Error directive..................................................99
3.8.6 Pragma directive.................................................99
3.8.7 Null directive..................................................100
3.8.8 Predefined macro names..........................................100

3.9 FUTURE LANGUAGE DIRECTIONS...........................................100 3.9.1 External names..................................................100 3.9.2 Character escape sequences......................................100 3.9.3 Storage-class specifiers........................................100 3.9.4 Function declarators............................................100 3.9.5 Function definitions............................................101

4. LIBRARY..................................................................101

4.1 INTRODUCTION.........................................................101 4.1.1 Definitions of terms............................................101 4.1.2 Standard headers................................................101 4.1.3 Errors <errno.h>................................................102 4.1.4 Limits <float.h> and <limits.h>.................................102 4.1.5 Common definitions <stddef.h>...................................102 4.1.6 Use of library functions........................................103

4.2 DIAGNOSTICS <assert.h>...............................................104
4.2.1 Program diagnostics.............................................104
4.2.1.1 The assert macro...........................................104

3

Activity (36)

You've already reviewed this. Edit your review.
1 hundred reads
1 thousand reads
Erwin Setiadi liked this
jimyao liked this
harlan_watson liked this
farcasiun liked this
ImZodd liked this
Jitendra Singh liked this
maryrufus liked this

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->