C99RationaleV5.10

VIP免费
2025-02-27 0 0 877.15KB 224 页 5.9玖币
侵权投诉
UNIX is a trademark of The Open Group.
POSIX is a trademark of IEEE.
Rationale for
International Standard—
Programming Languages—
C
Revision 5.10
April-2003
Contents
ii
0. Introduction ............................................................................................................................1
0.1 Organization of the document ......................................................................................5
1. Scope ......................................................................................................................................7
2. Normative References ............................................................................................................9
3. Terms and definitions...........................................................................................................11 5
4. Conformance ........................................................................................................................13
5. Environment .........................................................................................................................15
5.1 Conceptual models......................................................................................................15
5.1.1 Translation environment.................................................................................15
5.1.2 Execution environments .................................................................................17 10
5.2 Environmental considerations ....................................................................................19
5.2.1 Character sets..................................................................................................19
5.2.2 Character display semantics ...........................................................................23
5.2.3 Signals and interrupts .....................................................................................24
5.2.4 Environmental limits ......................................................................................24 15
6. Language ..............................................................................................................................31
6.2 Concepts .....................................................................................................................31
6.2.1 Scopes of identifiers .......................................................................................31
6.2.2 Linkages of identifiers ....................................................................................32
6.2.3 Name spaces of identifiers..............................................................................34 20
6.2.4 Storage durations of objects............................................................................34
6.2.5 Types...............................................................................................................36
6.2.6 Representations of types .................................................................................43
6.2.7 Compatible type and composite type..............................................................43
6.3 Conversions ................................................................................................................44 25
6.3.1 Arithmetic operands........................................................................................44
6.3.1.6 Complex types ................................................................................................46
6.3.1.7 Real and complex ...........................................................................................46
6.3.2 Other operands................................................................................................48
6.4 Lexical Elements ........................................................................................................49 30
6.4.1 Keywords........................................................................................................50
6.4.2 Identifiers........................................................................................................50
6.4.3 Universal character names..............................................................................51
6.4.4 Constants.........................................................................................................51
6.4.5 String literals...................................................................................................55 35
6.4.6 Punctuators .....................................................................................................57
6.4.7 Header names..................................................................................................57
6.4.8 Preprocessing numbers ...................................................................................57
6.4.9 Comments.......................................................................................................58
6.5 Expressions.................................................................................................................58 40
6.5.1 Primary expressions........................................................................................61
6.5.2 Postfix operators .............................................................................................61
6.5.3 Unary operators ..............................................................................................64
6.5.4 Cast operators .................................................................................................66
Contents
iii
6.5.5 Multiplicative operators..................................................................................67
6.5.6 Additive operators ..........................................................................................67
6.5.7 Bitwise shift operators ....................................................................................68
6.5.8 Relational operators ........................................................................................69
6.5.9 Equality operators...........................................................................................69 5
6.5.15 Conditional operator .......................................................................................69
6.5.16 Assignment operators .....................................................................................69
6.5.17 Comma operator .............................................................................................71
6.6 Constant expressions ..................................................................................................71
6.7 Declarations ................................................................................................................72 10
6.7.1 Storage-class specifiers...................................................................................72
6.7.2 Type specifiers................................................................................................72
6.7.3 Type qualifiers ................................................................................................75
6.7.4 Function specifiers..........................................................................................80
6.7.5 Declarators......................................................................................................81 15
6.7.6 Type names.....................................................................................................87
6.7.7 Type definitions ..............................................................................................87
6.7.8 Initialization....................................................................................................88
6.8 Statements and blocks.................................................................................................90
6.8.1 Labeled statements..........................................................................................91 20
6.8.2 Compound statement ......................................................................................92
6.8.3 Expression and null statements.......................................................................92
6.8.4 Selection statements........................................................................................92
6.8.5 Iteration statements.........................................................................................93
6.8.6. Jump statements..............................................................................................94 25
6.9 External definitions.....................................................................................................95
6.9.1 Function definitions ........................................................................................95
6.9.2 External object definitions..............................................................................97
6.10 Preprocessing directives .............................................................................................97
6.10.1 Conditional inclusion......................................................................................97 30
6.10.2 Source file inclusion .......................................................................................98
6.10.3 Macro replacement .........................................................................................99
6.10.4 Line control...................................................................................................105
6.10.5 Error directive...............................................................................................105
6.10.6 Pragma directive ...........................................................................................105 35
6.10.7 Null directive ................................................................................................105
6.10.8 Predefined macro names...............................................................................106
6.10.9 Pragma operator............................................................................................106
6.11 Future language directions........................................................................................106
6.11.1 Floating types................................................................................................107 40
6.11.2 Linkages of identifiers ..................................................................................107
6.11.3 External names..............................................................................................107
6.11.4 Character escape sequences..........................................................................107
6.11.5 Storage-class specifiers.................................................................................107
6.11.6 Function declarators......................................................................................107 45
6.11.7 Function definitions ......................................................................................108
6.11.8 Pragma directives..........................................................................................108
6.11.9 Predefined macro names...............................................................................108
Contents
iv
7. Library................................................................................................................................109
7.1 Introduction...............................................................................................................109
7.1.1 Definitions of terms ......................................................................................111
7.1.2 Standard headers...........................................................................................111
7.1.3 Reserved identifiers ......................................................................................112 5
7.1.4 Use of library functions ................................................................................112
7.2 Diagnostics <assert.h> ......................................................................................113
7.2.1 Program diagnostics......................................................................................113
7.3 Complex arithmetic <complex.h> .......................................................................114
7.3.5 Trigonometric functions ...............................................................................115 10
7.3.6 Hyperbolic functions ....................................................................................116
7.3.7 Exponential and logarithmic functions.........................................................117
7.3.8 Power and absolute-value functions .............................................................117
7.3.9 Manipulation functions.................................................................................118
7.4 Character handling <ctype.h> .............................................................................118 15
7.4.1 Character classification functions.................................................................118
7.4.2 Character case mapping functions ................................................................119
7.5 Errors <errno.h>..................................................................................................119
7.6 Floating-point environment <fenv.h> ..................................................................120
7.6.1 The FENV_ACCESS pragma........................................................................122 20
7.6.2 Floating-point exceptions .............................................................................122
7.6.3 Rounding.......................................................................................................122
7.6.4 Environment .................................................................................................123
7.7 Characteristics of floating types <float.h>.........................................................123
7.8 Format conversion of integer types <inttypes.h>.............................................124 25
7.9 Alternate spellings <iso646.h> ...........................................................................124
7.10 Sizes of integer types <limits.h>.......................................................................125
7.11 Localization <locale.h> .....................................................................................125
7.11.1 Locale control ...............................................................................................127
7.11.2 Numeric formatting convention inquiry .......................................................127 30
7.12 Mathematics <math.h> .........................................................................................127
7.12.1 Treatment of error conditions .......................................................................128
7.12.2 The FP_CONTRACT pragma........................................................................130
7.12.3 Classification macros....................................................................................130
7.12.4 Trigonometric functions ...............................................................................131 35
7.12.6 Exponential and logarithmic functions.........................................................132
7.12.7 Power and absolute-value functions .............................................................134
7.12.8 Error and gamma functions ..........................................................................134
7.12.9 Nearest integer functions ..............................................................................135
7.12.10 Remainder functions.................................................................................136 40
7.12.11 Manipulation functions.............................................................................137
7.12.12 Maximum, minimum, and positive difference functions..........................138
7.12.13 Floating multiply-add ...............................................................................138
7.12.14 Comparison macros ..................................................................................138
7.13 Nonlocal jumps <setjmp.h>................................................................................139 45
7.13.1 Save calling environment .............................................................................139
Contents
v
7.13.2 Restore calling environment .........................................................................140
7.14 Signal handling <signal.h> ................................................................................140
7.14.1 Specify signal handling.................................................................................141
7.14.2 Send signal....................................................................................................141
7.15 Variable arguments <stdarg.h>..........................................................................141 5
7.15.1 Variable argument list access macros...........................................................142
7.16 Boolean type and values <stdbool.h>................................................................143
7.17 Common definitions <stddef.h> ........................................................................143
7.18 Integer types <stdint.h>.....................................................................................144
7.18.1 Integer types..................................................................................................145 10
7.19 Input/output <stdio.h>........................................................................................145
7.19.1 Introduction...................................................................................................146
7.19.2 Streams .........................................................................................................146
7.19.3 Files...............................................................................................................148
7.19.4 Operations on files........................................................................................148 15
7.19.5 File access functions.....................................................................................149
7.19.6 Formatted input/output functions .................................................................151
7.19.7 Character input/output functions ..................................................................155
7.19.8 Direct input/output functions........................................................................157
7.19.9 File positioning functions .............................................................................157 20
7.19.10 Error-handling functions...........................................................................158
7.20 General Utilities <stdlib.h>...............................................................................158
7.20.1 Numeric conversion functions......................................................................158
7.20.2 Pseudo-random sequence generation functions............................................160
7.20.3 Memory management functions ...................................................................160 25
7.20.4 Communication with the environment .........................................................162
7.20.5 Searching and sorting utilities ......................................................................164
7.20.6 Integer arithmetic functions..........................................................................164
7.20.7 Multibyte/wide character conversion functions............................................165
7.20.8 Multibyte/wide string conversion functions .................................................165 30
7.21 String handling <string.h>.................................................................................165
7.21.1 String function conventions..........................................................................165
7.21.2 Copying functions.........................................................................................165
7.21.3 Concatenation functions ...............................................................................166
7.21.4 Comparison functions...................................................................................166 35
7.21.5 Search functions............................................................................................166
7.21.6 Miscellaneous functions ...............................................................................167
7.22 Type-generic math <tgmath.h> ...........................................................................167
7.23 Date and time <time.h>........................................................................................169
7.23.1 Components of time......................................................................................169 40
7.23.2 Time manipulation functions........................................................................169
7.23.3 Time conversion functions ...........................................................................171
7.24 Extended multibyte and wide character utilities <wchar.h> ................................171
7.25 Wide character classification and mapping utilities <wctype.h> ........................171
7.26 Future library directions ...........................................................................................172 45
8. Annexes..............................................................................................................................173
摘要:

UNIXisatrademarkofTheOpenGroup.POSIXisatrademarkofIEEE.RationaleforInternationalStandard—ProgrammingLanguages—CRevision5.10April-2003Contentsii0.Introduction............................................................................................................................10.1Organizationoft...

展开>> 收起<<
C99RationaleV5.10.pdf

共224页,预览5页

还剩页未读, 继续阅读

声明:本站为文档C2C交易模式,即用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。玖贝云文库仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知玖贝云文库,我们立即给予删除!
分类:计算机 价格:5.9玖币 属性:224 页 大小:877.15KB 格式:PDF 时间:2025-02-27

开通VIP享超值会员特权

  • 多端同步记录
  • 高速下载文档
  • 免费文档工具
  • 分享文档赚钱
  • 每日登录抽奖
  • 优质衍生服务
/ 224
客服
关注