Example: stock market

Rationale for International Standard ... - open-std.org

Rationale for International Standard . Programming Languages . C. Revision April-2003. UNIX is a trademark of The open Group. POSIX is a trademark of IEEE. Contents 0. Introduction ..1. Organization of the document ..5. 1. Scope ..7. 2. Normative References ..9. 5 3. Terms and 4. Conformance ..13. 5. Environment ..15. Conceptual Translation 10 Execution environments ..17. Environmental considerations ..19. Character Character display semantics ..23. Signals and interrupts ..24. 15 Environmental limits ..24. 6. Language ..31. Concepts ..31. Scopes of identifiers ..31. Linkages of identifiers ..32. 20 Name spaces of Storage durations of Representations of types ..43. Compatible type and composite 25 Conversions ..44. Arithmetic Complex types ..46. Real and complex ..46. Other 30 Lexical Elements ..49. Universal character 35 String Punctuators ..57. Header Preprocessing numbers ..57. Comments ..58. 40 Expressions ..58. Primary Postfix operators ..61. Unary operators ..64.

Introduction 1 0. Introduction This Rationale summarizes the deliberations of INCITS J11 (formerly X3J11 and NCITS J11) and SC22 WG14, respectively the ANSI Technical Committee and ISO/IEC JTC 1 Working

Tags:

  Open, Standards, Rationale

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Other abuse

Transcription of Rationale for International Standard ... - open-std.org

1 Rationale for International Standard . Programming Languages . C. Revision April-2003. UNIX is a trademark of The open Group. POSIX is a trademark of IEEE. Contents 0. Introduction ..1. Organization of the document ..5. 1. Scope ..7. 2. Normative References ..9. 5 3. Terms and 4. Conformance ..13. 5. Environment ..15. Conceptual Translation 10 Execution environments ..17. Environmental considerations ..19. Character Character display semantics ..23. Signals and interrupts ..24. 15 Environmental limits ..24. 6. Language ..31. Concepts ..31. Scopes of identifiers ..31. Linkages of identifiers ..32. 20 Name spaces of Storage durations of Representations of types ..43. Compatible type and composite 25 Conversions ..44. Arithmetic Complex types ..46. Real and complex ..46. Other 30 Lexical Elements ..49. Universal character 35 String Punctuators ..57. Header Preprocessing numbers ..57. Comments ..58. 40 Expressions ..58. Primary Postfix operators ..61. Unary operators ..64.

2 Cast operators ..66. ii Contents Multiplicative Additive operators ..67. Bitwise shift operators ..68. Relational operators ..69. 5 Equality Conditional operator ..69. Assignment operators ..69. Comma operator ..71. Constant expressions ..71. 10 Declarations ..72. Storage-class Type Type qualifiers ..75. Function 15 Type Type definitions ..87. Statements and 20 Labeled Compound statement ..92. Expression and null Selection Iteration 25 Jump External Function definitions ..95. External object Preprocessing directives ..97. 30 Conditional Source file inclusion ..98. Macro replacement ..99. Line Error 35 Pragma directive ..105. Null directive ..105. Predefined macro Pragma Future language 40 Floating Linkages of identifiers ..107. External Character escape Storage-class 45 Function Function definitions ..108. Pragma Predefined macro iii Contents 7. Definitions of terms ..111. Standard 5 Reserved identifiers ..112. Use of library functions ..112. Diagnostics < > ..113. Program Complex arithmetic < >.

3 114. 10 Trigonometric functions ..115. Hyperbolic functions ..116. Exponential and logarithmic Power and absolute-value functions ..117. Manipulation 15 Character handling < > ..118. Character classification Character case mapping functions ..119. Errors < >..119. Floating-point environment < > ..120. 20 The FENV_ACCESS Floating-point exceptions ..122. Environment ..123. Characteristics of floating types < >..123. 25 Format conversion of integer types < >..124. Alternate spellings < > ..124. Sizes of integer types < > ..125. Localization < > ..125. Locale control ..127. 30 Numeric formatting convention inquiry ..127. Mathematics < > ..127. Treatment of error conditions ..128. The FP_CONTRACT Classification 35 Trigonometric functions ..131. Exponential and logarithmic Power and absolute-value functions ..134. Error and gamma functions ..134. Nearest integer functions ..135. 40 Remainder Manipulation Maximum, minimum, and positive difference Floating multiply-add ..138.

4 Comparison macros ..138. 45 Nonlocal jumps < >..139. Save calling environment ..139. iv Contents Restore calling environment ..140. Signal handling < > ..140. Specify signal Send 5 Variable arguments < >..141. Variable argument list access Boolean type and values < >..143. Common definitions < > ..143. Integer types < >..144. 10 Integer Input/output < > ..145. Streams ..146. 15 Operations on File access functions ..149. Formatted input/output functions ..151. Character input/output functions ..155. Direct input/output 20 File positioning functions ..157. Error-handling General Utilities < >..158. Numeric conversion Pseudo-random sequence generation 25 Memory management functions ..160. Communication with the environment ..162. Searching and sorting utilities ..164. Integer arithmetic Multibyte/wide character conversion 30 Multibyte/wide string conversion functions ..165. String handling < >..165. String function Copying Concatenation functions ..166. 35 Comparison Search Miscellaneous functions.

