ISO/IEC9899:2011 (E)ISO/IEC2011-Allrights reserveddeprecate ungetc at the beginning of a binary file一removedeprecationofaliasedarrayparametersconversion of arrayto pointer not limited to lvaluesrelaxed constraints on aggregate and union initializationrelaxed restrictions onportableheadernamesreturn without expression not permitted in function that returns a value (and vice一versa)xviForeword
ISO/IEC 9899:2011 (E) © ISO/IEC 2011 − All rights reserved — deprecate ungetc at the beginning of a binary file — remove deprecation of aliased array parameters — conversion of array to pointer not limited to lvalues — relaxed constraints on aggregate and union initialization — relaxed restrictions on portable header names — return without expression not permitted in function that returns a value (and vice versa) xvi Foreword
ISO/IEC9899:2011(E)ISO/IEC2011-All rights reservedIntroductionWith the introduction of new devices and extended character sets, new features may beadded to this International Standard. Subclauses in the language and library clauses warnimplementors and programmers of usages which, though valid in themselves, mayconflict with future additions.2Certain features are obsolescent,which means that they may be considered forwithdrawal in future revisions of this International Standard. They are retained becauseof their widespread use, but their use in new implementations (for implementationfeatures) or new programs (for language [6.11] or library features [7.31]) is discouraged.3This International Standard is divided into four major subdivisions:—preliminaryelements(clauses1-4);the characteristics of environments that translate and execute C programs (clause 5), the language syntax, constraints, and semantics (clause 6), the library facilities (clause 7).4Examples are provided to illustrate possible forms of the constructions describedFootnotes are provided to emphasize consequences of the rules described in thatsubclause or elsewhere in this International Standard. References are usedto refer toother related subclauses.Recommendations are provided to give advice or guidance toimplementors.Annexesprovide additional information and summarizethe informationcontained in this International Standard.A bibliography lists documents that werereferred to during the preparation of the standard.5The language clause(clause6)is derivedfrom“The CReferenceManual"6The library clause (clause 7) is based on the 1984 /usr/group Standard.The Working Group responsible for this standard (WG 14) maintains a site on the WorldWideWeb athttp://www.open-std.org/JTc1/sc22/wG14/containingadditional information relevant to this standard such as a Rationale for many of thedecisions made during its preparation and a log of Defect Reports and Responses.Introductionxvii
© ISO/IEC 2011 − All rights reserved ISO/IEC 9899:2011 (E) Introduction 1 With the introduction of new devices and extended character sets, new features may be added to this International Standard. Subclauses in the language and library clauses warn implementors and programmers of usages which, though valid in themselves, may conflict with future additions. 2 Certain features are obsolescent, which means that they may be considered for withdrawal in future revisions of this International Standard. They are retained because of their widespread use, but their use in new implementations (for implementation features) or new programs (for language [6.11] or library features [7.31]) is discouraged. 3 This International Standard is divided into four major subdivisions: — preliminary elements (clauses 1−4); — the characteristics of environments that translate and execute C programs (clause 5); — the language syntax, constraints, and semantics (clause 6); — the library facilities (clause 7). 4 Examples are provided to illustrate possible forms of the constructions described. Footnotes are provided to emphasize consequences of the rules described in that subclause or elsewhere in this International Standard. References are used to refer to other related subclauses. Recommendations are provided to give advice or guidance to implementors. Annexes provide additional information and summarize the information contained in this International Standard. A bibliography lists documents that were referred to during the preparation of the standard. 5 The language clause (clause 6) is derived from ‘‘The C Reference Manual’’. 6 The library clause (clause 7) is based on the 1984 /usr/group Standard. 7 The Working Group responsible for this standard (WG 14) maintains a site on the World Wide Web at http://www.open-std.org/JTC1/SC22/WG14/ containing additional information relevant to this standard such as a Rationale for many of the decisions made during its preparation and a log of Defect Reports and Responses. Introduction xvii
ISO/IEC9899:2011(E) ISO/IEC 2011 - All rights reservedxviliIntroduction
ISO/IEC 9899:2011 (E) © ISO/IEC 2011 − All rights reserved xviii Introduction
INTERNATIONALSTANDARDCISO/IECISO/IEC9899:2011 (E)InformationtechnologyProgramminglanguagesC1. ScopeThis International Standard specifies the form and establishes the interpretation ofprograms written in the C programming language.l) It specifies-therepresentation of Cprograms;thesyntax and constraints of the Clanguage;thesemanticrulesforinterpretingCprograms-the representation of input data tobe processed by Cprograms, the representation of output data produced by C programs;-therestrictions and limits imposedbya conforming implementation ofC2ThisInternational Standarddoes notspecify the mechanism by which C programs are transformed for use by a data-processingsystem,themechanismby whichCprograms are invoked foruseby a data-processing一system, the mechanism by which input data are transformed for use by a C program;the mechanism by which output data are transformed after being produced by a Cprogram, the size or complexity of a program and its data that will exceed the capacity of anyspecific data-processing system or the capacity of a particular processor,all minimal requirements of a data-processing system that is capable of supporting aconformingimplementation.This International Standard is designed to promote the portability of C programs among a variety of1)data-processing systems.It is intended for use by implementors and programmers.1$1General
INTERNATIONAL STANDARD ©ISO/IEC ISO/IEC 9899:2011 (E) Information technology — Programming languages — C 1. Scope 1 This International Standard specifies the form and establishes the interpretation of programs written in the C programming language.1) It specifies — the representation of C programs; — the syntax and constraints of the C language; — the semantic rules for interpreting C programs; — the representation of input data to be processed by C programs; — the representation of output data produced by C programs; — the restrictions and limits imposed by a conforming implementation of C. 2 This International Standard does not specify — the mechanism by which C programs are transformed for use by a data-processing system; — the mechanism by which C programs are invoked for use by a data-processing system; — the mechanism by which input data are transformed for use by a C program; — the mechanism by which output data are transformed after being produced by a C program; — the size or complexity of a program and its data that will exceed the capacity of any specific data-processing system or the capacity of a particular processor; — all minimal requirements of a data-processing system that is capable of supporting a conforming implementation. 1) This International Standard is designed to promote the portability of C programs among a variety of data-processing systems. It is intended for use by implementors and programmers. §1 General 1
ISO/IEC9899:2011 (E)ISO/IEC 2011 -All rights reserved2. Normative referencesThe following referenced documents are indispensable for the application of this1document. For dated references, only the edition cited applies. For undated references,the latest edition of the referenced document (including any amendments) applies.2ISO/IEC2382-1:1993,Informationtechnology-—Vocabulary-—Part1:Fundamentalterms3ISO4217,Codes for the representation of currencies and fiunds.4ISO8601,Data elements and interchangeformats-Information interchangeRepresentation of dates and times.5ISO/IEC10646,Informationtechnology-—UniversalCodedCharacterSet(UCS)6IEC60559:1989,Binaryfloating-pointarithmeticformicroprocessorsystems(previouslydesignatedIEC559:1989).7ISO 80000-2, Quantities and units - Part 2: Mathematical signs and symbols to be usedin the natural sciences and technology2GeneralS2
ISO/IEC 9899:2011 (E) © ISO/IEC 2011 − All rights reserved 2. Normative references 1 The following referenced documents are indispensable for the application of this document. For dated references, only the edition cited applies. For undated references, the latest edition of the referenced document (including any amendments) applies. 2 ISO/IEC 2382−1:1993, Information technology — Vocabulary — Part 1: Fundamental terms. 3 ISO 4217, Codes for the representation of currencies and funds. 4 ISO 8601, Data elements and interchange formats — Information interchange — Representation of dates and times. 5 ISO/IEC 10646, Information technology — Universal Coded Character Set (UCS). 6 IEC 60559:1989, Binary floating-point arithmetic for microprocessor systems (previously designated IEC 559:1989). 7 ISO 80000−2, Quantities and units — Part 2: Mathematical signs and symbols to be used in the natural sciences and technology. 2 General §2