X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=n1256.html;h=42134cacb74112ed814baa68426f7756a1940fd0;hb=60964d4bc3b9138f1ee750c1e0c0a63442d53d72;hp=aa9717a7ada3a4a60e240d16c5f22736db9a01a8;hpb=7df8cd2a500cd0285ce82e96357a0d7e06b3956f;p=c-standard diff --git a/n1256.html b/n1256.html index aa9717a..42134ca 100644 --- a/n1256.html +++ b/n1256.html @@ -5,7 +5,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 -

Contents

+

Contents

-

Foreword

+

Foreword

ISO (the International Organization for Standardization) and IEC (the International Electrotechnical Commission) form the specialized system for worldwide @@ -476,7 +476,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 also for information only. -

Introduction

+

Introduction

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 @@ -515,7 +515,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 -

1. Scope

+

1. Scope

This International Standard specifies the form and establishes the interpretation of programs written in the C programming language.1) It specifies @@ -552,7 +552,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 data-processing systems. It is intended for use by implementors and programmers. -

2. Normative references

+

2. Normative references

The following normative documents contain provisions which, through reference in this text, constitute provisions of this International Standard. For dated references, @@ -584,7 +584,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 designated IEC 559:1989). -

3. Terms, definitions, and symbols

+

3. Terms, definitions, and symbols

For the purposes of this International Standard, the following definitions apply. Other terms are defined where they appear in italic type or on the left side of a syntax rule. @@ -593,9 +593,9 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 Standard are to be interpreted according to ISO/IEC 2382-1. Mathematical symbols not defined in this International Standard are to be interpreted according to ISO 31-11. -

3.1

+

3.1

- access + access
<execution-time action> to read or modify the value of an object

NOTE 1 Where only one of these two actions is meant, ''read'' or ''modify'' is used. @@ -607,38 +607,38 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 NOTE 3 Expressions that are not evaluated do not access objects. -

3.2

+

3.2

- alignment + alignment
requirement that objects of a particular type be located on storage boundaries with addresses that are particular multiples of a byte address -

3.3

+

3.3

- argument - actual argument - actual parameter (deprecated) + argument
+ actual argument
+ actual parameter (deprecated)
expression in the comma-separated list bounded by the parentheses in a function call expression, or a sequence of preprocessing tokens in the comma-separated list bounded by the parentheses in a function-like macro invocation -

3.4

+

3.4

- behavior + behavior
external appearance or action -

3.4.1

+

3.4.1

- implementation-defined behavior + implementation-defined behavior
unspecified behavior where each implementation documents how the choice is made

EXAMPLE An example of implementation-defined behavior is the propagation of the high-order bit when a signed integer is shifted right. -

3.4.2

+

3.4.2

- locale-specific behavior + locale-specific behavior
behavior that depends on local conventions of nationality, culture, and language that each implementation documents @@ -647,9 +647,9 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 characters other than the 26 lowercase Latin letters. -

3.4.3

+

3.4.3

- undefined behavior + undefined behavior
behavior, upon use of a nonportable or erroneous program construct or of erroneous data, for which this International Standard imposes no requirements

@@ -662,9 +662,9 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 EXAMPLE An example of undefined behavior is the behavior on integer overflow. -

3.4.4

+

3.4.4

- unspecified behavior + unspecified behavior
use of an unspecified value, or other behavior where this International Standard provides two or more possibilities and imposes no further requirements on which is chosen in any instance @@ -673,18 +673,18 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 evaluated. -

3.5

+

3.5

- bit + bit
unit of data storage in the execution environment large enough to hold an object that may have one of two values

NOTE It need not be possible to express the address of each individual bit of an object. -

3.6

+

3.6

- byte + byte
addressable unit of data storage large enough to hold any member of the basic character set of the execution environment

@@ -696,73 +696,73 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 bit. -

3.7

+

3.7

- character + character
<abstract> member of a set of elements used for the organization, control, or representation of data -

3.7.1

+

3.7.1

- character + character
single-byte character <C> bit representation that fits in a byte -

3.7.2

+

3.7.2

- multibyte character + multibyte character
sequence of one or more bytes representing a member of the extended character set of either the source or the execution environment

NOTE The extended character set is a superset of the basic character set. -

3.7.3

+

3.7.3

- wide character + wide character
bit representation that fits in an object of type wchar_t, capable of representing any character in the current locale -

3.8

+

3.8

- constraint + constraint
restriction, either syntactic or semantic, by which the exposition of language elements is to be interpreted -

3.9

+

3.9

- correctly rounded result + correctly rounded result
representation in the result format that is nearest in value, subject to the current rounding mode, to what the result would be given unlimited range and precision -

3.10

+

3.10

- diagnostic message + diagnostic message
message belonging to an implementation-defined subset of the implementation's message output -

3.11

+

3.11

- forward reference + forward reference
reference to a later subclause of this International Standard that contains additional information relevant to this subclause -

3.12

+

3.12

- implementation + implementation
particular set of software, running in a particular translation environment under particular control options, that performs translation of programs for, and supports execution of functions in, a particular execution environment -

3.13

+

3.13

- implementation limit + implementation limit
restriction imposed upon programs by the implementation -

3.14

+

3.14

- object + object
region of data storage in the execution environment, the contents of which can represent values @@ -770,62 +770,62 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 NOTE When referenced, an object may be interpreted as having a particular type; see 6.3.2.1. -

3.15

+

3.15

- parameter + parameter
formal parameter formal argument (deprecated) object declared as part of a function declaration or definition that acquires a value on entry to the function, or an identifier from the comma-separated list bounded by the parentheses immediately following the macro name in a function-like macro definition -

3.16

+

3.16

- recommended practice + recommended practice
specification that is strongly recommended as being in keeping with the intent of the standard, but that may be impractical for some implementations -

3.17

+

3.17

- value + value
precise meaning of the contents of an object when interpreted as having a specific type -

3.17.1

+

3.17.1

- implementation-defined value + implementation-defined value
unspecified value where each implementation documents how the choice is made -

3.17.2

+

3.17.2

- indeterminate value + indeterminate value
either an unspecified value or a trap representation -

3.17.3

+

3.17.3

- unspecified value + unspecified value
valid value of the relevant type where this International Standard imposes no requirements on which value is chosen in any instance

NOTE An unspecified value cannot be a trap representation. -

3.18

+

3.18

- ??? x??? + [^ x ^]
ceiling of x: the least integer greater than or equal to x

- EXAMPLE ???2.4??? is 3, ???-2.4??? is -2. + EXAMPLE [^2.4^] is 3, [^-2.4^] is -2. -

3.19

+

3.19

- ??? x??? + [_ x _]
floor of x: the greatest integer less than or equal to x

- EXAMPLE ???2.4??? is 2, ???-2.4??? is -3. + EXAMPLE [_2.4_] is 2, [_-2.4_] is -3. -

4. Conformance

+

4. Conformance

In this International Standard, ''shall'' is to be interpreted as a requirement on an implementation or on a program; conversely, ''shall not'' is to be interpreted as a @@ -898,7 +898,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 implementation. -

5. Environment

+

5. Environment

An implementation translates C source files and executes C programs in two data- processing-system environments, which will be called the translation environment and @@ -908,11 +908,11 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007

Forward references: In this clause, only a few of many possible forward references have been noted. -

5.1 Conceptual models

+

5.1 Conceptual models

-

5.1.1 Translation environment

+

5.1.1 Translation environment

-
5.1.1.1 Program structure
+
5.1.1.1 Program structure

A C program need not all be translated at the same time. The text of the program is kept in units called source files, (or preprocessing files) in this International Standard. A @@ -927,7 +927,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007

Forward references: linkages of identifiers (6.2.2), external definitions (6.9), preprocessing directives (6.10). -

5.1.1.2 Translation phases
+
5.1.1.2 Translation phases

The precedence among the syntax rules of translation is specified by the following phases.5) @@ -992,7 +992,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 character. -

5.1.1.3 Diagnostics
+
5.1.1.3 Diagnostics

A conforming implementation shall produce at least one diagnostic message (identified in an implementation-defined manner) if a preprocessing translation unit or translation unit @@ -1014,7 +1014,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 valid program is still correctly translated. It may also successfully translate an invalid program. -

5.1.2 Execution environments

+

5.1.2 Execution environments

Two execution environments are defined: freestanding and hosted. In both cases, program startup occurs when a designated C function is called by the execution @@ -1024,7 +1024,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 environment.

Forward references: storage durations of objects (6.2.4), initialization (6.7.8). -

5.1.2.1 Freestanding environment
+
5.1.2.1 Freestanding environment

In a freestanding environment (in which C program execution may take place without any benefit of an operating system), the name and type of the function called at program @@ -1034,7 +1034,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 The effect of program termination in a freestanding environment is implementation- defined. -

5.1.2.2 Hosted environment
+
5.1.2.2 Hosted environment

A hosted environment need not be provided, but shall conform to the following specifications if present. @@ -1044,7 +1044,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 -

5.1.2.2.1 Program startup
+
5.1.2.2.1 Program startup

The function called at program startup is named main. The implementation declares no prototype for this function. It shall be defined with a return type of int and with no @@ -1084,7 +1084,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 char ** argv, and so on. -

5.1.2.2.2 Program execution
+
5.1.2.2.2 Program execution

In a hosted environment, a program may use all the functions, macros, type definitions, and objects described in the library clause (clause 7). @@ -1093,7 +1093,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 -

5.1.2.2.3 Program termination
+
5.1.2.2.3 Program termination

If the return type of the main function is a type compatible with int, a return from the initial call to the main function is equivalent to calling the exit function with the value @@ -1107,7 +1107,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 will have ended in the former case, even where they would not have in the latter. -

5.1.2.3 Program execution
+
5.1.2.3 Program execution

The semantic descriptions in this International Standard describe the behavior of an abstract machine in which issues of optimization are irrelevant. @@ -1272,9 +1272,9 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 effects matter, freeing the implementations in other cases. -

5.2 Environmental considerations

+

5.2 Environmental considerations

-

5.2.1 Character sets

+

5.2.1 Character sets

Two sets of characters and their associated collating sequences shall be defined: the set in which source files are written (the source character set), and the set interpreted in the @@ -1326,7 +1326,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007

Forward references: universal character names (6.4.3), character constants (6.4.4.4), preprocessing directives (6.10), string literals (6.4.5), comments (6.4.9), string (7.1.1). -

5.2.1.1 Trigraph sequences
+
5.2.1.1 Trigraph sequences

Before any other processing takes place, each occurrence of one of the following sequences of three characters (called trigraph sequences12)) is replaced with the @@ -1359,7 +1359,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 described in ISO/IEC 646, which is a subset of the seven-bit US ASCII code set. -

5.2.1.2 Multibyte characters
+
5.2.1.2 Multibyte characters

The source character set may contain multibyte characters, used to represent members of the extended character set. The execution character set may also contain multibyte @@ -1390,7 +1390,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 of a sequence of valid multibyte characters. -

5.2.2 Character display semantics

+

5.2.2 Character display semantics

The active position is that location on a display device where the next character output by the fputc function would appear. The intent of writing a printing character (as defined @@ -1402,33 +1402,31 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007

Alphabetic escape sequences representing nongraphic characters in the execution character set are intended to produce actions on display devices as follows: - \a (alert) Produces an audible or visible alert without changing the active position. - \b (backspace) Moves the active position to the previous position on the current line. If -

+
+
\a
(alert) Produces an audible or visible alert without changing the active position. +
\b
(backspace) Moves the active position to the previous position on the current line. If the active position is at the initial position of a line, the behavior of the display - device is unspecified.
- \f ( form feed) Moves the active position to the initial position at the start of the next -
-    logical page.
- \n (new line) Moves the active position to the initial position of the next line. - \r (carriage return) Moves the active position to the initial position of the current line. - \t (horizontal tab) Moves the active position to the next horizontal tabulation position -
+    device is unspecified.
+
\f
( form feed) Moves the active position to the initial position at the start of the next + logical page. +
\n
(new line) Moves the active position to the initial position of the next line. +
\r
(carriage return) Moves the active position to the initial position of the current line. +
\t
(horizontal tab) Moves the active position to the next horizontal tabulation position on the current line. If the active position is at or past the last defined horizontal - tabulation position, the behavior of the display device is unspecified.
- \v (vertical tab) Moves the active position to the initial position of the next vertical + tabulation position, the behavior of the display device is unspecified. +
\v
(vertical tab) Moves the active position to the initial position of the next vertical -

-

      tabulation position. If the active position is at or past the last defined vertical
-      tabulation position, the behavior of the display device is unspecified.
+ tabulation position, the behavior of the display device is unspecified. + +

Each of these escape sequences shall produce a unique implementation-defined value which can be stored in a single char object. The external representations in a text file need not be identical to the internal representations, and are outside the scope of this International Standard.

Forward references: the isprint function (7.4.1.8), the fputc function (7.19.7.3). -

5.2.3 Signals and interrupts

+

5.2.3 Signals and interrupts

Functions shall be implemented such that they may be interrupted at any time by a signal, or may be called by a signal handler, or both, with no alteration to earlier, but still active, @@ -1437,14 +1435,14 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 image (the instructions that compose the executable representation of a function) on a per-invocation basis. -

5.2.4 Environmental limits

+

5.2.4 Environmental limits

Both the translation and execution environments constrain the implementation of language translators and libraries. The following summarizes the language-related environmental limits on a conforming implementation; the library-related limits are discussed in clause 7. -

5.2.4.1 Translation limits
+
5.2.4.1 Translation limits

The implementation shall be able to translate and execute at least one program that contains at least one instance of every one of the following limits:13) @@ -1490,14 +1488,14 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007

14) See ''future language directions'' (6.11.3). -

5.2.4.2 Numerical limits
+
5.2.4.2 Numerical limits

An implementation is required to document all the limits specified in this subclause, which are specified in the headers <limits.h> and <float.h>. Additional limits are specified in <stdint.h>.

Forward references: integer types <stdint.h> (7.18). -

5.2.4.2.1 Sizes of integer types
+
5.2.4.2.1 Sizes of integer types

The values given below shall be replaced by constant expressions suitable for use in #if preprocessing directives. Moreover, except for CHAR_BIT and MB_LEN_MAX, the @@ -1510,58 +1508,58 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 (absolute value) to those shown, with the same sign.

If the value of an object of type char is treated as a signed integer when used in an expression, the value of CHAR_MIN shall be the same as that of SCHAR_MIN and the value of CHAR_MAX shall be the same as that of SCHAR_MAX. Otherwise, the value of CHAR_MIN shall be 0 and the value of CHAR_MAX shall be the same as that of - UCHAR_MAX.15) The value UCHAR_MAX shall equal 2CHAR_BIT - 1. + UCHAR_MAX.15) The value UCHAR_MAX shall equal 2CHAR_BIT - 1.

Forward references: representations of types (6.2.6), conditional inclusion (6.10.1).

footnotes

15) See 6.2.5. -

5.2.4.2.2 Characteristics of floating types
+
5.2.4.2.2 Characteristics of floating types

The characteristics of floating types are defined in terms of a model that describes a representation of floating-point numbers and values that provide information about an @@ -1573,19 +1571,18 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 b base or radix of exponent representation (an integer > 1) e exponent (an integer between a minimum emin and a maximum emax ) p precision (the number of base-b digits in the significand) - fk nonnegative integers less than b (the significand digits) + fk nonnegative integers less than b (the significand digits) A floating-point number (x) is defined by the following model:

                     p
-        x = sb e   (Sum) f k b-k ,
-                   k=1
-                                  emin <= e <= emax
+ x = s be (Sum) fk b-k , emin <= e <= emax + k=1

- In addition to normalized floating-point numbers ( f 1 > 0 if x != 0), floating types may be + In addition to normalized floating-point numbers ( f1 > 0 if x != 0), floating types may be able to contain other kinds of floating-point numbers, such as subnormal floating-point - numbers (x != 0, e = emin , f 1 = 0) and unnormalized floating-point numbers (x != 0, - e > emin , f 1 = 0), and values that are not floating-point numbers, such as infinities and + numbers (x != 0, e = emin , f1 = 0) and unnormalized floating-point numbers (x != 0, + e > emin , f1 = 0), and values that are not floating-point numbers, such as infinities and NaNs. A NaN is an encoding signifying Not-a-Number. A quiet NaN propagates through almost every arithmetic operation without raising a floating-point exception; a signaling NaN generally raises a floating-point exception when occurring as an @@ -1609,8 +1606,8 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 All integer values in the <float.h> header, except FLT_ROUNDS, shall be constant expressions suitable for use in #if preprocessing directives; all floating values shall be constant expressions. All except DECIMAL_DIG, FLT_EVAL_METHOD, FLT_RADIX, - and FLT_ROUNDS have separate names for all three floating-point types. The floating- - point model representation is provided for all values except FLT_EVAL_METHOD and + and FLT_ROUNDS have separate names for all three floating-point types. The floating-point + model representation is provided for all values except FLT_EVAL_METHOD and FLT_ROUNDS.

The rounding mode for floating-point addition is characterized by the implementation- @@ -1651,19 +1648,19 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 those shown, with the same sign:

The values given in the following list shall be replaced by constant expressions with implementation-defined values that are greater than or equal to those shown:

The values given in the following list shall be replaced by constant expressions with implementation-defined (positive) values that are less than or equal to those shown:

- Recommended practice +
Recommended practice

Conversion from (at least) double to decimal with DECIMAL_DIG digits and back should be the identity function. @@ -1736,9 +1731,8 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 float:

                     6
-       x = s16e    (Sum) f k 16-k ,
-                   k=1
-                                   -31 <= e <= +32
+ x = s 16e (Sum) fk 16-k , -31 <= e <= +32 + k=1
          FLT_RADIX                                  16
@@ -1758,15 +1752,14 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
  <float.h> header for types float and double:
 
                    24
-       x f = s2e   (Sum) f k 2-k ,
-                   k=1
-                                  -125 <= e <= +128
+ xf = s 2e (Sum) fk 2-k , -125 <= e <= +128 + k=1
                    53
-       x d = s2e   (Sum) f k 2-k ,
-                   k=1
-                                  -1021 <= e <= +1024
+ xd = s 2e (Sum) fk 2-k , -1021 <= e <= +1024 + k=1 +
          FLT_RADIX                                   2
@@ -1829,9 +1822,9 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
  limits are one less than shown here.
 
 
-

6. Language

+

6. Language

-

6.1 Notation

+

6.1 Notation

In the syntax notation used in this clause, syntactic categories (nonterminals) are indicated by italic type, and literal words and character set members (terminals) by bold @@ -1839,7 +1832,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 definitions are listed on separate lines, except when prefaced by the words ''one of''. An optional symbol is indicated by the subscript ''opt'', so that

-          { expressionopt }
+ { expressionopt }
indicates an optional expression enclosed in braces.

When syntactic categories are referred to in the main text, they are not italicized and @@ -1847,9 +1840,9 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007

A summary of the language syntax is given in annex A. -

6.2 Concepts

+

6.2 Concepts

-

6.2.1 Scopes of identifiers

+

6.2.1 Scopes of identifiers

An identifier can denote an object; a function; a tag or a member of a structure, union, or enumeration; a typedef name; a label name; a macro name; or a macro parameter. The @@ -1901,7 +1894,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 (6.9.1), identifiers (6.4.2), name spaces of identifiers (6.2.3), macro replacement (6.10.3), source file inclusion (6.10.2), statements (6.8). -

6.2.2 Linkages of identifiers

+

6.2.2 Linkages of identifiers

An identifier declared in different scopes or in the same scope more than once can be made to refer to the same object or function by a process called linkage.21) There are @@ -1949,7 +1942,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007

23) As specified in 6.2.1, the later declaration might hide the prior declaration. -

6.2.3 Name spaces of identifiers

+

6.2.3 Name spaces of identifiers

If more than one declaration of a particular identifier is visible at any point in a translation unit, the syntactic context disambiguates uses that refer to different entities. @@ -1977,7 +1970,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007

24) There is only one name space for tags even though three are possible. -

6.2.4 Storage durations of objects

+

6.2.4 Storage durations of objects

An object has a storage duration that determines its lifetime. There are three storage durations: static, automatic, and allocated. Allocated storage is described in 7.20.3. @@ -2028,7 +2021,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 embedded block prior to the declaration, leaves the scope of the declaration. -

6.2.5 Types

+

6.2.5 Types

The meaning of a value stored in an object or returned by a function is determined by the type of the expression used to access it. (An identifier declared to be an object is the @@ -2245,9 +2238,9 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 arguments to functions, return values from functions, and members of unions. -

6.2.6 Representations of types

+

6.2.6 Representations of types

-
6.2.6.1 General
+
6.2.6.1 General

The representations of all types are unspecified except as stated in this subclause.

@@ -2299,11 +2292,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 represented by successive bits are additive, begin with 1, and are multiplied by successive integral powers of 2, except perhaps the bit with the highest position. (Adapted from the American National Dictionary for Information Processing Systems.) A byte contains CHAR_BIT bits, and the values of - type unsigned char range from 0 to 2 - -

-                                           CHAR_BIT
-                                                     - 1.
+ type unsigned char range from 0 to 2CHAR_BIT- 1.

41) Thus, an automatic variable can be initialized to a trap representation without causing undefined behavior, but the value of the variable cannot be used until a proper value is stored in it. @@ -2317,13 +2306,13 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 on values of type T may distinguish between them. -

6.2.6.2 Integer types
+
6.2.6.2 Integer types

For unsigned integer types other than unsigned char, the bits of the object representation shall be divided into two groups: value bits and padding bits (there need not be any of the latter). If there are N value bits, each bit shall represent a different - power of 2 between 1 and 2 N -1 , so that objects of that type shall be capable of - representing values from 0 to 2 N - 1 using a pure binary representation; this shall be + power of 2 between 1 and 2N-1 , so that objects of that type shall be capable of + representing values from 0 to 2N - 1 using a pure binary representation; this shall be known as the value representation. The values of any padding bits are unspecified.44)

For signed integer types, the bits of the object representation shall be divided into three @@ -2337,8 +2326,8 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 modified in one of the following ways:

Which of these applies is implementation-defined, as is whether the value with sign bit 1 and all value bits zero (for the first two), or with sign bit and all value bits 1 (for ones' @@ -2387,7 +2376,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 bits. -

6.2.7 Compatible type and composite type

+

6.2.7 Compatible type and composite type

Two types have compatible type if their types are the same. Additional rules for determining whether two types are compatible are described in 6.7.2 for type specifiers, @@ -2444,7 +2433,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007

47) As specified in 6.2.1, the later declaration might hide the prior declaration. -

6.3 Conversions

+

6.3 Conversions

Several operators convert operand values from one type to another automatically. This subclause specifies the result required from such an implicit conversion, as well as those @@ -2456,9 +2445,9 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 representation.

Forward references: cast operators (6.5.4). -

6.3.1 Arithmetic operands

+

6.3.1 Arithmetic operands

-
6.3.1.1 Boolean, characters, and integers
+
6.3.1.1 Boolean, characters, and integers

Every integer type has an integer conversion rank defined as follows:

+ The values of floating operands and of the results of floating expressions may be represented in greater precision and range than that required by the type; the types are not changed thereby.52) @@ -2633,9 +2625,9 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 described in 6.3.1.4 and 6.3.1.5. -

6.3.2 Other operands

+

6.3.2 Other operands

-
6.3.2.1 Lvalues, arrays, and function designators
+
6.3.2.1 Lvalues, arrays, and function designators

An lvalue is an expression with an object type or an incomplete type other than void;53) if an lvalue does not designate an object when it is evaluated, the behavior is undefined. @@ -2683,7 +2675,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 designator and violates the constraint in 6.5.3.4. -

6.3.2.2 void
+
6.3.2.2 void

The (nonexistent) value of a void expression (an expression that has type void) shall not be used in any way, and implicit or explicit conversions (except to void) shall not be @@ -2691,7 +2683,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 expression, its value or designator is discarded. (A void expression is evaluated for its side effects.) -

6.3.2.3 Pointers
+
6.3.2.3 Pointers

A pointer to void may be converted to or from a pointer to any incomplete or object type. A pointer to any incomplete or object type may be converted to a pointer to void @@ -2748,7 +2740,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 correctly aligned for a pointer to type C. -

6.4 Lexical elements

+

6.4 Lexical elements

Syntax

@@ -2820,7 +2812,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
  occur in source files.
 
 
-

6.4.1 Keywords

+

6.4.1 Keywords

Syntax

@@ -2849,9 +2841,9 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
 

59) One possible specification for imaginary types appears in annex G. -

6.4.2 Identifiers

+

6.4.2 Identifiers

-
6.4.2.1 General
+
6.4.2.1 General
Syntax

@@ -2890,7 +2882,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
  
  
 
- Implementation limits
+
Implementation limits

As discussed in 5.2.4.1, an implementation may limit the number of significant initial characters in an identifier; the limit for an external name (an identifier that has external @@ -2909,7 +2901,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 Extended characters may produce a long external identifier. -

6.4.2.2 Predefined identifiers
+
6.4.2.2 Predefined identifiers
Semantics

The identifier __func__ shall be implicitly declared by the translator as if, @@ -2946,7 +2938,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 identifier is explicitly declared using the name __func__, the behavior is undefined. -

6.4.3 Universal character names

+

6.4.3 Universal character names

Syntax

@@ -2985,7 +2977,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
 

63) Short identifiers for characters were first specified in ISO/IEC 10646-1/AMD9:1997. -

6.4.4 Constants

+

6.4.4 Constants

Syntax

@@ -3002,15 +2994,15 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
 

Each constant has a type, determined by its form and value, as detailed later. -

6.4.4.1 Integer constants
+
6.4.4.1 Integer constants
Syntax

           integer-constant:
-                  decimal-constant integer-suffixopt
-                  octal-constant integer-suffixopt
-                  hexadecimal-constant integer-suffixopt
+                  decimal-constant integer-suffixopt
+                  octal-constant integer-suffixopt
+                  hexadecimal-constant integer-suffixopt
           decimal-constant:
                 nonzero-digit
                 decimal-constant digit
@@ -3031,10 +3023,10 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
               a b c           d e      f
               A B C           D E      F
         integer-suffix:
-                unsigned-suffix long-suffixopt
+                unsigned-suffix long-suffixopt
                 unsigned-suffix long-long-suffix
-                long-suffix unsigned-suffixopt
-                long-long-suffix unsigned-suffixopt
+                long-suffix unsigned-suffixopt
+                long-long-suffix unsigned-suffixopt
         unsigned-suffix: one of
                u U
         long-suffix: one of
@@ -3059,38 +3051,45 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
  The type of an integer constant is the first of the corresponding list in which its value can
  be represented.
 
-
-                                                                  Octal or Hexadecimal
- Suffix Decimal Constant Constant - - none int int -
-                     long int                               unsigned int
-                     long long int                          long int
-                                                            unsigned long int
-                                                            long long int
-                                                            unsigned long long int
- - u or U unsigned int unsigned int -
-                     unsigned long int                      unsigned long int
-                     unsigned long long int                 unsigned long long int
- - l or L long int long int -
-                     long long int                          unsigned long int
-                                                            long long int
-                                                            unsigned long long int
- - Both u or U unsigned long int unsigned long int - and l or L unsigned long long int unsigned long long int - - ll or LL long long int long long int -
-                                                            unsigned long long int
- - Both u or U unsigned long long int unsigned long long int - and ll or LL + +
Suffix Decimal Constant Octal or Hexadecimal Constant +
none +
int
+long int
+long long int
+
int
+unsigned int
+long int
+unsigned long int
+long long int
+unsigned long long int
+
u or U +
unsigned int
+unsigned long int
+unsigned long long int
+
unsigned int
+unsigned long int
+unsigned long long int
+
l or L +
long int
+long long int
+
long int
+unsigned long int
+long long int
+unsigned long long int
+
Both u or U and l or L +
unsigned long int
+unsigned long long int
+
unsigned long int
+unsigned long long int
+
ll or LL +
long long int
+
long long int
+unsigned long long int
+
Both u or U and ll or LL +
unsigned long long int
+
unsigned long long int
+

If an integer constant cannot be represented by any type in its list, it may have an extended integer type, if the extended integer type can represent its value. If all of the @@ -3101,7 +3100,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 its list and has no extended integer type, then the integer constant has no type. -

6.4.4.2 Floating constants
+
6.4.4.2 Floating constants
Syntax

@@ -3110,31 +3109,31 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 decimal-floating-constant hexadecimal-floating-constant decimal-floating-constant: - fractional-constant exponent-partopt floating-suffixopt - digit-sequence exponent-part floating-suffixopt + fractional-constant exponent-partopt floating-suffixopt + digit-sequence exponent-part floating-suffixopt hexadecimal-floating-constant: hexadecimal-prefix hexadecimal-fractional-constant - binary-exponent-part floating-suffixopt + binary-exponent-part floating-suffixopt hexadecimal-prefix hexadecimal-digit-sequence - binary-exponent-part floating-suffixopt + binary-exponent-part floating-suffixopt fractional-constant: - digit-sequenceopt . digit-sequence + digit-sequenceopt . digit-sequence digit-sequence . exponent-part: - e signopt digit-sequence - E signopt digit-sequence + e signopt digit-sequence + E signopt digit-sequence sign: one of + - digit-sequence: digit digit-sequence digit hexadecimal-fractional-constant: - hexadecimal-digit-sequenceopt . + hexadecimal-digit-sequenceopt . hexadecimal-digit-sequence hexadecimal-digit-sequence . binary-exponent-part: - p signopt digit-sequence - P signopt digit-sequence + p signopt digit-sequence + P signopt digit-sequence hexadecimal-digit-sequence: hexadecimal-digit hexadecimal-digit-sequence hexadecimal-digit @@ -3168,7 +3167,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 Floating constants are converted to internal format as if at translation-time. The conversion of a floating constant shall not raise an exceptional condition or a floating- point exception at execution time. - Recommended practice +

Recommended practice

The implementation should produce a diagnostic message if a hexadecimal constant cannot be represented exactly in its evaluation format; the implementation should then @@ -3189,7 +3188,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 floating constants (see 7.20.1.3). -

6.4.4.3 Enumeration constants
+
6.4.4.3 Enumeration constants
Syntax

@@ -3200,7 +3199,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
  An identifier declared as an enumeration constant has type int.
 

Forward references: enumeration specifiers (6.7.2.2). -

6.4.4.4 Character constants
+
6.4.4.4 Character constants
Syntax

@@ -3332,13 +3331,13 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 the result is not a token and a diagnostic is required. See ''future language directions'' (6.11.4). -

6.4.5 String literals

+

6.4.5 String literals

Syntax

           string-literal:
-                  " s-char-sequenceopt "
-                  L" s-char-sequenceopt "
+                  " s-char-sequenceopt "
+                  L" s-char-sequenceopt "
           s-char-sequence:
                  s-char
                  s-char-sequence s-char
@@ -3397,7 +3396,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
  it by a \0 escape sequence.
 
 
-

6.4.6 Punctuators

+

6.4.6 Punctuators

Syntax

@@ -3435,7 +3434,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
  interchanged.
 
 
-

6.4.7 Header names

+

6.4.7 Header names

Syntax

@@ -3490,7 +3489,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
 

70) For an example of a header name preprocessing token used in a #pragma directive, see 6.10.9. -

6.4.8 Preprocessing numbers

+

6.4.8 Preprocessing numbers

Syntax

@@ -3520,7 +3519,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
  
 
 
-

6.4.9 Comments

+

6.4.9 Comments

Except within a character constant, a string literal, or a comment, the characters /* introduce a comment. The contents of such a comment are examined only to identify @@ -3556,7 +3555,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007

71) Thus, /* ... */ comments do not nest. -

6.5 Expressions

+

6.5 Expressions

An expression is a sequence of operators and operands that specifies computation of a value, or that designates an object or a function, or that generates side effects, or that @@ -3626,8 +3625,9 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007

             i = ++i + 1;
-            a[i++] = i;
+            a[i++] = i;
while allowing +
             i = i + 1;
             a[i] = i;
@@ -3640,9 +3640,8 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 parentheses () (6.5.1), subscripting brackets [] (6.5.2.1), function-call parentheses () (6.5.2.2), and the conditional operator ?: (6.5.15). -
-    Within each major subclause, the operators have the same precedence. Left- or right-associativity is
-    indicated in each subclause by the syntax for the expressions discussed therein.
+ Within each major subclause, the operators have the same precedence. Left- or right-associativity is + indicated in each subclause by the syntax for the expressions discussed therein.

75) Allocated objects have no declared type. @@ -3656,7 +3655,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 documented. -

6.5.1 Primary expressions

+

6.5.1 Primary expressions

Syntax

@@ -3686,14 +3685,14 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
 

79) Thus, an undeclared identifier is a violation of the syntax. -

6.5.2 Postfix operators

+

6.5.2 Postfix operators

Syntax

           postfix-expression:
                  primary-expression
                  postfix-expression [ expression ]
-                 postfix-expression ( argument-expression-listopt )
+                 postfix-expression ( argument-expression-listopt )
                  postfix-expression . identifier
                  postfix-expression -> identifier
                  postfix-expression ++
@@ -3710,7 +3709,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
                 assignment-expression
                 argument-expression-list , assignment-expression
-
6.5.2.1 Array subscripting
+
6.5.2.1 Array subscripting
Constraints

One of the expressions shall have type ''pointer to object type'', the other expression shall @@ -3747,7 +3746,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 (6.5.3.2), array declarators (6.7.5.2). -

6.5.2.2 Function calls
+
6.5.2.2 Function calls
Constraints

The expression that denotes the called function80) shall have type pointer to function @@ -3835,7 +3834,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 adjusted to have a pointer type as described in 6.9.1. -

6.5.2.3 Structure and union members
+
6.5.2.3 Structure and union members
Constraints

The first operand of the . operator shall have a qualified or unqualified structure or union @@ -3945,7 +3944,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 its operand), the expression (&E)->MOS is the same as E.MOS. -

6.5.2.4 Postfix increment and decrement operators
+
6.5.2.4 Postfix increment and decrement operators
Constraints

The operand of the postfix increment or decrement operator shall have qualified or @@ -3964,7 +3963,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 it).

Forward references: additive operators (6.5.6), compound assignment (6.5.16.2). -

6.5.2.5 Compound literals
+
6.5.2.5 Compound literals
Constraints

The type name shall specify an object type or an array of unknown size, but not a variable @@ -4100,7 +4099,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 the same or overlapping representations. -

6.5.3 Unary operators

+

6.5.3 Unary operators

Syntax

@@ -4114,7 +4113,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
           unary-operator: one of
                  & * + - ~             !
-
6.5.3.1 Prefix increment and decrement operators
+
6.5.3.1 Prefix increment and decrement operators
Constraints

The operand of the prefix increment or decrement operator shall have qualified or @@ -4130,7 +4129,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 operand is decremented.

Forward references: additive operators (6.5.6), compound assignment (6.5.16.2). -

6.5.3.2 Address and indirection operators
+
6.5.3.2 Address and indirection operators
Constraints

