ISO/IEC9899:201xCommittee Draft August 11, 2008WG14/N1336flexiblearraymembersstaticandtypequalifiersinparameterarraydeclaratorscomplex (and imaginary)supportin<complex.h>type-genericmathmacros in<tgmath.h>thelong long inttypeand libraryfunctionsincreased minimumtranslation limitsadditional floating-point characteristics in<f1oat.h>removeimplicitintreliableintegerdivisionuniversal characternames(luand lu)extended identifiers—hexadecimal floating-point constants and%a and %Aprintf/scanf conversionspecifiers-compound literalsdesignated initializers—/ / comments extended integer types and library functions in <inttypes.h> and <stdint.h>remove implicitfunction declarationpreprocessorarithmeticdoneinintmax_t/uintmax_tmixeddeclarationsandcodenewblockscopesforselectionand iterationstatements-integer constanttyperulesintegerpromotion rulesmacros with a variable number of argumentsthevscanffamilyoffunctionsin<stdio.h>and<wchar.h>— additional math library functions in<math.h>treatment of error conditions bymath libraryfunctions (math_errhandiing)—floating-point environment access in<fenv.h>—IEC60559(alsoknownasIEC559orIEEEarithmetic)support trailing comma allowed in enum declaration%lfconversionspecifierallowedinprintfxiiForeword
ISO/IEC 9899:201x Committee Draft — August 11, 2008 WG14/N1336 — flexible array members — static and type qualifiers in parameter array declarators — complex (and imaginary) support in <complex.h> — type-generic math macros in <tgmath.h> — the long long int type and library functions — increased minimum translation limits — additional floating-point characteristics in <float.h> — remove implicit int — reliable integer division — universal character names (\u and \U) — extended identifiers — hexadecimal floating-point constants and %a and %A printf/scanf conversion specifiers — compound literals — designated initializers — // comments — extended integer types and library functions in <inttypes.h> and <stdint.h> — remove implicit function declaration — preprocessor arithmetic done in intmax_t/uintmax_t — mixed declarations and code — new block scopes for selection and iteration statements — integer constant type rules — integer promotion rules — macros with a variable number of arguments — the vscanf family of functions in <stdio.h> and <wchar.h> — additional math library functions in <math.h> — treatment of error conditions by math library functions (math_errhandling) — floating-point environment access in <fenv.h> — IEC 60559 (also known as IEC 559 or IEEE arithmetic) support — trailing comma allowed in enum declaration — %lf conversion specifier allowed in printf xii Foreword
WG14/N1336ISO/IEC9899:201xCommitteeDraftAugust11.2008inline functionsthesnprintffamilyoffunctionsin<stdio.h>booleantypein<stdbool.h>idempotent typequalifiers-emptymacroargumentsnewstructuretypecompatibilityrules(tagcompatibility)二additional predefinedmacronames_Pragmapreprocessingoperator-standardpragmasfunc_predefinedidentifierva_copymacro-additional strftimeconversion specifiers-LIA compatibility annexdeprecate ungetc at the beginning of a binaryfileremovedeprecationofaliased arrayparametersconversion of arraytopointernot limited tolvaluesrelaxed constraints on aggregate and union initializationrelaxedrestrictionsonportableheadernamesreturn without expression not permitted in function that returns a value (and vice=versa)8Annexes D and F form a normative part of this standard, annexes A, B, C, E, G, H, I, Jthe bibliography, and the index are for information only. In accordance with Part 2 of the1ISO/IEC Directives, this foreword, the introduction, notes,footnotes, and examples arealso for information onlyForewordxili
WG14/N1336 Committee Draft — August 11, 2008 ISO/IEC 9899:201x — inline functions — the snprintf family of functions in <stdio.h> — boolean type in <stdbool.h> — idempotent type qualifiers — empty macro arguments — new structure type compatibility rules (tag compatibility) — additional predefined macro names — _Pragma preprocessing operator — standard pragmas — _ _func_ _ predefined identifier — va_copy macro — additional strftime conversion specifiers — LIA compatibility annex — 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) 8 AnnexesDand F form a normative part of this standard; annexes A, B, C, E, G, H, I, J, the bibliography, and the index are for information only. In accordance with Part 2 of the ISO/IEC Directives, this foreword, the introduction, notes, footnotes, and examples are also for information only. Foreword xiii
ISO/IEC9899:201xWG14/N1336Committee Draft August 11, 2008IntroductionWith 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 areretained becauseof their widespread use,but their use in new implementations(for implementationfeatures) or new programs (for language [6.11] or library features [7.26]) 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 described.Footnotes are provided to emphasize consequences of the rules described in thatsubclauseor elsewhere inthisInternational Standard.References are usedto refertoother related subclauses. Recommendations are provided to give advice or guidance toimplementors.Annexes provideadditional informationand summarizetheinformationcontained in this International Standard. A bibliography lists documents that werereferredtoduringthepreparationofthestandard.5Thelanguageclause (clause6)isderived from“TheCReferenceManual6The library clause (clause7)is based on the1984/usr/group StandardxivIntroduction
ISO/IEC 9899:201x Committee Draft — August 11, 2008 WG14/N1336 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.26]) 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. xiv Introduction
INTERNATIONALSTANDARDCISO/IECISO/IEC9899:201xProgramming languagesC1. ScopeThis International Standard specifies the form and establishes the interpretation ofprograms written in the C programming language.l) It specifiestherepresentationof Cprograms;thesyntax and constraints of the Clanguage;thesemanticrulesforinterpretingCprograms-therepresentation of input data to be processed by C programs; the representation of output data produced by C programs;-therestrictions and limits imposed bya conforming implementationofc2ThisInternational Standarddoesnotspecify the mechanism by which C programs are transformed for use by a data-processingsystem;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 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 particularprocessor,all minimal requirements of a data-processing system that is capable of supportingaconformingimplementation.This International Standard is designed to promote the portability of C programs among a variety of1)data-processingsystems.It is intendedforusebyimplementors and programmers1s1General
INTERNATIONAL STANDARD ©ISO/IEC ISO/IEC 9899:201x 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:201xCommittee DraftAugust 11,2008WG14/N13362. Normative referencesThe 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.2ISO 31-11:1992, Quantities and units - Part 11: Mathematical signs and symbols foruseinthephysical sciencesandtechnology.3ISO/IEC646,Information technology-ISO 7-bit codedcharacter setfor informationinterchange.4ISO/IEC2382-1:1993,Information technology-Vocabulary-Part I:Fundamentalterms.5ISO4217,Codes for the representation of currencies and funds.6ISO 8601, Data elements and interchange formats - Information interchangeRepresentationofdatesandtimes.ISO/IEC 10646 (all parts), Information technology - Universal Multiple-Octet Coded1Character Set (UCS)8IEC60559:1989,Binaryfloating-pointarithmeticformicroprocessor systems(previouslydesignated IEC 559:1989).2General$2
ISO/IEC 9899:201x Committee Draft — August 11, 2008 WG14/N1336 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 31−11:1992, Quantities and units — Part 11: Mathematical signs and symbols for use in the physical sciences and technology. 3 ISO/IEC 646, Information technology — ISO 7-bit coded character set for information interchange. 4 ISO/IEC 2382−1:1993, Information technology — Vocabulary — Part 1: Fundamental terms. 5 ISO 4217, Codes for the representation of currencies and funds. 6 ISO 8601, Data elements and interchange formats — Information interchange — Representation of dates and times. 7 ISO/IEC 10646 (all parts), Information technology — Universal Multiple-Octet Coded Character Set (UCS). 8 IEC 60559:1989, Binary floating-point arithmetic for microprocessor systems (previously designated IEC 559:1989). 2 General §2