5 167. Type-generic math < > ..167. Date and time < >..169. 40 Components of Time manipulation Time conversion functions ..171. Extended multibyte and wide character utilities < > ..171. Wide character classification and mapping utilities < > ..171. 45 Future library directions ..172. 8. Annexes ..173. v Contents Annex D Universal character names for identifiers (normative) ..175. Annex F IEC 60559 floating-point arithmetic (normative)..177. Binary-decimal 5 Environment ..179. Constant expressions ..179. Mathematics < > ..179. Trigonometric functions ..181. 10 Power and absolute value functions ..182. Maximum, minimum, and positive difference Annex G IEC 60559-compatible complex arithmetic (informative) ..183. Binary 15 Multiplicative Complex arithmetic < > ..184. Hyperbolic Exponential and logarithmic functions ..187. Power and absolute-value functions ..187. 20 Type-generic math < > ..187. Annex H Language independent arithmetic (informative) ..189. MSE. Multibyte Support Extensions MSE Programming model based on wide characters.

6 193. 25 Parallelism versus improvement ..193. Support for invariant ISO/IEC 646 ..197. Headers ..197. < >..197. < > ..199. 30 Wide-character classification Locale dependency of iswxxx Changed space character handling ..199. Extensible classification and mapping Generalized multibyte 35 Streams and files ..201. Conversion state ..201. Byte versus wide-character input/output ..203. Text versus binary 40 Formatted input/output Enhancing existing formatted input/output functions ..205. Formatted wide-character input/output functions ..205. Adding the fwide function ..206. Single-byte wide-character conversion vi Contents Extended conversion Conversion state ..207. Conversion Column 5 Index ..213. vii Introduction 0. Introduction This Rationale summarizes the deliberations of INCITS J11 (formerly X3J11 and NCITS J11). and SC22 WG14, respectively the ANSI Technical Committee and ISO/IEC JTC 1 Working Group, charged with revising the International Standard for the C programming language; and it 5 retains much of the text of the Rationale for the original ANSI Standard (ANSI , the so-called C89 ).

7 This document has been published along with the draft Standard to assist the process of formal public review. There have been several changes to the Standard already. C89 was quickly adopted as an International Standard (ISO/IEC 9899:1990, commonly called C90 ), with changes to clause 10 and subclause numbering to conform to ISO practices. Since then, there have been two Technical Corrigenda and one Amendment, AMD1; and those three documents, together with C90 itself, compose the International Standard , ( C95 ). The current C Standard was adopted in 1999 and is called C99.. J11 represents a cross-section of the C community in the United States: it consists of about 15 twenty or thirty members representing hardware manufacturers, vendors of compilers and other software development tools, software designers, consultants, academics, authors, applications programmers, and others. WG14's participants are representatives of national standards bodies such as AFNOR, ANSI, BSI, DIN and DS.

8 In this Rationale , the unqualified Committee refers to J11 and WG14 working together to create C99. 20 Upon publication of the new Standard , the primary role of the Committee will be to offer interpretations of the Standard . It will consider and respond to all correspondence it receives. The Committee's overall goal was to develop a clear, consistent, and unambiguous Standard for the C programming language which codifies the common, existing definition of C and which promotes the portability of user programs across C language environments. 25 The original X3J11 charter clearly mandated codifying common existing practice, and the C89. Committee held fast to precedent wherever that was clear and unambiguous. The vast majority of the language defined by C89 was precisely the same as defined in Appendix A of the first edition of The C Programming Language by Brian Kernighan and Dennis Ritchie, and as was implemented in almost all C translators of the time. (That document is hereinafter referred to as 30 K&R.)

9 K&R was not the only source of existing practice. Much work had been done over the years to improve the C language by addressing its weaknesses, and the C89 Committee formalized enhancements of proven value which had become part of the various dialects of C. This practice has continued in the present Committee. 35 Existing practice, however, has not always been consistent. Various dialects of C have approached problems in different and sometimes diametrically opposed ways. This divergence has happened for several reasons. First, K&R, which once served as the language specification for almost all C translators, is imprecise in some areas (thereby allowing divergent interpretations), and it does not address some issues (such as a complete specification of a 1. Introduction library) important for code portability. Second, as the language has matured over the years, various extensions have been added in different dialects to address limitations and weaknesses of the language; but these extensions have not been consistent across dialects.

10 One of the C89 Committee's goals was to consider such areas of divergence and to establish a 5 set of clear, unambiguous rules consistent with the rest of the language. This effort included the consideration of extensions made in various C dialects, the specification of a complete set of required library functions, and the development of a complete, correct syntax for C. Much of the Committee's work has always been in large part a balancing act. The C89. Committee tried to improve portability while retaining the definition of certain features of C as 10 machine-dependent, it attempted to incorporate valuable new ideas without disrupting the basic structure and fabric of the language, and it tried to develop a clear and consistent language without invalidating existing programs. All of the goals were important and each decision was weighed in the light of sometimes contradictory requirements in an attempt to reach a workable compromise. 15 In specifying a Standard language, the C89 Committee used several principles which continue to guide our deliberations today.