The operand of the unary & operator shall be either a function designator, the result of a @@ -4168,7 +4167,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 end of its lifetime. -

6.5.3.3 Unary arithmetic operators
+
6.5.3.3 Unary arithmetic operators
Constraints

The operand of the unary + or - operator shall have arithmetic type; of the ~ operator, @@ -4196,7 +4195,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 -

6.5.3.4 The sizeof operator
+
6.5.3.4 The sizeof operator
Constraints

The sizeof operator shall not be applied to an expression that has function type or an @@ -4263,7 +4262,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 size of the adjusted (pointer) type (see 6.9.1). -

6.5.4 Cast operators

+

6.5.4 Cast operators

Syntax

@@ -4299,7 +4298,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
  unqualified version of the type.
 
 
-

6.5.5 Multiplicative operators

+

6.5.5 Multiplicative operators

Syntax

@@ -4330,7 +4329,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
 

90) This is often called ''truncation toward zero''. -

6.5.6 Additive operators

+

6.5.6 Additive operators

Syntax

@@ -4430,7 +4429,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
   element'' requirements.
 
 
-

6.5.7 Bitwise shift operators

+

6.5.7 Bitwise shift operators

Syntax

@@ -4463,7 +4462,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
  part of the quotient of E1 / 2E2 . If E1 has a signed type and a negative value, the
  resulting value is implementation-defined.
 
-

6.5.8 Relational operators

+

6.5.8 Relational operators

Syntax

@@ -4514,7 +4513,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
  means (a<b)<c; in other words, ''if a is less than b, compare 1 to c; otherwise, compare 0 to c''.
 
 
-

6.5.9 Equality operators

+

6.5.9 Equality operators

Syntax

@@ -4574,7 +4573,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
  behavior.
 
 
-

6.5.10 Bitwise AND operator

+

6.5.10 Bitwise AND operator

Syntax

@@ -4597,7 +4596,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
  
 
 
-

6.5.11 Bitwise exclusive OR operator

+

6.5.11 Bitwise exclusive OR operator

Syntax

@@ -4615,7 +4614,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
  in the result is set if and only if exactly one of the corresponding bits in the converted
  operands is set).
 
-

6.5.12 Bitwise inclusive OR operator

+

6.5.12 Bitwise inclusive OR operator

Syntax

@@ -4634,7 +4633,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
  operands is set).
 
 
-

6.5.13 Logical AND operator

+

6.5.13 Logical AND operator

Syntax

@@ -4653,7 +4652,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
  there is a sequence point after the evaluation of the first operand. If the first operand
  compares equal to 0, the second operand is not evaluated.
 
-

6.5.14 Logical OR operator

+

6.5.14 Logical OR operator

Syntax

@@ -4673,7 +4672,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
  unequal to 0, the second operand is not evaluated.
 
 
-

6.5.15 Conditional operator

+

6.5.15 Conditional operator

Syntax

@@ -4746,7 +4745,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
 

95) A conditional expression does not yield an lvalue. -

6.5.16 Assignment operators

+

6.5.16 Assignment operators

Syntax

@@ -4772,7 +4771,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
  behavior is undefined.
 
 
-
6.5.16.1 Simple assignment
+
6.5.16.1 Simple assignment
Constraints

One of the following shall hold:96) @@ -4849,7 +4848,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 not volatile from the type int volatile * const). -

6.5.16.2 Compound assignment
+
6.5.16.2 Compound assignment
Constraints

For the operators += and -= only, either the left operand shall be a pointer to an object @@ -4864,7 +4863,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 expression E1 = E1 op (E2) only in that the lvalue E1 is evaluated only once. -

6.5.17 Comma operator

+

6.5.17 Comma operator

Syntax

@@ -4897,7 +4896,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
 

97) A comma operator does not yield an lvalue. -

6.6 Constant expressions

+

6.6 Constant expressions

Syntax

@@ -4983,17 +4982,17 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
  the expression is a valid integer constant expression with value one.
 
 
-

6.7 Declarations

+

6.7 Declarations

Syntax

           declaration:
-                 declaration-specifiers init-declarator-listopt ;
+                 declaration-specifiers init-declarator-listopt ;
           declaration-specifiers:
-                 storage-class-specifier declaration-specifiersopt
-                 type-specifier declaration-specifiersopt
-                 type-qualifier declaration-specifiersopt
-                 function-specifier declaration-specifiersopt
+                 storage-class-specifier declaration-specifiersopt
+                 type-specifier declaration-specifiersopt
+                 type-qualifier declaration-specifiersopt
+                 function-specifier declaration-specifiersopt
           init-declarator-list:
                   init-declarator
                   init-declarator-list , init-declarator
@@ -5041,7 +5040,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
 

101) Function definitions have a different syntax, described in 6.9.1. -

6.7.1 Storage-class specifiers

+

6.7.1 Storage-class specifiers

Syntax

@@ -5089,7 +5088,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
  register is sizeof.
 
 
-

6.7.2 Type specifiers

+

6.7.2 Type specifiers

Syntax

@@ -5165,12 +5164,12 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
 

104) Freestanding implementations are not required to provide complex types. * -

6.7.2.1 Structure and union specifiers
+
6.7.2.1 Structure and union specifiers
Syntax

           struct-or-union-specifier:
-                  struct-or-union identifieropt { struct-declaration-list }
+                  struct-or-union identifieropt { struct-declaration-list }
                   struct-or-union identifier
           struct-or-union:
                   struct
@@ -5181,14 +5180,14 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
           struct-declaration:
                   specifier-qualifier-list struct-declarator-list ;
           specifier-qualifier-list:
-                 type-specifier specifier-qualifier-listopt
-                 type-qualifier specifier-qualifier-listopt
+                 type-specifier specifier-qualifier-listopt
+                 type-qualifier specifier-qualifier-listopt
           struct-declarator-list:
                   struct-declarator
                   struct-declarator-list , struct-declarator
           struct-declarator:
                   declarator
-                  declaratoropt : constant-expression
+ declaratoropt : constant-expression
Constraints

A structure or union shall not contain a member with incomplete or function type (hence, @@ -5362,13 +5361,13 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 layouts. -

6.7.2.2 Enumeration specifiers
+
6.7.2.2 Enumeration specifiers
Syntax

           enum-specifier:
-                enum identifieropt { enumerator-list }
-                enum identifieropt { enumerator-list , }
+                enum identifieropt { enumerator-list }
+                enum identifieropt { enumerator-list , }
                 enum identifier
           enumerator-list:
                 enumerator
@@ -5423,7 +5422,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
  been seen.
 
 
-
6.7.2.3 Tags
+
6.7.2.3 Tags
Constraints

A specific type shall have its content defined at most once. @@ -5447,7 +5446,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007

A type specifier of the form

-         struct-or-union identifieropt { struct-declaration-list }
+ struct-or-union identifieropt { struct-declaration-list }
or
          enum identifier { enumerator-list }
@@ -5542,7 +5541,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007

113) A similar construction with enum does not exist. -

6.7.3 Type qualifiers

+

6.7.3 Type qualifiers

Syntax

@@ -5644,7 +5643,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
 

118) Both of these can occur through the use of typedefs. -

6.7.3.1 Formal definition of restrict
+
6.7.3.1 Formal definition of restrict

Let D be a declaration of an ordinary identifier that provides a means of designating an object P as a restrict-qualified pointer to type T. @@ -5761,7 +5760,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 expressions *p and p[1] are not. -

6.7.4 Function specifiers

+

6.7.4 Function specifiers

Syntax

@@ -5843,24 +5842,24 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
  duration are also distinct in each of the definitions.
 
 
-

6.7.5 Declarators

+

6.7.5 Declarators

Syntax

           declarator:
-                 pointeropt direct-declarator
+                 pointeropt direct-declarator
           direct-declarator:
                   identifier
                   ( declarator )
-                  direct-declarator [ type-qualifier-listopt assignment-expressionopt ]
-                  direct-declarator [ static type-qualifier-listopt assignment-expression ]
+                  direct-declarator [ type-qualifier-listopt assignment-expressionopt ]
+                  direct-declarator [ static type-qualifier-listopt assignment-expression ]
                   direct-declarator [ type-qualifier-list static assignment-expression ]
-                  direct-declarator [ type-qualifier-listopt * ]
+                  direct-declarator [ type-qualifier-listopt * ]
                   direct-declarator ( parameter-type-list )
-                  direct-declarator ( identifier-listopt )
+                  direct-declarator ( identifier-listopt )
           pointer:
-                 * type-qualifier-listopt
-                 * type-qualifier-listopt pointer
+                 * type-qualifier-listopt
+                 * type-qualifier-listopt pointer
           type-qualifier-list:
                  type-qualifier
                  type-qualifier-list type-qualifier
@@ -5872,7 +5871,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
                 parameter-list , parameter-declaration
           parameter-declaration:
                 declaration-specifiers declarator
-                declaration-specifiers abstract-declaratoropt
+                declaration-specifiers abstract-declaratoropt
           identifier-list:
                   identifier
                   identifier-list , identifier
@@ -5907,19 +5906,19 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 then ident has the type specified by the declaration ''T D''. Thus, a declarator in parentheses is identical to the unparenthesized declarator, but the binding of complicated declarators may be altered by parentheses. - Implementation limits +
Implementation limits

As discussed in 5.2.4.1, an implementation may limit the number of pointer, array, and function declarators that modify an arithmetic, structure, union, or incomplete type, either directly or via one or more typedefs.

Forward references: array declarators (6.7.5.2), type definitions (6.7.7). -

6.7.5.1 Pointer declarators
+
6.7.5.1 Pointer declarators
Semantics

If, in the declaration ''T D1'', D1 has the form

-         * type-qualifier-listopt D
+ * type-qualifier-listopt D
and the type specified for ident in the declaration ''T D'' is ''derived-declarator-type-list T '', then the type specified for ident is ''derived-declarator-type-list type-qualifier-list pointer to T ''. For each type qualifier in the list, ident is a so-qualified pointer. @@ -5946,7 +5945,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 declares constant_ptr as an object that has type ''const-qualified pointer to int''. -
6.7.5.2 Array declarators
+
6.7.5.2 Array declarators
Constraints

In addition to optional type qualifiers and the keyword static, the [ and ] may delimit @@ -5964,10 +5963,10 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007

If, in the declaration ''T D1'', D1 has one of the forms:

-          D[ type-qualifier-listopt assignment-expressionopt ]
-          D[ static type-qualifier-listopt assignment-expression ]
+          D[ type-qualifier-listopt assignment-expressionopt ]
+          D[ static type-qualifier-listopt assignment-expression ]
           D[ type-qualifier-list static assignment-expression ]
-          D[ type-qualifier-listopt * ]
+ D[ type-qualifier-listopt * ]
and the type specified for ident in the declaration ''T D'' is ''derived-declarator-type-list T '', then the type specified for ident is ''derived-declarator-type-list array of T ''.123) (See 6.7.5.3 for the meaning of the optional type qualifiers and the keyword static.) @@ -6064,7 +6063,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007

124) Thus, * can be used only in function declarations that are not definitions (see 6.7.5.3). -

6.7.5.3 Function declarators (including prototypes)
+
6.7.5.3 Function declarators (including prototypes)
Constraints

A function declarator shall not specify a return type that is a function type or an array @@ -6085,7 +6084,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 or

-          D( identifier-listopt )
+ D( identifier-listopt )
and the type specified for ident in the declaration ''T D'' is ''derived-declarator-type-list T '', then the type specified for ident is ''derived-declarator-type-list function returning T ''. @@ -6226,25 +6225,25 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007

127) If both function types are ''old style'', parameter types are not compared. -

6.7.6 Type names

+

6.7.6 Type names

Syntax

           type-name:
-                 specifier-qualifier-list abstract-declaratoropt
+                 specifier-qualifier-list abstract-declaratoropt
           abstract-declarator:
                  pointer
-                 pointeropt direct-abstract-declarator
+                 pointeropt direct-abstract-declarator
           direct-abstract-declarator:
                   ( abstract-declarator )
-                  direct-abstract-declaratoropt [ type-qualifier-listopt
-                                 assignment-expressionopt ]
-                  direct-abstract-declaratoropt [ static type-qualifier-listopt
+                  direct-abstract-declaratoropt [ type-qualifier-listopt
+                                 assignment-expressionopt ]
+                  direct-abstract-declaratoropt [ static type-qualifier-listopt
                                  assignment-expression ]
-                  direct-abstract-declaratoropt [ type-qualifier-list static
+                  direct-abstract-declaratoropt [ type-qualifier-list static
                                  assignment-expression ]
-                  direct-abstract-declaratoropt [ * ]
-                  direct-abstract-declaratoropt ( parameter-type-listopt )
+ direct-abstract-declaratoropt [ * ] + direct-abstract-declaratoropt ( parameter-type-listopt )
Semantics

In several contexts, it is necessary to specify a type. This is accomplished using a type @@ -6278,7 +6277,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 parameter specification'', rather than redundant parentheses around the omitted identifier. -

6.7.7 Type definitions

+

6.7.7 Type definitions

Syntax

@@ -6376,7 +6375,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
                      a[i-1] = b[i];
          }
-

6.7.8 Initialization

+

6.7.8 Initialization

Syntax

@@ -6385,8 +6384,8 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
                    { initializer-list }
                    { initializer-list , }
           initializer-list:
-                   designationopt initializer
-                   initializer-list , designationopt initializer
+                   designationopt initializer
+                   initializer-list , designationopt initializer
           designation:
                  designator-list =
           designator-list:
@@ -6690,7 +6689,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
 

133) In particular, the evaluation order need not be the same as the order of subobject initialization. -

6.8 Statements and blocks

+

6.8 Statements and blocks

Syntax

@@ -6722,7 +6721,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
 

Forward references: expression and null statements (6.8.3), selection statements (6.8.4), iteration statements (6.8.5), the return statement (6.8.6.4). -

6.8.1 Labeled statements

+

6.8.1 Labeled statements

Syntax

@@ -6744,12 +6743,12 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
  them.
 

Forward references: the goto statement (6.8.6.1), the switch statement (6.8.4.2). -

6.8.2 Compound statement

+

6.8.2 Compound statement

Syntax

           compound-statement:
-                { block-item-listopt }
+                { block-item-listopt }
           block-item-list:
                   block-item
                   block-item-list block-item
@@ -6760,12 +6759,12 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
 

A compound statement is a block. -

6.8.3 Expression and null statements

+

6.8.3 Expression and null statements

Syntax

           expression-statement:
-                 expressionopt ;
+ expressionopt ;
Semantics

The expression in an expression statement is evaluated as a void expression for its side @@ -6815,7 +6814,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007

134) Such as assignments, and function calls which have side effects. -

6.8.4 Selection statements

+

6.8.4 Selection statements

Syntax

@@ -6832,7 +6831,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
  enclosing block. Each associated substatement is also a block whose scope is a strict
  subset of the scope of the selection statement.
 
-
6.8.4.1 The if statement
+
6.8.4.1 The if statement
Constraints

The controlling expression of an if statement shall have scalar type. @@ -6847,7 +6846,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 An else is associated with the lexically nearest preceding if that is allowed by the syntax. -

6.8.4.2 The switch statement
+
6.8.4.2 The switch statement
Constraints

The controlling expression of a switch statement shall have integer type. @@ -6876,7 +6875,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 a default label, control jumps to the labeled statement. If no converted case constant expression matches and there is no default label, no part of the switch body is executed. - Implementation limits +

Implementation limits

As discussed in 5.2.4.1, the implementation may limit the number of case values in a switch statement. @@ -6908,15 +6907,15 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 default label associated with the switch that is in the block containing the declaration. -

6.8.5 Iteration statements

+

6.8.5 Iteration statements

Syntax

           iteration-statement:
                   while ( expression ) statement
                   do statement while ( expression ) ;
-                  for ( expressionopt ; expressionopt ; expressionopt ) statement
-                  for ( declaration expressionopt ; expressionopt ) statement
+ for ( expressionopt ; expressionopt ; expressionopt ) statement + for ( declaration expressionopt ; expressionopt ) statement
Constraints

The controlling expression of an iteration statement shall have scalar type. @@ -6943,17 +6942,17 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 statement is not evaluated before entering the loop body, nor is clause-1 of a for statement. -

6.8.5.1 The while statement
+
6.8.5.1 The while statement

The evaluation of the controlling expression takes place before each execution of the loop body. -

6.8.5.2 The do statement
+
6.8.5.2 The do statement

The evaluation of the controlling expression takes place after each execution of the loop body. -

6.8.5.3 The for statement
+
6.8.5.3 The for statement

The statement

@@ -6976,7 +6975,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
  specifies an operation (such as incrementing) that is performed after each iteration.
 
 
-

6.8.6 Jump statements

+

6.8.6 Jump statements

Syntax

@@ -6984,7 +6983,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
                  goto identifier ;
                  continue ;
                  break ;
-                 return expressionopt ;
+ return expressionopt ;
Semantics

A jump statement causes an unconditional jump to another place. @@ -6994,7 +6993,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 -

6.8.6.1 The goto statement
+
6.8.6.1 The goto statement
Constraints

The identifier in a goto statement shall name a label located somewhere in the enclosing @@ -7012,10 +7011,10 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007

  • The general initialization code is too large to warrant duplication.
  • The code to determine the next operation is at the head of the loop. (To allow it to be reached by continue statements, for example.) +
       /* ... */
       goto first_time;
       for (;;) {
    -
               // determine next operation
               /* ... */
               if (need to reinitialize) {
    @@ -7027,8 +7026,8 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
                       continue;
               }
               // handle other operations
    -          /* ... */
    - } + /* ... */ + }

    @@ -7049,7 +7048,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 goto lab4; // invalid: going INTO scope of VLA.

  • -
    6.8.6.2 The continue statement
    +
    6.8.6.2 The continue statement
    Constraints

    A continue statement shall appear only in or as a loop body. @@ -7058,13 +7057,13 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 A continue statement causes a jump to the loop-continuation portion of the smallest enclosing iteration statement; that is, to the end of the loop body. More precisely, in each of the statements - while (/* ... */) { do { for (/* ... */) {

    + while (/* ... */) {                  do {                                 for (/* ... */) {
         /* ... */                            /* ... */                            /* ... */
         continue;                            continue;                            continue;
    -    /* ... */                            /* ... */                            /* ... */
    + /* ... */ /* ... */ /* ... */ contin: ; contin: ; contin: ; - } } while (/* ... */); } + } } while (/* ... */); }
    unless the continue statement shown is in an enclosed iteration statement (in which case it is interpreted within that statement), it is equivalent to goto contin;.138) @@ -7072,7 +7071,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007

    138) Following the contin: label is a null statement. -

    6.8.6.3 The break statement
    +
    6.8.6.3 The break statement
    Constraints

    A break statement shall appear only in or as a switch body or loop body. @@ -7085,7 +7084,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 -

    6.8.6.4 The return statement
    +
    6.8.6.4 The return statement
    Constraints

    A return statement with an expression shall not appear in a function whose return type @@ -7135,7 +7134,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 range and precision. -

    6.9 External definitions

    +

    6.9 External definitions

    Syntax

    @@ -7180,12 +7179,12 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      external definition for it.
     
     
    -

    6.9.1 Function definitions

    +

    6.9.1 Function definitions

    Syntax

               function-definition:
    -                 declaration-specifiers declarator declaration-listopt compound-statement
    +                 declaration-specifiers declarator declaration-listopt compound-statement
               declaration-list:
                      declaration
                      declaration-list declaration
    @@ -7312,7 +7311,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007

    142) See ''future language directions'' (6.11.7). -

    6.9.2 External object definitions

    +

    6.9.2 External object definitions

    Semantics

    If the declaration of an identifier for an object has file scope and an initializer, the @@ -7356,13 +7355,13 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 zero on program startup. -

    6.10 Preprocessing directives

    +

    6.10 Preprocessing directives

    Syntax

               preprocessing-file:
    -                 groupopt
    +                 groupopt
               group:
                        group-part
                        group group-part
    @@ -7372,41 +7371,41 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
                      text-line
                      # non-directive
               if-section:
    -                   if-group elif-groupsopt else-groupopt endif-line
    +                   if-group elif-groupsopt else-groupopt endif-line
               if-group:
    -                  # if     constant-expression new-line groupopt
    -                  # ifdef identifier new-line groupopt
    -                  # ifndef identifier new-line groupopt
    +                  # if     constant-expression new-line groupopt
    +                  # ifdef identifier new-line groupopt
    +                  # ifndef identifier new-line groupopt
               elif-groups:
                       elif-group
                       elif-groups elif-group
               elif-group:
    -                  # elif       constant-expression new-line groupopt
    +                  # elif       constant-expression new-line groupopt
               else-group:
    -                  # else       new-line groupopt
    +                  # else       new-line groupopt
               endif-line:
                       # endif      new-line
               control-line:
                      # include pp-tokens new-line
                      # define identifier replacement-list new-line
    -                 # define identifier lparen identifier-listopt )
    +                 # define identifier lparen identifier-listopt )
                                                      replacement-list new-line
                      # define identifier lparen ... ) replacement-list new-line
                      # define identifier lparen identifier-list , ... )
                                                      replacement-list new-line
                      # undef   identifier new-line
                      # line    pp-tokens new-line
    -                 # error   pp-tokensopt new-line
    -                 # pragma pp-tokensopt new-line
    +                 # error   pp-tokensopt new-line
    +                 # pragma pp-tokensopt new-line
                      #         new-line
               text-line:
    -                  pp-tokensopt new-line
    +                  pp-tokensopt new-line
               non-directive:
                      pp-tokens new-line
               lparen:
                         a ( character not immediately preceded by white-space
               replacement-list:
    -                 pp-tokensopt
    +                 pp-tokensopt
               pp-tokens:
                      preprocessing-token
                      pp-tokens preprocessing-token
    @@ -7462,7 +7461,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      # character string literal creation operator in 6.10.3.2, for example).
     
     
    -

    6.10.1 Conditional inclusion

    +

    6.10.1 Conditional inclusion

    Constraints

    The expression that controls conditional inclusion shall be an integer constant expression @@ -7490,8 +7489,8 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007

    Preprocessing directives of the forms

    -      # if   constant-expression new-line groupopt
    -      # elif constant-expression new-line groupopt
    + # if constant-expression new-line groupopt + # elif constant-expression new-line groupopt
    check whether the controlling constant expression evaluates to nonzero.

    Prior to evaluation, macro invocations in the list of preprocessing tokens that will become @@ -7519,8 +7518,8 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007

    -    # ifdef identifier new-line groupopt
    -    # ifndef identifier new-line groupopt
    + # ifdef identifier new-line groupopt + # ifndef identifier new-line groupopt
    check whether the identifier is or is not currently defined as a macro name. Their conditions are equivalent to #if defined identifier and #if !defined identifier respectively. @@ -7546,8 +7545,9 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007

    146) Thus, the constant expression in the following #if directive and if statement is not guaranteed to evaluate to the same value in these two contexts. +

        #if 'z' - 'a' == 25
    -   if ('z' - 'a' == 25)
    +   if ('z' - 'a' == 25)

    147) As indicated by the syntax, a preprocessing token shall not follow a #else or #endif directive @@ -7555,7 +7555,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 including within a preprocessing directive. -

    6.10.2 Source file inclusion

    +

    6.10.2 Source file inclusion

    Constraints

    A #include directive shall identify a header or source file that can be processed by the @@ -7636,7 +7636,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 phases in 5.1.1.2); thus, an expansion that results in two string literals is an invalid directive. -

    6.10.3 Macro replacement

    +

    6.10.3 Macro replacement

    Constraints

    Two replacement lists are identical if and only if the preprocessing tokens in both have @@ -7687,7 +7687,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007

    A preprocessing directive of the form

    -    # define identifier lparen identifier-listopt ) replacement-list new-line
    +    # define identifier lparen identifier-listopt ) replacement-list new-line
         # define identifier lparen ... ) replacement-list new-line
         # define identifier lparen identifier-list , ... ) replacement-list new-line
    defines a function-like macro with parameters, whose use is similar syntactically to a @@ -7726,7 +7726,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007

    150) Despite the name, a non-directive is a preprocessing directive. -

    6.10.3.1 Argument substitution
    +
    6.10.3.1 Argument substitution

    After the arguments for the invocation of a function-like macro have been identified, argument substitution takes place. A parameter in the replacement list, unless preceded @@ -7740,7 +7740,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 were a parameter, and the variable arguments shall form the preprocessing tokens used to replace it. -

    6.10.3.2 The # operator
    +
    6.10.3.2 The # operator
    Constraints

    Each # preprocessing token in the replacement list for a function-like macro shall be @@ -7764,7 +7764,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 ## operators is unspecified. -

    6.10.3.3 The ## operator
    +
    6.10.3.3 The ## operator
    Constraints

    A ## preprocessing token shall not occur at the beginning or at the end of a replacement @@ -7814,7 +7814,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 exist only within translation phase 4. -

    6.10.3.4 Rescanning and further replacement
    +
    6.10.3.4 Rescanning and further replacement

    After all parameters in the replacement list have been substituted and # and ## processing has taken place, all placemarker preprocessing tokens are removed. Then, the @@ -7832,7 +7832,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 as a preprocessing directive even if it resembles one, but all pragma unary operator expressions within it are then processed as specified in 6.10.9 below. -

    6.10.3.5 Scope of macro definitions
    +
    6.10.3.5 Scope of macro definitions

    A macro definition lasts (independent of block structure) until a corresponding #undef directive is encountered or (if none is encountered) until the end of the preprocessing @@ -7976,7 +7976,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 printf("x is %d but y is %d", x, y));

    -

    6.10.4 Line control

    +

    6.10.4 Line control

    Constraints

    The string literal of a #line directive, if present, shall be a character string literal. @@ -7996,7 +7996,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007

    A preprocessing directive of the form

    -    # line digit-sequence "s-char-sequenceopt" new-line
    + # line digit-sequence "s-char-sequenceopt" new-line
    sets the presumed line number similarly and changes the presumed name of the source file to be the contents of the character string literal.

    @@ -8010,21 +8010,21 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 previous forms and is then processed as appropriate. -

    6.10.5 Error directive

    +

    6.10.5 Error directive

    Semantics

    A preprocessing directive of the form

    -    # error pp-tokensopt new-line
    + # error pp-tokensopt new-line
    causes the implementation to produce a diagnostic message that includes the specified sequence of preprocessing tokens. -

    6.10.6 Pragma directive

    +

    6.10.6 Pragma directive

    Semantics

    A preprocessing directive of the form

    -    # pragma pp-tokensopt new-line
    + # pragma pp-tokensopt new-line
    where the preprocessing token STDC does not immediately follow pragma in the directive (prior to any macro replacement)152) causes the implementation to behave in an implementation-defined manner. The behavior might cause translation to fail or cause the @@ -8059,7 +8059,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007

    153) See ''future language directions'' (6.11.8). -

    6.10.7 Null directive

    +

    6.10.7 Null directive

    Semantics

    A preprocessing directive of the form @@ -8067,57 +8067,52 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 # new-line

    has no effect. -

    6.10.8 Predefined macro names

    +

    6.10.8 Predefined macro names

    The following macro names154) shall be defined by the implementation: - __DATE__ The date of translation of the preprocessing translation unit: a character -

    +
    +
    __DATE__
    The date of translation of the preprocessing translation unit: a character string literal of the form "Mmm dd yyyy", where the names of the months are the same as those generated by the asctime function, and the first character of dd is a space character if the value is less than 10. If the date of translation is not available, an implementation-defined valid date - shall be supplied.
    - __FILE__ The presumed name of the current source file (a character string literal).155) - __LINE__ The presumed line number (within the current source file) of the current -
    -            source line (an integer constant).155)
    - __STDC__ The integer constant 1, intended to indicate a conforming implementation. - __STDC_HOSTED__ The integer constant 1 if the implementation is a hosted -
    -           implementation or the integer constant 0 if it is not.
    - __STDC_MB_MIGHT_NEQ_WC__ The integer constant 1, intended to indicate that, in -
    +            shall be supplied.
    +
    __FILE__
    The presumed name of the current source file (a character string literal).155) +
    __LINE__
    The presumed line number (within the current source file) of the current + source line (an integer constant).155) +
    __STDC__
    The integer constant 1, intended to indicate a conforming implementation. +
    __STDC_HOSTED__
    The integer constant 1 if the implementation is a hosted + implementation or the integer constant 0 if it is not. +
    __STDC_MB_MIGHT_NEQ_WC__
    The integer constant 1, intended to indicate that, in the encoding for wchar_t, a member of the basic character set need not have a code value equal to its value when used as the lone character in an - integer character constant.
    - __STDC_VERSION__ The integer constant 199901L.156) - __TIME__ The time of translation of the preprocessing translation unit: a character -
    +           integer character constant.
    +
    __STDC_VERSION__
    The integer constant 199901L.156) +
    __TIME__
    The time of translation of the preprocessing translation unit: a character string literal of the form "hh:mm:ss" as in the time generated by the asctime function. If the time of translation is not available, an - implementation-defined valid time shall be supplied.
    - + implementation-defined valid time shall be supplied. +

    The following macro names are conditionally defined by the implementation: - __STDC_IEC_559__ The integer constant 1, intended to indicate conformance to the -

    -           specifications in annex F (IEC 60559 floating-point arithmetic).
    - __STDC_IEC_559_COMPLEX__ The integer constant 1, intended to indicate -
    +
    +
    __STDC_IEC_559__
    The integer constant 1, intended to indicate conformance to the + specifications in annex F (IEC 60559 floating-point arithmetic). +
    __STDC_IEC_559_COMPLEX__
    The integer constant 1, intended to indicate adherence to the specifications in informative annex G (IEC 60559 - compatible complex arithmetic).
    - __STDC_ISO_10646__ An integer constant of the form yyyymmL (for example, -

    -

    +           compatible complex arithmetic).
    +
    __STDC_ISO_10646__
    An integer constant of the form yyyymmL (for example, 199712L). If this symbol is defined, then every character in the Unicode required set, when stored in an object of type wchar_t, has the same value as the short identifier of that character. The Unicode required set consists of all the characters that are defined by ISO/IEC 10646, along with all amendments and technical corrigenda, as of the specified year and - month.
    + month. + +

    The values of the predefined macros (except for __FILE__ and __LINE__) remain constant throughout the translation unit.

    @@ -8140,7 +8135,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 int that is increased with each revision of this International Standard. -

    6.10.9 Pragma operator

    +

    6.10.9 Pragma operator

    Semantics

    A unary operator expression of the form: @@ -8169,59 +8164,59 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 #define PRAGMA(x) _Pragma(#x) LISTING ( ..\listing.dir )

    -

    6.11 Future language directions

    +

    6.11 Future language directions

    -

    6.11.1 Floating types

    +

    6.11.1 Floating types

    Future standardization may include additional floating-point types, including those with greater range, precision, or both than long double. -

    6.11.2 Linkages of identifiers

    +

    6.11.2 Linkages of identifiers

    Declaring an identifier with internal linkage at file scope without the static storage- class specifier is an obsolescent feature. -

    6.11.3 External names

    +

    6.11.3 External names

    Restriction of the significance of an external name to fewer than 255 characters (considering each universal character name or extended source character as a single character) is an obsolescent feature that is a concession to existing implementations. -

    6.11.4 Character escape sequences

    +

    6.11.4 Character escape sequences

    Lowercase letters as escape sequences are reserved for future standardization. Other characters may be used in extensions. -

    6.11.5 Storage-class specifiers

    +

    6.11.5 Storage-class specifiers

    The placement of a storage-class specifier other than at the beginning of the declaration specifiers in a declaration is an obsolescent feature. -

    6.11.6 Function declarators

    +

    6.11.6 Function declarators

    The use of function declarators with empty parentheses (not prototype-format parameter type declarators) is an obsolescent feature. -

    6.11.7 Function definitions

    +

    6.11.7 Function definitions

    The use of function definitions with separate parameter identifier and declaration lists (not prototype-format parameter type and identifier declarators) is an obsolescent feature. -

    6.11.8 Pragma directives

    +

    6.11.8 Pragma directives

    Pragmas whose first preprocessing token is STDC are reserved for future standardization. -

    6.11.9 Predefined macro names

    +

    6.11.9 Predefined macro names

    Macro names beginning with __STDC_ are reserved for future standardization. -

    7. Library

    +

    7. Library

    -

    7.1 Introduction

    +

    7.1 Introduction

    -

    7.1.1 Definitions of terms

    +

    7.1.1 Definitions of terms

    A string is a contiguous sequence of characters terminated by and including the first null character. The term multibyte string is sometimes used instead to emphasize special @@ -8264,7 +8259,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 implementation's choice. -

    7.1.2 Standard headers

    +

    7.1.2 Standard headers

    Each library function is declared, with a type that includes a prototype, in a header,159) whose contents are made available by the #include preprocessing directive. The @@ -8315,7 +8310,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 necessarily valid source file names. -

    7.1.3 Reserved identifiers

    +

    7.1.3 Reserved identifiers

    Each header declares or defines all identifiers listed in its associated subclause, and optionally declares or defines identifiers listed in its associated future library directions @@ -8349,7 +8344,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 setjmp, and va_end. -

    7.1.4 Use of library functions

    +

    7.1.4 Use of library functions

    Each of the following statements applies unless explicitly stated otherwise in the detailed descriptions that follow: If an argument to a function has an invalid value (such as a value @@ -8448,7 +8443,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007

    164) Thus, a signal handler cannot, in general, call standard library functions. -

    7.2 Diagnostics

    +

    7.2 Diagnostics

    The header <assert.h> defines the assert macro and refers to another macro,

    @@ -8465,9 +8460,9 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      macro definition is suppressed in order to access an actual function, the behavior is
      undefined.
     
    -

    7.2.1 Program diagnostics

    +

    7.2.1 Program diagnostics

    -
    7.2.1.1 The assert macro
    +
    7.2.1.1 The assert macro
    Synopsis

    @@ -8498,9 +8493,9 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      Assertion failed: expression, function abc, file xyz, line nnn.
     
     
    -

    7.3 Complex arithmetic

    +

    7.3 Complex arithmetic

    -

    7.3.1 Introduction

    +

    7.3.1 Introduction

    The header <complex.h> defines macros and declares functions that support complex arithmetic.166) Each synopsis specifies a family of functions consisting of a principal @@ -8545,17 +8540,17 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007

    footnotes

    166) See ''future library directions'' (7.26.1). -

    167) The imaginary unit is a number i such that i 2 = -1. +

    167) The imaginary unit is a number i such that i2 = -1.

    168) A specification for imaginary types is in informative annex G. -

    7.3.2 Conventions

    +

    7.3.2 Conventions

    Values are interpreted as radians, not degrees. An implementation may set errno but is not required to. -

    7.3.3 Branch cuts

    +

    7.3.3 Branch cuts

    Some of the functions below have branch cuts, across which the function is discontinuous. For implementations with a signed zero (including all IEC 60559 @@ -8574,7 +8569,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 the finite endpoint of the cut along the negative real axis approaches the cut from above, so the cut maps to the positive imaginary axis. -

    7.3.4 The CX_LIMITED_RANGE pragma

    +

    7.3.4 The CX_LIMITED_RANGE pragma

    Synopsis

    @@ -8604,15 +8599,15 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
     
     
          (x + iy) x (u + iv) = (xu - yv) + i(yu + xv)
    -     (x + iy) / (u + iv) = [(xu + yv) + i(yu - xv)]/(u2 + v 2 )
    -     | x + iy | = (sqrt) x 2 + y 2
    -                  ???????????????
    + (x + iy) / (u + iv) = [(xu + yv) + i(yu - xv)]/(u2 + v2) + | x + iy | = (sqrt)(x2 + y2) +
    where the programmer can determine they are safe.
    -

    7.3.5 Trigonometric functions

    +

    7.3.5 Trigonometric functions

    -
    7.3.5.1 The cacos functions
    +
    7.3.5.1 The cacos functions
    Synopsis

    @@ -8630,7 +8625,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      mathematically unbounded along the imaginary axis and in the interval [0, pi ] along the
      real axis.
     
    -
    7.3.5.2 The casin functions
    +
    7.3.5.2 The casin functions
    Synopsis

    @@ -8649,7 +8644,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      along the real axis.
     
     
    -
    7.3.5.3 The catan functions
    +
    7.3.5.3 The catan functions
    Synopsis

    @@ -8667,7 +8662,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      mathematically unbounded along the imaginary axis and in the interval [-pi /2, +pi /2]
      along the real axis.
     
    -
    7.3.5.4 The ccos functions
    +
    7.3.5.4 The ccos functions
    Synopsis

    @@ -8682,7 +8677,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
     

    The ccos functions return the complex cosine value. -

    7.3.5.5 The csin functions
    +
    7.3.5.5 The csin functions
    Synopsis

    @@ -8698,7 +8693,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      The csin functions return the complex sine value.
     
     
    -
    7.3.5.6 The ctan functions
    +
    7.3.5.6 The ctan functions
    Synopsis

    @@ -8713,9 +8708,9 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
     

    The ctan functions return the complex tangent value. -

    7.3.6 Hyperbolic functions

    +

    7.3.6 Hyperbolic functions

    -
    7.3.6.1 The cacosh functions
    +
    7.3.6.1 The cacosh functions
    Synopsis

    @@ -8733,7 +8728,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      half-strip of non-negative values along the real axis and in the interval [-ipi , +ipi ] along
      the imaginary axis.
     
    -
    7.3.6.2 The casinh functions
    +
    7.3.6.2 The casinh functions
    Synopsis

    @@ -8752,7 +8747,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      strip mathematically unbounded along the real axis and in the interval [-ipi /2, +ipi /2]
      along the imaginary axis.
     
    -
    7.3.6.3 The catanh functions
    +
    7.3.6.3 The catanh functions
    Synopsis

    @@ -8770,7 +8765,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      strip mathematically unbounded along the real axis and in the interval [-ipi /2, +ipi /2]
      along the imaginary axis.
     
    -
    7.3.6.4 The ccosh functions
    +
    7.3.6.4 The ccosh functions
    Synopsis

    @@ -8785,7 +8780,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
     

    The ccosh functions return the complex hyperbolic cosine value. -

    7.3.6.5 The csinh functions
    +
    7.3.6.5 The csinh functions
    Synopsis

    @@ -8801,7 +8796,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007

    The csinh functions return the complex hyperbolic sine value. -

    7.3.6.6 The ctanh functions
    +
    7.3.6.6 The ctanh functions
    Synopsis

    @@ -8816,9 +8811,9 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
     

    The ctanh functions return the complex hyperbolic tangent value. -

    7.3.7 Exponential and logarithmic functions

    +

    7.3.7 Exponential and logarithmic functions

    -
    7.3.7.1 The cexp functions
    +
    7.3.7.1 The cexp functions
    Synopsis

    @@ -8833,7 +8828,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
     

    The cexp functions return the complex base-e exponential value. -

    7.3.7.2 The clog functions
    +
    7.3.7.2 The clog functions
    Synopsis

    @@ -8852,9 +8847,9 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 mathematically unbounded along the real axis and in the interval [-ipi , +ipi ] along the imaginary axis. -

    7.3.8 Power and absolute-value functions

    +

    7.3.8 Power and absolute-value functions

    -
    7.3.8.1 The cabs functions
    +
    7.3.8.1 The cabs functions
    Synopsis

    @@ -8870,7 +8865,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
     

    The cabs functions return the complex absolute value. -

    7.3.8.2 The cpow functions
    +
    7.3.8.2 The cpow functions
    Synopsis

    @@ -8888,7 +8883,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      The cpow functions return the complex power function value.
     
     
    -
    7.3.8.3 The csqrt functions
    +
    7.3.8.3 The csqrt functions
    Synopsis

    @@ -8905,9 +8900,9 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      The csqrt functions return the complex square root value, in the range of the right half-
      plane (including the imaginary axis).
     
    -

    7.3.9 Manipulation functions

    +

    7.3.9 Manipulation functions

    -
    7.3.9.1 The carg functions
    +
    7.3.9.1 The carg functions
    Synopsis

    @@ -8923,7 +8918,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
     

    The carg functions return the value of the argument in the interval [-pi , +pi ]. -

    7.3.9.2 The cimag functions
    +
    7.3.9.2 The cimag functions
    Synopsis

    @@ -8943,7 +8938,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007

    170) For a variable z of complex type, z == creal(z) + cimag(z)*I. -

    7.3.9.3 The conj functions
    +
    7.3.9.3 The conj functions
    Synopsis

    @@ -8959,7 +8954,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
     

    The conj functions return the complex conjugate value. -

    7.3.9.4 The cproj functions
    +
    7.3.9.4 The cproj functions
    Synopsis

    @@ -8984,7 +8979,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      
     
     
    -
    7.3.9.5 The creal functions
    +
    7.3.9.5 The creal functions
    Synopsis

    @@ -9008,7 +9003,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
     

    171) For a variable z of complex type, z == creal(z) + cimag(z)*I. -

    7.4 Character handling

    +

    7.4 Character handling

    The header <ctype.h> declares several functions useful for classifying and mapping characters.172) In all cases the argument is an int, the value of which shall be @@ -9032,12 +9027,12 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 values lie from 0 (NUL) through 0x1F (US), and the character 0x7F (DEL). -

    7.4.1 Character classification functions

    +

    7.4.1 Character classification functions

    The functions in this subclause return nonzero (true) if and only if the value of the argument c conforms to that in the description of the function. -

    7.4.1.1 The isalnum function
    +
    7.4.1.1 The isalnum function
    Synopsis

    @@ -9047,7 +9042,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
     

    The isalnum function tests for any character for which isalpha or isdigit is true. -

    7.4.1.2 The isalpha function
    +
    7.4.1.2 The isalpha function
    Synopsis

    @@ -9069,7 +9064,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      characters; all four combinations are possible.
     
     
    -
    7.4.1.3 The isblank function
    +
    7.4.1.3 The isblank function
    Synopsis

    @@ -9083,7 +9078,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      space (' '), and horizontal tab ('\t'). In the "C" locale, isblank returns true only
      for the standard blank characters.
     
    -
    7.4.1.4 The iscntrl function
    +
    7.4.1.4 The iscntrl function
    Synopsis

    @@ -9093,7 +9088,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
     

    The iscntrl function tests for any control character. -

    7.4.1.5 The isdigit function
    +
    7.4.1.5 The isdigit function
    Synopsis

    @@ -9103,7 +9098,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
     

    The isdigit function tests for any decimal-digit character (as defined in 5.2.1). -

    7.4.1.6 The isgraph function
    +
    7.4.1.6 The isgraph function
    Synopsis

    @@ -9118,7 +9113,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
     

    The isgraph function tests for any printing character except space (' '). -

    7.4.1.7 The islower function
    +
    7.4.1.7 The islower function
    Synopsis

    @@ -9131,7 +9126,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      isspace is true. In the "C" locale, islower returns true only for the lowercase
      letters (as defined in 5.2.1).
     
    -
    7.4.1.8 The isprint function
    +
    7.4.1.8 The isprint function
    Synopsis

    @@ -9141,7 +9136,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
     

    The isprint function tests for any printing character including space (' '). -

    7.4.1.9 The ispunct function
    +
    7.4.1.9 The ispunct function
    Synopsis

    @@ -9154,7 +9149,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      locale, ispunct returns true for every printing character for which neither isspace
      nor isalnum is true.
     
    -
    7.4.1.10 The isspace function
    +
    7.4.1.10 The isspace function
    Synopsis

    @@ -9169,7 +9164,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      ('\n'), carriage return ('\r'), horizontal tab ('\t'), and vertical tab ('\v'). In the
      "C" locale, isspace returns true only for the standard white-space characters.
     
    -
    7.4.1.11 The isupper function
    +
    7.4.1.11 The isupper function
    Synopsis

    @@ -9182,7 +9177,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      isspace is true. In the "C" locale, isupper returns true only for the uppercase
      letters (as defined in 5.2.1).
     
    -
    7.4.1.12 The isxdigit function
    +
    7.4.1.12 The isxdigit function
    Synopsis

    @@ -9192,9 +9187,9 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
     

    The isxdigit function tests for any hexadecimal-digit character (as defined in 6.4.4.1). -

    7.4.2 Character case mapping functions

    +

    7.4.2 Character case mapping functions

    -
    7.4.2.1 The tolower function
    +
    7.4.2.1 The tolower function
    Synopsis

    @@ -9211,7 +9206,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      for any given locale); otherwise, the argument is returned unchanged.
     
     
    -
    7.4.2.2 The toupper function
    +
    7.4.2.2 The toupper function
    Synopsis

    @@ -9228,7 +9223,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      for any given locale); otherwise, the argument is returned unchanged.
     
     
    -

    7.5 Errors

    +

    7.5 Errors

    The header <errno.h> defines several macros, all relating to the reporting of error conditions. @@ -9273,7 +9268,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007

    177) See ''future library directions'' (7.26.3). -

    7.6 Floating-point environment

    +

    7.6 Floating-point environment

    The header <fenv.h> declares two types and several macros and functions to provide access to the floating-point environment. The floating-point environment refers @@ -9354,9 +9349,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007

               FE_DFL_ENV
    represents the default floating-point environment -- the one installed at program startup -
      -
    • and has type ''pointer to const-qualified fenv_t''. It can be used as an argument to -
    + -- and has type ''pointer to const-qualified fenv_t''. It can be used as an argument to <fenv.h> functions that manage the floating-point environment.

    Additional implementation-defined environments, with macro definitions beginning with @@ -9384,7 +9377,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 FLT_ROUNDS, they are not required to do so. -

    7.6.1 The FENV_ACCESS pragma

    +

    7.6.1 The FENV_ACCESS pragma

    Synopsis

    @@ -9446,7 +9439,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      ''off'', just one evaluation of x + 1 would suffice.
     
     
    -

    7.6.2 Floating-point exceptions

    +

    7.6.2 Floating-point exceptions

    The following functions provide access to the floating-point status flags.186) The int input argument for the functions represents a subset of floating-point exceptions, and can @@ -9462,7 +9455,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 content of flags. -

    7.6.2.1 The feclearexcept function
    +
    7.6.2.1 The feclearexcept function
    Synopsis

    @@ -9480,7 +9473,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      
     
     
    -
    7.6.2.2 The fegetexceptflag function
    +
    7.6.2.2 The fegetexceptflag function
    Synopsis

    @@ -9497,7 +9490,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      The fegetexceptflag function returns zero if the representation was successfully
      stored. Otherwise, it returns a nonzero value.
     
    -
    7.6.2.3 The feraiseexcept function
    +
    7.6.2.3 The feraiseexcept function
    Synopsis

    @@ -9526,7 +9519,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      in F.7.6 is in the same spirit.
     
     
    -
    7.6.2.4 The fesetexceptflag function
    +
    7.6.2.4 The fesetexceptflag function
    Synopsis

    @@ -9547,7 +9540,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      all the specified flags were successfully set to the appropriate state. Otherwise, it returns
      a nonzero value.
     
    -
    7.6.2.5 The fetestexcept function
    +
    7.6.2.5 The fetestexcept function
    Synopsis

    @@ -9589,12 +9582,12 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
     

    188) This mechanism allows testing several floating-point exceptions with just one function call. -

    7.6.3 Rounding

    +

    7.6.3 Rounding

    The fegetround and fesetround functions provide control of rounding direction modes. -

    7.6.3.1 The fegetround function
    +
    7.6.3.1 The fegetround function
    Synopsis

    @@ -9609,7 +9602,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      representing the current rounding direction or a negative value if there is no such
      rounding direction macro or the current rounding direction is not determinable.
     
    -
    7.6.3.2 The fesetround function
    +
    7.6.3.2 The fesetround function
    Synopsis

    @@ -9645,12 +9638,12 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
             }
    -

    7.6.4 Environment

    +

    7.6.4 Environment

    The functions in this section manage the floating-point environment -- status flags and control modes -- as one entity. -

    7.6.4.1 The fegetenv function
    +
    7.6.4.1 The fegetenv function
    Synopsis

    @@ -9665,7 +9658,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      The fegetenv function returns zero if the environment was successfully stored.
      Otherwise, it returns a nonzero value.
     
    -
    7.6.4.2 The feholdexcept function
    +
    7.6.4.2 The feholdexcept function
    Synopsis

    @@ -9690,7 +9683,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      function to write routines that hide spurious floating-point exceptions from their callers.
     
     
    -
    7.6.4.3 The fesetenv function
    +
    7.6.4.3 The fesetenv function
    Synopsis

    @@ -9708,7 +9701,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      The fesetenv function returns zero if the environment was successfully established.
      Otherwise, it returns a nonzero value.
     
    -
    7.6.4.4 The feupdateenv function
    +
    7.6.4.4 The feupdateenv function
    Synopsis

    @@ -9751,7 +9744,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
                  return result;
            }
    -

    7.7 Characteristics of floating types

    +

    7.7 Characteristics of floating types

    The header <float.h> defines several macros that expand to various limits and parameters of the standard floating-point types. @@ -9760,7 +9753,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 in 5.2.4.2.2. -

    7.8 Format conversion of integer types

    +

    7.8 Format conversion of integer types

    The header <inttypes.h> includes the header <stdint.h> and extends it with additional facilities provided by hosted implementations. @@ -9779,7 +9772,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007

    190) See ''future library directions'' (7.26.4). -

    7.8.1 Macros for format specifiers

    +

    7.8.1 Macros for format specifiers

    Each of the following object-like macros191) expands to a character string literal containing a conversion specifier, possibly modified by a length modifier, suitable for use @@ -9846,9 +9839,9 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 same. -

    7.8.2 Functions for greatest-width integer types

    +

    7.8.2 Functions for greatest-width integer types

    -
    7.8.2.1 The imaxabs function
    +
    7.8.2.1 The imaxabs function
    Synopsis

    @@ -9870,7 +9863,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
     

    193) The absolute value of the most negative number cannot be represented in two's complement. -

    7.8.2.2 The imaxdiv function
    +
    7.8.2.2 The imaxdiv function
    Synopsis

    @@ -9887,7 +9880,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      quot (the quotient) and rem (the remainder), each of which has type intmax_t. If
      either part of the result cannot be represented, the behavior is undefined.
     
    -
    7.8.2.3 The strtoimax and strtoumax functions
    +
    7.8.2.3 The strtoimax and strtoumax functions
    Synopsis

    @@ -9912,7 +9905,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      (7.20.1.4).
     
     
    -
    7.8.2.4 The wcstoimax and wcstoumax functions
    +
    7.8.2.4 The wcstoimax and wcstoumax functions
    Synopsis

    @@ -9938,7 +9931,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      (7.24.4.1.2).
     
     
    -

    7.9 Alternative spellings

    +

    7.9 Alternative spellings

    The header <iso646.h> defines the following eleven macros (on the left) that expand to the corresponding tokens (on the right): @@ -9956,7 +9949,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 xor ^ xor_eq ^=

    -

    7.10 Sizes of integer types

    +

    7.10 Sizes of integer types

    The header <limits.h> defines several macros that expand to various limits and parameters of the standard integer types. @@ -9965,7 +9958,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 in 5.2.4.2.1. -

    7.11 Localization

    +

    7.11 Localization

    The header <locale.h> declares two functions, one type, and defines several macros.

    @@ -10022,9 +10015,9 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007

    195) See ''future library directions'' (7.26.5). -

    7.11.1 Locale control

    +

    7.11.1 Locale control

    -
    7.11.1.1 The setlocale function
    +
    7.11.1.1 The setlocale function
    Synopsis

    @@ -10085,9 +10078,9 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      locale when category has the value LC_ALL.
     
     
    -

    7.11.2 Numeric formatting convention inquiry

    +

    7.11.2 Numeric formatting convention inquiry

    -
    7.11.2.1 The localeconv function
    +
    7.11.2.1 The localeconv function
    Synopsis

    @@ -10107,140 +10100,144 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      strings shall start and end in the initial shift state. The members with type char are
      nonnegative numbers, any of which can be CHAR_MAX to indicate that the value is not
      available in the current locale. The members include the following:
    - char *decimal_point
    -
    -           The decimal-point character used to format nonmonetary quantities.
    - char *thousands_sep -
    +
    +
    char *decimal_point +
    + The decimal-point character used to format nonmonetary quantities. +
    char *thousands_sep +
    The character used to separate groups of digits before the decimal-point - character in formatted nonmonetary quantities.
    - char *grouping -
    +           character in formatted nonmonetary quantities.
    +
    char *grouping +
    A string whose elements indicate the size of each group of digits in - formatted nonmonetary quantities.
    - char *mon_decimal_point -
    -           The decimal-point used to format monetary quantities.
    - char *mon_thousands_sep -
    +           formatted nonmonetary quantities.
    +
    char *mon_decimal_point +
    + The decimal-point used to format monetary quantities. +
    char *mon_thousands_sep +
    The separator for groups of digits before the decimal-point in formatted - monetary quantities.
    - char *mon_grouping -
    +           monetary quantities.
    +
    char *mon_grouping +
    A string whose elements indicate the size of each group of digits in - formatted monetary quantities.
    - char *positive_sign -
    +           formatted monetary quantities.
    +
    char *positive_sign +
    The string used to indicate a nonnegative-valued formatted monetary - quantity.
    - char *negative_sign -
    -           The string used to indicate a negative-valued formatted monetary quantity.
    - char *currency_symbol -
    -           The local currency symbol applicable to the current locale.
    - char frac_digits -
    +           quantity.
    +
    char *negative_sign +
    + The string used to indicate a negative-valued formatted monetary quantity. +
    char *currency_symbol +
    + The local currency symbol applicable to the current locale. +
    char frac_digits +
    The number of fractional digits (those after the decimal-point) to be - displayed in a locally formatted monetary quantity.
    - char p_cs_precedes -
    +           displayed in a locally formatted monetary quantity.
    +
    char p_cs_precedes +
    Set to 1 or 0 if the currency_symbol respectively precedes or - succeeds the value for a nonnegative locally formatted monetary quantity.
    - char n_cs_precedes + succeeds the value for a nonnegative locally formatted monetary quantity. +
    char n_cs_precedes -
    +
    Set to 1 or 0 if the currency_symbol respectively precedes or - succeeds the value for a negative locally formatted monetary quantity.
    - char p_sep_by_space -
    +           succeeds the value for a negative locally formatted monetary quantity.
    +
    char p_sep_by_space +
    Set to a value indicating the separation of the currency_symbol, the sign string, and the value for a nonnegative locally formatted monetary - quantity.
    - char n_sep_by_space -
    +           quantity.
    +
    char n_sep_by_space +
    Set to a value indicating the separation of the currency_symbol, the sign string, and the value for a negative locally formatted monetary - quantity.
    - char p_sign_posn -
    +           quantity.
    +
    char p_sign_posn +
    Set to a value indicating the positioning of the positive_sign for a - nonnegative locally formatted monetary quantity.
    - char n_sign_posn -
    +           nonnegative locally formatted monetary quantity.
    +
    char n_sign_posn +
    Set to a value indicating the positioning of the negative_sign for a - negative locally formatted monetary quantity.
    - char *int_curr_symbol -
    +           negative locally formatted monetary quantity.
    +
    char *int_curr_symbol +
    The international currency symbol applicable to the current locale. The first three characters contain the alphabetic international currency symbol in accordance with those specified in ISO 4217. The fourth character (immediately preceding the null character) is the character used to separate - the international currency symbol from the monetary quantity.
    - char int_frac_digits -
    +           the international currency symbol from the monetary quantity.
    +
    char int_frac_digits +
    The number of fractional digits (those after the decimal-point) to be - displayed in an internationally formatted monetary quantity.
    - char int_p_cs_precedes -
    +           displayed in an internationally formatted monetary quantity.
    +
    char int_p_cs_precedes +
    Set to 1 or 0 if the int_curr_symbol respectively precedes or succeeds the value for a nonnegative internationally formatted monetary - quantity.
    - char int_n_cs_precedes -
    +           quantity.
    +
    char int_n_cs_precedes +
    Set to 1 or 0 if the int_curr_symbol respectively precedes or succeeds the value for a negative internationally formatted monetary - quantity.
    - char int_p_sep_by_space + quantity. +
    char int_p_sep_by_space -
    +
    Set to a value indicating the separation of the int_curr_symbol, the sign string, and the value for a nonnegative internationally formatted - monetary quantity.
    - char int_n_sep_by_space -
    +           monetary quantity.
    +
    char int_n_sep_by_space +
    Set to a value indicating the separation of the int_curr_symbol, the sign string, and the value for a negative internationally formatted monetary - quantity.
    - char int_p_sign_posn -
    +           quantity.
    +
    char int_p_sign_posn +
    Set to a value indicating the positioning of the positive_sign for a - nonnegative internationally formatted monetary quantity.
    - char int_n_sign_posn -

    -

    +           nonnegative internationally formatted monetary quantity.
    +
    char int_n_sign_posn +
    Set to a value indicating the positioning of the negative_sign for a - negative internationally formatted monetary quantity.
    + negative internationally formatted monetary quantity. + +

    The elements of grouping and mon_grouping are interpreted according to the following: - CHAR_MAX No further grouping is to be performed. - 0 The previous element is to be repeatedly used for the remainder of the -

    -               digits.
    - other The integer value is the number of digits that compose the current group. -

    -

    +
    +
    CHAR_MAX
    No further grouping is to be performed. +
    0
    The previous element is to be repeatedly used for the remainder of the + digits. +
    other
    The integer value is the number of digits that compose the current group. The next element is examined to determine the size of the next group of - digits before the current group.
    + digits before the current group. + +

    The values of p_sep_by_space, n_sep_by_space, int_p_sep_by_space, and int_n_sep_by_space are interpreted according to the following: - 0 No space separates the currency symbol and value. - 1 If the currency symbol and sign string are adjacent, a space separates them from the -

    -     value; otherwise, a space separates the currency symbol from the value.
    - 2 If the currency symbol and sign string are adjacent, a space separates them; -
    -     otherwise, a space separates the sign string from the value.
    +
    +
    0
    No space separates the currency symbol and value. +
    1
    If the currency symbol and sign string are adjacent, a space separates them from the + value; otherwise, a space separates the currency symbol from the value. +
    2
    If the currency symbol and sign string are adjacent, a space separates them; + otherwise, a space separates the sign string from the value. +
    For int_p_sep_by_space and int_n_sep_by_space, the fourth character of int_curr_symbol is used instead of a space.

    The values of p_sign_posn, n_sign_posn, int_p_sign_posn, and int_n_sign_posn are interpreted according to the following: - 0 Parentheses surround the quantity and currency symbol. - 1 The sign string precedes the quantity and currency symbol. - 2 The sign string succeeds the quantity and currency symbol. - 3 The sign string immediately precedes the currency symbol. - 4 The sign string immediately succeeds the currency symbol. +

    +
    0
    Parentheses surround the quantity and currency symbol. +
    1
    The sign string precedes the quantity and currency symbol. +
    2
    The sign string succeeds the quantity and currency symbol. +
    3
    The sign string immediately precedes the currency symbol. +
    4
    The sign string immediately succeeds the currency symbol. +

    The implementation shall behave as if no library function calls the localeconv @@ -10256,19 +10253,20 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 EXAMPLE 1 The following table illustrates rules which may well be used by four countries to format monetary quantities.

    -                               Local format                                     International format
    + Local format International format - Country Positive Negative Positive Negative + Country Positive Negative Positive Negative Country1 1.234,56 mk -1.234,56 mk FIM 1.234,56 FIM -1.234,56 Country2 L.1.234 -L.1.234 ITL 1.234 -ITL 1.234 - Country3 fl. 1.234,56 fl. -1.234,56 NLG 1.234,56 NLG -1.234,56 + Country3 fl. 1.234,56 fl. -1.234,56 NLG 1.234,56 NLG -1.234,56 Country4 SFrs.1,234.56 SFrs.1,234.56C CHF 1,234.56 CHF 1,234.56C +

    For these four countries, the respective values for the monetary members of the structure returned by localeconv could be:

    -                                   Country1              Country2              Country3            Country4
    + Country1 Country2 Country3 Country4 mon_decimal_point "," "" "," "." mon_thousands_sep "." "." "." "," @@ -10291,31 +10289,29 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 int_n_sep_by_space 2 1 2 1 int_p_sign_posn 1 1 1 1 int_n_sign_posn 4 1 4 2 +

    EXAMPLE 2 The following table illustrates how the cs_precedes, sep_by_space, and sign_posn members affect the formatted value.

    -                                                               p_sep_by_space
    - - p_cs_precedes p_sign_posn 0 1 2 - -
    -                 0                    0         (1.25$)            (1.25 $)            (1.25$)
    -                                      1         +1.25$             +1.25 $             + 1.25$
    -                                      2         1.25$+             1.25 $+             1.25$ +
    -                                      3         1.25+$             1.25 +$             1.25+ $
    -                                      4         1.25$+             1.25 $+             1.25$ +
    - - -
    -                 1                    0         ($1.25)            ($ 1.25)            ($1.25)
    -                                      1         +$1.25             +$ 1.25             + $1.25
    -                                      2         $1.25+             $ 1.25+             $1.25 +
    -                                      3         +$1.25             +$ 1.25             + $1.25
    -                                      4         $+1.25             $+ 1.25             $ +1.25
    + p_sep_by_space + p_cs_precedes p_sign_posn 0 1 2 + + 0 0 (1.25$) (1.25 $) (1.25$) + 1 +1.25$ +1.25 $ + 1.25$ + 2 1.25$+ 1.25 $+ 1.25$ + + 3 1.25+$ 1.25 +$ 1.25+ $ + 4 1.25$+ 1.25 $+ 1.25$ + -

    7.12 Mathematics

    + 1 0 ($1.25) ($ 1.25) ($1.25) + 1 +$1.25 +$ 1.25 + $1.25 + 2 $1.25+ $ 1.25+ $1.25 + + 3 +$1.25 +$ 1.25 + $1.25 + 4 $+1.25 $+ 1.25 $ +1.25
    + + +

    7.12 Mathematics

    The header <math.h> declares two types and many mathematical functions and defines several macros. Most synopses specify a family of functions consisting of a principal @@ -10432,7 +10428,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 substantially slower. -

    7.12.1 Treatment of error conditions

    +

    7.12.1 Treatment of error conditions

    The behavior of each of the functions in <math.h> is specified for all representable values of its input arguments, except where stated otherwise. Each function shall execute @@ -10484,7 +10480,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 also ''flush-to-zero'' underflow. -

    7.12.2 The FP_CONTRACT pragma

    +

    7.12.2 The FP_CONTRACT pragma

    Synopsis

    @@ -10510,12 +10506,12 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      
     
     
    -

    7.12.3 Classification macros

    +

    7.12.3 Classification macros

    In the synopses in this subclause, real-floating indicates that the argument shall be an expression of real floating type. -

    7.12.3.1 The fpclassify macro
    +
    7.12.3.1 The fpclassify macro
    Synopsis

    @@ -10546,7 +10542,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      become subnormal when converted to double, and zero when converted to float.
     
     
    -
    7.12.3.2 The isfinite macro
    +
    7.12.3.2 The isfinite macro
    Synopsis

    @@ -10568,7 +10564,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      The isfinite macro returns a nonzero value if and only if its argument has a finite
      value.
     
    -
    7.12.3.3 The isinf macro
    +
    7.12.3.3 The isinf macro
    Synopsis

    @@ -10584,7 +10580,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      The isinf macro returns a nonzero value if and only if its argument has an infinite
      value.
     
    -
    7.12.3.4 The isnan macro
    +
    7.12.3.4 The isnan macro
    Synopsis

    @@ -10604,7 +10600,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      NaNs in the evaluation type but not in the semantic type.
     
     
    -
    7.12.3.5 The isnormal macro
    +
    7.12.3.5 The isnormal macro
    Synopsis

    @@ -10626,7 +10622,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      The isnormal macro returns a nonzero value if and only if its argument has a normal
      value.
     
    -
    7.12.3.6 The signbit macro
    +
    7.12.3.6 The signbit macro
    Synopsis

    @@ -10645,9 +10641,9 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      unsigned, it is treated as positive.
     
     
    -

    7.12.4 Trigonometric functions

    +

    7.12.4 Trigonometric functions

    -
    7.12.4.1 The acos functions
    +
    7.12.4.1 The acos functions
    Synopsis

    @@ -10668,7 +10664,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      
     
     
    -
    7.12.4.2 The asin functions
    +
    7.12.4.2 The asin functions
    Synopsis

    @@ -10684,7 +10680,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
     

    The asin functions return arcsin x in the interval [-pi /2, +pi /2] radians. -

    7.12.4.3 The atan functions
    +
    7.12.4.3 The atan functions
    Synopsis

    @@ -10699,7 +10695,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
     

    The atan functions return arctan x in the interval [-pi /2, +pi /2] radians. -

    7.12.4.4 The atan2 functions
    +
    7.12.4.4 The atan2 functions
    Synopsis

    @@ -10717,7 +10713,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      The atan2 functions return arctan y/x in the interval [-pi , +pi ] radians.
     
     
    -
    7.12.4.5 The cos functions
    +
    7.12.4.5 The cos functions
    Synopsis

    @@ -10732,7 +10728,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
     

    The cos functions return cos x. -

    7.12.4.6 The sin functions
    +
    7.12.4.6 The sin functions
    Synopsis

    @@ -10747,7 +10743,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
     

    The sin functions return sin x. -

    7.12.4.7 The tan functions
    +
    7.12.4.7 The tan functions
    Synopsis

    @@ -10763,9 +10759,9 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      The tan functions return tan x.
     
     
    -

    7.12.5 Hyperbolic functions

    +

    7.12.5 Hyperbolic functions

    -
    7.12.5.1 The acosh functions
    +
    7.12.5.1 The acosh functions
    Synopsis

    @@ -10781,7 +10777,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
     

    The acosh functions return arcosh x in the interval [0, +(inf)]. -

    7.12.5.2 The asinh functions
    +
    7.12.5.2 The asinh functions
    Synopsis

    @@ -10796,7 +10792,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
     

    The asinh functions return arsinh x. -

    7.12.5.3 The atanh functions
    +
    7.12.5.3 The atanh functions
    Synopsis

    @@ -10814,7 +10810,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
     

    The atanh functions return artanh x. -

    7.12.5.4 The cosh functions
    +
    7.12.5.4 The cosh functions
    Synopsis

    @@ -10830,7 +10826,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
     

    The cosh functions return cosh x. -

    7.12.5.5 The sinh functions
    +
    7.12.5.5 The sinh functions
    Synopsis

    @@ -10846,7 +10842,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
     

    The sinh functions return sinh x. -

    7.12.5.6 The tanh functions
    +
    7.12.5.6 The tanh functions
    Synopsis

    @@ -10862,9 +10858,9 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
     

    The tanh functions return tanh x. -

    7.12.6 Exponential and logarithmic functions

    +

    7.12.6 Exponential and logarithmic functions

    -
    7.12.6.1 The exp functions
    +
    7.12.6.1 The exp functions
    Synopsis

    @@ -10878,9 +10874,9 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      magnitude of x is too large.
     
    Returns

    - The exp functions return ex . + The exp functions return ex. -

    7.12.6.2 The exp2 functions
    +
    7.12.6.2 The exp2 functions
    Synopsis

    @@ -10894,9 +10890,9 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      magnitude of x is too large.
     
    Returns

    - The exp2 functions return 2x . + The exp2 functions return 2x. -

    7.12.6.3 The expm1 functions
    +
    7.12.6.3 The expm1 functions
    Synopsis

    @@ -10911,13 +10907,13 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 error occurs if x is too large.208)

    Returns

    - The expm1 functions return ex - 1. + The expm1 functions return ex - 1.

    footnotes

    208) For small magnitude x, expm1(x) is expected to be more accurate than exp(x) - 1. -

    7.12.6.4 The frexp functions
    +
    7.12.6.4 The frexp functions
    Synopsis

    @@ -10933,9 +10929,9 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
     

    If value is not a floating-point number, the results are unspecified. Otherwise, the frexp functions return the value x, such that x has a magnitude in the interval [1/2, 1) or - zero, and value equals x x 2*exp . If value is zero, both parts of the result are zero. + zero, and value equals x 2*exp . If value is zero, both parts of the result are zero. -

    7.12.6.5 The ilogb functions
    +
    7.12.6.5 The ilogb functions
    Synopsis

    @@ -10961,7 +10957,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      The ilogb functions return the exponent of x as a signed int value.
     

    Forward references: the logb functions (7.12.6.11). -

    7.12.6.6 The ldexp functions
    +
    7.12.6.6 The ldexp functions
    Synopsis

    @@ -10975,9 +10971,9 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      range error may occur.
     
    Returns

    - The ldexp functions return x x 2exp . + The ldexp functions return x 2exp . -

    7.12.6.7 The log functions
    +
    7.12.6.7 The log functions
    Synopsis

    @@ -10993,7 +10989,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
     

    The log functions return loge x. -

    7.12.6.8 The log10 functions
    +
    7.12.6.8 The log10 functions
    Synopsis

    @@ -11010,7 +11006,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007

    The log10 functions return log10 x. -

    7.12.6.9 The log1p functions
    +
    7.12.6.9 The log1p functions
    Synopsis

    @@ -11031,7 +11027,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
     

    209) For small magnitude x, log1p(x) is expected to be more accurate than log(1 + x). -

    7.12.6.10 The log2 functions
    +
    7.12.6.10 The log2 functions
    Synopsis

    @@ -11052,7 +11048,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      
     
     
    -
    7.12.6.11 The logb functions
    +
    7.12.6.11 The logb functions
    Synopsis

    @@ -11066,13 +11062,13 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      format. If x is subnormal it is treated as though it were normalized; thus, for positive
      finite x,
     
    -       1 <= x x FLT_RADIX-logb(x) < FLT_RADIX
    + 1 <= x FLT_RADIX-logb(x) < FLT_RADIX
    A domain error or range error may occur if the argument is zero.
    Returns

    The logb functions return the signed exponent of x. -

    7.12.6.12 The modf functions
    +
    7.12.6.12 The modf functions
    Synopsis

    @@ -11090,7 +11086,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      The modf functions return the signed fractional part of value.
     
     
    -
    7.12.6.13 The scalbn and scalbln functions
    +
    7.12.6.13 The scalbn and scalbln functions
    Synopsis

    @@ -11103,15 +11099,15 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
             long double scalblnl(long double x, long int n);
    Description

    - The scalbn and scalbln functions compute x x FLT_RADIXn efficiently, not - normally by computing FLT_RADIXn explicitly. A range error may occur. + The scalbn and scalbln functions compute x FLT_RADIXn efficiently, not + normally by computing FLT_RADIXn explicitly. A range error may occur.

    Returns

    - The scalbn and scalbln functions return x x FLT_RADIXn . + The scalbn and scalbln functions return x FLT_RADIXn . -

    7.12.7 Power and absolute-value functions

    +

    7.12.7 Power and absolute-value functions

    -
    7.12.7.1 The cbrt functions
    +
    7.12.7.1 The cbrt functions
    Synopsis

    @@ -11124,9 +11120,9 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      The cbrt functions compute the real cube root of x.
     
    Returns

    - The cbrt functions return x1/3 . + The cbrt functions return x1/3. -

    7.12.7.2 The fabs functions
    +
    7.12.7.2 The fabs functions
    Synopsis

    @@ -11142,7 +11138,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
     

    The fabs functions return | x |. -

    7.12.7.3 The hypot functions
    +
    7.12.7.3 The hypot functions
    Synopsis

    @@ -11157,12 +11153,9 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
     

    Returns

    - The hypot functions return (sqrt)x2 + y2 . -

    -                            ???
    -                            ???????????????
    + The hypot functions return (sqrt)(x2 + y2). -
    7.12.7.4 The pow functions
    +
    7.12.7.4 The pow functions
    Synopsis

    @@ -11178,9 +11171,9 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      is zero and y is less than zero.
     
    Returns

    - The pow functions return xy . + The pow functions return xy. -

    7.12.7.5 The sqrt functions
    +
    7.12.7.5 The sqrt functions
    Synopsis

    @@ -11195,14 +11188,11 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 the argument is less than zero.

    Returns

    - The sqrt functions return (sqrt)x. -

    -                           ???
    -                           ???
    + The sqrt functions return (sqrt)(x). -

    7.12.8 Error and gamma functions

    +

    7.12.8 Error and gamma functions

    -
    7.12.8.1 The erf functions
    +
    7.12.8.1 The erf functions
    Synopsis

    @@ -11214,22 +11204,14 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
     

    The erf functions compute the error function of x.

    Returns
    +

    + The erf functions return

    -                                    2        x
    -                                         (integral)
    - - The erf functions return erf x = e-t dt. -
    -                                                   2
    - - -
    -                                    (sqrt)pi
    -                                    ???
    -                                    ???    0
    - + 2 x + erf x = --- (integral) e-t2 dt . + (sqrt)(pi) 0
    -
    7.12.8.2 The erfc functions
    +
    7.12.8.2 The erfc functions
    Synopsis

    @@ -11242,22 +11224,15 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      The erfc functions compute the complementary error function of x. A range error
      occurs if x is too large.
     
    Returns
    +

    + The erfc functions return

    -                                                           2        (inf)
    -                                                                (integral)
    - - The erfc functions return erfc x = 1 - erf x = e-t dt. -
    -                                                                          2
    - + 2 (inf) + erfc x = 1 - erf x = --- (integral) e-t2 dt . + (sqrt)(pi) x
    -
    -                                                           (sqrt)pi
    -                                                           ???
    -                                                           ???    x
    - -
    7.12.8.3 The lgamma functions
    +
    7.12.8.3 The lgamma functions
    Synopsis

    @@ -11274,7 +11249,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
     

    The lgamma functions return loge | (Gamma)(x) |. -

    7.12.8.4 The tgamma functions
    +
    7.12.8.4 The tgamma functions
    Synopsis

    @@ -11291,9 +11266,9 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
     

    The tgamma functions return (Gamma)(x). -

    7.12.9 Nearest integer functions

    +

    7.12.9 Nearest integer functions

    -
    7.12.9.1 The ceil functions
    +
    7.12.9.1 The ceil functions
    Synopsis

    @@ -11307,9 +11282,9 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
     
     
    Returns

    - The ceil functions return ???x???, expressed as a floating-point number. + The ceil functions return [^x^], expressed as a floating-point number. -

    7.12.9.2 The floor functions
    +
    7.12.9.2 The floor functions
    Synopsis

    @@ -11322,9 +11297,9 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      The floor functions compute the largest integer value not greater than x.
     
    Returns

    - The floor functions return ???x???, expressed as a floating-point number. + The floor functions return [_x_], expressed as a floating-point number. -

    7.12.9.3 The nearbyint functions
    +
    7.12.9.3 The nearbyint functions
    Synopsis

    @@ -11341,7 +11316,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
     

    The nearbyint functions return the rounded integer value. -

    7.12.9.4 The rint functions
    +
    7.12.9.4 The rint functions
    Synopsis

    @@ -11359,7 +11334,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
     

    The rint functions return the rounded integer value. -

    7.12.9.5 The lrint and llrint functions
    +
    7.12.9.5 The lrint and llrint functions
    Synopsis

    @@ -11380,7 +11355,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
     

    The lrint and llrint functions return the rounded integer value. -

    7.12.9.6 The round functions
    +
    7.12.9.6 The round functions
    Synopsis

    @@ -11398,7 +11373,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      The round functions return the rounded integer value.
     
     
    -
    7.12.9.7 The lround and llround functions
    +
    7.12.9.7 The lround and llround functions
    Synopsis

    @@ -11419,7 +11394,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
     

    The lround and llround functions return the rounded integer value. -

    7.12.9.8 The trunc functions
    +
    7.12.9.8 The trunc functions
    Synopsis

    @@ -11436,9 +11411,9 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      The trunc functions return the truncated integer value.
     
     
    -

    7.12.10 Remainder functions

    +

    7.12.10 Remainder functions

    -
    7.12.10.1 The fmod functions
    +
    7.12.10.1 The fmod functions
    Synopsis

    @@ -11456,7 +11431,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      whether a domain error occurs or the fmod functions return zero is implementation-
      defined.
     
    -
    7.12.10.2 The remainder functions
    +
    7.12.10.2 The remainder functions
    Synopsis

    @@ -11484,7 +11459,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      x.'' This definition is applicable for all implementations.
     
     
    -
    7.12.10.3 The remquo functions
    +
    7.12.10.3 The remquo functions
    Synopsis

    @@ -11497,7 +11472,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
     

    The remquo functions compute the same remainder as the remainder functions. In the object pointed to by quo they store a value whose sign is the sign of x/y and whose - magnitude is congruent modulo 2n to the magnitude of the integral quotient of x/y, where + magnitude is congruent modulo 2n to the magnitude of the integral quotient of x/y, where n is an implementation-defined integer greater than or equal to 3.

    Returns

    @@ -11505,9 +11480,9 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 pointed to by quo is unspecified and whether a domain error occurs or the functions return zero is implementation defined. -

    7.12.11 Manipulation functions

    +

    7.12.11 Manipulation functions

    -
    7.12.11.1 The copysign functions
    +
    7.12.11.1 The copysign functions
    Synopsis

    @@ -11526,7 +11501,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      The copysign functions return a value with the magnitude of x and the sign of y.
     
     
    -
    7.12.11.2 The nan functions
    +
    7.12.11.2 The nan functions
    Synopsis

    @@ -11548,7 +11523,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      If the implementation does not support quiet NaNs, the functions return zero.
     

    Forward references: the strtod, strtof, and strtold functions (7.20.1.3). -

    7.12.11.3 The nextafter functions
    +
    7.12.11.3 The nextafter functions
    Synopsis

    @@ -11576,7 +11551,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      function.
     
     
    -
    7.12.11.4 The nexttoward functions
    +
    7.12.11.4 The nexttoward functions
    Synopsis

    @@ -11595,9 +11570,9 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      range or precision in a floating second argument.
     
     
    -

    7.12.12 Maximum, minimum, and positive difference functions

    +

    7.12.12 Maximum, minimum, and positive difference functions

    -
    7.12.12.1 The fdim functions
    +
    7.12.12.1 The fdim functions
    Synopsis

    @@ -11609,15 +11584,15 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
     

    The fdim functions determine the positive difference between their arguments:

    -       ???x - y if x > y
    -       ???
    -       ???+0     if x <= y
    + {x - y if x > y + { + {+0 if x <= y
    A range error may occur.
    Returns

    The fdim functions return the positive difference value. -

    7.12.12.2 The fmax functions
    +
    7.12.12.2 The fmax functions
    Synopsis

    @@ -11641,7 +11616,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      fmax functions choose the numeric value. See F.9.9.2.
     
     
    -
    7.12.12.3 The fmin functions
    +
    7.12.12.3 The fmin functions
    Synopsis

    @@ -11660,9 +11635,9 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
     

    214) The fmin functions are analogous to the fmax functions in their treatment of NaNs. -

    7.12.13 Floating multiply-add

    +

    7.12.13 Floating multiply-add

    -
    7.12.13.1 The fma functions
    +
    7.12.13.1 The fma functions
    Synopsis

    @@ -11673,19 +11648,19 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
                   long double z);
    Description

    - The fma functions compute (x x y) + z, rounded as one ternary operation: they compute + The fma functions compute (x y) + z, rounded as one ternary operation: they compute the value (as if) to infinite precision and round once to the result format, according to the current rounding mode. A range error may occur.

    Returns

    - The fma functions return (x x y) + z, rounded as one ternary operation. + The fma functions return (x y) + z, rounded as one ternary operation. -

    7.12.14 Comparison macros

    +

    7.12.14 Comparison macros

    The relational and equality operators support the usual mathematical relationships between numeric values. For any ordered pair of numeric values exactly one of the @@ -11704,7 +11679,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 NaNs; the result in these cases is false. -

    7.12.14.1 The isgreater macro
    +
    7.12.14.1 The isgreater macro
    Synopsis

    @@ -11720,7 +11695,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
     

    The isgreater macro returns the value of (x) > (y). -

    7.12.14.2 The isgreaterequal macro
    +
    7.12.14.2 The isgreaterequal macro
    Synopsis

    @@ -11740,7 +11715,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
     

    The isgreaterequal macro returns the value of (x) >= (y). -

    7.12.14.3 The isless macro
    +
    7.12.14.3 The isless macro
    Synopsis

    @@ -11756,7 +11731,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
     

    The isless macro returns the value of (x) < (y). -

    7.12.14.4 The islessequal macro
    +
    7.12.14.4 The islessequal macro
    Synopsis

    @@ -11772,7 +11747,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
     

    The islessequal macro returns the value of (x) <= (y). -

    7.12.14.5 The islessgreater macro
    +
    7.12.14.5 The islessgreater macro
    Synopsis

    @@ -11790,7 +11765,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
     

    The islessgreater macro returns the value of (x) < (y) || (x) > (y). -

    7.12.14.6 The isunordered macro
    +
    7.12.14.6 The isunordered macro
    Synopsis

    @@ -11804,7 +11779,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      The isunordered macro returns 1 if its arguments are unordered and 0 otherwise.
     
     
    -

    7.13 Nonlocal jumps

    +

    7.13 Nonlocal jumps

    The header <setjmp.h> defines the macro setjmp, and declares one function and one type, for bypassing the normal function call and return discipline.216) @@ -11828,9 +11803,9 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 a program. -

    7.13.1 Save calling environment

    +

    7.13.1 Save calling environment

    -
    7.13.1.1 The setjmp macro
    +
    7.13.1.1 The setjmp macro
    Synopsis

    @@ -11845,7 +11820,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      If the return is from a direct invocation, the setjmp macro returns the value zero. If the
      return is from a call to the longjmp function, the setjmp macro returns a nonzero
      value.
    - Environmental limits
    +
    Environmental limits

    An invocation of the setjmp macro shall appear only in one of the following contexts:

    -
    7.18.2.5 Limits of greatest-width integer types
    +
    7.18.2.5 Limits of greatest-width integer types

    • minimum value of greatest-width signed integer type - INTMAX_MIN -(263 - 1) +
      +   INTMAX_MIN                                         -(263 - 1)
    • maximum value of greatest-width signed integer type - INTMAX_MAX 263 - 1 +
      +   INTMAX_MAX                                         263 - 1
    • maximum value of greatest-width unsigned integer type - UINTMAX_MAX 264 - 1 +
      +   UINTMAX_MAX                                        264 - 1
    -

    7.18.3 Limits of other integer types

    +

    7.18.3 Limits of other integer types

    The following object-like macros227) specify the minimum and maximum limits of integer types corresponding to types defined in other standard headers. @@ -12546,23 +12534,31 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 actually provides.228)

    • limits of ptrdiff_t - PTRDIFF_MIN -65535 - PTRDIFF_MAX +65535 +
      +   PTRDIFF_MIN                                            -65535
      +   PTRDIFF_MAX                                            +65535
      +
    • limits of sig_atomic_t - SIG_ATOMIC_MIN see below - SIG_ATOMIC_MAX see below +
      +   SIG_ATOMIC_MIN                                         see below
      +   SIG_ATOMIC_MAX                                         see below
      +
    • limit of size_t - SIZE_MAX 65535 +
      +   SIZE_MAX                                               65535
      +
    • limits of wchar_t - - - WCHAR_MIN see below - WCHAR_MAX see below +
      +   WCHAR_MIN                                              see below
      +   WCHAR_MAX                                              see below
      +
    • limits of wint_t - WINT_MIN see below - WINT_MAX see below +
      +   WINT_MIN                                               see below
      +   WINT_MAX                                               see below
      +

    If sig_atomic_t (see 7.14) is defined as a signed integer type, the value of @@ -12591,7 +12587,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 character set. -

    7.18.4 Macros for integer constants

    +

    7.18.4 Macros for integer constants

    The following function-like macros230) expand to integer constants suitable for initializing objects that have integer types corresponding to types defined in @@ -12616,7 +12612,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 defined before <stdint.h> is included. -

    7.18.4.1 Macros for minimum-width integer constants
    +
    7.18.4.1 Macros for minimum-width integer constants

    The macro INTN_C(value) shall expand to an integer constant expression corresponding to the type int_leastN_t. The macro UINTN_C(value) shall expand @@ -12624,7 +12620,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 example, if uint_least64_t is a name for the type unsigned long long int, then UINT64_C(0x123) might expand to the integer constant 0x123ULL. -

    7.18.4.2 Macros for greatest-width integer constants
    +
    7.18.4.2 Macros for greatest-width integer constants

    The following macro expands to an integer constant expression having the value specified by its argument and the type intmax_t: @@ -12636,9 +12632,9 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007

             UINTMAX_C(value)
    -

    7.19 Input/output

    +

    7.19 Input/output

    -

    7.19.1 Introduction

    +

    7.19.1 Introduction

    The header <stdio.h> declares three types, several macros, and many functions for performing input and output. @@ -12738,7 +12734,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 all possible strings of length FILENAME_MAX cannot be expected to be opened successfully. -

    7.19.2 Streams

    +

    7.19.2 Streams

    Input and output, whether to or from physical devices such as terminals and tape drives, or whether to or from files supported on structured storage devices, are mapped into @@ -12794,7 +12790,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 value of this mbstate_t object as part of the value of the fpos_t object. A later successful call to fsetpos using the same stored fpos_t value restores the value of the associated mbstate_t object as well as the position within the controlled stream. - Environmental limits +

    Environmental limits

    An implementation shall support text files with lines containing at least 254 characters, including the terminating new-line character. The value of the macro BUFSIZ shall be at @@ -12816,7 +12812,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007

    233) The three predefined streams stdin, stdout, and stderr are unoriented at program startup. -

    7.19.3 Files

    +

    7.19.3 Files

    A stream is associated with an external file (which may be a physical device) by opening a file, which may involve creating a new file. Creating an existing file causes its former @@ -12863,9 +12859,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007

    At program startup, three text streams are predefined and need not be opened explicitly -

      -
    • standard input (for reading conventional input), standard output (for writing -
    + -- standard input (for reading conventional input), standard output (for writing conventional output), and standard error (for writing diagnostic output). As initially opened, the standard error stream is not fully buffered; the standard input and standard output streams are fully buffered if and only if the stream can be determined not to refer @@ -12912,7 +12906,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 multibyte character. The wide character input/output functions and the byte input/output functions store the value of the macro EILSEQ in errno if and only if an encoding error occurs. - Environmental limits +
    Environmental limits

    The value of FOPEN_MAX shall be at least eight, including the three standard text streams. @@ -12928,9 +12922,9 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 with state-dependent encoding that does not assuredly end in the initial shift state. -

    7.19.4 Operations on files

    +

    7.19.4 Operations on files

    -
    7.19.4.1 The remove function
    +
    7.19.4.1 The remove function
    Synopsis

    @@ -12946,7 +12940,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
     

    The remove function returns zero if the operation succeeds, nonzero if it fails. -

    7.19.4.2 The rename function
    +
    7.19.4.2 The rename function
    Synopsis

    @@ -12969,7 +12963,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      or that it is necessary to copy its contents to effectuate its renaming.
     
     
    -
    7.19.4.3 The tmpfile function
    +
    7.19.4.3 The tmpfile function
    Synopsis

    @@ -12981,7 +12975,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      existing file and that will automatically be removed when it is closed or at program
      termination. If the program terminates abnormally, whether an open temporary file is
      removed is implementation-defined. The file is opened for update with "wb+" mode.
    - Recommended practice
    +
    Recommended practice

    It should be possible to open at least TMP_MAX temporary files during the lifetime of the program (this limit may be shared with tmpnam) and there should be no limit on the @@ -12993,7 +12987,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 cannot be created, the tmpfile function returns a null pointer.

    Forward references: the fopen function (7.19.5.3). -

    7.19.4.4 The tmpnam function
    +
    7.19.4.4 The tmpnam function
    Synopsis

    @@ -13020,7 +13014,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      function may modify the same object). If the argument is not a null pointer, it is assumed
      to point to an array of at least L_tmpnam chars; the tmpnam function writes its result
      in that array and returns the argument as its value.
    - Environmental limits
    +
    Environmental limits

    The value of the macro TMP_MAX shall be at least 25. @@ -13031,9 +13025,9 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 is ended, and before program termination. -

    7.19.5 File access functions

    +

    7.19.5 File access functions

    -
    7.19.5.1 The fclose function
    +
    7.19.5.1 The fclose function
    Synopsis

    @@ -13052,7 +13046,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      The fclose function returns zero if the stream was successfully closed, or EOF if any
      errors were detected.
     
    -
    7.19.5.2 The fflush function
    +
    7.19.5.2 The fflush function
    Synopsis

    @@ -13074,7 +13068,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 error occurs, otherwise it returns zero.

    Forward references: the fopen function (7.19.5.3). -

    7.19.5.3 The fopen function
    +
    7.19.5.3 The fopen function
    Synopsis

    @@ -13088,23 +13082,22 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
     

    The argument mode points to a string. If the string is one of the following, the file is open in the indicated mode. Otherwise, the behavior is undefined.237) - r open text file for reading - w truncate to zero length or create text file for writing - a append; open or create text file for writing at end-of-file - rb open binary file for reading - wb truncate to zero length or create binary file for writing - ab append; open or create binary file for writing at end-of-file - r+ open text file for update (reading and writing) - w+ truncate to zero length or create text file for update - a+ append; open or create text file for update, writing at end-of-file - - - +

    +
    r
    open text file for reading +
    w
    truncate to zero length or create text file for writing +
    a
    append; open or create text file for writing at end-of-file +
    rb
    open binary file for reading +
    wb
    truncate to zero length or create binary file for writing +
    ab
    append; open or create binary file for writing at end-of-file +
    r+
    open text file for update (reading and writing) +
    w+
    truncate to zero length or create text file for update +
    a+
    append; open or create text file for update, writing at end-of-file - r+b or rb+ open binary file for update (reading and writing) - w+b or wb+ truncate to zero length or create binary file for update - a+b or ab+ append; open or create binary file for update, writing at end-of-file +
    r+b or rb+
    open binary file for update (reading and writing) +
    w+b or wb+
    truncate to zero length or create binary file for update +
    a+b or ab+
    append; open or create binary file for update, writing at end-of-file +

    Opening a file with read mode ('r' as the first character in the mode argument) fails if the file does not exist or cannot be read. @@ -13139,7 +13132,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 conform to the properties in 7.19.2). -

    7.19.5.4 The freopen function
    +
    7.19.5.4 The freopen function
    Synopsis

    @@ -13173,7 +13166,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      returned by the fopen function may be assigned.
     
     
    -
    7.19.5.5 The setbuf function
    +
    7.19.5.5 The setbuf function
    Synopsis

    @@ -13190,7 +13183,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      The setbuf function returns no value.
     

    Forward references: the setvbuf function (7.19.5.6). -

    7.19.5.6 The setvbuf function
    +
    7.19.5.6 The setvbuf function
    Synopsis

    @@ -13225,7 +13218,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      before a buffer that has automatic storage duration is deallocated upon block exit.
     
     
    -

    7.19.6 Formatted input/output functions

    +

    7.19.6 Formatted input/output functions

    The formatted input/output functions shall behave as if there is a sequence point after the actions associated with each specifier.240) @@ -13234,7 +13227,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007

    240) The fprintf functions perform writes to memory for the %n specifier. -

    7.19.6.1 The fprintf function
    +
    7.19.6.1 The fprintf function
    Synopsis

    @@ -13289,25 +13282,18 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      precision were omitted.
     

    The flag characters and their meanings are: - - The result of the conversion is left-justified within the field. (It is right-justified if -

    -          this flag is not specified.)
    - + The result of a signed conversion always begins with a plus or minus sign. (It -
    -          begins with a sign only when a negative value is converted if this flag is not
    - - - +
    +
    -
    The result of the conversion is left-justified within the field. (It is right-justified if + this flag is not specified.) +
    +
    The result of a signed conversion always begins with a plus or minus sign. (It + begins with a sign only when a negative value is converted if this flag is not -
    -           specified.)242)
    - space If the first character of a signed conversion is not a sign, or if a signed conversion -
    +           specified.)242)
    +
    space
    If the first character of a signed conversion is not a sign, or if a signed conversion results in no characters, a space is prefixed to the result. If the space and + flags - both appear, the space flag is ignored.
    - # The result is converted to an ''alternative form''. For o conversion, it increases -
    +       both appear, the space flag is ignored.
    +
    #
    The result is converted to an ''alternative form''. For o conversion, it increases the precision, if and only if necessary, to force the first digit of the result to be a zero (if the value and precision are both 0, a single 0 is printed). For x (or X) conversion, a nonzero result has 0x (or 0X) prefixed to it. For a, A, e, E, f, F, g, @@ -13315,84 +13301,74 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 contains a decimal-point character, even if no digits follow it. (Normally, a decimal-point character appears in the result of these conversions only if a digit follows it.) For g and G conversions, trailing zeros are not removed from the - result. For other conversions, the behavior is undefined.
    - 0 For d, i, o, u, x, X, a, A, e, E, f, F, g, and G conversions, leading zeros -

    -

    +           result. For other conversions, the behavior is undefined.
    +
    0
    For d, i, o, u, x, X, a, A, e, E, f, F, g, and G conversions, leading zeros (following any indication of sign or base) are used to pad to the field width rather than performing space padding, except when converting an infinity or NaN. If the 0 and - flags both appear, the 0 flag is ignored. For d, i, o, u, x, and X conversions, if a precision is specified, the 0 flag is ignored. For other - conversions, the behavior is undefined.
    + conversions, the behavior is undefined. +
    +

    The length modifiers and their meanings are: - hh Specifies that a following d, i, o, u, x, or X conversion specifier applies to a -

    +
    +
    hh
    Specifies that a following d, i, o, u, x, or X conversion specifier applies to a signed char or unsigned char argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to signed char or unsigned char before printing); or that a following n conversion specifier applies to a pointer to a signed char - argument.
    - h Specifies that a following d, i, o, u, x, or X conversion specifier applies to a -
    +                argument.
    +
    h
    Specifies that a following d, i, o, u, x, or X conversion specifier applies to a short int or unsigned short int argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to short int or unsigned short int before printing); or that a following n conversion specifier applies to a pointer to a short - int argument.
    - l (ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a -
    +                int argument.
    +
    l (ell)
    Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long int or unsigned long int argument; that a following n - conversion specifier applies to a pointer to a long int argument; that a
    - + conversion specifier applies to a pointer to a long int argument; that a -
                   following c conversion specifier applies to a wint_t argument; that a
                   following s conversion specifier applies to a pointer to a wchar_t
                   argument; or has no effect on a following a, A, e, E, f, F, g, or G conversion
    -              specifier.
    - ll (ell-ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a -
    +              specifier.
    +
    ll (ell-ell)
    Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long long int or unsigned long long int argument; or that a following n conversion specifier applies to a pointer to a long long int - argument.
    - j Specifies that a following d, i, o, u, x, or X conversion specifier applies to -
    +              argument.
    +
    j
    Specifies that a following d, i, o, u, x, or X conversion specifier applies to an intmax_t or uintmax_t argument; or that a following n conversion - specifier applies to a pointer to an intmax_t argument.
    - z Specifies that a following d, i, o, u, x, or X conversion specifier applies to a -
    +              specifier applies to a pointer to an intmax_t argument.
    +
    z
    Specifies that a following d, i, o, u, x, or X conversion specifier applies to a size_t or the corresponding signed integer type argument; or that a following n conversion specifier applies to a pointer to a signed integer type - corresponding to size_t argument.
    - t Specifies that a following d, i, o, u, x, or X conversion specifier applies to a -
    +              corresponding to size_t argument.
    +
    t
    Specifies that a following d, i, o, u, x, or X conversion specifier applies to a ptrdiff_t or the corresponding unsigned integer type argument; or that a following n conversion specifier applies to a pointer to a ptrdiff_t - argument.
    - L Specifies that a following a, A, e, E, f, F, g, or G conversion specifier -
    -              applies to a long double argument.
    - If a length modifier appears with any conversion specifier other than as specified above, + argument. +
    L
    Specifies that a following a, A, e, E, f, F, g, or G conversion specifier + applies to a long double argument. + +If a length modifier appears with any conversion specifier other than as specified above, the behavior is undefined.

    The conversion specifiers and their meanings are: - d,i The int argument is converted to signed decimal in the style [-]dddd. The -

    +
    +
    d,i
    The int argument is converted to signed decimal in the style [-]dddd. The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it is expanded with leading zeros. The default precision is 1. The result of converting a zero - value with a precision of zero is no characters.
    - o,u,x,X The unsigned int argument is converted to unsigned octal (o), unsigned + value with a precision of zero is no characters. +
    o,u,x,X
    The unsigned int argument is converted to unsigned octal (o), unsigned -
              decimal (u), or unsigned hexadecimal notation (x or X) in the style dddd; the
              letters abcdef are used for x conversion and the letters ABCDEF for X
              conversion. The precision specifies the minimum number of digits to appear;
              if the value being converted can be represented in fewer digits, it is expanded
              with leading zeros. The default precision is 1. The result of converting a
    -         zero value with a precision of zero is no characters.
    - f,F A double argument representing a floating-point number is converted to -
    +         zero value with a precision of zero is no characters.
    +
    f,F
    A double argument representing a floating-point number is converted to decimal notation in the style [-]ddd.ddd, where the number of digits after the decimal-point character is equal to the precision specification. If the precision is missing, it is taken as 6; if the precision is zero and the # flag is @@ -13405,9 +13381,8 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 [-]nan or [-]nan(n-char-sequence) -- which style, and the meaning of any n-char-sequence, is implementation-defined. The F conversion specifier produces INF, INFINITY, or NAN instead of inf, infinity, or nan, - respectively.243)
    - e,E A double argument representing a floating-point number is converted in the -
    +              respectively.243)
    +
    e,E
    A double argument representing a floating-point number is converted in the style [-]d.ddd e(+-)dd, where there is one digit (which is nonzero if the argument is nonzero) before the decimal-point character and the number of digits after it is equal to the precision; if the precision is missing, it is taken as @@ -13418,26 +13393,24 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 and only as many more digits as necessary to represent the exponent. If the value is zero, the exponent is zero. A double argument representing an infinity or NaN is converted in the style - of an f or F conversion specifier.
    - g,G A double argument representing a floating-point number is converted in -
    +              of an f or F conversion specifier.
    +
    g,G
    A double argument representing a floating-point number is converted in style f or e (or in style F or E in the case of a G conversion specifier), depending on the value converted and the precision. Let P equal the precision if nonzero, 6 if the precision is omitted, or 1 if the precision is zero. Then, if a conversion with style E would have an exponent of X : - -- if P > X >= -4, the conversion is with style f (or F) and precision +
      +
    • if P > X >= -4, the conversion is with style f (or F) and precision P - (X + 1). - -- otherwise, the conversion is with style e (or E) and precision P - 1. - Finally, unless the # flag is used, any trailing zeros are removed from the
    - +
  • otherwise, the conversion is with style e (or E) and precision P - 1. + + Finally, unless the # flag is used, any trailing zeros are removed from the -
                    fractional portion of the result and the decimal-point character is removed if
                    there is no fractional portion remaining.
                    A double argument representing an infinity or NaN is converted in the style
    -               of an f or F conversion specifier.
    - a,A A double argument representing a floating-point number is converted in the -
    +               of an f or F conversion specifier.
    +
    a,A
    A double argument representing a floating-point number is converted in the style [-]0xh.hhhh p(+-)d, where there is one hexadecimal digit (which is nonzero if the argument is a normalized floating-point number and is otherwise unspecified) before the decimal-point character244) and the number @@ -13453,22 +13426,17 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 least one digit, and only as many more digits as necessary to represent the decimal exponent of 2. If the value is zero, the exponent is zero. A double argument representing an infinity or NaN is converted in the style - of an f or F conversion specifier.
    - c If no l length modifier is present, the int argument is converted to an -
    +               of an f or F conversion specifier.
    +
    c
    If no l length modifier is present, the int argument is converted to an unsigned char, and the resulting character is written. If an l length modifier is present, the wint_t argument is converted as if by an ls conversion specification with no precision and an argument that points to the initial element of a two-element array of wchar_t, the first element containing the wint_t argument to the lc conversion specification and the - second a null wide character.
    - s If no l length modifier is present, the argument shall be a pointer to the initial -
    -               element of an array of character type.246) Characters from the array are
    - - + second a null wide character. +
    s
    If no l length modifier is present, the argument shall be a pointer to the initial + element of an array of character type.246) Characters from the array are -
                     written up to (but not including) the terminating null character. If the
                     precision is specified, no more than that many bytes are written. If the
                     precision is not specified or is greater than the size of the array, the array shall
    @@ -13485,21 +13453,19 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
                     written (including shift sequences, if any), and the array shall contain a null
                     wide character if, to equal the multibyte character sequence length given by
                     the precision, the function would need to access a wide character one past the
    -                end of the array. In no case is a partial multibyte character written.247)
    - p The argument shall be a pointer to void. The value of the pointer is -
    +                end of the array. In no case is a partial multibyte character written.247)
    +
    p
    The argument shall be a pointer to void. The value of the pointer is converted to a sequence of printing characters, in an implementation-defined - manner.
    - n The argument shall be a pointer to signed integer into which is written the -
    +                manner.
    +
    n
    The argument shall be a pointer to signed integer into which is written the number of characters written to the output stream so far by this call to fprintf. No argument is converted, but one is consumed. If the conversion specification includes any flags, a field width, or a precision, the behavior is - undefined.
    - % A % character is written. No argument is converted. The complete + undefined. +
    %
    A % character is written. No argument is converted. The complete + conversion specification shall be %%. +

    -

    -                conversion specification shall be %%.
    If a conversion specification is invalid, the behavior is undefined.248) If any argument is not the correct type for the corresponding conversion specification, the behavior is undefined. @@ -13515,7 +13481,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007

    For a and A conversions, if FLT_RADIX is a power of 2, the value is correctly rounded to a hexadecimal floating number with the given precision. - Recommended practice +

    Recommended practice

    For a and A conversions, if FLT_RADIX is not a power of 2 and the result is not exactly representable in the given precision, the result should be one of the two adjacent numbers @@ -13534,7 +13500,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007

    The fprintf function returns the number of characters transmitted, or a negative value if an output or encoding error occurred. - Environmental limits +

    Environmental limits

    The number of characters that can be produced by any single conversion shall be at least 4095. @@ -13597,7 +13563,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007

    244) Binary implementations can choose the hexadecimal digit to the left of the decimal-point character so that subsequent digits align to nibble (4-bit) boundaries. -

    245) The precision p is sufficient to distinguish values of the source type if 16 p-1 > b n where b is +

    245) The precision p is sufficient to distinguish values of the source type if 16p-1 > b n where b is FLT_RADIX and n is the number of base-b digits in the significand of the source type. A smaller p might suffice depending on the implementation's scheme for determining the digit to the left of the decimal-point character. @@ -13613,7 +13579,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 the case of fixed-point conversion by the source value as well. -

    7.19.6.2 The fscanf function
    +
    7.19.6.2 The fscanf function
    Synopsis

    @@ -13686,73 +13652,61 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      in the object, the behavior is undefined.
     

    The length modifiers and their meanings are: - hh Specifies that a following d, i, o, u, x, X, or n conversion specifier applies -

    -              to an argument with type pointer to signed char or unsigned char.
    - h Specifies that a following d, i, o, u, x, X, or n conversion specifier applies -
    +
    +
    hh
    Specifies that a following d, i, o, u, x, X, or n conversion specifier applies + to an argument with type pointer to signed char or unsigned char. +
    h
    Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to short int or unsigned short - int.
    - l (ell) Specifies that a following d, i, o, u, x, X, or n conversion specifier applies -
    +              int.
    +
    l (ell)
    Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to long int or unsigned long int; that a following a, A, e, E, f, F, g, or G conversion specifier applies to an argument with type pointer to double; or that a following c, s, or [ - conversion specifier applies to an argument with type pointer to wchar_t.
    - ll (ell-ell) Specifies that a following d, i, o, u, x, X, or n conversion specifier applies -
    +              conversion specifier applies to an argument with type pointer to wchar_t.
    +
    ll (ell-ell)
    Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to long long int or unsigned - long long int.
    - j Specifies that a following d, i, o, u, x, X, or n conversion specifier applies -
    -              to an argument with type pointer to intmax_t or uintmax_t.
    - z Specifies that a following d, i, o, u, x, X, or n conversion specifier applies -
    +              long long int.
    +
    j
    Specifies that a following d, i, o, u, x, X, or n conversion specifier applies + to an argument with type pointer to intmax_t or uintmax_t. +
    z
    Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to size_t or the corresponding signed - integer type.
    - t Specifies that a following d, i, o, u, x, X, or n conversion specifier applies -
    +              integer type.
    +
    t
    Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to ptrdiff_t or the corresponding - unsigned integer type.
    - L Specifies that a following a, A, e, E, f, F, g, or G conversion specifier -
    -              applies to an argument with type pointer to long double.
    + unsigned integer type. +
    L
    Specifies that a following a, A, e, E, f, F, g, or G conversion specifier + applies to an argument with type pointer to long double. + If a length modifier appears with any conversion specifier other than as specified above, the behavior is undefined.

    The conversion specifiers and their meanings are: - d Matches an optionally signed decimal integer, whose format is the same as -

    +
    +
    d
    Matches an optionally signed decimal integer, whose format is the same as expected for the subject sequence of the strtol function with the value 10 for the base argument. The corresponding argument shall be a pointer to - signed integer.
    - i Matches an optionally signed integer, whose format is the same as expected + signed integer. +
    i
    Matches an optionally signed integer, whose format is the same as expected -
                  for the subject sequence of the strtol function with the value 0 for the
                  base argument. The corresponding argument shall be a pointer to signed
    -             integer.
    - o Matches an optionally signed octal integer, whose format is the same as -
    +             integer.
    +
    o
    Matches an optionally signed octal integer, whose format is the same as expected for the subject sequence of the strtoul function with the value 8 for the base argument. The corresponding argument shall be a pointer to - unsigned integer.
    - u Matches an optionally signed decimal integer, whose format is the same as -
    +               unsigned integer.
    +
    u
    Matches an optionally signed decimal integer, whose format is the same as expected for the subject sequence of the strtoul function with the value 10 for the base argument. The corresponding argument shall be a pointer to - unsigned integer.
    - x Matches an optionally signed hexadecimal integer, whose format is the same -
    +               unsigned integer.
    +
    x
    Matches an optionally signed hexadecimal integer, whose format is the same as expected for the subject sequence of the strtoul function with the value 16 for the base argument. The corresponding argument shall be a pointer to - unsigned integer.
    - a,e,f,g Matches an optionally signed floating-point number, infinity, or NaN, whose -
    +               unsigned integer.
    +
    a,e,f,g
    Matches an optionally signed floating-point number, infinity, or NaN, whose format is the same as expected for the subject sequence of the strtod - function. The corresponding argument shall be a pointer to floating.
    - c Matches a sequence of characters of exactly the number specified by the field -
    +         function. The corresponding argument shall be a pointer to floating.
    +
    c
    Matches a sequence of characters of exactly the number specified by the field width (1 if no field width is present in the directive).252) If no l length modifier is present, the corresponding argument shall be a pointer to the initial element of a character array large enough to accept the @@ -13764,27 +13718,22 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 initialized to zero before the first multibyte character is converted. The corresponding argument shall be a pointer to the initial element of an array of wchar_t large enough to accept the resulting sequence of wide characters. - No null wide character is added.
    - s Matches a sequence of non-white-space characters.252) -
    +               No null wide character is added.
    +
    s
    Matches a sequence of non-white-space characters.252) If no l length modifier is present, the corresponding argument shall be a pointer to the initial element of a character array large enough to accept the sequence and a terminating null character, which will be added automatically. - If an l length modifier is present, the input shall be a sequence of multibyte
    - - + If an l length modifier is present, the input shall be a sequence of multibyte -
               characters that begins in the initial shift state. Each multibyte character is
               converted to a wide character as if by a call to the mbrtowc function, with
               the conversion state described by an mbstate_t object initialized to zero
               before the first multibyte character is converted. The corresponding argument
               shall be a pointer to the initial element of an array of wchar_t large enough
               to accept the sequence and the terminating null wide character, which will be
    -          added automatically.
    - [ Matches a nonempty sequence of characters from a set of expected characters -
    -          (the scanset).252)
    +          added automatically.
    +
    [
    Matches a nonempty sequence of characters from a set of expected characters + (the scanset).252) If no l length modifier is present, the corresponding argument shall be a pointer to the initial element of a character array large enough to accept the sequence and a terminating null character, which will be added automatically. @@ -13807,28 +13756,26 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 the first following right bracket character is the one that ends the specification. If a - character is in the scanlist and is not the first, nor the second where the first character is a ^, nor the last character, the behavior is - implementation-defined.
    - p Matches an implementation-defined set of sequences, which should be the + implementation-defined. +
    p
    Matches an implementation-defined set of sequences, which should be the -
               same as the set of sequences that may be produced by the %p conversion of
               the fprintf function. The corresponding argument shall be a pointer to a
               pointer to void. The input item is converted to a pointer value in an
               implementation-defined manner. If the input item is a value converted earlier
               during the same program execution, the pointer that results shall compare
    -          equal to that value; otherwise the behavior of the %p conversion is undefined.
    - n No input is consumed. The corresponding argument shall be a pointer to -
    +          equal to that value; otherwise the behavior of the %p conversion is undefined.
    +
    n
    No input is consumed. The corresponding argument shall be a pointer to signed integer into which is to be written the number of characters read from the input stream so far by this call to the fscanf function. Execution of a %n directive does not increment the assignment count returned at the completion of execution of the fscanf function. No argument is converted, but one is consumed. If the conversion specification includes an assignment- - suppressing character or a field width, the behavior is undefined.
    - % Matches a single % character; no conversion or assignment occurs. The + suppressing character or a field width, the behavior is undefined. +
    %
    Matches a single % character; no conversion or assignment occurs. The + complete conversion specification shall be %%. +

    -

    -                complete conversion specification shall be %%.
    If a conversion specification is invalid, the behavior is undefined.253)

    The conversion specifiers A, E, F, G, and X are also valid and behave the same as, @@ -13983,7 +13930,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007

    253) See ''future library directions'' (7.26.9). -

    7.19.6.3 The printf function
    +
    7.19.6.3 The printf function
    Synopsis

    @@ -13998,7 +13945,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      The printf function returns the number of characters transmitted, or a negative value if
      an output or encoding error occurred.
     
    -
    7.19.6.4 The scanf function
    +
    7.19.6.4 The scanf function
    Synopsis

    @@ -14015,7 +13962,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      assigned, which can be fewer than provided for, or even zero, in the event of an early
      matching failure.
     
    -
    7.19.6.5 The snprintf function
    +
    7.19.6.5 The snprintf function
    Synopsis

    @@ -14038,7 +13985,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      value if an encoding error occurred. Thus, the null-terminated output has been
      completely written if and only if the returned value is nonnegative and less than n.
     
    -
    7.19.6.6 The sprintf function
    +
    7.19.6.6 The sprintf function
    Synopsis

    @@ -14056,7 +14003,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      The sprintf function returns the number of characters written in the array, not
      counting the terminating null character, or a negative value if an encoding error occurred.
     
    -
    7.19.6.7 The sscanf function
    +
    7.19.6.7 The sscanf function
    Synopsis

    @@ -14077,7 +14024,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      early matching failure.
     
     
    -
    7.19.6.8 The vfprintf function
    +
    7.19.6.8 The vfprintf function
    Synopsis

    @@ -14122,7 +14069,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      vsscanf invoke the va_arg macro, the value of arg after the return is indeterminate.
     
     
    -
    7.19.6.9 The vfscanf function
    +
    7.19.6.9 The vfscanf function
    Synopsis

    @@ -14136,7 +14083,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      The vfscanf function is equivalent to fscanf, with the variable argument list
      replaced by arg, which shall have been initialized by the va_start macro (and
      possibly subsequent va_arg calls). The vfscanf function does not invoke the
    - va_end macro.254)
    + va_end macro.254)
     
    Returns

    The vfscanf function returns the value of the macro EOF if an input failure occurs @@ -14144,7 +14091,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 items assigned, which can be fewer than provided for, or even zero, in the event of an early matching failure. -

    7.19.6.10 The vprintf function
    +
    7.19.6.10 The vprintf function
    Synopsis

    @@ -14157,14 +14104,14 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      The vprintf function is equivalent to printf, with the variable argument list
      replaced by arg, which shall have been initialized by the va_start macro (and
      possibly subsequent va_arg calls). The vprintf function does not invoke the
    - va_end macro.254)
    + va_end macro.254)
     
    Returns

    The vprintf function returns the number of characters transmitted, or a negative value if an output or encoding error occurred. -

    7.19.6.11 The vscanf function
    +
    7.19.6.11 The vscanf function
    Synopsis

    @@ -14177,7 +14124,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      The vscanf function is equivalent to scanf, with the variable argument list replaced
      by arg, which shall have been initialized by the va_start macro (and possibly
      subsequent va_arg calls). The vscanf function does not invoke the va_end
    - macro.254)
    + macro.254)
     
    Returns

    The vscanf function returns the value of the macro EOF if an input failure occurs @@ -14185,7 +14132,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 items assigned, which can be fewer than provided for, or even zero, in the event of an early matching failure. -

    7.19.6.12 The vsnprintf function
    +
    7.19.6.12 The vsnprintf function
    Synopsis

    @@ -14199,7 +14146,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      The vsnprintf function is equivalent to snprintf, with the variable argument list
      replaced by arg, which shall have been initialized by the va_start macro (and
      possibly subsequent va_arg calls). The vsnprintf function does not invoke the
    - va_end macro.254) If copying takes place between objects that overlap, the behavior is
    + va_end macro.254) If copying takes place between objects that overlap, the behavior is
      undefined.
     
    Returns

    @@ -14209,7 +14156,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 completely written if and only if the returned value is nonnegative and less than n. -

    7.19.6.13 The vsprintf function
    +
    7.19.6.13 The vsprintf function
    Synopsis

    @@ -14223,14 +14170,14 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      The vsprintf function is equivalent to sprintf, with the variable argument list
      replaced by arg, which shall have been initialized by the va_start macro (and
      possibly subsequent va_arg calls). The vsprintf function does not invoke the
    - va_end macro.254) If copying takes place between objects that overlap, the behavior is
    + va_end macro.254) If copying takes place between objects that overlap, the behavior is
      undefined.
     
    Returns

    The vsprintf function returns the number of characters written in the array, not counting the terminating null character, or a negative value if an encoding error occurred. -

    7.19.6.14 The vsscanf function
    +
    7.19.6.14 The vsscanf function
    Synopsis

    @@ -14244,7 +14191,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      The vsscanf function is equivalent to sscanf, with the variable argument list
      replaced by arg, which shall have been initialized by the va_start macro (and
      possibly subsequent va_arg calls). The vsscanf function does not invoke the
    - va_end macro.254)
    + va_end macro.254)
     
    Returns

    The vsscanf function returns the value of the macro EOF if an input failure occurs @@ -14253,9 +14200,9 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 early matching failure. -

    7.19.7 Character input/output functions

    +

    7.19.7 Character input/output functions

    -
    7.19.7.1 The fgetc function
    +
    7.19.7.1 The fgetc function
    Synopsis

    @@ -14279,7 +14226,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
     

    255) An end-of-file and a read error can be distinguished by use of the feof and ferror functions. -

    7.19.7.2 The fgets function
    +
    7.19.7.2 The fgets function
    Synopsis

    @@ -14304,7 +14251,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      
     
     
    -
    7.19.7.3 The fputc function
    +
    7.19.7.3 The fputc function
    Synopsis

    @@ -14322,7 +14269,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      The fputc function returns the character written. If a write error occurs, the error
      indicator for the stream is set and fputc returns EOF.
     
    -
    7.19.7.4 The fputs function
    +
    7.19.7.4 The fputs function
    Synopsis

    @@ -14338,7 +14285,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      The fputs function returns EOF if a write error occurs; otherwise it returns a
      nonnegative value.
     
    -
    7.19.7.5 The getc function
    +
    7.19.7.5 The getc function
    Synopsis

    @@ -14357,7 +14304,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      getc returns EOF. If a read error occurs, the error indicator for the stream is set and
      getc returns EOF.
     
    -
    7.19.7.6 The getchar function
    +
    7.19.7.6 The getchar function
    Synopsis

    @@ -14373,7 +14320,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      getchar returns EOF. If a read error occurs, the error indicator for the stream is set and
      getchar returns EOF.
     
    -
    7.19.7.7 The gets function
    +
    7.19.7.7 The gets function
    Synopsis

    @@ -14394,7 +14341,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
     

    Forward references: future library directions (7.26.9). -

    7.19.7.8 The putc function
    +
    7.19.7.8 The putc function
    Synopsis

    @@ -14410,7 +14357,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      The putc function returns the character written. If a write error occurs, the error
      indicator for the stream is set and putc returns EOF.
     
    -
    7.19.7.9 The putchar function
    +
    7.19.7.9 The putchar function
    Synopsis

    @@ -14424,7 +14371,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      The putchar function returns the character written. If a write error occurs, the error
      indicator for the stream is set and putchar returns EOF.
     
    -
    7.19.7.10 The puts function
    +
    7.19.7.10 The puts function
    Synopsis

    @@ -14441,7 +14388,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      value.
     
     
    -
    7.19.7.11 The ungetc function
    +
    7.19.7.11 The ungetc function
    Synopsis

    @@ -14486,9 +14433,9 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
     

    256) See ''future library directions'' (7.26.9). -

    7.19.8 Direct input/output functions

    +

    7.19.8 Direct input/output functions

    -
    7.19.8.1 The fread function
    +
    7.19.8.1 The fread function
    Synopsis

    @@ -14512,7 +14459,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      fread returns zero and the contents of the array and the state of the stream remain
      unchanged.
     
    -
    7.19.8.2 The fwrite function
    +
    7.19.8.2 The fwrite function
    Synopsis

    @@ -14536,9 +14483,9 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      less than nmemb only if a write error is encountered. If size or nmemb is zero,
      fwrite returns zero and the state of the stream remains unchanged.
     
    -

    7.19.9 File positioning functions

    +

    7.19.9 File positioning functions

    -
    7.19.9.1 The fgetpos function
    +
    7.19.9.1 The fgetpos function
    Synopsis

    @@ -14557,7 +14504,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      returns nonzero and stores an implementation-defined positive value in errno.
     

    Forward references: the fsetpos function (7.19.9.3). -

    7.19.9.2 The fseek function
    +
    7.19.9.2 The fseek function
    Synopsis

    @@ -14588,7 +14535,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      The fseek function returns nonzero only for a request that cannot be satisfied.
     

    Forward references: the ftell function (7.19.9.4). -

    7.19.9.3 The fsetpos function
    +
    7.19.9.3 The fsetpos function
    Synopsis

    @@ -14611,7 +14558,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      If successful, the fsetpos function returns zero; on failure, the fsetpos function
      returns nonzero and stores an implementation-defined positive value in errno.
     
    -
    7.19.9.4 The ftell function
    +
    7.19.9.4 The ftell function
    Synopsis

    @@ -14633,7 +14580,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      for the stream. On failure, the ftell function returns -1L and stores an
      implementation-defined positive value in errno.
     
    -
    7.19.9.5 The rewind function
    +
    7.19.9.5 The rewind function
    Synopsis

    @@ -14650,9 +14597,9 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
     

    The rewind function returns no value. -

    7.19.10 Error-handling functions

    +

    7.19.10 Error-handling functions

    -
    7.19.10.1 The clearerr function
    +
    7.19.10.1 The clearerr function
    Synopsis

    @@ -14667,7 +14614,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      The clearerr function returns no value.
     
     
    -
    7.19.10.2 The feof function
    +
    7.19.10.2 The feof function
    Synopsis

    @@ -14681,7 +14628,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      The feof function returns nonzero if and only if the end-of-file indicator is set for
      stream.
     
    -
    7.19.10.3 The ferror function
    +
    7.19.10.3 The ferror function
    Synopsis

    @@ -14695,7 +14642,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      The ferror function returns nonzero if and only if the error indicator is set for
      stream.
     
    -
    7.19.10.4 The perror function
    +
    7.19.10.4 The perror function
    Synopsis

    @@ -14715,7 +14662,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
     

    Forward references: the strerror function (7.21.6.2). -

    7.20 General utilities

    +

    7.20 General utilities

    The header <stdlib.h> declares five types and several functions of general utility, and defines several macros.257) @@ -14759,13 +14706,13 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007

    257) See ''future library directions'' (7.26.10). -

    7.20.1 Numeric conversion functions

    +

    7.20.1 Numeric conversion functions

    The functions atof, atoi, atol, and atoll need not affect the value of the integer expression errno on an error. If the value of the result cannot be represented, the behavior is undefined. -

    7.20.1.1 The atof function
    +
    7.20.1.1 The atof function
    Synopsis

    @@ -14782,7 +14729,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      The atof function returns the converted value.
     

    Forward references: the strtod, strtof, and strtold functions (7.20.1.3). -

    7.20.1.2 The atoi, atol, and atoll functions
    +
    7.20.1.2 The atoi, atol, and atoll functions
    Synopsis

    @@ -14806,7 +14753,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      (7.20.1.4).
     
     
    -
    7.20.1.3 The strtod, strtof, and strtold functions
    +
    7.20.1.3 The strtod, strtof, and strtold functions
    Synopsis

    @@ -14836,7 +14783,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
     
  • a 0x or 0X, then a nonempty sequence of hexadecimal digits optionally containing a decimal-point character, then an optional binary exponent part as defined in 6.4.4.2;
  • INF or INFINITY, ignoring case -
  • NAN or NAN(n-char-sequenceopt), ignoring case in the NAN part, where: +
  • NAN or NAN(n-char-sequenceopt), ignoring case in the NAN part, where:
               n-char-sequence:
                      digit
    @@ -14859,7 +14806,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      the subject sequence begins with a minus sign, the sequence is interpreted as negated.258)
      A character sequence INF or INFINITY is interpreted as an infinity, if representable in
      the return type, else like a floating constant that is too large for the range of the return
    - type. A character sequence NAN or NAN(n-char-sequenceopt), is interpreted as a quiet
    + type. A character sequence NAN or NAN(n-char-sequenceopt), is interpreted as a quiet
      NaN, if supported in the return type, else like a subject sequence part that does not have
      the expected form; the meaning of the n-char sequences is implementation-defined.259) A
      pointer to the final string is stored in the object pointed to by endptr, provided that
    @@ -14874,7 +14821,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      If the subject sequence is empty or does not have the expected form, no conversion is
      performed; the value of nptr is stored in the object pointed to by endptr, provided
      that endptr is not a null pointer.
    - Recommended practice
    +
    Recommended practice

    If the subject sequence has the hexadecimal form, FLT_RADIX is not a power of 2, and the result is not exactly representable, the result should be one of the two numbers in the @@ -14916,7 +14863,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 to the same internal floating value, but if not will round to adjacent values. -

    7.20.1.4 The strtol, strtoll, strtoul, and strtoull functions
    +
    7.20.1.4 The strtol, strtoll, strtoul, and strtoull functions
    Synopsis

    @@ -14991,9 +14938,9 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      and sign of the value, if any), and the value of the macro ERANGE is stored in errno.
     
     
    -

    7.20.2 Pseudo-random sequence generation functions

    +

    7.20.2 Pseudo-random sequence generation functions

    -
    7.20.2.1 The rand function
    +
    7.20.2.1 The rand function
    Synopsis

    @@ -15008,11 +14955,11 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
     
    Returns

    The rand function returns a pseudo-random integer. - Environmental limits +

    Environmental limits

    The value of the RAND_MAX macro shall be at least 32767. -

    7.20.2.2 The srand function
    +
    7.20.2.2 The srand function
    Synopsis

    @@ -15046,7 +14993,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
              }
    -

    7.20.3 Memory management functions

    +

    7.20.3 Memory management functions

    The order and contiguity of storage allocated by successive calls to the calloc, malloc, and realloc functions is unspecified. The pointer returned if the allocation @@ -15060,7 +15007,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 defined: either a null pointer is returned, or the behavior is as if the size were some nonzero value, except that the returned pointer shall not be used to access an object. -

    7.20.3.1 The calloc function
    +
    7.20.3.1 The calloc function
    Synopsis

    @@ -15079,7 +15026,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      constant.
     
     
    -
    7.20.3.2 The free function
    +
    7.20.3.2 The free function
    Synopsis

    @@ -15099,7 +15046,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
     

    The free function returns no value. -

    7.20.3.3 The malloc function
    +
    7.20.3.3 The malloc function
    Synopsis

    @@ -15113,7 +15060,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
     

    The malloc function returns either a null pointer or a pointer to the allocated space. -

    7.20.3.4 The realloc function
    +
    7.20.3.4 The realloc function
    Synopsis

    @@ -15139,9 +15086,9 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      allocated.
     
     
    -

    7.20.4 Communication with the environment

    +

    7.20.4 Communication with the environment

    -
    7.20.4.1 The abort function
    +
    7.20.4.1 The abort function
    Synopsis

    @@ -15159,7 +15106,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
     

    The abort function does not return to its caller. -

    7.20.4.2 The atexit function
    +
    7.20.4.2 The atexit function
    Synopsis

    @@ -15169,7 +15116,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
     

    The atexit function registers the function pointed to by func, to be called without arguments at normal program termination. - Environmental limits +

    Environmental limits

    The implementation shall support the registration of at least 32 functions.

    Returns
    @@ -15177,7 +15124,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 The atexit function returns zero if the registration succeeds, nonzero if it fails.

    Forward references: the exit function (7.20.4.3). -

    7.20.4.3 The exit function
    +
    7.20.4.3 The exit function
    Synopsis

    @@ -15212,7 +15159,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      other registered functions.
     
     
    -
    7.20.4.4 The _Exit function
    +
    7.20.4.4 The _Exit function
    Synopsis

    @@ -15235,7 +15182,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      
     
     
    -
    7.20.4.5 The getenv function
    +
    7.20.4.5 The getenv function
    Synopsis

    @@ -15255,7 +15202,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      overwritten by a subsequent call to the getenv function. If the specified name cannot
      be found, a null pointer is returned.
     
    -
    7.20.4.6 The system function
    +
    7.20.4.6 The system function
    Synopsis

    @@ -15275,7 +15222,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      function does return, it returns an implementation-defined value.
     
     
    -

    7.20.5 Searching and sorting utilities

    +

    7.20.5 Searching and sorting utilities

    These utilities make use of a comparison function to search or sort arrays of unspecified type. Where an argument declared as size_t nmemb specifies the length of the array @@ -15312,7 +15259,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 (char *)p < (char *)base + nmemb * size

    -
    7.20.5.1 The bsearch function
    +
    7.20.5.1 The bsearch function
    Synopsis

    @@ -15345,7 +15292,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
     

    264) In practice, the entire array is sorted according to the comparison function. -

    7.20.5.2 The qsort function
    +
    7.20.5.2 The qsort function
    Synopsis

    @@ -15373,9 +15320,9 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      
     
     
    -

    7.20.6 Integer arithmetic functions

    +

    7.20.6 Integer arithmetic functions

    -
    7.20.6.1 The abs, labs and llabs functions
    +
    7.20.6.1 The abs, labs and llabs functions
    Synopsis

    @@ -15395,7 +15342,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
     

    265) The absolute value of the most negative number cannot be represented in two's complement. -

    7.20.6.2 The div, ldiv, and lldiv functions
    +
    7.20.6.2 The div, ldiv, and lldiv functions
    Synopsis

    @@ -15420,7 +15367,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      
     
     
    -

    7.20.7 Multibyte/wide character conversion functions

    +

    7.20.7 Multibyte/wide character conversion functions

    The behavior of the multibyte character functions is affected by the LC_CTYPE category of the current locale. For a state-dependent encoding, each function is placed into its @@ -15436,7 +15383,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 character codes, but are grouped with an adjacent multibyte character. -

    7.20.7.1 The mblen function
    +
    7.20.7.1 The mblen function
    Synopsis

    @@ -15466,7 +15413,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      
     
     
    -
    7.20.7.2 The mbtowc function
    +
    7.20.7.2 The mbtowc function
    Synopsis

    @@ -15497,7 +15444,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      In no case will the value returned be greater than n or the value of the MB_CUR_MAX
      macro.
     
    -
    7.20.7.3 The wctomb function
    +
    7.20.7.3 The wctomb function
    Synopsis

    @@ -15525,12 +15472,12 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
     

    In no case will the value returned be greater than the value of the MB_CUR_MAX macro. -

    7.20.8 Multibyte/wide string conversion functions

    +

    7.20.8 Multibyte/wide string conversion functions

    The behavior of the multibyte string functions is affected by the LC_CTYPE category of the current locale. -

    7.20.8.1 The mbstowcs function
    +
    7.20.8.1 The mbstowcs function
    Synopsis

    @@ -15565,7 +15512,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
     

    267) The array will not be null-terminated if the value returned is n. -

    7.20.8.2 The wcstombs function
    +
    7.20.8.2 The wcstombs function
    Synopsis

    @@ -15589,12 +15536,12 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      If a wide character is encountered that does not correspond to a valid multibyte character,
      the wcstombs function returns (size_t)(-1). Otherwise, the wcstombs function
      returns the number of bytes modified, not including a terminating null character, if
    - any.267)
    + any.267)
     
     
    -

    7.21 String handling

    +

    7.21 String handling

    -

    7.21.1 String function conventions

    +

    7.21.1 String function conventions

    The header <string.h> declares one type and several functions, and defines one macro useful for manipulating arrays of character type and other objects treated as arrays @@ -15619,9 +15566,9 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007

    268) See ''future library directions'' (7.26.11). -

    7.21.2 Copying functions

    +

    7.21.2 Copying functions

    -
    7.21.2.1 The memcpy function
    +
    7.21.2.1 The memcpy function
    Synopsis

    @@ -15643,7 +15590,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      
     
     
    -
    7.21.2.2 The memmove function
    +
    7.21.2.2 The memmove function
    Synopsis

    @@ -15660,7 +15607,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
     

    The memmove function returns the value of s1. -

    7.21.2.3 The strcpy function
    +
    7.21.2.3 The strcpy function
    Synopsis

    @@ -15676,7 +15623,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
     

    The strcpy function returns the value of s1. -

    7.21.2.4 The strncpy function
    +
    7.21.2.4 The strncpy function
    Synopsis

    @@ -15703,9 +15650,9 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      not be null-terminated.
     
     
    -

    7.21.3 Concatenation functions

    +

    7.21.3 Concatenation functions

    -
    7.21.3.1 The strcat function
    +
    7.21.3.1 The strcat function
    Synopsis

    @@ -15722,7 +15669,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
     

    The strcat function returns the value of s1. -

    7.21.3.2 The strncat function
    +
    7.21.3.2 The strncat function
    Synopsis

    @@ -15749,14 +15696,14 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      strlen(s1)+n+1.
     
     
    -

    7.21.4 Comparison functions

    +

    7.21.4 Comparison functions

    The sign of a nonzero value returned by the comparison functions memcmp, strcmp, and strncmp is determined by the sign of the difference between the values of the first pair of characters (both interpreted as unsigned char) that differ in the objects being compared. -

    7.21.4.1 The memcmp function
    +
    7.21.4.1 The memcmp function
    Synopsis

    @@ -15778,7 +15725,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      comparison.
     
     
    -
    7.21.4.2 The strcmp function
    +
    7.21.4.2 The strcmp function
    Synopsis

    @@ -15796,7 +15743,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
     
      pointed to by s2.
     
    -
    7.21.4.3 The strcoll function
    +
    7.21.4.3 The strcoll function
    Synopsis

    @@ -15812,7 +15759,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      accordingly as the string pointed to by s1 is greater than, equal to, or less than the string
      pointed to by s2 when both are interpreted as appropriate to the current locale.
     
    -
    7.21.4.4 The strncmp function
    +
    7.21.4.4 The strncmp function
    Synopsis

    @@ -15829,7 +15776,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      accordingly as the possibly null-terminated array pointed to by s1 is greater than, equal
      to, or less than the possibly null-terminated array pointed to by s2.
     
    -
    7.21.4.5 The strxfrm function
    +
    7.21.4.5 The strxfrm function
    Synopsis

    @@ -15860,9 +15807,9 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
             1 + strxfrm(NULL, s, 0)
    -

    7.21.5 Search functions

    +

    7.21.5 Search functions

    -
    7.21.5.1 The memchr function
    +
    7.21.5.1 The memchr function
    Synopsis

    @@ -15878,7 +15825,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      The memchr function returns a pointer to the located character, or a null pointer if the
      character does not occur in the object.
     
    -
    7.21.5.2 The strchr function
    +
    7.21.5.2 The strchr function
    Synopsis

    @@ -15895,7 +15842,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      character does not occur in the string.
     
     
    -
    7.21.5.3 The strcspn function
    +
    7.21.5.3 The strcspn function
    Synopsis

    @@ -15910,7 +15857,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
     

    The strcspn function returns the length of the segment. -

    7.21.5.4 The strpbrk function
    +
    7.21.5.4 The strpbrk function
    Synopsis

    @@ -15925,7 +15872,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      The strpbrk function returns a pointer to the character, or a null pointer if no character
      from s2 occurs in s1.
     
    -
    7.21.5.5 The strrchr function
    +
    7.21.5.5 The strrchr function
    Synopsis

    @@ -15942,7 +15889,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      occur in the string.
     
     
    -
    7.21.5.6 The strspn function
    +
    7.21.5.6 The strspn function
    Synopsis

    @@ -15956,7 +15903,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
     

    The strspn function returns the length of the segment. -

    7.21.5.7 The strstr function
    +
    7.21.5.7 The strstr function
    Synopsis

    @@ -15972,7 +15919,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      The strstr function returns a pointer to the located string, or a null pointer if the string
      is not found. If s2 points to a string with zero length, the function returns s1.
     
    -
    7.21.5.8 The strtok function
    +
    7.21.5.8 The strtok function
    Synopsis

    @@ -16020,9 +15967,9 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
              t   =   strtok(NULL, "?");      //   t   is a null pointer
    -

    7.21.6 Miscellaneous functions

    +

    7.21.6 Miscellaneous functions

    -
    7.21.6.1 The memset function
    +
    7.21.6.1 The memset function
    Synopsis

    @@ -16037,7 +15984,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      The memset function returns the value of s.
     
     
    -
    7.21.6.2 The strerror function
    +
    7.21.6.2 The strerror function
    Synopsis

    @@ -16056,7 +16003,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      specific. The array pointed to shall not be modified by the program, but may be
      overwritten by a subsequent call to the strerror function.
     
    -
    7.21.6.3 The strlen function
    +
    7.21.6.3 The strlen function
    Synopsis

    @@ -16071,7 +16018,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      character.
     
     
    -

    7.22 Type-generic math

    +

    7.22 Type-generic math

    The header <tgmath.h> includes the headers <math.h> and <complex.h> and defines several type-generic macros. @@ -16106,6 +16053,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007

              <math.h>          <complex.h>           type-generic
               function            function              macro
    +
                acos               cacos                acos
                asin               casin                asin
                atan               catan                atan
    @@ -16165,7 +16113,8 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      functions invoked by use of type-generic macros are shown in the following table:
     
     
    -                  macro use                                  invokes
    +                macro use                                  invokes
    +
                  exp(n)                              exp(n), the function
                  acosh(f)                            acoshf(f)
                  sin(d)                              sin(d), the function
    @@ -16196,9 +16145,9 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      the behavior is undefined.
     
     
    -

    7.23 Date and time

    +

    7.23 Date and time

    -

    7.23.1 Components of time

    +

    7.23.1 Components of time

    The header <time.h> defines two macros, and declares several types and functions for manipulating time. Many functions deal with a calendar time that represents the current @@ -16249,9 +16198,9 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007

    274) The range [0, 60] for tm_sec allows for a positive leap second. -

    7.23.2 Time manipulation functions

    +

    7.23.2 Time manipulation functions

    -
    7.23.2.1 The clock function
    +
    7.23.2.1 The clock function
    Synopsis

    @@ -16274,7 +16223,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      the program and its return value subtracted from the value returned by subsequent calls.
     
     
    -
    7.23.2.2 The difftime function
    +
    7.23.2.2 The difftime function
    Synopsis

    @@ -16293,7 +16242,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      
     
     
    -
    7.23.2.3 The mktime function
    +
    7.23.2.3 The mktime function
    Synopsis

    @@ -16350,7 +16299,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      causes it to attempt to determine whether Daylight Saving Time is in effect for the specified time.
     
     
    -
    7.23.2.4 The time function
    +
    7.23.2.4 The time function
    Synopsis

    @@ -16367,7 +16316,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      available. If timer is not a null pointer, the return value is also assigned to the object it
      points to.
     
    -

    7.23.3 Time conversion functions

    +

    7.23.3 Time conversion functions

    Except for the strftime function, these functions each return a pointer to one of two types of static objects: a broken-down time structure or an array of char. Execution of @@ -16376,7 +16325,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 previous call to any of them. The implementation shall behave as if no other library functions call these functions. -

    7.23.3.1 The asctime function
    +
    7.23.3.1 The asctime function
    Synopsis

    @@ -16390,9 +16339,9 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
     
             Sun Sep 16 01:03:52 1973\n\0
    using the equivalent of the following algorithm. +
      char *asctime(const struct tm *timeptr)
      {
    -
           static const char wday_name[7][3] = {
                "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
           };
    @@ -16407,13 +16356,14 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
                  timeptr->tm_mday, timeptr->tm_hour,
                  timeptr->tm_min, timeptr->tm_sec,
                  1900 + timeptr->tm_year);
    -        return result;
    + return result; } +
    Returns

    The asctime function returns a pointer to the string. -

    7.23.3.2 The ctime function
    +
    7.23.3.2 The ctime function
    Synopsis

    @@ -16432,7 +16382,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
     

    Forward references: the localtime function (7.23.3.4). -

    7.23.3.3 The gmtime function
    +
    7.23.3.3 The gmtime function
    Synopsis

    @@ -16447,7 +16397,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      The gmtime function returns a pointer to the broken-down time, or a null pointer if the
      specified time cannot be converted to UTC.
     
    -
    7.23.3.4 The localtime function
    +
    7.23.3.4 The localtime function
    Synopsis

    @@ -16462,7 +16412,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      The localtime function returns a pointer to the broken-down time, or a null pointer if
      the specified time cannot be converted to local time.
     
    -
    7.23.3.5 The strftime function
    +
    7.23.3.5 The strftime function
    Synopsis

    @@ -16489,125 +16439,102 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      of the current locale and by the values of zero or more members of the broken-down time
      structure pointed to by timeptr, as specified in brackets in the description. If any of
      the specified values is outside the normal range, the characters stored are unspecified.
    - %a    is replaced by the locale's abbreviated weekday name. [tm_wday]
    - %A    is replaced by the locale's full weekday name. [tm_wday]
    - %b    is replaced by the locale's abbreviated month name. [tm_mon]
    - %B    is replaced by the locale's full month name. [tm_mon]
    - %c    is replaced by the locale's appropriate date and time representation. [all specified
    -
    -       in 7.23.1]
    - %C is replaced by the year divided by 100 and truncated to an integer, as a decimal -
    -       number (00-99). [tm_year]
    - %d is replaced by the day of the month as a decimal number (01-31). [tm_mday] - %D is equivalent to ''%m/%d/%y''. [tm_mon, tm_mday, tm_year] - %e is replaced by the day of the month as a decimal number (1-31); a single digit is -
    -       preceded by a space. [tm_mday]
    - %F is equivalent to ''%Y-%m-%d'' (the ISO 8601 date format). [tm_year, tm_mon, -
    -       tm_mday]
    - %g is replaced by the last 2 digits of the week-based year (see below) as a decimal -
    -       number (00-99). [tm_year, tm_wday, tm_yday]
    - %G is replaced by the week-based year (see below) as a decimal number (e.g., 1997). -
    -       [tm_year, tm_wday, tm_yday]
    - %h is equivalent to ''%b''. [tm_mon] - %H is replaced by the hour (24-hour clock) as a decimal number (00-23). [tm_hour] - %I is replaced by the hour (12-hour clock) as a decimal number (01-12). [tm_hour] - %j is replaced by the day of the year as a decimal number (001-366). [tm_yday] - %m is replaced by the month as a decimal number (01-12). [tm_mon] - %M is replaced by the minute as a decimal number (00-59). [tm_min] - %n is replaced by a new-line character. - %p is replaced by the locale's equivalent of the AM/PM designations associated with a -
    -       12-hour clock. [tm_hour]
    - %r is replaced by the locale's 12-hour clock time. [tm_hour, tm_min, tm_sec] - %R is equivalent to ''%H:%M''. [tm_hour, tm_min] - %S is replaced by the second as a decimal number (00-60). [tm_sec] - %t is replaced by a horizontal-tab character. - %T is equivalent to ''%H:%M:%S'' (the ISO 8601 time format). [tm_hour, tm_min, +
    +
    %a
    is replaced by the locale's abbreviated weekday name. [tm_wday] +
    %A
    is replaced by the locale's full weekday name. [tm_wday] +
    %b
    is replaced by the locale's abbreviated month name. [tm_mon] +
    %B
    is replaced by the locale's full month name. [tm_mon] +
    %c
    is replaced by the locale's appropriate date and time representation. [all specified + in 7.23.1] +
    %C
    is replaced by the year divided by 100 and truncated to an integer, as a decimal + number (00-99). [tm_year] +
    %d
    is replaced by the day of the month as a decimal number (01-31). [tm_mday] +
    %D
    is equivalent to ''%m/%d/%y''. [tm_mon, tm_mday, tm_year] +
    %e
    is replaced by the day of the month as a decimal number (1-31); a single digit is + preceded by a space. [tm_mday] +
    %F
    is equivalent to ''%Y-%m-%d'' (the ISO 8601 date format). [tm_year, tm_mon, + tm_mday] +
    %g
    is replaced by the last 2 digits of the week-based year (see below) as a decimal + number (00-99). [tm_year, tm_wday, tm_yday] +
    %G
    is replaced by the week-based year (see below) as a decimal number (e.g., 1997). + [tm_year, tm_wday, tm_yday] +
    %h
    is equivalent to ''%b''. [tm_mon] +
    %H
    is replaced by the hour (24-hour clock) as a decimal number (00-23). [tm_hour] +
    %I
    is replaced by the hour (12-hour clock) as a decimal number (01-12). [tm_hour] +
    %j
    is replaced by the day of the year as a decimal number (001-366). [tm_yday] +
    %m
    is replaced by the month as a decimal number (01-12). [tm_mon] +
    %M
    is replaced by the minute as a decimal number (00-59). [tm_min] +
    %n
    is replaced by a new-line character. +
    %p
    is replaced by the locale's equivalent of the AM/PM designations associated with a + 12-hour clock. [tm_hour] +
    %r
    is replaced by the locale's 12-hour clock time. [tm_hour, tm_min, tm_sec] +
    %R
    is equivalent to ''%H:%M''. [tm_hour, tm_min] +
    %S
    is replaced by the second as a decimal number (00-60). [tm_sec] +
    %t
    is replaced by a horizontal-tab character. +
    %T
    is equivalent to ''%H:%M:%S'' (the ISO 8601 time format). [tm_hour, tm_min, -
    -       tm_sec]
    - %u is replaced by the ISO 8601 weekday as a decimal number (1-7), where Monday -
    -      is 1. [tm_wday]
    - %U is replaced by the week number of the year (the first Sunday as the first day of week -
    -      1) as a decimal number (00-53). [tm_year, tm_wday, tm_yday]
    - %V is replaced by the ISO 8601 week number (see below) as a decimal number -
    -      (01-53). [tm_year, tm_wday, tm_yday]
    - %w is replaced by the weekday as a decimal number (0-6), where Sunday is 0. -
    -      [tm_wday]
    - %W is replaced by the week number of the year (the first Monday as the first day of -
    -      week 1) as a decimal number (00-53). [tm_year, tm_wday, tm_yday]
    - %x is replaced by the locale's appropriate date representation. [all specified in 7.23.1] - %X is replaced by the locale's appropriate time representation. [all specified in 7.23.1] - %y is replaced by the last 2 digits of the year as a decimal number (00-99). -
    -      [tm_year]
    - %Y is replaced by the year as a decimal number (e.g., 1997). [tm_year] - %z is replaced by the offset from UTC in the ISO 8601 format ''-0430'' (meaning 4 -
    +       tm_sec]
    +
    %u
    is replaced by the ISO 8601 weekday as a decimal number (1-7), where Monday + is 1. [tm_wday] +
    %U
    is replaced by the week number of the year (the first Sunday as the first day of week + 1) as a decimal number (00-53). [tm_year, tm_wday, tm_yday] +
    %V
    is replaced by the ISO 8601 week number (see below) as a decimal number + (01-53). [tm_year, tm_wday, tm_yday] +
    %w
    is replaced by the weekday as a decimal number (0-6), where Sunday is 0. + [tm_wday] +
    %W
    is replaced by the week number of the year (the first Monday as the first day of + week 1) as a decimal number (00-53). [tm_year, tm_wday, tm_yday] +
    %x
    is replaced by the locale's appropriate date representation. [all specified in 7.23.1] +
    %X
    is replaced by the locale's appropriate time representation. [all specified in 7.23.1] +
    %y
    is replaced by the last 2 digits of the year as a decimal number (00-99). + [tm_year] +
    %Y
    is replaced by the year as a decimal number (e.g., 1997). [tm_year] +
    %z
    is replaced by the offset from UTC in the ISO 8601 format ''-0430'' (meaning 4 hours 30 minutes behind UTC, west of Greenwich), or by no characters if no time - zone is determinable. [tm_isdst]
    - %Z is replaced by the locale's time zone name or abbreviation, or by no characters if no -
    -      time zone is determinable. [tm_isdst]
    - %% is replaced by %. + zone is determinable. [tm_isdst] +
    %Z
    is replaced by the locale's time zone name or abbreviation, or by no characters if no + time zone is determinable. [tm_isdst] +
    %%
    is replaced by %. +

    Some conversion specifiers can be modified by the inclusion of an E or O modifier character to indicate an alternative format or specification. If the alternative format or specification does not exist for the current locale, the modifier is ignored. - %Ec is replaced by the locale's alternative date and time representation. - %EC is replaced by the name of the base year (period) in the locale's alternative -

    -     representation.
    - %Ex is replaced by the locale's alternative date representation. - %EX is replaced by the locale's alternative time representation. - %Ey is replaced by the offset from %EC (year only) in the locale's alternative -
    -     representation.
    - %EY is replaced by the locale's full alternative year representation. - %Od is replaced by the day of the month, using the locale's alternative numeric symbols -
    +
    +
    %Ec
    is replaced by the locale's alternative date and time representation. +
    %EC
    is replaced by the name of the base year (period) in the locale's alternative + representation. +
    %Ex
    is replaced by the locale's alternative date representation. +
    %EX
    is replaced by the locale's alternative time representation. +
    %Ey
    is replaced by the offset from %EC (year only) in the locale's alternative + representation. +
    %EY
    is replaced by the locale's full alternative year representation. +
    %Od
    is replaced by the day of the month, using the locale's alternative numeric symbols (filled as needed with leading zeros, or with leading spaces if there is no alternative - symbol for zero).
    - %Oe is replaced by the day of the month, using the locale's alternative numeric symbols -
    -     (filled as needed with leading spaces).
    - %OH is replaced by the hour (24-hour clock), using the locale's alternative numeric + symbol for zero). +
    %Oe
    is replaced by the day of the month, using the locale's alternative numeric symbols + (filled as needed with leading spaces). +
    %OH
    is replaced by the hour (24-hour clock), using the locale's alternative numeric -
    -     symbols.
    - %OI is replaced by the hour (12-hour clock), using the locale's alternative numeric -
    -     symbols.
    - %Om is replaced by the month, using the locale's alternative numeric symbols. - %OM is replaced by the minutes, using the locale's alternative numeric symbols. - %OS is replaced by the seconds, using the locale's alternative numeric symbols. - %Ou is replaced by the ISO 8601 weekday as a number in the locale's alternative -
    -     representation, where Monday is 1.
    - %OU is replaced by the week number, using the locale's alternative numeric symbols. - %OV is replaced by the ISO 8601 week number, using the locale's alternative numeric -
    -     symbols.
    - %Ow is replaced by the weekday as a number, using the locale's alternative numeric -
    -     symbols.
    - %OW is replaced by the week number of the year, using the locale's alternative numeric -
    -     symbols.
    - %Oy is replaced by the last 2 digits of the year, using the locale's alternative numeric + symbols. +
    %OI
    is replaced by the hour (12-hour clock), using the locale's alternative numeric + symbols. +
    %Om
    is replaced by the month, using the locale's alternative numeric symbols. +
    %OM
    is replaced by the minutes, using the locale's alternative numeric symbols. +
    %OS
    is replaced by the seconds, using the locale's alternative numeric symbols. +
    %Ou
    is replaced by the ISO 8601 weekday as a number in the locale's alternative + representation, where Monday is 1. +
    %OU
    is replaced by the week number, using the locale's alternative numeric symbols. +
    %OV
    is replaced by the ISO 8601 week number, using the locale's alternative numeric + symbols. +
    %Ow
    is replaced by the weekday as a number, using the locale's alternative numeric + symbols. +
    %OW
    is replaced by the week number of the year, using the locale's alternative numeric + symbols. +
    %Oy
    is replaced by the last 2 digits of the year, using the locale's alternative numeric + symbols. +

    -

    -     symbols.
    %g, %G, and %V give values according to the ISO 8601 week-based year. In this system, weeks begin on a Monday and week 1 of the year is the week that includes January 4th, which is also the week that includes the first Thursday of the year, and is also the first @@ -16622,16 +16549,18 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007

    In the "C" locale, the E and O modifiers are ignored and the replacement strings for the following specifiers are: - %a the first three characters of %A. - %A one of ''Sunday'', ''Monday'', ... , ''Saturday''. - %b the first three characters of %B. - %B one of ''January'', ''February'', ... , ''December''. - %c equivalent to ''%a %b %e %T %Y''. - %p one of ''AM'' or ''PM''. - %r equivalent to ''%I:%M:%S %p''. - %x equivalent to ''%m/%d/%y''. - %X equivalent to %T. - %Z implementation-defined. +

    +
    %a
    the first three characters of %A. +
    %A
    one of ''Sunday'', ''Monday'', ... , ''Saturday''. +
    %b
    the first three characters of %B. +
    %B
    one of ''January'', ''February'', ... , ''December''. +
    %c
    equivalent to ''%a %b %e %T %Y''. +
    %p
    one of ''AM'' or ''PM''. +
    %r
    equivalent to ''%I:%M:%S %p''. +
    %x
    equivalent to ''%m/%d/%y''. +
    %X
    equivalent to %T. +
    %Z
    implementation-defined. +
    Returns

    @@ -16641,9 +16570,9 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 zero is returned and the contents of the array are indeterminate. -

    7.24 Extended multibyte and wide character utilities

    +

    7.24 Extended multibyte and wide character utilities

    -

    7.24.1 Introduction

    +

    7.24.1 Introduction

    The header <wchar.h> declares four data types, one tag, four macros, and many functions.277) @@ -16700,7 +16629,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007

    279) The value of the macro WEOF may differ from that of EOF and need not be negative. -

    7.24.2 Formatted wide character input/output functions

    +

    7.24.2 Formatted wide character input/output functions

    The formatted wide character input/output functions shall behave as if there is a sequence point after the actions associated with each specifier.280) @@ -16709,7 +16638,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007

    280) The fwprintf functions perform writes to memory for the %n specifier. -

    7.24.2.1 The fwprintf function
    +
    7.24.2.1 The fwprintf function
    Synopsis

    @@ -16766,105 +16695,93 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      precision were omitted.
     

    The flag wide characters and their meanings are: - - The result of the conversion is left-justified within the field. (It is right-justified if -

    -          this flag is not specified.)
    - + The result of a signed conversion always begins with a plus or minus sign. (It -
    +
    +
    -
    The result of the conversion is left-justified within the field. (It is right-justified if + this flag is not specified.) +
    +
    The result of a signed conversion always begins with a plus or minus sign. (It begins with a sign only when a negative value is converted if this flag is not - specified.)282)
    - space If the first wide character of a signed conversion is not a sign, or if a signed -
    +          specified.)282)
    +
    space
    If the first wide character of a signed conversion is not a sign, or if a signed conversion results in no wide characters, a space is prefixed to the result. If the - space and + flags both appear, the space flag is ignored.
    - # The result is converted to an ''alternative form''. For o conversion, it increases -
    +       space and + flags both appear, the space flag is ignored.
    +
    #
    The result is converted to an ''alternative form''. For o conversion, it increases the precision, if and only if necessary, to force the first digit of the result to be a zero (if the value and precision are both 0, a single 0 is printed). For x (or X) - conversion, a nonzero result has 0x (or 0X) prefixed to it. For a, A, e, E, f, F, g,
    + conversion, a nonzero result has 0x (or 0X) prefixed to it. For a, A, e, E, f, F, g, -
                and G conversions, the result of converting a floating-point number always
                contains a decimal-point wide character, even if no digits follow it. (Normally, a
                decimal-point wide character appears in the result of these conversions only if a
                digit follows it.) For g and G conversions, trailing zeros are not removed from the
    -           result. For other conversions, the behavior is undefined.
    - 0 For d, i, o, u, x, X, a, A, e, E, f, F, g, and G conversions, leading zeros -

    -

    +           result. For other conversions, the behavior is undefined.
    +
    0
    For d, i, o, u, x, X, a, A, e, E, f, F, g, and G conversions, leading zeros (following any indication of sign or base) are used to pad to the field width rather than performing space padding, except when converting an infinity or NaN. If the 0 and - flags both appear, the 0 flag is ignored. For d, i, o, u, x, and X conversions, if a precision is specified, the 0 flag is ignored. For other - conversions, the behavior is undefined.
    + conversions, the behavior is undefined. + +

    The length modifiers and their meanings are: - hh Specifies that a following d, i, o, u, x, or X conversion specifier applies to a -

    +
    +
    hh
    Specifies that a following d, i, o, u, x, or X conversion specifier applies to a signed char or unsigned char argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to signed char or unsigned char before printing); or that a following n conversion specifier applies to a pointer to a signed char - argument.
    - h Specifies that a following d, i, o, u, x, or X conversion specifier applies to a -
    +                argument.
    +
    h
    Specifies that a following d, i, o, u, x, or X conversion specifier applies to a short int or unsigned short int argument (the argument will have been promoted according to the integer promotions, but its value shall be converted to short int or unsigned short int before printing); or that a following n conversion specifier applies to a pointer to a short - int argument.
    - l (ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a -
    +                int argument.
    +
    l (ell)
    Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long int or unsigned long int argument; that a following n conversion specifier applies to a pointer to a long int argument; that a following c conversion specifier applies to a wint_t argument; that a following s conversion specifier applies to a pointer to a wchar_t argument; or has no effect on a following a, A, e, E, f, F, g, or G conversion - specifier.
    - ll (ell-ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a -
    +                specifier.
    +
    ll (ell-ell)
    Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long long int or unsigned long long int argument; or that a following n conversion specifier applies to a pointer to a long long int - argument.
    - j Specifies that a following d, i, o, u, x, or X conversion specifier applies to + argument. +
    j
    Specifies that a following d, i, o, u, x, or X conversion specifier applies to -
                     an intmax_t or uintmax_t argument; or that a following n conversion
    -                specifier applies to a pointer to an intmax_t argument.
    - z Specifies that a following d, i, o, u, x, or X conversion specifier applies to a -
    +                specifier applies to a pointer to an intmax_t argument.
    +
    z
    Specifies that a following d, i, o, u, x, or X conversion specifier applies to a size_t or the corresponding signed integer type argument; or that a following n conversion specifier applies to a pointer to a signed integer type - corresponding to size_t argument.
    - t Specifies that a following d, i, o, u, x, or X conversion specifier applies to a -
    +             corresponding to size_t argument.
    +
    t
    Specifies that a following d, i, o, u, x, or X conversion specifier applies to a ptrdiff_t or the corresponding unsigned integer type argument; or that a following n conversion specifier applies to a pointer to a ptrdiff_t - argument.
    - L Specifies that a following a, A, e, E, f, F, g, or G conversion specifier -
    -             applies to a long double argument.
    + argument. +
    L
    Specifies that a following a, A, e, E, f, F, g, or G conversion specifier + applies to a long double argument. + If a length modifier appears with any conversion specifier other than as specified above, the behavior is undefined.

    The conversion specifiers and their meanings are: - d,i The int argument is converted to signed decimal in the style [-]dddd. The -

    +
    +
    d,i
    The int argument is converted to signed decimal in the style [-]dddd. The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it is expanded with leading zeros. The default precision is 1. The result of converting a zero - value with a precision of zero is no wide characters.
    - o,u,x,X The unsigned int argument is converted to unsigned octal (o), unsigned -
    +            value with a precision of zero is no wide characters.
    +
    o,u,x,X
    The unsigned int argument is converted to unsigned octal (o), unsigned decimal (u), or unsigned hexadecimal notation (x or X) in the style dddd; the letters abcdef are used for x conversion and the letters ABCDEF for X conversion. The precision specifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it is expanded with leading zeros. The default precision is 1. The result of converting a - zero value with a precision of zero is no wide characters.
    - f,F A double argument representing a floating-point number is converted to + zero value with a precision of zero is no wide characters. +
    f,F
    A double argument representing a floating-point number is converted to -
                 decimal notation in the style [-]ddd.ddd, where the number of digits after
                 the decimal-point wide character is equal to the precision specification. If the
                 precision is missing, it is taken as 6; if the precision is zero and the # flag is
    @@ -16877,9 +16794,8 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
                 [-]nan or [-]nan(n-wchar-sequence) -- which style, and the meaning of
                 any n-wchar-sequence, is implementation-defined. The F conversion
                 specifier produces INF, INFINITY, or NAN instead of inf, infinity, or
    -              nan, respectively.283)
    - e,E A double argument representing a floating-point number is converted in the -
    +              nan, respectively.283)
    +
    e,E
    A double argument representing a floating-point number is converted in the style [-]d.ddd e(+-)dd, where there is one digit (which is nonzero if the argument is nonzero) before the decimal-point wide character and the number of digits after it is equal to the precision; if the precision is missing, it is taken @@ -16890,32 +16806,29 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 and only as many more digits as necessary to represent the exponent. If the value is zero, the exponent is zero. A double argument representing an infinity or NaN is converted in the style - of an f or F conversion specifier.
    - g,G A double argument representing a floating-point number is converted in -
    +              of an f or F conversion specifier.
    +
    g,G
    A double argument representing a floating-point number is converted in style f or e (or in style F or E in the case of a G conversion specifier), depending on the value converted and the precision. Let P equal the precision if nonzero, 6 if the precision is omitted, or 1 if the precision is zero. Then, if a conversion with style E would have an exponent of X : - -- if P > X >= -4, the conversion is with style f (or F) and precision +
      +
    • if P > X >= -4, the conversion is with style f (or F) and precision P - (X + 1). - -- otherwise, the conversion is with style e (or E) and precision P - 1. +
    • otherwise, the conversion is with style e (or E) and precision P - 1. +
    Finally, unless the # flag is used, any trailing zeros are removed from the fractional portion of the result and the decimal-point wide character is removed if there is no fractional portion remaining. A double argument representing an infinity or NaN is converted in the style - of an f or F conversion specifier.
    - a,A A double argument representing a floating-point number is converted in the -
    +              of an f or F conversion specifier.
    +
    a,A
    A double argument representing a floating-point number is converted in the style [-]0xh.hhhh p(+-)d, where there is one hexadecimal digit (which is nonzero if the argument is a normalized floating-point number and is otherwise unspecified) before the decimal-point wide character284) and the number of hexadecimal digits after it is equal to the precision; if the precision - is missing and FLT_RADIX is a power of 2, then the precision is sufficient
    - - + is missing and FLT_RADIX is a power of 2, then the precision is sufficient -
                   for an exact representation of the value; if the precision is missing and
                   FLT_RADIX is not a power of 2, then the precision is sufficient to
                   distinguish285) values of type double, except that trailing zeros may be
    @@ -16927,14 +16840,12 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
                   represent the decimal exponent of 2. If the value is zero, the exponent is
                   zero.
                   A double argument representing an infinity or NaN is converted in the style
    -              of an f or F conversion specifier.
    - c If no l length modifier is present, the int argument is converted to a wide -
    +              of an f or F conversion specifier.
    +
    c
    If no l length modifier is present, the int argument is converted to a wide character as if by calling btowc and the resulting wide character is written. If an l length modifier is present, the wint_t argument is converted to - wchar_t and written.
    - s If no l length modifier is present, the argument shall be a pointer to the initial -
    +              wchar_t and written.
    +
    s
    If no l length modifier is present, the argument shall be a pointer to the initial element of a character array containing a multibyte character sequence beginning in the initial shift state. Characters from the array are converted as if by repeated calls to the mbrtowc function, with the conversion state @@ -16949,24 +16860,20 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 written up to (but not including) a terminating null wide character. If the precision is specified, no more than that many wide characters are written. If the precision is not specified or is greater than the size of the array, the array - shall contain a null wide character.
    - p The argument shall be a pointer to void. The value of the pointer is -
    -              converted to a sequence of printing wide characters, in an implementation-
    - + shall contain a null wide character. +
    p
    The argument shall be a pointer to void. The value of the pointer is + converted to a sequence of printing wide characters, in an implementation- -
    -                defined manner.
    - n The argument shall be a pointer to signed integer into which is written the -
    +                defined manner.
    +
    n
    The argument shall be a pointer to signed integer into which is written the number of wide characters written to the output stream so far by this call to fwprintf. No argument is converted, but one is consumed. If the conversion specification includes any flags, a field width, or a precision, the - behavior is undefined.
    - % A % wide character is written. No argument is converted. The complete + behavior is undefined. +
    %
    A % wide character is written. No argument is converted. The complete + conversion specification shall be %%. +

    -

    -                conversion specification shall be %%.
    If a conversion specification is invalid, the behavior is undefined.286) If any argument is not the correct type for the corresponding conversion specification, the behavior is undefined. @@ -16977,7 +16884,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007

    For a and A conversions, if FLT_RADIX is a power of 2, the value is correctly rounded to a hexadecimal floating number with the given precision. - Recommended practice +

    Recommended practice

    For a and A conversions, if FLT_RADIX is not a power of 2 and the result is not exactly representable in the given precision, the result should be one of the two adjacent numbers @@ -16998,7 +16905,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 value if an output or encoding error occurred. - Environmental limits +

    Environmental limits

    The number of wide characters that can be produced by any single conversion shall be at least 4095. @@ -17031,7 +16938,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007

    284) Binary implementations can choose the hexadecimal digit to the left of the decimal-point wide character so that subsequent digits align to nibble (4-bit) boundaries. -

    285) The precision p is sufficient to distinguish values of the source type if 16 p-1 > b n where b is +

    285) The precision p is sufficient to distinguish values of the source type if 16p-1 > b n where b is FLT_RADIX and n is the number of base-b digits in the significand of the source type. A smaller p might suffice depending on the implementation's scheme for determining the digit to the left of the decimal-point wide character. @@ -17043,7 +16950,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 the case of fixed-point conversion by the source value as well. -

    7.24.2.2 The fwscanf function
    +
    7.24.2.2 The fwscanf function
    Synopsis

    @@ -17118,73 +17025,61 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      represented in the object, the behavior is undefined.
     

    The length modifiers and their meanings are: - hh Specifies that a following d, i, o, u, x, X, or n conversion specifier applies -

    -             to an argument with type pointer to signed char or unsigned char.
    - h Specifies that a following d, i, o, u, x, X, or n conversion specifier applies -
    +
    +
    hh
    Specifies that a following d, i, o, u, x, X, or n conversion specifier applies + to an argument with type pointer to signed char or unsigned char. +
    h
    Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to short int or unsigned short - int.
    - l (ell) Specifies that a following d, i, o, u, x, X, or n conversion specifier applies -
    +             int.
    +
    l (ell)
    Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to long int or unsigned long int; that a following a, A, e, E, f, F, g, or G conversion specifier applies to an argument with type pointer to double; or that a following c, s, or [ - conversion specifier applies to an argument with type pointer to wchar_t.
    - ll (ell-ell) Specifies that a following d, i, o, u, x, X, or n conversion specifier applies -
    +             conversion specifier applies to an argument with type pointer to wchar_t.
    +
    ll (ell-ell)
    Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to long long int or unsigned - long long int.
    - j Specifies that a following d, i, o, u, x, X, or n conversion specifier applies -
    -             to an argument with type pointer to intmax_t or uintmax_t.
    - z Specifies that a following d, i, o, u, x, X, or n conversion specifier applies -
    +              long long int.
    +
    j
    Specifies that a following d, i, o, u, x, X, or n conversion specifier applies + to an argument with type pointer to intmax_t or uintmax_t. +
    z
    Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to size_t or the corresponding signed - integer type.
    - t Specifies that a following d, i, o, u, x, X, or n conversion specifier applies -
    +             integer type.
    +
    t
    Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to ptrdiff_t or the corresponding - unsigned integer type.
    - L Specifies that a following a, A, e, E, f, F, g, or G conversion specifier -
    -             applies to an argument with type pointer to long double.
    + unsigned integer type. +
    L
    Specifies that a following a, A, e, E, f, F, g, or G conversion specifier + applies to an argument with type pointer to long double. + If a length modifier appears with any conversion specifier other than as specified above, the behavior is undefined.

    The conversion specifiers and their meanings are: - d Matches an optionally signed decimal integer, whose format is the same as -

    +
    +
    d
    Matches an optionally signed decimal integer, whose format is the same as expected for the subject sequence of the wcstol function with the value 10 for the base argument. The corresponding argument shall be a pointer to - signed integer.
    - i Matches an optionally signed integer, whose format is the same as expected + signed integer. +
    i
    Matches an optionally signed integer, whose format is the same as expected -
                 for the subject sequence of the wcstol function with the value 0 for the
                 base argument. The corresponding argument shall be a pointer to signed
    -             integer.
    - o Matches an optionally signed octal integer, whose format is the same as -
    +             integer.
    +
    o
    Matches an optionally signed octal integer, whose format is the same as expected for the subject sequence of the wcstoul function with the value 8 for the base argument. The corresponding argument shall be a pointer to - unsigned integer.
    - u Matches an optionally signed decimal integer, whose format is the same as -
    +             unsigned integer.
    +
    u
    Matches an optionally signed decimal integer, whose format is the same as expected for the subject sequence of the wcstoul function with the value 10 for the base argument. The corresponding argument shall be a pointer to - unsigned integer.
    - x Matches an optionally signed hexadecimal integer, whose format is the same -
    +             unsigned integer.
    +
    x
    Matches an optionally signed hexadecimal integer, whose format is the same as expected for the subject sequence of the wcstoul function with the value 16 for the base argument. The corresponding argument shall be a pointer to - unsigned integer.
    - a,e,f,g Matches an optionally signed floating-point number, infinity, or NaN, whose -
    +             unsigned integer.
    +
    a,e,f,g
    Matches an optionally signed floating-point number, infinity, or NaN, whose format is the same as expected for the subject sequence of the wcstod - function. The corresponding argument shall be a pointer to floating.
    - c Matches a sequence of wide characters of exactly the number specified by the -
    +         function. The corresponding argument shall be a pointer to floating.
    +
    c
    Matches a sequence of wide characters of exactly the number specified by the field width (1 if no field width is present in the directive). If no l length modifier is present, characters from the input field are converted as if by repeated calls to the wcrtomb function, with the @@ -17194,10 +17089,9 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 accept the sequence. No null character is added. If an l length modifier is present, the corresponding argument shall be a pointer to the initial element of an array of wchar_t large enough to accept - the sequence. No null wide character is added.
    - s Matches a sequence of non-white-space wide characters. + the sequence. No null wide character is added. +
    s
    Matches a sequence of non-white-space wide characters. -
                  If no l length modifier is present, characters from the input field are
                  converted as if by repeated calls to the wcrtomb function, with the
                  conversion state described by an mbstate_t object initialized to zero
    @@ -17208,9 +17102,8 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
                  If an l length modifier is present, the corresponding argument shall be a
                  pointer to the initial element of an array of wchar_t large enough to accept
               the sequence and the terminating null wide character, which will be added
    -          automatically.
    - [ Matches a nonempty sequence of wide characters from a set of expected -
    +          automatically.
    +
    [
    Matches a nonempty sequence of wide characters from a set of expected characters (the scanset). If no l length modifier is present, characters from the input field are converted as if by repeated calls to the wcrtomb function, with the @@ -17234,29 +17127,27 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 the specification; otherwise the first following right bracket wide character is the one that ends the specification. If a - wide character is in the scanlist and is not the first, nor the second where the first wide character is a ^, nor the - last character, the behavior is implementation-defined.
    - p Matches an implementation-defined set of sequences, which should be the -
    +          last character, the behavior is implementation-defined.
    +
    p
    Matches an implementation-defined set of sequences, which should be the same as the set of sequences that may be produced by the %p conversion of the fwprintf function. The corresponding argument shall be a pointer to a pointer to void. The input item is converted to a pointer value in an implementation-defined manner. If the input item is a value converted earlier during the same program execution, the pointer that results shall compare - equal to that value; otherwise the behavior of the %p conversion is undefined.
    - n No input is consumed. The corresponding argument shall be a pointer to + equal to that value; otherwise the behavior of the %p conversion is undefined. +
    n
    No input is consumed. The corresponding argument shall be a pointer to -
               signed integer into which is to be written the number of wide characters read
               from the input stream so far by this call to the fwscanf function. Execution
               of a %n directive does not increment the assignment count returned at the
               completion of execution of the fwscanf function. No argument is
                     converted, but one is consumed. If the conversion specification includes an
                     assignment-suppressing wide character or a field width, the behavior is
    -                undefined.
    - % Matches a single % wide character; no conversion or assignment occurs. The + undefined. +
    %
    Matches a single % wide character; no conversion or assignment occurs. The + complete conversion specification shall be %%. +

    -

    -                complete conversion specification shall be %%.
    If a conversion specification is invalid, the behavior is undefined.290)

    The conversion specifiers A, E, F, G, and X are also valid and behave the same as, @@ -17314,7 +17205,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007

    290) See ''future library directions'' (7.26.12). -

    7.24.2.3 The swprintf function
    +
    7.24.2.3 The swprintf function
    Synopsis

    @@ -17334,7 +17225,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      counting the terminating null wide character, or a negative value if an encoding error
      occurred or if n or more wide characters were requested to be written.
     
    -
    7.24.2.4 The swscanf function
    +
    7.24.2.4 The swscanf function
    Synopsis

    @@ -17355,7 +17246,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      early matching failure.
     
     
    -
    7.24.2.5 The vfwprintf function
    +
    7.24.2.5 The vfwprintf function
    Synopsis

    @@ -17403,7 +17294,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      invoke the va_arg macro, the value of arg after the return is indeterminate.
     
     
    -
    7.24.2.6 The vfwscanf function
    +
    7.24.2.6 The vfwscanf function
    Synopsis

    @@ -17418,7 +17309,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      The vfwscanf function is equivalent to fwscanf, with the variable argument list
      replaced by arg, which shall have been initialized by the va_start macro (and
      possibly subsequent va_arg calls). The vfwscanf function does not invoke the
    - va_end macro.291)
    + va_end macro.291)
     
    Returns

    The vfwscanf function returns the value of the macro EOF if an input failure occurs @@ -17426,7 +17317,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 items assigned, which can be fewer than provided for, or even zero, in the event of an early matching failure. -

    7.24.2.7 The vswprintf function
    +
    7.24.2.7 The vswprintf function
    Synopsis

    @@ -17441,7 +17332,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      The vswprintf function is equivalent to swprintf, with the variable argument list
      replaced by arg, which shall have been initialized by the va_start macro (and
      possibly subsequent va_arg calls). The vswprintf function does not invoke the
    - va_end macro.291)
    + va_end macro.291)
     
    Returns

    The vswprintf function returns the number of wide characters written in the array, not @@ -17449,7 +17340,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 occurred or if n or more wide characters were requested to be generated. -

    7.24.2.8 The vswscanf function
    +
    7.24.2.8 The vswscanf function
    Synopsis

    @@ -17463,7 +17354,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      The vswscanf function is equivalent to swscanf, with the variable argument list
      replaced by arg, which shall have been initialized by the va_start macro (and
      possibly subsequent va_arg calls). The vswscanf function does not invoke the
    - va_end macro.291)
    + va_end macro.291)
     
    Returns

    The vswscanf function returns the value of the macro EOF if an input failure occurs @@ -17471,7 +17362,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 items assigned, which can be fewer than provided for, or even zero, in the event of an early matching failure. -

    7.24.2.9 The vwprintf function
    +
    7.24.2.9 The vwprintf function
    Synopsis

    @@ -17484,14 +17375,14 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      The vwprintf function is equivalent to wprintf, with the variable argument list
      replaced by arg, which shall have been initialized by the va_start macro (and
      possibly subsequent va_arg calls). The vwprintf function does not invoke the
    - va_end macro.291)
    + va_end macro.291)
     
    Returns

    The vwprintf function returns the number of wide characters transmitted, or a negative value if an output or encoding error occurred. -

    7.24.2.10 The vwscanf function
    +
    7.24.2.10 The vwscanf function
    Synopsis

    @@ -17504,7 +17395,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      The vwscanf function is equivalent to wscanf, with the variable argument list
      replaced by arg, which shall have been initialized by the va_start macro (and
      possibly subsequent va_arg calls). The vwscanf function does not invoke the
    - va_end macro.291)
    + va_end macro.291)
     
    Returns

    The vwscanf function returns the value of the macro EOF if an input failure occurs @@ -17512,7 +17403,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 items assigned, which can be fewer than provided for, or even zero, in the event of an early matching failure. -

    7.24.2.11 The wprintf function
    +
    7.24.2.11 The wprintf function
    Synopsis

    @@ -17527,7 +17418,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      The wprintf function returns the number of wide characters transmitted, or a negative
      value if an output or encoding error occurred.
     
    -
    7.24.2.12 The wscanf function
    +
    7.24.2.12 The wscanf function
    Synopsis

    @@ -17545,9 +17436,9 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      items assigned, which can be fewer than provided for, or even zero, in the event of an
      early matching failure.
     
    -

    7.24.3 Wide character input/output functions

    +

    7.24.3 Wide character input/output functions

    -
    7.24.3.1 The fgetwc function
    +
    7.24.3.1 The fgetwc function
    Synopsis

    @@ -17574,7 +17465,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      Also, errno will be set to EILSEQ by input/output functions only if an encoding error occurs.
     
     
    -
    7.24.3.2 The fgetws function
    +
    7.24.3.2 The fgetws function
    Synopsis

    @@ -17599,7 +17490,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      null pointer is returned. If a read or encoding error occurs during the operation, the array
      contents are indeterminate and a null pointer is returned.
     
    -
    7.24.3.3 The fputwc function
    +
    7.24.3.3 The fputwc function
    Synopsis

    @@ -17619,7 +17510,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      error indicator for the stream is set and fputwc returns WEOF. If an encoding error
      occurs, the value of the macro EILSEQ is stored in errno and fputwc returns WEOF.
     
    -
    7.24.3.4 The fputws function
    +
    7.24.3.4 The fputws function
    Synopsis

    @@ -17637,7 +17528,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      returns a nonnegative value.
     
     
    -
    7.24.3.5 The fwide function
    +
    7.24.3.5 The fwide function
    Synopsis

    @@ -17660,7 +17551,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
     

    293) If the orientation of the stream has already been determined, fwide does not change it. -

    7.24.3.6 The getwc function
    +
    7.24.3.6 The getwc function
    Synopsis

    @@ -17677,7 +17568,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      The getwc function returns the next wide character from the input stream pointed to by
      stream, or WEOF.
     
    -
    7.24.3.7 The getwchar function
    +
    7.24.3.7 The getwchar function
    Synopsis

    @@ -17696,7 +17587,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      The getwchar function returns the next wide character from the input stream pointed to
      by stdin, or WEOF.
     
    -
    7.24.3.8 The putwc function
    +
    7.24.3.8 The putwc function
    Synopsis

    @@ -17712,7 +17603,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
     

    The putwc function returns the wide character written, or WEOF. -

    7.24.3.9 The putwchar function
    +
    7.24.3.9 The putwchar function
    Synopsis

    @@ -17725,7 +17616,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
     

    The putwchar function returns the character written, or WEOF. -

    7.24.3.10 The ungetwc function
    +
    7.24.3.10 The ungetwc function
    Synopsis

    @@ -17762,7 +17653,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      The ungetwc function returns the wide character pushed back, or WEOF if the operation
      fails.
     
    -

    7.24.4 General wide string utilities

    +

    7.24.4 General wide string utilities

    The header <wchar.h> declares a number of functions useful for wide string manipulation. Various methods are used for determining the lengths of the arrays, but in @@ -17778,9 +17669,9 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 zero wide characters. -

    7.24.4.1 Wide string numeric conversion functions
    +
    7.24.4.1 Wide string numeric conversion functions
    -
    7.24.4.1.1 The wcstod, wcstof, and wcstold functions
    +
    7.24.4.1.1 The wcstod, wcstof, and wcstold functions
    Synopsis

    @@ -17812,7 +17703,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      decimal-point wide character, then an optional binary exponent part as defined in
      6.4.4.2;
     
  • INF or INFINITY, or any other wide string equivalent except for case -
  • NAN or NAN(n-wchar-sequenceopt), or any other wide string equivalent except for +
  • NAN or NAN(n-wchar-sequenceopt), or any other wide string equivalent except for case in the NAN part, where:
               n-wchar-sequence:
    @@ -17838,7 +17729,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      sign, the sequence is interpreted as negated.294) A wide character sequence INF or
      INFINITY is interpreted as an infinity, if representable in the return type, else like a
      floating constant that is too large for the range of the return type. A wide character
    - sequence NAN or NAN(n-wchar-sequenceopt) is interpreted as a quiet NaN, if supported
    + sequence NAN or NAN(n-wchar-sequenceopt) is interpreted as a quiet NaN, if supported
      in the return type, else like a subject sequence part that does not have the expected form;
      the meaning of the n-wchar sequences is implementation-defined.295) A pointer to the
      final wide string is stored in the object pointed to by endptr, provided that endptr is
    @@ -17853,7 +17744,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      If the subject sequence is empty or does not have the expected form, no conversion is
      performed; the value of nptr is stored in the object pointed to by endptr, provided
      that endptr is not a null pointer.
    - Recommended practice
    +
    Recommended practice

    If the subject sequence has the hexadecimal form, FLT_RADIX is not a power of 2, and the result is not exactly representable, the result should be one of the two numbers in the @@ -17902,7 +17793,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 to the same internal floating value, but if not will round to adjacent values. -

    7.24.4.1.2 The wcstol, wcstoll, wcstoul, and wcstoull functions
    +
    7.24.4.1.2 The wcstol, wcstoll, wcstoul, and wcstoull functions
    Synopsis

    @@ -17976,9 +17867,9 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      LLONG_MAX, ULONG_MAX, or ULLONG_MAX is returned (according to the return type
      sign of the value, if any), and the value of the macro ERANGE is stored in errno.
     
    -
    7.24.4.2 Wide string copying functions
    +
    7.24.4.2 Wide string copying functions
    -
    7.24.4.2.1 The wcscpy function
    +
    7.24.4.2.1 The wcscpy function
    Synopsis

    @@ -17994,7 +17885,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      The wcscpy function returns the value of s1.
     
     
    -
    7.24.4.2.2 The wcsncpy function
    +
    7.24.4.2.2 The wcsncpy function
    Synopsis

    @@ -18020,7 +17911,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      result will not be null-terminated.
     
     
    -
    7.24.4.2.3 The wmemcpy function
    +
    7.24.4.2.3 The wmemcpy function
    Synopsis

    @@ -18041,7 +17932,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      
     
     
    -
    7.24.4.2.4 The wmemmove function
    +
    7.24.4.2.4 The wmemmove function
    Synopsis

    @@ -18059,9 +17950,9 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
     

    The wmemmove function returns the value of s1. -

    7.24.4.3 Wide string concatenation functions
    +
    7.24.4.3 Wide string concatenation functions
    -
    7.24.4.3.1 The wcscat function
    +
    7.24.4.3.1 The wcscat function
    Synopsis

    @@ -18077,7 +17968,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
     

    The wcscat function returns the value of s1. -

    7.24.4.3.2 The wcsncat function
    +
    7.24.4.3.2 The wcsncat function
    Synopsis

    @@ -18102,13 +17993,13 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      wcslen(s1)+n+1.
     
     
    -
    7.24.4.4 Wide string comparison functions
    +
    7.24.4.4 Wide string comparison functions

    Unless explicitly stated otherwise, the functions described in this subclause order two wide characters the same way as two integers of the underlying integer type designated by wchar_t. -

    7.24.4.4.1 The wcscmp function
    +
    7.24.4.4.1 The wcscmp function
    Synopsis

    @@ -18124,7 +18015,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      accordingly as the wide string pointed to by s1 is greater than, equal to, or less than the
      wide string pointed to by s2.
     
    -
    7.24.4.4.2 The wcscoll function
    +
    7.24.4.4.2 The wcscoll function
    Synopsis

    @@ -18145,7 +18036,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      wide string pointed to by s2 when both are interpreted as appropriate to the current
      locale.
     
    -
    7.24.4.4.3 The wcsncmp function
    +
    7.24.4.4.3 The wcsncmp function
    Synopsis

    @@ -18163,7 +18054,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      accordingly as the possibly null-terminated array pointed to by s1 is greater than, equal
      to, or less than the possibly null-terminated array pointed to by s2.
     
    -
    7.24.4.4.4 The wcsxfrm function
    +
    7.24.4.4.4 The wcsxfrm function
    Synopsis

    @@ -18193,7 +18084,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
             1 + wcsxfrm(NULL, s, 0)
    -
    7.24.4.4.5 The wmemcmp function
    +
    7.24.4.4.5 The wmemcmp function
    Synopsis

    @@ -18210,9 +18101,9 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      accordingly as the object pointed to by s1 is greater than, equal to, or less than the object
      pointed to by s2.
     
    -
    7.24.4.5 Wide string search functions
    +
    7.24.4.5 Wide string search functions
    -
    7.24.4.5.1 The wcschr function
    +
    7.24.4.5.1 The wcschr function
    Synopsis

    @@ -18227,7 +18118,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      The wcschr function returns a pointer to the located wide character, or a null pointer if
      the wide character does not occur in the wide string.
     
    -
    7.24.4.5.2 The wcscspn function
    +
    7.24.4.5.2 The wcscspn function
    Synopsis

    @@ -18243,7 +18134,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
     

    The wcscspn function returns the length of the segment. -

    7.24.4.5.3 The wcspbrk function
    +
    7.24.4.5.3 The wcspbrk function
    Synopsis

    @@ -18258,7 +18149,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      The wcspbrk function returns a pointer to the wide character in s1, or a null pointer if
      no wide character from s2 occurs in s1.
     
    -
    7.24.4.5.4 The wcsrchr function
    +
    7.24.4.5.4 The wcsrchr function
    Synopsis

    @@ -18273,7 +18164,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      The wcsrchr function returns a pointer to the wide character, or a null pointer if c does
      not occur in the wide string.
     
    -
    7.24.4.5.5 The wcsspn function
    +
    7.24.4.5.5 The wcsspn function
    Synopsis

    @@ -18289,7 +18180,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      The wcsspn function returns the length of the segment.
     
     
    -
    7.24.4.5.6 The wcsstr function
    +
    7.24.4.5.6 The wcsstr function
    Synopsis

    @@ -18306,7 +18197,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      wide string is not found. If s2 points to a wide string with zero length, the function
      returns s1.
     
    -
    7.24.4.5.7 The wcstok function
    +
    7.24.4.5.7 The wcstok function
    Synopsis

    @@ -18363,7 +18254,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
             t   =   wcstok(NULL,   L"?", &ptr1);          //   t   is a null pointer
    -
    7.24.4.5.8 The wmemchr function
    +
    7.24.4.5.8 The wmemchr function
    Synopsis

    @@ -18380,9 +18271,9 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      the wide character does not occur in the object.
     
     
    -
    7.24.4.6 Miscellaneous functions
    +
    7.24.4.6 Miscellaneous functions
    -
    7.24.4.6.1 The wcslen function
    +
    7.24.4.6.1 The wcslen function
    Synopsis

    @@ -18396,7 +18287,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      The wcslen function returns the number of wide characters that precede the terminating
      null wide character.
     
    -
    7.24.4.6.2 The wmemset function
    +
    7.24.4.6.2 The wmemset function
    Synopsis

    @@ -18410,9 +18301,9 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
     

    The wmemset function returns the value of s. -

    7.24.5 Wide character time conversion functions

    +

    7.24.5 Wide character time conversion functions

    -
    7.24.5.1 The wcsftime function
    +
    7.24.5.1 The wcsftime function
    Synopsis

    @@ -18442,7 +18333,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      wide character. Otherwise, zero is returned and the contents of the array are
      indeterminate.
     
    -

    7.24.6 Extended multibyte/wide character conversion utilities

    +

    7.24.6 Extended multibyte/wide character conversion utilities

    The header <wchar.h> declares an extended set of functions useful for conversion between multibyte characters and wide characters. @@ -18479,9 +18370,9 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 character string. -

    7.24.6.1 Single-byte/wide character conversion functions
    +
    7.24.6.1 Single-byte/wide character conversion functions
    -
    7.24.6.1.1 The btowc function
    +
    7.24.6.1.1 The btowc function
    Synopsis

    @@ -18498,7 +18389,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      does not constitute a valid single-byte character in the initial shift state. Otherwise, it
      returns the wide character representation of that character.
     
    -
    7.24.6.1.2 The wctob function
    +
    7.24.6.1.2 The wctob function
    Synopsis

    @@ -18516,9 +18407,9 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      length one in the initial shift state. Otherwise, it returns the single-byte representation of
      that character as an unsigned char converted to an int.
     
    -
    7.24.6.2 Conversion state functions
    +
    7.24.6.2 Conversion state functions
    -
    7.24.6.2.1 The mbsinit function
    +
    7.24.6.2.1 The mbsinit function
    Synopsis

    @@ -18534,7 +18425,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      The mbsinit function returns nonzero if ps is a null pointer or if the pointed-to object
      describes an initial conversion state; otherwise, it returns zero.
     
    -
    7.24.6.3 Restartable multibyte/wide character conversion functions
    +
    7.24.6.3 Restartable multibyte/wide character conversion functions

    These functions differ from the corresponding multibyte character functions of 7.20.7 (mblen, mbtowc, and wctomb) in that they have an extra parameter, ps, of type @@ -18547,7 +18438,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 Also unlike their corresponding functions, the return value does not represent whether the encoding is state-dependent. -

    7.24.6.3.1 The mbrlen function
    +
    7.24.6.3.1 The mbrlen function
    Synopsis

    @@ -18569,7 +18460,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
     

    Forward references: the mbrtowc function (7.24.6.3.2). -

    7.24.6.3.2 The mbrtowc function
    +
    7.24.6.3.2 The mbrtowc function
    Synopsis

    @@ -18596,23 +18487,20 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
     

    The mbrtowc function returns the first of the following that applies (given the current conversion state): - 0 if the next n or fewer bytes complete the multibyte character that -

    -                       corresponds to the null wide character (which is the value stored).
    - between 1 and n inclusive if the next n or fewer bytes complete a valid multibyte -
    +
    +
    0
    if the next n or fewer bytes complete the multibyte character that + corresponds to the null wide character (which is the value stored). +
    between 1 and n inclusive
    if the next n or fewer bytes complete a valid multibyte character (which is the value stored); the value returned is the number - of bytes that complete the multibyte character.
    - (size_t)(-2) if the next n bytes contribute to an incomplete (but potentially valid) -
    +                    of bytes that complete the multibyte character.
    +
    (size_t)(-2)
    if the next n bytes contribute to an incomplete (but potentially valid) multibyte character, and all n bytes have been processed (no value is - stored).300)
    - (size_t)(-1) if an encoding error occurs, in which case the next n or fewer bytes -
    +              stored).300)
    +
    (size_t)(-1)
    if an encoding error occurs, in which case the next n or fewer bytes do not contribute to a complete and valid multibyte character (no value is stored); the value of the macro EILSEQ is stored in errno, - and the conversion state is unspecified.
    - + and the conversion state is unspecified. +
    footnotes
    @@ -18620,7 +18508,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 sequence of redundant shift sequences (for implementations with state-dependent encodings). -
    7.24.6.3.3 The wcrtomb function
    +
    7.24.6.3.3 The wcrtomb function
    Synopsis

    @@ -18648,7 +18536,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      the function stores the value of the macro EILSEQ in errno and returns
      (size_t)(-1); the conversion state is unspecified.
     
    -
    7.24.6.4 Restartable multibyte/wide string conversion functions
    +
    7.24.6.4 Restartable multibyte/wide string conversion functions

    These functions differ from the corresponding multibyte string functions of 7.20.8 (mbstowcs and wcstombs) in that they have an extra parameter, ps, of type pointer to @@ -18664,7 +18552,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 to reflect the amount of the source processed by that invocation. -

    7.24.6.4.1 The mbsrtowcs function
    +
    7.24.6.4.1 The mbsrtowcs function
    Synopsis

    @@ -18707,7 +18595,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
     

    301) Thus, the value of len is ignored if dst is a null pointer. -

    7.24.6.4.2 The wcsrtombs function
    +
    7.24.6.4.2 The wcsrtombs function
    Synopsis

    @@ -18752,9 +18640,9 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      include those necessary to reach the initial shift state immediately before the null byte.
     
     
    -

    7.25 Wide character classification and mapping utilities

    +

    7.25 Wide character classification and mapping utilities

    -

    7.25.1 Introduction

    +

    7.25.1 Introduction

    The header <wctype.h> declares three data types, one macro, and many functions.303)

    @@ -18797,7 +18685,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007

    303) See ''future library directions'' (7.26.13). -

    7.25.2 Wide character classification utilities

    +

    7.25.2 Wide character classification utilities

    The header <wctype.h> declares several functions useful for classifying wide characters. @@ -18807,7 +18695,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 term control wide character refers to a member of a locale-specific set of wide characters that are not printing wide characters. -

    7.25.2.1 Wide character classification functions
    +
    7.25.2.1 Wide character classification functions

    The functions in this subclause return nonzero (true) if and only if the value of the argument wc conforms to that in the description of the function. @@ -18826,7 +18714,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 && iswspace(wc) is true, but not both. -

    7.25.2.1.1 The iswalnum function
    +
    7.25.2.1.1 The iswalnum function
    Synopsis

    @@ -18837,7 +18725,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      The iswalnum function tests for any wide character for which iswalpha or
      iswdigit is true.
     
    -
    7.25.2.1.2 The iswalpha function
    +
    7.25.2.1.2 The iswalpha function
    Synopsis

    @@ -18857,7 +18745,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      wide characters; all four combinations are possible.
     
     
    -
    7.25.2.1.3 The iswblank function
    +
    7.25.2.1.3 The iswblank function
    Synopsis

    @@ -18871,7 +18759,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      characters are the following: space (L' '), and horizontal tab (L'\t'). In the "C"
      locale, iswblank returns true only for the standard blank characters.
     
    -
    7.25.2.1.4 The iswcntrl function
    +
    7.25.2.1.4 The iswcntrl function
    Synopsis

    @@ -18881,7 +18769,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
     

    The iswcntrl function tests for any control wide character. -

    7.25.2.1.5 The iswdigit function
    +
    7.25.2.1.5 The iswdigit function
    Synopsis

    @@ -18892,7 +18780,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      The iswdigit function tests for any wide character that corresponds to a decimal-digit
      character (as defined in 5.2.1).
     
    -
    7.25.2.1.6 The iswgraph function
    +
    7.25.2.1.6 The iswgraph function
    Synopsis

    @@ -18914,7 +18802,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      characters other than ' '.
     
     
    -
    7.25.2.1.7 The iswlower function
    +
    7.25.2.1.7 The iswlower function
    Synopsis

    @@ -18926,7 +18814,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      letter or is one of a locale-specific set of wide characters for which none of iswcntrl,
      iswdigit, iswpunct, or iswspace is true.
     
    -
    7.25.2.1.8 The iswprint function
    +
    7.25.2.1.8 The iswprint function
    Synopsis

    @@ -18936,7 +18824,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
     

    The iswprint function tests for any printing wide character. -

    7.25.2.1.9 The iswpunct function
    +
    7.25.2.1.9 The iswpunct function
    Synopsis

    @@ -18948,7 +18836,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      specific set of punctuation wide characters for which neither iswspace nor iswalnum
      is true.306)
     
    -
    7.25.2.1.10 The iswspace function
    +
    7.25.2.1.10 The iswspace function
    Synopsis

    @@ -18964,7 +18852,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      set of white-space wide characters for which none of iswalnum, iswgraph, or
      iswpunct is true.
     
    -
    7.25.2.1.11 The iswupper function
    +
    7.25.2.1.11 The iswupper function
    Synopsis

    @@ -18976,7 +18864,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      letter or is one of a locale-specific set of wide characters for which none of iswcntrl,
      iswdigit, iswpunct, or iswspace is true.
     
    -
    7.25.2.1.12 The iswxdigit function
    +
    7.25.2.1.12 The iswxdigit function
    Synopsis

    @@ -18987,13 +18875,13 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      The iswxdigit function tests for any wide character that corresponds to a
      hexadecimal-digit character (as defined in 6.4.4.1).
     
    -
    7.25.2.2 Extensible wide character classification functions
    +
    7.25.2.2 Extensible wide character classification functions

    The functions wctype and iswctype provide extensible wide character classification as well as testing equivalent to that performed by the functions described in the previous subclause (7.25.2.1). -

    7.25.2.2.1 The iswctype function
    +
    7.25.2.2.1 The iswctype function
    Synopsis

    @@ -19027,7 +18915,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      character wc has the property described by desc.
     

    Forward references: the wctype function (7.25.2.2.2). -

    7.25.2.2.2 The wctype function
    +
    7.25.2.2.2 The wctype function
    Synopsis

    @@ -19047,13 +18935,13 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      as the second argument to the iswctype function; otherwise, it returns zero.              *
     
     
    -

    7.25.3 Wide character case mapping utilities

    +

    7.25.3 Wide character case mapping utilities

    The header <wctype.h> declares several functions useful for mapping wide characters. -

    7.25.3.1 Wide character case mapping functions
    +
    7.25.3.1 Wide character case mapping functions
    -
    7.25.3.1.1 The towlower function
    +
    7.25.3.1.1 The towlower function
    Synopsis

    @@ -19070,7 +18958,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      characters (always the same one for any given locale); otherwise, the argument is
      returned unchanged.
     
    -
    7.25.3.1.2 The towupper function
    +
    7.25.3.1.2 The towupper function
    Synopsis

    @@ -19087,14 +18975,14 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      characters (always the same one for any given locale); otherwise, the argument is
      returned unchanged.
     
    -
    7.25.3.2 Extensible wide character case mapping functions
    +
    7.25.3.2 Extensible wide character case mapping functions

    The functions wctrans and towctrans provide extensible wide character mapping as well as case mapping equivalent to that performed by the functions described in the previous subclause (7.25.3.1). -

    7.25.3.2.1 The towctrans function
    +
    7.25.3.2.1 The towctrans function
    Synopsis

    @@ -19116,7 +19004,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      The towctrans function returns the mapped value of wc using the mapping described
      by desc.
     
    -
    7.25.3.2.2 The wctrans function
    +
    7.25.3.2.2 The wctrans function
    Synopsis

    @@ -19136,12 +19024,12 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      as the second argument to the towctrans function; otherwise, it returns zero.
     
     
    -

    7.26 Future library directions

    +

    7.26 Future library directions

    The following names are grouped under individual headers for convenience. All external names described below are reserved no matter what headers are included by the program. -

    7.26.1 Complex arithmetic

    +

    7.26.1 Complex arithmetic

    The function names

    @@ -19151,37 +19039,37 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      and the same names suffixed with f or l may be added to the declarations in the
      <complex.h> header.
     
    -

    7.26.2 Character handling

    +

    7.26.2 Character handling

    Function names that begin with either is or to, and a lowercase letter may be added to the declarations in the <ctype.h> header. -

    7.26.3 Errors

    +

    7.26.3 Errors

    Macros that begin with E and a digit or E and an uppercase letter may be added to the declarations in the <errno.h> header. -

    7.26.4 Format conversion of integer types

    +

    7.26.4 Format conversion of integer types

    Macro names beginning with PRI or SCN followed by any lowercase letter or X may be added to the macros defined in the <inttypes.h> header. -

    7.26.5 Localization

    +

    7.26.5 Localization

    Macros that begin with LC_ and an uppercase letter may be added to the definitions in the <locale.h> header. -

    7.26.6 Signal handling

    +

    7.26.6 Signal handling

    Macros that begin with either SIG and an uppercase letter or SIG_ and an uppercase letter may be added to the definitions in the <signal.h> header. -

    7.26.7 Boolean type and values

    +

    7.26.7 Boolean type and values

    The ability to undefine and perhaps then redefine the macros bool, true, and false is an obsolescent feature. -

    7.26.8 Integer types

    +

    7.26.8 Integer types

    Typedef names beginning with int or uint and ending with _t may be added to the types defined in the <stdint.h> header. Macro names beginning with INT or UINT @@ -19189,7 +19077,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 <stdint.h> header. -

    7.26.9 Input/output

    +

    7.26.9 Input/output

    Lowercase letters may be added to the conversion specifiers and length modifiers in fprintf and fscanf. Other characters may be used in extensions. @@ -19199,17 +19087,17 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 The use of ungetc on a binary stream where the file position indicator is zero prior to the call is an obsolescent feature. -

    7.26.10 General utilities

    +

    7.26.10 General utilities

    Function names that begin with str and a lowercase letter may be added to the declarations in the <stdlib.h> header. -

    7.26.11 String handling

    +

    7.26.11 String handling

    Function names that begin with str, mem, or wcs and a lowercase letter may be added to the declarations in the <string.h> header. -

    7.26.12 Extended multibyte and wide character utilities

    +

    7.26.12 Extended multibyte and wide character utilities

    Function names that begin with wcs and a lowercase letter may be added to the declarations in the <wchar.h> header. @@ -19217,14 +19105,14 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 Lowercase letters may be added to the conversion specifiers and length modifiers in fwprintf and fwscanf. Other characters may be used in extensions. -

    7.26.13 Wide character classification and mapping utilities

    +

    7.26.13 Wide character classification and mapping utilities

    <wctype.h>

    Function names that begin with is or to and a lowercase letter may be added to the declarations in the <wctype.h> header. -

    Annex A

    +

    Annex A

                                                   (informative)
    @@ -19232,9 +19120,9 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      NOTE     The notation is described in 6.1.
      
     
    -

    A.1 Lexical grammar

    +

    A.1 Lexical grammar

    -

    A.1.1 Lexical elements

    +

    A.1.1 Lexical elements

    (6.4) token:
                       keyword
    @@ -19252,7 +19140,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
                    punctuator
                    each non-white-space character that cannot be one of the above
    -

    A.1.2 Keywords

    +

    A.1.2 Keywords

    (6.4.1) keyword: one of
    @@ -19267,7 +19155,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
                    double                    long             typedef
                    else                      register         union
    -

    A.1.3 Identifiers

    +

    A.1.3 Identifiers

    (6.4.2.1) identifier:
                     identifier-nondigit
    @@ -19288,7 +19176,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
     
                     0 1 2         3    4   5   6   7   8     9
    -

    A.1.4 Universal character names

    +

    A.1.4 Universal character names

    (6.4.3) universal-character-name:
                    \u hex-quad
    @@ -19298,7 +19186,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
                    hexadecimal-digit hexadecimal-digit
                                 hexadecimal-digit hexadecimal-digit
    -

    A.1.5 Constants

    +

    A.1.5 Constants

    (6.4.4) constant:
                    integer-constant
    @@ -19435,7 +19323,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
                    \x hexadecimal-digit
                    hexadecimal-escape-sequence hexadecimal-digit
    -

    A.1.6 String literals

    +

    A.1.6 String literals

    (6.4.5) string-literal:
                     " s-char-sequenceopt "
    @@ -19451,7 +19339,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
                                  the double-quote ", backslash \, or new-line character
                     escape-sequence
    -

    A.1.7 Punctuators

    +

    A.1.7 Punctuators

    (6.4.6) punctuator: one of
                    [ ] ( ) { } . ->
    @@ -19462,7 +19350,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
                    , # ##
                    <: :> <% %> %: %:%:
    -

    A.1.8 Header names

    +

    A.1.8 Header names

    (6.4.7) header-name:
                    < h-char-sequence >
    @@ -19484,7 +19372,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
                    any member of the source character set except
                                 the new-line character and "
    -

    A.1.9 Preprocessing numbers

    +

    A.1.9 Preprocessing numbers

    (6.4.8) pp-number:
    @@ -19498,9 +19386,9 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
                    pp-number   P sign
                    pp-number   .
    -

    A.2 Phrase structure grammar

    +

    A.2 Phrase structure grammar

    -

    A.2.1 Expressions

    +

    A.2.1 Expressions

    (6.5.1) primary-expression:
                    identifier
    @@ -19606,7 +19494,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
     
                    conditional-expression
    -

    A.2.2 Declarations

    +

    A.2.2 Declarations

    (6.7) declaration:
                     declaration-specifiers init-declarator-listopt ;
    @@ -19778,7 +19666,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 [ constant-expression ] . identifier
    -

    A.2.3 Statements

    +

    A.2.3 Statements

    (6.8) statement:
                    labeled-statement
    @@ -19825,7 +19713,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
                    break ;
                    return expressionopt ;
    -

    A.2.4 External definitions

    +

    A.2.4 External definitions

    (6.9) translation-unit:
                     external-declaration
    @@ -19842,7 +19730,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
                    declaration
                    declaration-list declaration
    -

    A.3 Preprocessing directives

    +

    A.3 Preprocessing directives

    (6.10) preprocessing-file:
                    groupopt
    @@ -19914,17 +19802,17 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007
                    the new-line character
    -

    Annex B

    +

    Annex B

                                    (informative)
                                Library summary
    -

    B.1 Diagnostics

    +

    B.1 Diagnostics

             NDEBUG
             void assert(scalar expression);
    -

    B.2 Complex

    +

    B.2 Complex

    @@ -19999,7 +19887,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
            float crealf(float complex z);
            long double creall(long double complex z);
    -

    B.3 Character handling

    +

    B.3 Character handling

             int    isalnum(int c);
             int    isalpha(int c);
    @@ -20016,11 +19904,11 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
             int    tolower(int c);
             int    toupper(int c);
    -

    B.4 Errors

    +

    B.4 Errors

             EDOM            EILSEQ             ERANGE            errno
    -

    B.5 Floating-point environment

    +

    B.5 Floating-point environment

             fenv_t                 FE_OVERFLOW             FE_TOWARDZERO
    @@ -20042,7 +19930,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
             int fesetenv(const fenv_t *envp);
             int feupdateenv(const fenv_t *envp);
    -

    B.6 Characteristics of floating types

    +

    B.6 Characteristics of floating types

            FLT_ROUNDS              DBL_MIN_EXP             FLT_MAX
            FLT_EVAL_METHOD         LDBL_MIN_EXP            DBL_MAX
    @@ -20056,7 +19944,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
            LDBL_DIG                DBL_MAX_10_EXP
            FLT_MIN_EXP             LDBL_MAX_10_EXP
    -

    B.7 Format conversion of integer types

    +

    B.7 Format conversion of integer types

            imaxdiv_t
    @@ -20082,13 +19970,13 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
            uintmax_t wcstoumax(const wchar_t * restrict nptr,
                    wchar_t ** restrict endptr, int base);
    -

    B.8 Alternative spellings

    +

    B.8 Alternative spellings

           and             bitor             not_eq            xor
           and_eq          compl             or                xor_eq
           bitand          not               or_eq
    -

    B.9 Sizes of integer types

    +

    B.9 Sizes of integer types

           CHAR_BIT        CHAR_MAX          INT_MIN           ULONG_MAX
           SCHAR_MIN       MB_LEN_MAX        INT_MAX           LLONG_MIN
    @@ -20096,14 +19984,14 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
           UCHAR_MAX       SHRT_MAX          LONG_MIN          ULLONG_MAX
           CHAR_MIN        USHRT_MAX         LONG_MAX
    -

    B.10 Localization

    +

    B.10 Localization

           struct lconv    LC_ALL            LC_CTYPE          LC_NUMERIC
           NULL            LC_COLLATE        LC_MONETARY       LC_TIME
           char *setlocale(int category, const char *locale);
           struct lconv *localeconv(void);
    -

    B.11 Mathematics

    +

    B.11 Mathematics

    @@ -20304,13 +20192,13 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 int islessgreater(real-floating x, real-floating y); int isunordered(real-floating x, real-floating y);
    -

    B.12 Nonlocal jumps

    +

    B.12 Nonlocal jumps

            jmp_buf
            int setjmp(jmp_buf env);
            void longjmp(jmp_buf env, int val);
    -

    B.13 Signal handling

    +

    B.13 Signal handling

            sig_atomic_t   SIG_IGN            SIGILL            SIGTERM
            SIG_DFL        SIGABRT            SIGINT
    @@ -20318,7 +20206,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
            void (*signal(int sig, void (*func)(int)))(int);
            int raise(int sig);
    -

    B.14 Variable arguments

    +

    B.14 Variable arguments

            va_list
            type va_arg(va_list ap, type);
    @@ -20326,7 +20214,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
            void va_end(va_list ap);
            void va_start(va_list ap, parmN);
    -

    B.15 Boolean type and values

    +

    B.15 Boolean type and values

            bool
    @@ -20334,12 +20222,12 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
            false
            __bool_true_false_are_defined
    -

    B.16 Common definitions

    +

    B.16 Common definitions

              ptrdiff_t       size_t            wchar_t           NULL
              offsetof(type, member-designator)
    -

    B.17 Integer types

    +

    B.17 Integer types

              intN_t                INT_LEASTN_MIN          PTRDIFF_MAX
              uintN_t               INT_LEASTN_MAX          SIG_ATOMIC_MIN
    @@ -20355,7 +20243,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
              INTN_MAX              UINTMAX_MAX             UINTMAX_C(value)
              UINTN_MAX             PTRDIFF_MIN
    -

    B.18 Input/output

    +

    B.18 Input/output

    @@ -20434,7 +20322,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
              int ferror(FILE *stream);
              void perror(const char *s);
    -

    B.19 General utilities

    +

    B.19 General utilities

    @@ -20494,7 +20382,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
            size_t wcstombs(char * restrict s,
                 const wchar_t * restrict pwcs, size_t n);
    -

    B.20 String handling

    +

    B.20 String handling

              size_t
    @@ -20529,7 +20417,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
              char *strerror(int errnum);
              size_t strlen(const char *s);
    -

    B.21 Type-generic math

    +

    B.21 Type-generic math

            acos           sqrt               fmod              nextafter
            asin           fabs               frexp             nexttoward
    @@ -20547,7 +20435,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
            log            fmax               lround            cproj
            pow            fmin               nearbyint         creal
    -

    B.22 Date and time

    +

    B.22 Date and time

            NULL                  size_t                  time_t
    @@ -20565,7 +20453,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
                 const char * restrict format,
                 const struct tm * restrict timeptr);
    -

    B.23 Extended multibyte/wide character utilities

    +

    B.23 Extended multibyte/wide character utilities

    @@ -20673,7 +20561,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
                   const wchar_t ** restrict src, size_t len,
                   mbstate_t * restrict ps);
    -

    B.24 Wide character classification and mapping utilities

    +

    B.24 Wide character classification and mapping utilities

    @@ -20697,7 +20585,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
            wint_t towctrans(wint_t wc, wctrans_t desc);
            wctrans_t wctrans(const char *property);
    -

    Annex C

    +

    Annex C

                                          (informative)
    @@ -20722,7 +20610,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
     
     
     
    -

    Annex D

    +

    Annex D

                                          (normative)
    @@ -20811,11 +20699,11 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
                         2107, 210A-2113, 2115, 2118-211D, 2124, 2126, 2128, 212A-2131,
                         2133-2138, 2160-2182, 3005-3007, 3021-3029
    -

    Annex E

    +

    Annex E

                                         (informative)
    -                             Implementation limits
    +
    Implementation limits
    The contents of the header <limits.h> are given below, in alphabetical order. The minimum magnitudes shown shall be replaced by implementation-defined magnitudes with the same sign. The values shall all be constant expressions suitable for use in #if @@ -20896,12 +20784,12 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 #define LDBL_EPSILON 1E-9 #define LDBL_MIN 1E-37
    -

    Annex F

    +

    Annex F

                                                (normative)
                            IEC 60559 floating-point arithmetic
    -

    F.1 Introduction

    +

    F.1 Introduction

    This annex specifies C language support for the IEC 60559 floating-point standard. The IEC 60559 floating-point standard is specifically Binary floating-point arithmetic for @@ -20915,7 +20803,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 a binding between the C language and IEC 60559 is indicated, the IEC 60559-specified behavior is adopted by reference, unless stated otherwise. -

    F.2 Types

    +

    F.2 Types

    The C floating types match the IEC 60559 formats as follows:

      @@ -20926,7 +20814,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007
    Any non-IEC 60559 extended format used for the long double type shall have more precision than IEC 60559 double and at least the range of IEC 60559 double.308) - Recommended practice +
    Recommended practice

    The long double type should match an IEC 60559 extended format. @@ -20943,7 +20831,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 all double values. -

    F.2.1 Infinities, signed zeros, and NaNs

    +

    F.2.1 Infinities, signed zeros, and NaNs

    This specification does not define the behavior of signaling NaNs.309) It generally uses the term NaN to denote quiet NaNs. The NAN and INFINITY macros and the nan @@ -20954,7 +20842,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 sufficient for closure of the arithmetic. -

    F.3 Operators and functions

    +

    F.3 Operators and functions

    C operators and functions provide IEC 60559 required and recommended facilities as listed below. @@ -21032,7 +20920,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 macros defined in 7.12.3 do not distinguish signaling from quiet NaNs). -

    F.4 Floating to integer conversion

    +

    F.4 Floating to integer conversion

    If the floating value is infinite or NaN or if the integral part of the floating value exceeds the range of the integer type, then the ''invalid'' floating-point exception is raised and the @@ -21048,7 +20936,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 <math.h>. -

    F.5 Binary-decimal conversion

    +

    F.5 Binary-decimal conversion

    Conversion from the widest supported IEC 60559 format to decimal with DECIMAL_DIG digits and back is the identity function.311) @@ -21076,18 +20964,18 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 DBL_DIG are 18 and 15, respectively, for these formats.) -

    F.6 Contracted expressions

    +

    F.6 Contracted expressions

    A contracted expression treats infinities, NaNs, signed zeros, subnormals, and the rounding directions in a manner consistent with the basic arithmetic operations covered by IEC 60559. - Recommended practice +

    Recommended practice

    A contracted expression should raise floating-point exceptions in a manner generally consistent with the basic arithmetic operations. A contracted expression should deliver the same value as its uncontracted counterpart, else should be correctly rounded (once). -

    F.7 Floating-point environment

    +

    F.7 Floating-point environment

    The floating-point environment defined in <fenv.h> includes the IEC 60559 floating- point exception status flags and directed-rounding control modes. It includes also @@ -21098,7 +20986,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007

    312) This specification does not require dynamic rounding precision nor trap enablement modes. -

    F.7.1 Environment management

    +

    F.7.1 Environment management

    IEC 60559 requires that floating-point operations implicitly raise floating-point exception status flags, and that rounding control modes can be set explicitly to affect result values of @@ -21112,7 +21000,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 which allows certain optimizations (see F.8). -

    F.7.2 Translation

    +

    F.7.2 Translation

    During translation the IEC 60559 default modes are in effect:

      @@ -21120,7 +21008,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007
    • The rounding precision mode (if supported) is set so that results are not shortened.
    • Trapping or stopping (if supported) is disabled on all floating-point exceptions.
    - Recommended practice +
    Recommended practice

    The implementation should produce a diagnostic message for each translation-time @@ -21138,7 +21026,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 strtod, provide execution-time conversion of numeric strings. -

    F.7.3 Execution

    +

    F.7.3 Execution

    At program startup the floating-point environment is initialized as prescribed by IEC 60559: @@ -21150,7 +21038,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007

  • Trapping or stopping (if supported) is disabled on all floating-point exceptions. -

    F.7.4 Constant expressions

    +

    F.7.4 Constant expressions

    An arithmetic constant expression of floating type, other than one in an initializer for an object that has static storage duration, is evaluated (as if) during execution; thus, it is @@ -21189,7 +21077,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 const static double one_third = 1.0/3.0;

  • -

    F.7.5 Initialization

    +

    F.7.5 Initialization

    All computation for automatic initialization is done (as if) at execution time; thus, it is affected by any operative modes and raises floating-point exceptions as required by @@ -21235,7 +21123,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 could be done at translation time, regardless of the expression evaluation method. -

    F.7.6 Changing the environment

    +

    F.7.6 Changing the environment

    Operations defined in 6.5 and functions and macros defined for the standard libraries change floating-point status flags and control modes just as indicated by their @@ -21247,12 +21135,12 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 ''inexact'', or ''underflow'' and ''inexact''), then ''overflow'' or ''underflow'' is raised before ''inexact''. -

    F.8 Optimization

    +

    F.8 Optimization

    This section identifies code transformations that might subvert IEC 60559-specified behavior, and others that do not. -

    F.8.1 Global transformations

    +

    F.8.1 Global transformations

    Floating-point arithmetic operations and external function calls may entail side effects which optimization shall honor, at least where the state of the FENV_ACCESS pragma is @@ -21285,7 +21173,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007

              if (0 < n) x + 1;
    -

    F.8.2 Expression transformations

    +

    F.8.2 Expression transformations

    x / 2 <-> x * 0.5 Although similar transformations involving inexact

    @@ -21348,7 +21236,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      for complex z.
     
     
    -

    F.8.3 Relational operators

    +

    F.8.3 Relational operators

    x != x -> false The statement x != x is true if x is a NaN. x == x -> true The statement x == x is false if x is a NaN. @@ -21401,7 +21289,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 f();

    -

    F.8.4 Constant arithmetic

    +

    F.8.4 Constant arithmetic

    The implementation shall honor floating-point exceptions raised by execution-time constant arithmetic wherever the state of the FENV_ACCESS pragma is ''on''. (See F.7.4 @@ -21416,7 +21304,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007

    319) 0 - 0 yields -0 instead of +0 just when the rounding direction is downward. -

    F.9 Mathematics

    +

    F.9 Mathematics

    This subclause contains specifications of <math.h> facilities that are particularly suited for IEC 60559 implementations. @@ -21465,7 +21353,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 For families of functions, the specifications apply to all of the functions even though only the principal function is shown. Unless otherwise specified, where the symbol ''(+-)'' occurs in both an argument and the result, the result has the same sign as the argument. - Recommended practice +

    Recommended practice

    If a function with one or more NaN arguments returns a NaN result, the result should be the same as one of the NaN arguments (after possible type conversion), except perhaps @@ -21479,9 +21367,9 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 avoiding them would be too costly. -

    F.9.1 Trigonometric functions

    +

    F.9.1 Trigonometric functions

    -
    F.9.1.1 The acos functions
    +
    F.9.1.1 The acos functions

    • acos(1) returns +0. @@ -21494,7 +21382,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007
    -
    F.9.1.2 The asin functions
    +
    F.9.1.2 The asin functions

    • asin((+-)0) returns (+-)0. @@ -21502,14 +21390,14 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 | x | > 1.
    -
    F.9.1.3 The atan functions
    +
    F.9.1.3 The atan functions

    • atan((+-)0) returns (+-)0.
    • atan((+-)(inf)) returns (+-)pi /2.
    -
    F.9.1.4 The atan2 functions
    +
    F.9.1.4 The atan2 functions

    -
    F.9.3.5 The ilogb functions
    +
    F.9.3.5 The ilogb functions

    If the correct result is outside the range of the return type, the numeric result is unspecified and the ''invalid'' floating-point exception is raised. -

    F.9.3.6 The ldexp functions
    +
    F.9.3.6 The ldexp functions

    On a binary system, ldexp(x, exp) is equivalent to scalbn(x, exp). -

    F.9.3.7 The log functions
    +
    F.9.3.7 The log functions

    • log((+-)0) returns -(inf) and raises the ''divide-by-zero'' floating-point exception. @@ -21668,7 +21556,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007
    • log(+(inf)) returns +(inf).
    -
    F.9.3.8 The log10 functions
    +
    F.9.3.8 The log10 functions

    • log10((+-)0) returns -(inf) and raises the ''divide-by-zero'' floating-point exception. @@ -21677,7 +21565,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007
    • log10(+(inf)) returns +(inf).
    -
    F.9.3.9 The log1p functions
    +
    F.9.3.9 The log1p functions

    • log1p((+-)0) returns (+-)0. @@ -21687,7 +21575,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007
    • log1p(+(inf)) returns +(inf).
    -
    F.9.3.10 The log2 functions
    +
    F.9.3.10 The log2 functions

    • log2((+-)0) returns -(inf) and raises the ''divide-by-zero'' floating-point exception. @@ -21696,7 +21584,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007
    • log2(+(inf)) returns +(inf).
    -
    F.9.3.11 The logb functions
    +
    F.9.3.11 The logb functions

    • logb((+-)0) returns -(inf) and raises the ''divide-by-zero'' floating-point exception. @@ -21704,7 +21592,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007
    -
    F.9.3.12 The modf functions
    +
    F.9.3.12 The modf functions

    • modf((+-)x, iptr) returns a result with the same sign as x. @@ -21729,7 +21617,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 value - (*iptr), value); }
    -
    F.9.3.13 The scalbn and scalbln functions
    +
    F.9.3.13 The scalbn and scalbln functions

    • scalbn((+-)0, n) returns (+-)0. @@ -21737,16 +21625,16 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007
    • scalbn((+-)(inf), n) returns (+-)(inf).
    -

    F.9.4 Power and absolute value functions

    +

    F.9.4 Power and absolute value functions

    -
    F.9.4.1 The cbrt functions
    +
    F.9.4.1 The cbrt functions

    • cbrt((+-)0) returns (+-)0.
    • cbrt((+-)(inf)) returns (+-)(inf).
    -
    F.9.4.2 The fabs functions
    +
    F.9.4.2 The fabs functions

    • fabs((+-)0) returns +0. @@ -21754,7 +21642,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007
    -
    F.9.4.3 The hypot functions
    +
    F.9.4.3 The hypot functions

    • hypot(x, y), hypot(y, x), and hypot(x, -y) are equivalent. @@ -21762,7 +21650,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007
    • hypot((+-)(inf), y) returns +(inf), even if y is a NaN.
    -
    F.9.4.4 The pow functions
    +
    F.9.4.4 The pow functions

    • pow((+-)0, y) returns (+-)(inf) and raises the ''divide-by-zero'' floating-point exception @@ -21789,27 +21677,27 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007
    -
    F.9.4.5 The sqrt functions
    +
    F.9.4.5 The sqrt functions

    sqrt is fully specified as a basic arithmetic operation in IEC 60559. -

    F.9.5 Error and gamma functions

    +

    F.9.5 Error and gamma functions

    -
    F.9.5.1 The erf functions
    +
    F.9.5.1 The erf functions

    • erf((+-)0) returns (+-)0.
    • erf((+-)(inf)) returns (+-)1.
    -
    F.9.5.2 The erfc functions
    +
    F.9.5.2 The erfc functions

    • erfc(-(inf)) returns 2.
    • erfc(+(inf)) returns +0.
    -
    F.9.5.3 The lgamma functions
    +
    F.9.5.3 The lgamma functions

    • lgamma(1) returns +0. @@ -21820,7 +21708,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007
    • lgamma(+(inf)) returns +(inf).
    -
    F.9.5.4 The tgamma functions
    +
    F.9.5.4 The tgamma functions

    • tgamma((+-)0) returns (+-)(inf) and raises the ''divide-by-zero'' floating-point exception. @@ -21830,9 +21718,9 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007
    • tgamma(+(inf)) returns +(inf).
    -

    F.9.6 Nearest integer functions

    +

    F.9.6 Nearest integer functions

    -
    F.9.6.1 The ceil functions
    +
    F.9.6.1 The ceil functions

    • ceil((+-)0) returns (+-)0. @@ -21855,7 +21743,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 return result; }
    -
    F.9.6.2 The floor functions
    +
    F.9.6.2 The floor functions

    • floor((+-)0) returns (+-)0. @@ -21864,7 +21752,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007

      See the sample implementation for ceil in F.9.6.1. -

      F.9.6.3 The nearbyint functions
      +
      F.9.6.3 The nearbyint functions

      The nearbyint functions use IEC 60559 rounding according to the current rounding direction. They do not raise the ''inexact'' floating-point exception if the result differs in @@ -21874,12 +21762,12 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007

    • nearbyint((+-)(inf)) returns (+-)(inf) (for all rounding directions).
    -
    F.9.6.4 The rint functions
    +
    F.9.6.4 The rint functions

    The rint functions differ from the nearbyint functions only in that they do raise the ''inexact'' floating-point exception if the result differs in value from the argument. -

    F.9.6.5 The lrint and llrint functions
    +
    F.9.6.5 The lrint and llrint functions

    The lrint and llrint functions provide floating-to-integer conversion as prescribed by IEC 60559. They round according to the current rounding direction. If the rounded @@ -21889,7 +21777,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 exception. -

    F.9.6.6 The round functions
    +
    F.9.6.6 The round functions

    • round((+-)0) returns (+-)0. @@ -21917,14 +21805,14 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 The round functions may, but are not required to, raise the ''inexact'' floating-point exception for non-integer numeric arguments, as this implementation does. -
      F.9.6.7 The lround and llround functions
      +
      F.9.6.7 The lround and llround functions

      The lround and llround functions differ from the lrint and llrint functions with the default rounding direction just in that the lround and llround functions round halfway cases away from zero and need not raise the ''inexact'' floating-point exception for non-integer arguments that round to within the range of the return type. -

      F.9.6.8 The trunc functions
      +
      F.9.6.8 The trunc functions

      The trunc functions use IEC 60559 rounding toward zero (regardless of the current rounding direction). @@ -21934,9 +21822,9 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007

    -

    F.9.7 Remainder functions

    +

    F.9.7 Remainder functions

    -
    F.9.7.1 The fmod functions
    +
    F.9.7.1 The fmod functions

    • fmod((+-)0, y) returns (+-)0 for y not zero. @@ -21958,28 +21846,28 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 return copysign(result, x); }
    -
    F.9.7.2 The remainder functions
    +
    F.9.7.2 The remainder functions

    The remainder functions are fully specified as a basic arithmetic operation in IEC 60559. -

    F.9.7.3 The remquo functions
    +
    F.9.7.3 The remquo functions

    The remquo functions follow the specifications for the remainder functions. They have no further specifications special to IEC 60559 implementations. -

    F.9.8 Manipulation functions

    +

    F.9.8 Manipulation functions

    -
    F.9.8.1 The copysign functions
    +
    F.9.8.1 The copysign functions

    copysign is specified in the Appendix to IEC 60559. -

    F.9.8.2 The nan functions
    +
    F.9.8.2 The nan functions

    All IEC 60559 implementations support quiet NaNs, in all floating formats. -

    F.9.8.3 The nextafter functions
    +
    F.9.8.3 The nextafter functions

    • nextafter(x, y) raises the ''overflow'' and ''inexact'' floating-point exceptions @@ -21988,17 +21876,17 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 exceptions for the function value subnormal or zero and x != y.
    -
    F.9.8.4 The nexttoward functions
    +
    F.9.8.4 The nexttoward functions

    No additional requirements beyond those on nextafter. -

    F.9.9 Maximum, minimum, and positive difference functions

    +

    F.9.9 Maximum, minimum, and positive difference functions

    -
    F.9.9.1 The fdim functions
    +
    F.9.9.1 The fdim functions

    No additional requirements. -

    F.9.9.2 The fmax functions
    +
    F.9.9.2 The fmax functions

    If just one argument is a NaN, the fmax functions return the other argument (if both arguments are NaNs, the functions return a NaN). @@ -22013,13 +21901,13 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 return +0; however, implementation in software might be impractical. -

    F.9.9.3 The fmin functions
    +
    F.9.9.3 The fmin functions

    The fmin functions are analogous to the fmax functions (see F.9.9.2). -

    F.9.10 Floating multiply-add

    +

    F.9.10 Floating multiply-add

    -
    F.9.10.1 The fma functions
    +
    F.9.10.1 The fma functions

    • fma(x, y, z) computes xy + z, correctly rounded once. @@ -22036,12 +21924,12 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007
    -

    Annex G

    +

    Annex G

                                          (informative)
                    IEC 60559-compatible complex arithmetic
    -

    G.1 Introduction

    +

    G.1 Introduction

    This annex supplements annex F to specify complex arithmetic for compatibility with IEC 60559 real floating-point arithmetic. Although these specifications have been @@ -22050,7 +21938,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 recommended practice. An implementation that defines __STDC_IEC_559_COMPLEX__ should conform to the specifications in this annex. -

    G.2 Types

    +

    G.2 Types

    There is a new keyword _Imaginary, which is used to specify imaginary types. It is used as a type specifier within declaration specifiers in the same way as _Complex is @@ -22069,7 +21957,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007

    The imaginary type domain comprises the imaginary types. -

    G.3 Conventions

    +

    G.3 Conventions

    A complex or imaginary value with at least one infinite part is regarded as an infinity (even if its other part is a NaN). A complex or imaginary value is a finite number if each @@ -22077,14 +21965,14 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 a zero if each of its parts is a zero. -

    G.4 Conversions

    +

    G.4 Conversions

    -

    G.4.1 Imaginary types

    +

    G.4.1 Imaginary types

    Conversions among imaginary types follow rules analogous to those for real floating types. -

    G.4.2 Real and imaginary

    +

    G.4.2 Real and imaginary

    When a value of imaginary type is converted to a real type other than _Bool,324) the result is a positive zero. @@ -22096,7 +21984,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007

    324) See 6.3.1.2. -

    G.4.3 Imaginary and complex

    +

    G.4.3 Imaginary and complex

    When a value of imaginary type is converted to a complex type, the real part of the complex result value is a positive zero and the imaginary part of the complex result value @@ -22106,7 +21994,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 complex value is discarded and the value of the imaginary part is converted according to the conversion rules for the corresponding real types. -

    G.5 Binary operators

    +

    G.5 Binary operators

    The following subclauses supplement 6.5 in order to specify the type of the result for an operation with an imaginary operand. @@ -22123,7 +22011,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 -

    G.5.1 Multiplicative operators

    +

    G.5.1 Multiplicative operators

    Semantics

    If one operand has real type and the other operand has imaginary type, then the result has @@ -22294,7 +22182,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 (at least where the state for CX_LIMITED_RANGE is ''off''). -

    G.5.2 Additive operators

    +

    G.5.2 Additive operators

    Semantics

    If both operands have imaginary type, then the result has imaginary type. (If one operand @@ -22315,7 +22203,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007

             x + iy         (x (+-) u) + iy            x + i(y (+-) v)        (x (+-) u) + i(y (+-) v)
    -

    G.6 Complex arithmetic

    +

    G.6 Complex arithmetic

    The macros

    @@ -22385,9 +22273,9 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      other part is a NaN.
     
     
    -

    G.6.1 Trigonometric functions

    +

    G.6.1 Trigonometric functions

    -
    G.6.1.1 The cacos functions
    +
    G.6.1.1 The cacos functions

    • cacos(conj(z)) = conj(cacos(z)). @@ -22408,9 +22296,9 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007
    • cacos(NaN + iNaN) returns NaN + iNaN.
    -

    G.6.2 Hyperbolic functions

    +

    G.6.2 Hyperbolic functions

    -
    G.6.2.1 The cacosh functions
    +
    G.6.2.1 The cacosh functions

    • cacosh(conj(z)) = conj(cacosh(z)). @@ -22430,7 +22318,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007
    • cacosh(NaN + iNaN) returns NaN + iNaN.
    -
    G.6.2.2 The casinh functions
    +
    G.6.2.2 The casinh functions

    • casinh(conj(z)) = conj(casinh(z)) and casinh is odd. @@ -22449,7 +22337,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007
    • casinh(NaN + iNaN) returns NaN + iNaN.
    -
    G.6.2.3 The catanh functions
    +
    G.6.2.3 The catanh functions

    • catanh(conj(z)) = conj(catanh(z)) and catanh is odd. @@ -22471,7 +22359,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007
    • catanh(NaN + iNaN) returns NaN + iNaN.
    -
    G.6.2.4 The ccosh functions
    +
    G.6.2.4 The ccosh functions

    • ccosh(conj(z)) = conj(ccosh(z)) and ccosh is even. @@ -22496,7 +22384,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007
    • ccosh(NaN + iNaN) returns NaN + iNaN.
    -
    G.6.2.5 The csinh functions
    +
    G.6.2.5 The csinh functions

    • csinh(conj(z)) = conj(csinh(z)) and csinh is odd. @@ -22522,7 +22410,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007
    • csinh(NaN + iNaN) returns NaN + iNaN.
    -
    G.6.2.6 The ctanh functions
    +
    G.6.2.6 The ctanh functions

    • ctanh(conj(z)) = conj(ctanh(z))and ctanh is odd. @@ -22543,9 +22431,9 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007
    -

    G.6.3 Exponential and logarithmic functions

    +

    G.6.3 Exponential and logarithmic functions

    -
    G.6.3.1 The cexp functions
    +
    G.6.3.1 The cexp functions

    • cexp(conj(z)) = conj(cexp(z)). @@ -22571,7 +22459,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007
    • cexp(NaN + iNaN) returns NaN + iNaN.
    -
    G.6.3.2 The clog functions
    +
    G.6.3.2 The clog functions

    • clog(conj(z)) = conj(clog(z)). @@ -22594,9 +22482,9 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007
    • clog(NaN + iNaN) returns NaN + iNaN.
    -

    G.6.4 Power and absolute-value functions

    +

    G.6.4 Power and absolute-value functions

    -
    G.6.4.1 The cpow functions
    +
    G.6.4.1 The cpow functions

    The cpow functions raise floating-point exceptions if appropriate for the calculation of the parts of the result, and may raise spurious exceptions.327) @@ -22606,7 +22494,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 implementations that treat special cases more carefully. -

    G.6.4.2 The csqrt functions
    +
    G.6.4.2 The csqrt functions

    • csqrt(conj(z)) = conj(csqrt(z)). @@ -22629,7 +22517,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007
    -

    G.7 Type-generic math

    +

    G.7 Type-generic math

    Type-generic macros that accept complex arguments also accept imaginary arguments. If an argument is imaginary, the macro expands to an expression whose type is real, @@ -22654,29 +22542,29 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 asinh(iy) = i asin(y) atanh(iy) = i atan(y)

    -

    Annex H

    +

    Annex H

                                          (informative)
                          Language independent arithmetic
    -

    H.1 Introduction

    +

    H.1 Introduction

    This annex documents the extent to which the C language supports the ISO/IEC 10967-1 standard for language-independent arithmetic (LIA-1). LIA-1 is more general than IEC 60559 (annex F) in that it covers integer and diverse floating-point arithmetics. -

    H.2 Types

    +

    H.2 Types

    The relevant C arithmetic types meet the requirements of LIA-1 types if an implementation adds notification of exceptional arithmetic operations and meets the 1 unit in the last place (ULP) accuracy requirement (LIA-1 subclause 5.2.8). -

    H.2.1 Boolean type

    +

    H.2.1 Boolean type

    The LIA-1 data type Boolean is implemented by the C data type bool with values of true and false, all from <stdbool.h>. -

    H.2.2 Integer types

    +

    H.2.2 Integer types

    The signed C integer types int, long int, long long int, and the corresponding unsigned types are compatible with LIA-1. If an implementation adds support for the @@ -22696,7 +22584,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 is always 0 for the unsigned types, and is not provided for those types. -

    H.2.2.1 Integer operations
    +
    H.2.2.1 Integer operations

    The integer operations on integer types are the following: addI x + y @@ -22714,7 +22602,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 geqI x >= y where x and y are expressions of the same integer type. -

    H.2.3 Floating-point types

    +

    H.2.3 Floating-point types

    The C floating-point types float, double, and long double are compatible with LIA-1. If an implementation adds support for the LIA-1 exceptional values @@ -22723,7 +22611,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 operations (see annex F) along with IEC 60559 status flags and traps has LIA-1 conformant types. -

    H.2.3.1 Floating-point parameters
    +
    H.2.3.1 Floating-point parameters

    The parameters for a floating point data type can be accessed by the following: r FLT_RADIX @@ -22738,7 +22626,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 epsilon FLT_EPSILON, DBL_EPSILON, LDBL_EPSILON rnd_style FLT_ROUNDS -

    H.2.3.2 Floating-point operations
    +
    H.2.3.2 Floating-point operations

    The floating-point operations on floating-point types are the following: addF x + y @@ -22762,7 +22650,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 where x and y are expressions of the same floating point type, n is of type int, and li is of type long int. -

    H.2.3.3 Rounding styles
    +
    H.2.3.3 Rounding styles

    The C Standard requires all floating types to use the same radix and rounding style, so that only one identifier for each is provided to map to LIA-1. @@ -22775,7 +22663,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 provided that an implementation extends FLT_ROUNDS to cover the rounding style used in all relevant LIA-1 operations, not just addition as in C. -

    H.2.4 Type conversions

    +

    H.2.4 Type conversions

    The LIA-1 type conversions are the following type casts: cvtI' -> I (int)i, (long int)i, (long long int)i, @@ -22812,14 +22700,14 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 implementation uses round-to-nearest. -

    H.3 Notification

    +

    H.3 Notification

    Notification is the process by which a user or program is informed that an exceptional arithmetic operation has occurred. C's operations are compatible with LIA-1 in that C allows an implementation to cause a notification to occur when any arithmetic operation returns an exceptional value as defined in LIA-1 clause 5. -

    H.3.1 Notification alternatives

    +

    H.3.1 Notification alternatives

    LIA-1 requires at least the following two alternatives for handling of notifications: setting indicators or trap-and-terminate. LIA-1 allows a third alternative: trap-and- @@ -22839,7 +22727,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 math library function calls. User-provided signal handlers for SIGFPE allow for trap- and-resume behavior with the same constraint. -

    H.3.1.1 Indicators
    +
    H.3.1.1 Indicators

    C's <fenv.h> status flags are compatible with the LIA-1 indicators.

    @@ -22864,7 +22752,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 This documentation makes that distinction because <fenv.h> covers only the floating- point indicators. -

    H.3.1.2 Traps
    +
    H.3.1.2 Traps

    C is compatible with LIA-1's trap requirements for arithmetic operations, but not for math library functions (which are not permitted to generate any externally visible @@ -22882,7 +22770,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 resume, at the programmer's option. -

    Annex I

    +

    Annex I

                                          (informative)
    @@ -22926,7 +22814,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
     
     
     
    -

    Annex J

    +

    Annex J

                                           (informative)
    @@ -22934,7 +22822,7 @@ WG14/N1256                Committee Draft -- Septermber 7, 2007
      This annex collects some information about portability that appears in this International
      Standard.
     
    -

    J.1 Unspecified behavior

    +

    J.1 Unspecified behavior

    The following are unspecified:

    -

    J.2 Undefined behavior

    +

    J.2 Undefined behavior

    The behavior is undefined in the following circumstances:

      @@ -23504,12 +23392,12 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007
    -

    J.3 Implementation-defined behavior

    +

    J.3 Implementation-defined behavior

    A conforming implementation is required to document its choice of behavior in each of the areas listed in this subclause. The following are implementation-defined: -

    J.3.1 Translation

    +

    J.3.1 Translation

    • How a diagnostic is identified (3.10, 5.1.1.3). @@ -23517,7 +23405,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 retained or replaced by one space character in translation phase 3 (5.1.1.2).
    -

    J.3.2 Environment

    +

    J.3.2 Environment

    • The mapping between physical source file multibyte characters and the source @@ -23538,7 +23426,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007
    • The manner of execution of the string by the system function (7.20.4.6).
    -

    J.3.3 Identifiers

    +

    J.3.3 Identifiers

    • Which additional multibyte characters may appear in identifiers and their @@ -23547,7 +23435,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007
    -

    J.3.4 Characters

    +

    J.3.4 Characters

    • The number of bits in a byte (3.6). @@ -23575,7 +23463,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 represented in the execution character set (6.4.5).
    -

    J.3.5 Integers

    +

    J.3.5 Integers

    • Any extended integer types that exist in the implementation (6.2.5). @@ -23590,7 +23478,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007
    • The results of some bitwise operations on signed integers (6.5).
    -

    J.3.6 Floating point

    +

    J.3.6 Floating point

    • The accuracy of the floating-point operations and of the library functions in @@ -23617,7 +23505,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007
    • The default state for the FP_CONTRACT pragma (7.12.2). *
    -

    J.3.7 Arrays and pointers

    +

    J.3.7 Arrays and pointers

    • The result of converting a pointer to an integer or vice versa (6.3.2.3). @@ -23626,7 +23514,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007
    -

    J.3.8 Hints

    +

    J.3.8 Hints

    • The extent to which suggestions made by using the register storage-class @@ -23635,7 +23523,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 effective (6.7.4).
    -

    J.3.9 Structures, unions, enumerations, and bit-fields

    +

    J.3.9 Structures, unions, enumerations, and bit-fields

    • Whether a ''plain'' int bit-field is treated as a signed int bit-field or as an @@ -23649,13 +23537,13 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007
    • The integer type compatible with each enumerated type (6.7.2.2).
    -

    J.3.10 Qualifiers

    +

    J.3.10 Qualifiers

    • What constitutes an access to an object that has volatile-qualified type (6.7.3).
    -

    J.3.11 Preprocessing directives

    +

    J.3.11 Preprocessing directives

    • The locations within #pragma directives where header name preprocessing tokens @@ -23682,7 +23570,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 time of translation are not available (6.10.8).
    -

    J.3.12 Library functions

    +

    J.3.12 Library functions

    • Any library facilities available to a freestanding program, other than the minimal set @@ -23774,7 +23662,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 IEC 60559 conformant implementation, unless explicitly specified otherwise (F.9).
    -

    J.3.13 Architecture

    +

    J.3.13 Architecture

    • The values or expressions assigned to the macros specified in the headers @@ -23785,7 +23673,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007
    -

    J.4 Locale-specific behavior

    +

    J.4 Locale-specific behavior

    The following characteristics of a hosted environment are locale-specific and are required to be documented by the implementation: @@ -23815,7 +23703,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 -

    J.5 Common extensions

    +

    J.5 Common extensions

    The following extensions are widely used in many systems, but are not portable to all implementations. The inclusion of any extension that may cause a strictly conforming @@ -23823,34 +23711,34 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 extensions are new keywords, extra library functions declared in standard headers, or predefined macros with names that do not begin with an underscore. -

    J.5.1 Environment arguments

    +

    J.5.1 Environment arguments

    In a hosted environment, the main function receives a third argument, char *envp[], that points to a null-terminated array of pointers to char, each of which points to a string that provides information about the environment for this execution of the program (5.1.2.2.1). -

    J.5.2 Specialized identifiers

    +

    J.5.2 Specialized identifiers

    Characters other than the underscore _, letters, and digits, that are not part of the basic source character set (such as the dollar sign $, or characters in national character sets) may appear in an identifier (6.4.2). -

    J.5.3 Lengths and cases of identifiers

    +

    J.5.3 Lengths and cases of identifiers

    All characters in identifiers (with or without external linkage) are significant (6.4.2). -

    J.5.4 Scopes of identifiers

    +

    J.5.4 Scopes of identifiers

    A function identifier, or the identifier of an object the declaration of which contains the keyword extern, has file scope (6.2.1). -

    J.5.5 Writable string literals

    +

    J.5.5 Writable string literals

    String literals are modifiable (in which case, identical string literals should denote distinct objects) (6.4.5). -

    J.5.6 Other arithmetic types

    +

    J.5.6 Other arithmetic types

    Additional arithmetic types, such as __int128 or double double, and their appropriate conversions are defined (6.2.5, 6.3.1). Additional floating types may have @@ -23858,7 +23746,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 other floating types, and may be used to define float_t or double_t. -

    J.5.7 Function pointer casts

    +

    J.5.7 Function pointer casts

    A pointer to an object or to void may be cast to a pointer to a function, allowing data to be invoked as a function (6.5.4). @@ -23866,69 +23754,69 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007 A pointer to a function may be cast to a pointer to an object or to void, allowing a function to be inspected or modified (for example, by a debugger) (6.5.4). -

    J.5.8 Extended bit-field types

    +

    J.5.8 Extended bit-field types

    A bit-field may be declared with a type other than _Bool, unsigned int, or signed int, with an appropriate maximum width (6.7.2.1). -

    J.5.9 The fortran keyword

    +

    J.5.9 The fortran keyword

    The fortran function specifier may be used in a function declaration to indicate that calls suitable for FORTRAN should be generated, or that a different representation for the external name is to be generated (6.7.4). -

    J.5.10 The asm keyword

    +

    J.5.10 The asm keyword

    The asm keyword may be used to insert assembly language directly into the translator output (6.8). The most common implementation is via a statement of the form:

             asm ( character-string-literal );
    -

    J.5.11 Multiple external definitions

    +

    J.5.11 Multiple external definitions

    There may be more than one external definition for the identifier of an object, with or without the explicit use of the keyword extern; if the definitions disagree, or more than one is initialized, the behavior is undefined (6.9.2). -

    J.5.12 Predefined macro names

    +

    J.5.12 Predefined macro names

    Macro names that do not begin with an underscore, describing the translation and execution environments, are defined by the implementation before translation begins (6.10.8). -

    J.5.13 Floating-point status flags

    +

    J.5.13 Floating-point status flags

    If any floating-point status flags are set on normal termination after all calls to functions registered by the atexit function have been made (see 7.20.4.3), the implementation writes some diagnostics indicating the fact to the stderr stream, if it is still open, -

    J.5.14 Extra arguments for signal handlers

    +

    J.5.14 Extra arguments for signal handlers

    Handlers for specific signals are called with extra arguments in addition to the signal number (7.14.1.1). -

    J.5.15 Additional stream types and file-opening modes

    +

    J.5.15 Additional stream types and file-opening modes

    Additional mappings from files to streams are supported (7.19.2).

    Additional file-opening modes may be specified by characters appended to the mode argument of the fopen function (7.19.5.3). -

    J.5.16 Defined file position indicator

    +

    J.5.16 Defined file position indicator

    The file position indicator is decremented by each successful call to the ungetc or ungetwc function for a text stream, except if its value was zero before a call (7.19.7.11, 7.24.3.10). -

    J.5.17 Math error reporting

    +

    J.5.17 Math error reporting

    Functions declared in <complex.h> and <math.h> raise SIGFPE to report errors instead of, or in addition to, setting errno or raising floating-point exceptions (7.3, 7.12). -

    Bibliography

    +

    Bibliography

    1. ''The C Reference Manual'' by Dennis M. Ritchie, a version of which was published in The C Programming Language by Brian W. Kernighan and Dennis @@ -23993,7 +23881,7 @@ WG14/N1256 Committee Draft -- Septermber 7, 2007
    -

    Index

    +

    Index

      ??? x ???, 3.18                                                    , (comma punctuator), 6.5.2, 6.7, 6.7.2.1, 6.7.2.2,
                                                                          6.7.2.3, 6.7.8