<a href="#6.4.9"> 6.4.9 Comments . . . . . . . . . . . . . . . . . . . . . 66</a>
<a href="#6.5"> 6.5 Expressions . . . . . . . . . . . . . . . . . . . . . . . . 67</a>
-
[page iii]
<a href="#6.5.1"> 6.5.1 Primary expressions . . . . . . . . . . . . . . . . . 69</a>
<a href="#Bibliography">Bibliography . . . . . . . . . . . . . . . . . . . . . . . . . . . 516</a>
<a href="#Index">Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 519</a>
-
-
-
[<a name="pix" href="#pix">page ix</a>] (<a href="#Contents">Contents</a>)
-
[<a name="px" href="#px">page x</a>] (<a href="#Contents">Contents</a>)
<a name="Foreword" href="#Foreword"><b> Foreword</b></a>
-- type-generic math macros in <a href="#7.22"><tgmath.h></a>
-- the long long int type and library functions
-
[<a name="pxi" href="#pxi">page xi</a>] (<a href="#Contents">Contents</a>)
-- increased minimum translation limits
-- idempotent type qualifiers
-- empty macro arguments
-
[<a name="pxii" href="#pxii">page xii</a>] (<a href="#Contents">Contents</a>)
-- new structure type compatibility rules (tag compatibility)
ISO/IEC Directives, this foreword, the introduction, notes, footnotes, and examples are
also for information only.
-
-
-
[<a name="pxiii" href="#pxiii">page xiii</a>] (<a href="#Contents">Contents</a>)
<a name="Introduction" href="#Introduction"><b> Introduction</b></a>
5 The language clause (clause 6) is derived from ''The C Reference Manual''.
6 The library clause (clause 7) is based on the 1984 /usr/group Standard.
-
-
-
[<a name="pxiv" href="#pxiv">page xiv</a>] (<a href="#Contents">Contents</a>)
8 IEC 60559:1989, Binary floating-point arithmetic for microprocessor systems (previously
designated IEC 559:1989).
-
-
-
[<a name="p2" href="#p2">page 2</a>] (<a href="#Contents">Contents</a>)
behavior that depends on local conventions of nationality, culture, and language that each
implementation documents
-
[<a name="p3" href="#p3">page 3</a>] (<a href="#Contents">Contents</a>)
2 EXAMPLE An example of locale-specific behavior is whether the islower function returns true for
1 character
single-byte character
<C> bit representation that fits in a byte
+
[<a name="p4" href="#p4">page 4</a>] (<a href="#Contents">Contents</a>)
<a name="3.7.2" href="#3.7.2"><b> 3.7.2</b></a>
floor of x: the greatest integer less than or equal to x
2 EXAMPLE ???2.4??? is 2, ???-2.4??? is -3.
-
-
-
[<a name="p6" href="#p6">page 6</a>] (<a href="#Contents">Contents</a>)
that the result would be the same as if it were executed using double-precision arithmetic (for example, if d
were replaced by the constant 2.0, which has type double).
-
-
-
[<a name="p14" href="#p14">page 14</a>] (<a href="#Contents">Contents</a>)
12 EXAMPLE 4 Implementations employing wide registers have to take care to honor appropriate
above expression statement can be rewritten by the implementation in any of the above ways because the
same result will occur.
-
-
-
[<a name="p15" href="#p15">page 15</a>] (<a href="#Contents">Contents</a>)
15 EXAMPLE 7 The grouping of an expression does not completely determine its evaluation. In the
Forward references: expressions (<a href="#6.5">6.5</a>), type qualifiers (<a href="#6.7.3">6.7.3</a>), statements (<a href="#6.8">6.8</a>), the
signal function (<a href="#7.14">7.14</a>), files (<a href="#7.19.3">7.19.3</a>).
-
-
-
[<a name="p16" href="#p16">page 16</a>] (<a href="#Contents">Contents</a>)
<a name="5.2" href="#5.2"><b> 5.2 Environmental considerations</b></a>
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
+
[<a name="p19" href="#p19">page 19</a>] (<a href="#Contents">Contents</a>)
tabulation position, the behavior of the display device is unspecified.
-- maximum value for an object of type unsigned long int
ULONG_MAX 4294967295 // 232 - 1
-
[<a name="p22" href="#p22">page 22</a>] (<a href="#Contents">Contents</a>)
-- minimum value for an object of type long long int
implementation-defined (positive) values that are less than or equal to those shown:
-- the difference between 1 and the least value greater than 1 that is representable in the
given floating point type, b1- p
+
[<a name="p26" href="#p26">page 26</a>] (<a href="#Contents">Contents</a>)
FLT_EPSILON 1E-5
(<a href="#7.24">7.24</a>), floating-point environment <a href="#7.6"><fenv.h></a> (<a href="#7.6">7.6</a>), general utilities <a href="#7.20"><stdlib.h></a>
(<a href="#7.20">7.20</a>), input/output <a href="#7.19"><stdio.h></a> (<a href="#7.19">7.19</a>), mathematics <a href="#7.12"><math.h></a> (<a href="#7.12">7.12</a>).
-
-
-
[<a name="p28" href="#p28">page 28</a>] (<a href="#Contents">Contents</a>)
declares the identifier appears inside a block or within the list of parameter declarations in
a function definition, the identifier has block scope, which terminates at the end of the
associated block. If the declarator or type specifier that declares the identifier appears
+
[<a name="p29" href="#p29">page 29</a>] (<a href="#Contents">Contents</a>)
within the list of parameter declarations in a function prototype (not part of a function
The resulting composite type for the function is:
int f(int (*)(char *), double (*)[3]);
-
-
-
[<a name="p41" href="#p41">page 41</a>] (<a href="#Contents">Contents</a>)
<a name="6.3" href="#6.3"><b> 6.3 Conversions</b></a>
Forward references: cast operators (<a href="#6.5.4">6.5.4</a>), equality operators (<a href="#6.5.9">6.5.9</a>), integer types
capable of holding object pointers (<a href="#7.18.1.4">7.18.1.4</a>), simple assignment (<a href="#6.5.16.1">6.5.16.1</a>).
-
-
-
[<a name="p48" href="#p48">page 48</a>] (<a href="#Contents">Contents</a>)
<a name="6.4" href="#6.4"><b> 6.4 Lexical elements</b></a>
octal-digit: one of
0 1 2 3 4 5 6 7
-
-
-
[<a name="p54" href="#p54">page 54</a>] (<a href="#Contents">Contents</a>)
hexadecimal-digit: one of
5 The type of an integer constant is the first of the corresponding list in which its value can
be represented.
-
-
-
[<a name="p55" href="#p55">page 55</a>] (<a href="#Contents">Contents</a>)
Octal or Hexadecimal
may be signed or unsigned. If an integer constant cannot be represented by any type in
its list and has no extended integer type, then the integer constant has no type.
-
-
-
[<a name="p56" href="#p56">page 56</a>] (<a href="#Contents">Contents</a>)
<a name="6.4.4.2" href="#6.4.4.2"><b> 6.4.4.2 Floating constants</b></a>
\x hexadecimal-digit
hexadecimal-escape-sequence hexadecimal-digit
-
-
[<a name="p59" href="#p59">page 59</a>] (<a href="#Contents">Contents</a>)
<b> Description</b>
Forward references: common definitions <a href="#7.17"><stddef.h></a> (<a href="#7.17">7.17</a>), the mbtowc function
(<a href="#7.20.7.2">7.20.7.2</a>).
-
-
-
[<a name="p61" href="#p61">page 61</a>] (<a href="#Contents">Contents</a>)
<a name="6.4.5" href="#6.4.5"><b> 6.4.5 String literals</b></a>
in which case it is known as an operator (other forms of operator also exist in some
contexts). An operand is an entity on which an operator acts.
-
-
-
[<a name="p63" href="#p63">page 63</a>] (<a href="#Contents">Contents</a>)
3 In all aspects of the language, the six tokens<sup><a href="#note67"><b>67)</b></a></sup>
Forward references: additive operators (<a href="#6.5.6">6.5.6</a>), address and indirection operators
(<a href="#6.5.3.2">6.5.3.2</a>), array declarators (<a href="#6.7.5.2">6.7.5.2</a>).
-
-
-
[<a name="p70" href="#p70">page 70</a>] (<a href="#Contents">Contents</a>)
<a name="6.5.2.2" href="#6.5.2.2"><b> 6.5.2.2 Function calls</b></a>
structure'' or ''pointer to qualified or unqualified union'', and the second operand shall
name a member of the type pointed to.
-
-
-
[<a name="p72" href="#p72">page 72</a>] (<a href="#Contents">Contents</a>)
<b> Semantics</b>
Forward references: address and indirection operators (<a href="#6.5.3.2">6.5.3.2</a>), structure and union
specifiers (<a href="#6.7.2.1">6.7.2.1</a>).
-
-
-
[<a name="p74" href="#p74">page 74</a>] (<a href="#Contents">Contents</a>)
<a name="6.5.2.4" href="#6.5.2.4"><b> 6.5.2.4 Postfix increment and decrement operators</b></a>
Forward references: type names (<a href="#6.7.6">6.7.6</a>), initialization (<a href="#6.7.8">6.7.8</a>).
-
-
-
[<a name="p77" href="#p77">page 77</a>] (<a href="#Contents">Contents</a>)
<a name="6.5.3" href="#6.5.3"><b> 6.5.3 Unary operators</b></a>
object of type ptrdiff_t. Moreover, if the expression P points either to an element of
an array object or one past the last element of an array object, and the expression Q points
to the last element of the same array object, the expression ((Q)+1)-(P) has the same
+
[<a name="p83" href="#p83">page 83</a>] (<a href="#Contents">Contents</a>)
value as ((Q)-(P))+1 and as -((P)-((Q)+1)), and has the value zero if the
the result is set if and only if at least one of the corresponding bits in the converted
operands is set).
-
-
-
[<a name="p88" href="#p88">page 88</a>] (<a href="#Contents">Contents</a>)
<a name="6.5.13" href="#6.5.13"><b> 6.5.13 Logical AND operator</b></a>
a sequence point after the evaluation of the first operand. If the first operand compares
unequal to 0, the second operand is not evaluated.
-
-
-
[<a name="p89" href="#p89">page 89</a>] (<a href="#Contents">Contents</a>)
<a name="6.5.15" href="#6.5.15"><b> 6.5.15 Conditional operator</b></a>
the result of an assignment operator or to access it after the next sequence point, the
behavior is undefined.
-
[<a name="p91" href="#p91">page 91</a>] (<a href="#Contents">Contents</a>)
<a name="6.5.16.1" href="#6.5.16.1"><b> 6.5.16.1 Simple assignment</b></a>
3 A compound assignment of the form E1 op = E2 differs from the simple assignment
expression E1 = E1 op (E2) only in that the lvalue E1 is evaluated only once.
-
-
-
[<a name="p93" href="#p93">page 93</a>] (<a href="#Contents">Contents</a>)
<a name="6.5.17" href="#6.5.17"><b> 6.5.17 Comma operator</b></a>
-- unsigned short, or unsigned short int
-- int, signed, or signed int
-
[<a name="p99" href="#p99">page 99</a>] (<a href="#Contents">Contents</a>)
-- unsigned, or unsigned int
4 A bit-field shall have a type that is a qualified or unqualified version of _Bool, signed
int, unsigned int, or some other implementation-defined type.
-
[<a name="p101" href="#p101">page 101</a>] (<a href="#Contents">Contents</a>)
<b> Semantics</b>
not be the same).
18 Following the above declaration:
-
-
-
[<a name="p103" href="#p103">page 103</a>] (<a href="#Contents">Contents</a>)
struct s t1 = { 0 }; // valid
function call and an equivalent nested block. With one exception, only ''outer-to-inner'' assignments
between restricted pointers declared in nested blocks have defined behavior.
-
-
-
[<a name="p111" href="#p111">page 111</a>] (<a href="#Contents">Contents</a>)
{
implementation-defined.<sup><a href="#note121"><b>121)</b></a></sup>
6 Any function with internal linkage can be an inline function. For a function with external
linkage, the following restrictions apply: If a function is declared with an inline
+
[<a name="p112" href="#p112">page 112</a>] (<a href="#Contents">Contents</a>)
function specifier, then it shall also be defined in the same translation unit. If all of the
scope, storage duration, and type indicated by the declaration specifiers.
3 A full declarator is a declarator that is not part of another declarator. The end of a full
declarator is a sequence point. If, in the nested sequence of declarators in a full
+
[<a name="p114" href="#p114">page 114</a>] (<a href="#Contents">Contents</a>)
declarator, there is a declarator specifying a variable length array type, the type specified
3 EXAMPLE The following pair of declarations demonstrates the difference between a ''variable pointer
to a constant value'' and a ''constant pointer to a variable value''.
-
-
-
[<a name="p115" href="#p115">page 115</a>] (<a href="#Contents">Contents</a>)
const int *ptr_to_constant;
The pointer returned by fpfi points to a function that has one int parameter and accepts zero or more
additional arguments of any type.
-
-
-
[<a name="p120" href="#p120">page 120</a>] (<a href="#Contents">Contents</a>)
20 EXAMPLE 4 The following prototype has a variably modified parameter.
Forward references: function definitions (<a href="#6.9.1">6.9.1</a>), type names (<a href="#6.7.6">6.7.6</a>).
-
-
-
[<a name="p121" href="#p121">page 121</a>] (<a href="#Contents">Contents</a>)
<a name="6.7.6" href="#6.7.6"><b> 6.7.6 Type names</b></a>
type t1 and the type pointed to by tp1 are compatible. Type t1 is also compatible with type struct
s1, but not compatible with the types struct s2, t2, the type pointed to by tp2, or int.
-
-
-
[<a name="p123" href="#p123">page 123</a>] (<a href="#Contents">Contents</a>)
6 EXAMPLE 3 The following obscure constructions
a[i-1] = b[i];
}
-
-
-
[<a name="p124" href="#p124">page 124</a>] (<a href="#Contents">Contents</a>)
<a name="6.7.8" href="#6.7.8"><b> 6.7.8 Initialization</b></a>
. identifier
then the current object (defined below) shall have structure or union type and the
identifier shall be the name of a member of that type.
+
[<a name="p125" href="#p125">page 125</a>] (<a href="#Contents">Contents</a>)
<b> Semantics</b>
17 Each brace-enclosed initializer list has an associated current object. When no
designations are present, subobjects of the current object are initialized in order according
to the type of the current object: array elements in increasing subscript order, structure
+
[<a name="p126" href="#p126">page 126</a>] (<a href="#Contents">Contents</a>)
members in declaration order, and the first named member of a union.<sup><a href="#note129"><b>129)</b></a></sup> In contrast, a
int a[] = { 1, 2 }, b[] = { 3, 4, 5 };
due to the rules for incomplete types.
-
-
[<a name="p129" href="#p129">page 129</a>] (<a href="#Contents">Contents</a>)
32 EXAMPLE 8 The declaration
Forward references: common definitions <a href="#7.17"><stddef.h></a> (<a href="#7.17">7.17</a>).
-
-
-
[<a name="p130" href="#p130">page 130</a>] (<a href="#Contents">Contents</a>)
<a name="6.8" href="#6.8"><b> 6.8 Statements and blocks</b></a>
2 A case or default label shall appear only in a switch statement. Further
constraints on such labels are discussed under the switch statement.
-
[<a name="p131" href="#p131">page 131</a>] (<a href="#Contents">Contents</a>)
3 Label names shall be unique within a function.
/* ... */
}
-
-
-
[<a name="p137" href="#p137">page 137</a>] (<a href="#Contents">Contents</a>)
4 EXAMPLE 2 A goto statement is not allowed to jump past any declarations of objects with variably
int (*fp)(void); // fp points to a function that has type F
F *Fp; // Fp points to a function that has type F
-
[<a name="p141" href="#p141">page 141</a>] (<a href="#Contents">Contents</a>)
<b> Semantics</b>
3 If the declaration of an identifier for an object is a tentative definition and has internal
linkage, the declared type shall not be an incomplete type.
-
-
-
[<a name="p143" href="#p143">page 143</a>] (<a href="#Contents">Contents</a>)
4 EXAMPLE 1
the array i still has incomplete type, the implicit initializer causes it to have one element, which is set to
zero on program startup.
-
-
-
[<a name="p144" href="#p144">page 144</a>] (<a href="#Contents">Contents</a>)
<a name="6.10" href="#6.10"><b> 6.10 Preprocessing directives</b></a>
endif-line:
# endif new-line
-
-
-
[<a name="p145" href="#p145">page 145</a>] (<a href="#Contents">Contents</a>)
control-line:
string literal corresponding to an empty argument is "". The order of evaluation of # and
## operators is unspecified.
-
-
-
[<a name="p153" href="#p153">page 153</a>] (<a href="#Contents">Contents</a>)
<a name="6.10.3.3" href="#6.10.3.3"><b> 6.10.3.3 The ## operator</b></a>
#define max(a, b) ((a) > (b) ? (a) : (b))
The parentheses ensure that the arguments and the resulting expression are bound properly.
-
-
-
[<a name="p155" href="#p155">page 155</a>] (<a href="#Contents">Contents</a>)
5 EXAMPLE 3 To illustrate the rules for redefinition and reexamination, the sequence
xglue(HIGH, LOW)
results in
-
-
-
[<a name="p156" href="#p156">page 156</a>] (<a href="#Contents">Contents</a>)
printf("x" "1" "= %d, x" "2" "= %s", x1, x2);
showlist(The first, second, and third items.);
report(x>y, "x is %d but y is %d", x, y);
-
[<a name="p157" href="#p157">page 157</a>] (<a href="#Contents">Contents</a>)
results in
tokens). The directive resulting after all replacements shall match one of the two
previous forms and is then processed as appropriate.
-
-
-
[<a name="p158" href="#p158">page 158</a>] (<a href="#Contents">Contents</a>)
<a name="6.10.5" href="#6.10.5"><b> 6.10.5 Error directive</b></a>
2 EXAMPLE A directive of the form:
#pragma listing on "..\listing.dir"
can also be expressed as:
+
[<a name="p161" href="#p161">page 161</a>] (<a href="#Contents">Contents</a>)
_Pragma ( "listing on \"..\\listing.dir\"" )
#define PRAGMA(x) _Pragma(#x)
LISTING ( ..\listing.dir )
-
-
-
[<a name="p162" href="#p162">page 162</a>] (<a href="#Contents">Contents</a>)
<a name="6.11" href="#6.11"><b> 6.11 Future language directions</b></a>
<a name="6.11.9" href="#6.11.9"><b> 6.11.9 Predefined macro names</b></a>
1 Macro names beginning with __STDC_ are reserved for future standardization.
-
-
-
[<a name="p163" href="#p163">page 163</a>] (<a href="#Contents">Contents</a>)
/* ... */
i = atoi(str);
-
-
-
[<a name="p168" href="#p168">page 168</a>] (<a href="#Contents">Contents</a>)
<a name="7.2" href="#7.2"><b> 7.2 Diagnostics <assert.h></b></a>
<sup><a name="note165" href="#note165"><b>165)</b></a></sup> The message written might be of the form:
Assertion failed: expression, function abc, file xyz, line nnn.
-
[<a name="p169" href="#p169">page 169</a>] (<a href="#Contents">Contents</a>)
<a name="7.3" href="#7.3"><b> 7.3 Complex arithmetic <complex.h></b></a>
<sup><a name="note169" href="#note169"><b>169)</b></a></sup> The purpose of the pragma is to allow the implementation to use the formulas:
(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 | = (sqrt) x 2 + y 2
???????????????
where the programmer can determine they are safe.
2 The casinh functions compute the complex arc hyperbolic sine of z, with branch cuts
outside the interval [-i, +i] along the imaginary axis.
-
[<a name="p174" href="#p174">page 174</a>] (<a href="#Contents">Contents</a>)
<b> Returns</b>
float complex csinhf(float complex z);
long double complex csinhl(long double complex z);
-
[<a name="p175" href="#p175">page 175</a>] (<a href="#Contents">Contents</a>)
<b> Description</b>
float complex clogf(float complex z);
long double complex clogl(long double complex z);
-
-
[<a name="p176" href="#p176">page 176</a>] (<a href="#Contents">Contents</a>)
<b> Description</b>
<b> Returns</b>
3 The cpow functions return the complex power function value.
-
-
-
[<a name="p177" href="#p177">page 177</a>] (<a href="#Contents">Contents</a>)
<a name="7.3.8.3" href="#7.3.8.3"><b> 7.3.8.3 The csqrt functions</b></a>
float cimagf(float complex z);
long double cimagl(long double complex z);
-
-
-
[<a name="p178" href="#p178">page 178</a>] (<a href="#Contents">Contents</a>)
<b> Description</b>
the tolower function returns one of the corresponding characters (always the same one
for any given locale); otherwise, the argument is returned unchanged.
-
-
-
[<a name="p184" href="#p184">page 184</a>] (<a href="#Contents">Contents</a>)
<a name="7.4.2.2" href="#7.4.2.2"><b> 7.4.2.2 The toupper function</b></a>
the toupper function returns one of the corresponding characters (always the same one
for any given locale); otherwise, the argument is returned unchanged.
-
-
-
[<a name="p185" href="#p185">page 185</a>] (<a href="#Contents">Contents</a>)
<a name="7.5" href="#7.5"><b> 7.5 Errors <errno.h></b></a>
3 The fesetround function returns zero if and only if the requested rounding direction
was established.
-
[<a name="p193" href="#p193">page 193</a>] (<a href="#Contents">Contents</a>)
4 EXAMPLE Save, set, and restore the rounding direction. Report an error and abort if setting the
return result;
}
-
-
-
[<a name="p196" href="#p196">page 196</a>] (<a href="#Contents">Contents</a>)
<a name="7.7" href="#7.7"><b> 7.7 Characteristics of floating types <float.h></b></a>
2 The macros, their meanings, and the constraints (or restrictions) on their values are listed
in <a href="#5.2.4.2.2">5.2.4.2.2</a>.
-
-
-
[<a name="p197" href="#p197">page 197</a>] (<a href="#Contents">Contents</a>)
<a name="7.8" href="#7.8"><b> 7.8 Format conversion of integer types <inttypes.h></b></a>
Forward references: the strtol, strtoll, strtoul, and strtoull functions
(<a href="#7.20.1.4">7.20.1.4</a>).
-
-
[<a name="p200" href="#p200">page 200</a>] (<a href="#Contents">Contents</a>)
<a name="7.8.2.4" href="#7.8.2.4"><b> 7.8.2.4 The wcstoimax and wcstoumax functions</b></a>
Forward references: the wcstol, wcstoll, wcstoul, and wcstoull functions
(<a href="#7.24.4.1.2">7.24.4.1.2</a>).
-
-
-
[<a name="p201" href="#p201">page 201</a>] (<a href="#Contents">Contents</a>)
<a name="7.9" href="#7.9"><b> 7.9 Alternative spellings <iso646.h></b></a>
xor ^
xor_eq ^=
-
-
-
[<a name="p202" href="#p202">page 202</a>] (<a href="#Contents">Contents</a>)
<a name="7.10" href="#7.10"><b> 7.10 Sizes of integer types <limits.h></b></a>
2 The macros, their meanings, and the constraints (or restrictions) on their values are listed
in <a href="#5.2.4.2.1">5.2.4.2.1</a>.
-
-
-
[<a name="p203" href="#p203">page 203</a>] (<a href="#Contents">Contents</a>)
<a name="7.11" href="#7.11"><b> 7.11 Localization <locale.h></b></a>
char int_p_sign_posn; // CHAR_MAX
char int_n_sign_posn; // CHAR_MAX
-
-
-
[<a name="p204" href="#p204">page 204</a>] (<a href="#Contents">Contents</a>)
3 The macros defined are NULL (described in <a href="#7.17">7.17</a>); and
Set to 1 or 0 if the currency_symbol respectively precedes or
succeeds the value for a negative locally formatted monetary quantity.
-
[<a name="p207" href="#p207">page 207</a>] (<a href="#Contents">Contents</a>)
char p_sep_by_space
sign string, and the value for a nonnegative internationally formatted
monetary quantity.
-
-
-
[<a name="p208" href="#p208">page 208</a>] (<a href="#Contents">Contents</a>)
char int_n_sep_by_space
3 The sign string immediately precedes the currency symbol.
4 The sign string immediately succeeds the currency symbol.
-
[<a name="p209" href="#p209">page 209</a>] (<a href="#Contents">Contents</a>)
7 The implementation shall behave as if no library function calls the localeconv
int_p_sign_posn 1 1 1 1
int_n_sign_posn 4 1 4 2
-
-
-
[<a name="p210" href="#p210">page 210</a>] (<a href="#Contents">Contents</a>)
11 EXAMPLE 2 The following table illustrates how the cs_precedes, sep_by_space, and sign_posn members
3 +$1.25 +$ <a href="#1.25">1.25</a> + $1.25
4 $+1.25 $+ <a href="#1.25">1.25</a> $ +1.25
-
-
-
[<a name="p211" href="#p211">page 211</a>] (<a href="#Contents">Contents</a>)
<a name="7.12" href="#7.12"><b> 7.12 Mathematics <math.h></b></a>
<b> Returns</b>
3 The atan2 functions return arctan y/x in the interval [-pi , +pi ] radians.
-
[<a name="p219" href="#p219">page 219</a>] (<a href="#Contents">Contents</a>)
<a name="7.12.4.5" href="#7.12.4.5"><b> 7.12.4.5 The cos functions</b></a>
<b> Returns</b>
3 The tan functions return tan x.
-
-
-
[<a name="p220" href="#p220">page 220</a>] (<a href="#Contents">Contents</a>)
<a name="7.12.5" href="#7.12.5"><b> 7.12.5 Hyperbolic functions</b></a>
for arguments not in the interval [-1, +1]. A range error may occur if the argument
equals -1 or +1.
-
-
[<a name="p221" href="#p221">page 221</a>] (<a href="#Contents">Contents</a>)
<b> Returns</b>
<b> Description</b>
2 The tanh functions compute the hyperbolic tangent of x.
-
-
[<a name="p222" href="#p222">page 222</a>] (<a href="#Contents">Contents</a>)
<b> Returns</b>
float expm1f(float x);
long double expm1l(long double x);
-
-
-
[<a name="p223" href="#p223">page 223</a>] (<a href="#Contents">Contents</a>)
<b> Description</b>
float log10f(float x);
long double log10l(long double x);
-
-
-
[<a name="p225" href="#p225">page 225</a>] (<a href="#Contents">Contents</a>)
<b> Description</b>
<b> Returns</b>
3 The modf functions return the signed fractional part of value.
-
-
-
[<a name="p227" href="#p227">page 227</a>] (<a href="#Contents">Contents</a>)
<a name="7.12.6.13" href="#7.12.6.13"><b> 7.12.6.13 The scalbn and scalbln functions</b></a>
<b> Description</b>
2 The fabs functions compute the absolute value of a floating-point number x.
-
[<a name="p228" href="#p228">page 228</a>] (<a href="#Contents">Contents</a>)
<b> Returns</b>
2 The hypot functions compute the square root of the sum of the squares of x and y,
without undue overflow or underflow. A range error may occur.
3 Returns
-4 The hypot functions return sqrt:x2 + y2 .
+4 The hypot functions return (sqrt)x2 + y2 .
???
???????????????
<a name="7.12.7.4" href="#7.12.7.4"><b> 7.12.7.4 The pow functions</b></a>
float sqrtf(float x);
long double sqrtl(long double x);
-
-
-
[<a name="p229" href="#p229">page 229</a>] (<a href="#Contents">Contents</a>)
<b> Description</b>
2 The sqrt functions compute the nonnegative square root of x. A domain error occurs if
the argument is less than zero.
<b> Returns</b>
-3 The sqrt functions return sqrt:x.
+3 The sqrt functions return (sqrt)x.
???
???
<a name="7.12.8" href="#7.12.8"><b> 7.12.8 Error and gamma functions</b></a>
2
- sqrt:pi
+ (sqrt)pi
???
??? 0
2
- sqrt:pi
+ (sqrt)pi
???
??? x
-
-
-
[<a name="p230" href="#p230">page 230</a>] (<a href="#Contents">Contents</a>)
<a name="7.12.8.3" href="#7.12.8.3"><b> 7.12.8.3 The lgamma functions</b></a>
<b> Description</b>
2 The ceil functions compute the smallest integer value not less than x.
-
[<a name="p231" href="#p231">page 231</a>] (<a href="#Contents">Contents</a>)
<b> Returns</b>
2 The rint functions differ from the nearbyint functions (<a href="#7.12.9.3">7.12.9.3</a>) only in that the
rint functions may raise the ''inexact'' floating-point exception if the result differs in
value from the argument.
+
[<a name="p232" href="#p232">page 232</a>] (<a href="#Contents">Contents</a>)
<b> Returns</b>
<b> Returns</b>
3 The round functions return the rounded integer value.
-
-
-
[<a name="p233" href="#p233">page 233</a>] (<a href="#Contents">Contents</a>)
<a name="7.12.9.7" href="#7.12.9.7"><b> 7.12.9.7 The lround and llround functions</b></a>
<b> Returns</b>
3 The trunc functions return the truncated integer value.
-
-
-
[<a name="p234" href="#p234">page 234</a>] (<a href="#Contents">Contents</a>)
<a name="7.12.10" href="#7.12.10"><b> 7.12.10 Remainder functions</b></a>
<b> Returns</b>
3 The copysign functions return a value with the magnitude of x and the sign of y.
-
-
-
[<a name="p236" href="#p236">page 236</a>] (<a href="#Contents">Contents</a>)
<a name="7.12.11.2" href="#7.12.11.2"><b> 7.12.11.2 The nan functions</b></a>
(x) < (y) || (x) > (y); however, islessgreater(x, y) does not raise
the ''invalid'' floating-point exception when x and y are unordered (nor does it evaluate x
and y twice).
+
[<a name="p241" href="#p241">page 241</a>] (<a href="#Contents">Contents</a>)
<b> Returns</b>
<b> Returns</b>
3 The isunordered macro returns 1 if its arguments are unordered and 0 otherwise.
-
-
-
[<a name="p242" href="#p242">page 242</a>] (<a href="#Contents">Contents</a>)
<a name="7.13" href="#7.13"><b> 7.13 Nonlocal jumps <setjmp.h></b></a>
longjmp(buf, 2); // might cause memory loss
}
-
-
-
[<a name="p245" href="#p245">page 245</a>] (<a href="#Contents">Contents</a>)
<a name="7.14" href="#7.14"><b> 7.14 Signal handling <signal.h></b></a>
<b> Returns</b>
3 The raise function returns zero if successful, nonzero if unsuccessful.
-
-
-
[<a name="p248" href="#p248">page 248</a>] (<a href="#Contents">Contents</a>)
<a name="7.15" href="#7.15"><b> 7.15 Variable arguments <stdarg.h></b></a>
char *array[MAXARGS];
int ptr_no = 0;
-
-
-
[<a name="p251" href="#p251">page 251</a>] (<a href="#Contents">Contents</a>)
if (n_ptrs > MAXARGS)
f4(n_ptrs, array);
}
-
-
-
[<a name="p252" href="#p252">page 252</a>] (<a href="#Contents">Contents</a>)
<a name="7.16" href="#7.16"><b> 7.16 Boolean type and values <stdbool.h></b></a>
large enough to make this necessary.
Forward references: localization (<a href="#7.11">7.11</a>).
-
-
-
[<a name="p254" href="#p254">page 254</a>] (<a href="#Contents">Contents</a>)
<a name="7.18" href="#7.18"><b> 7.18 Integer types <stdint.h></b></a>
-- maximum value of pointer-holding signed integer type
INTPTR_MAX 215 - 1
-
-
-[<a name="p258" href="#p258">page 258</a>] (<a href="#Contents">Contents</a>)
+[<a name="p258" href="#p258">page 258</a>] (<a href="#Contents">Contents</a>)
-- maximum value of pointer-holding unsigned integer type
UINTPTR_MAX 216 - 1
by its argument and the type uintmax_t:
UINTMAX_C(value)
-
-
-
[<a name="p261" href="#p261">page 261</a>] (<a href="#Contents">Contents</a>)
<a name="7.19" href="#7.19"><b> 7.19 Input/output <stdio.h></b></a>
which expands to an integer constant expression that is the size needed for an array of
char large enough to hold the longest file name string that the implementation
-
-
[<a name="p262" href="#p262">page 262</a>] (<a href="#Contents">Contents</a>)
guarantees can be opened;<sup><a href="#note231"><b>231)</b></a></sup>
old is no longer accessible by that name. If a file named by the string pointed to by new
exists prior to the call to the rename function, the behavior is implementation-defined.
-
-
-
[<a name="p268" href="#p268">page 268</a>] (<a href="#Contents">Contents</a>)
<b> Returns</b>
1 #include <a href="#7.19"><stdio.h></a>
int fflush(FILE *stream);
-
-
-
[<a name="p270" href="#p270">page 270</a>] (<a href="#Contents">Contents</a>)
<b> Description</b>
2 The freopen function opens the file whose name is the string pointed to by filename
and associates the stream pointed to by stream with it. The mode argument is used just
-
-
-
[<a name="p272" href="#p272">page 272</a>] (<a href="#Contents">Contents</a>)
as in the fopen function.<sup><a href="#note238"><b>238)</b></a></sup>
with leading zeros. The default precision is 1. The result of converting a
zero value with a precision of zero is no characters.
-
[<a name="p277" href="#p277">page 277</a>] (<a href="#Contents">Contents</a>)
f,F A double argument representing a floating-point number is converted to
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.
+
[<a name="p284" href="#p284">page 284</a>] (<a href="#Contents">Contents</a>)
o Matches an optionally signed octal integer, whose format is the same as
entry into the alternate shift state.
23 After the call:
-
-
-
[<a name="p288" href="#p288">page 288</a>] (<a href="#Contents">Contents</a>)
#include <a href="#7.19"><stdio.h></a>
strtol, strtoll, strtoul, and strtoull functions (<a href="#7.20.1.4">7.20.1.4</a>), conversion state
(<a href="#7.24.6">7.24.6</a>), the wcrtomb function (<a href="#7.24.6.3.3">7.24.6.3.3</a>).
-
-
-
[<a name="p289" href="#p289">page 289</a>] (<a href="#Contents">Contents</a>)
<a name="7.19.6.3" href="#7.19.6.3"><b> 7.19.6.3 The printf function</b></a>
items assigned, which can be fewer than provided for, or even zero, in the event of an
early matching failure.
-
-
-
[<a name="p291" href="#p291">page 291</a>] (<a href="#Contents">Contents</a>)
<a name="7.19.6.8" href="#7.19.6.8"><b> 7.19.6.8 The vfprintf function</b></a>
3 The vprintf function returns the number of characters transmitted, or a negative value
if an output or encoding error occurred.
-
-
-
[<a name="p293" href="#p293">page 293</a>] (<a href="#Contents">Contents</a>)
<a name="7.19.6.11" href="#7.19.6.11"><b> 7.19.6.11 The vscanf function</b></a>
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.
-
-
-
[<a name="p294" href="#p294">page 294</a>] (<a href="#Contents">Contents</a>)
<a name="7.19.6.13" href="#7.19.6.13"><b> 7.19.6.13 The vsprintf function</b></a>
items assigned, which can be fewer than provided for, or even zero, in the event of an
early matching failure.
-
-
-
[<a name="p295" href="#p295">page 295</a>] (<a href="#Contents">Contents</a>)
<a name="7.19.7" href="#7.19.7"><b> 7.19.7 Character input/output functions</b></a>
may evaluate stream more than once, so the argument should never be an expression
with side effects.
-
-
-
[<a name="p297" href="#p297">page 297</a>] (<a href="#Contents">Contents</a>)
<b> Returns</b>
indeterminate and a null pointer is returned.
Forward references: future library directions (<a href="#7.26.9">7.26.9</a>).
-
-
-
[<a name="p298" href="#p298">page 298</a>] (<a href="#Contents">Contents</a>)
<a name="7.19.7.8" href="#7.19.7.8"><b> 7.19.7.8 The putc function</b></a>
3 The puts function returns EOF if a write error occurs; otherwise it returns a nonnegative
value.
-
-
-
[<a name="p299" href="#p299">page 299</a>] (<a href="#Contents">Contents</a>)
<a name="7.19.7.11" href="#7.19.7.11"><b> 7.19.7.11 The ungetc function</b></a>
error occurs, the resulting value of the file position indicator for the stream is
indeterminate.
-
-
-
[<a name="p301" href="#p301">page 301</a>] (<a href="#Contents">Contents</a>)
<b> Returns</b>
<b> Returns</b>
3 The clearerr function returns no value.
-
-
-
[<a name="p304" href="#p304">page 304</a>] (<a href="#Contents">Contents</a>)
<a name="7.19.10.2" href="#7.19.10.2"><b> 7.19.10.2 The feof function</b></a>
3 The perror function returns no value.
Forward references: the strerror function (<a href="#7.21.6.2">7.21.6.2</a>).
-
[<a name="p305" href="#p305">page 305</a>] (<a href="#Contents">Contents</a>)
<a name="7.20" href="#7.20"><b> 7.20 General utilities <stdlib.h></b></a>
Forward references: the strtol, strtoll, strtoul, and strtoull functions
(<a href="#7.20.1.4">7.20.1.4</a>).
-
-
[<a name="p307" href="#p307">page 307</a>] (<a href="#Contents">Contents</a>)
<a name="7.20.1.3" href="#7.20.1.3"><b> 7.20.1.3 The strtod, strtof, and strtold functions</b></a>
4 If the subject sequence has the expected form for a floating-point number, the sequence of
characters starting with the first digit or the decimal-point character (whichever occurs
first) is interpreted as a floating constant according to the rules of <a href="#6.4.4.2">6.4.4.2</a>, except that the
+
[<a name="p308" href="#p308">page 308</a>] (<a href="#Contents">Contents</a>)
decimal-point character is used in place of a period, and that if neither an exponent part
LLONG_MAX, ULONG_MAX, or ULLONG_MAX is returned (according to the return type
and sign of the value, if any), and the value of the macro ERANGE is stored in errno.
-
-
-
[<a name="p311" href="#p311">page 311</a>] (<a href="#Contents">Contents</a>)
<a name="7.20.2" href="#7.20.2"><b> 7.20.2 Pseudo-random sequence generation functions</b></a>
return (unsigned int)(next/65536) % 32768;
}
-
-
[<a name="p312" href="#p312">page 312</a>] (<a href="#Contents">Contents</a>)
void srand(unsigned int seed)
value as a pointer to the old object), or a null pointer if the new object could not be
allocated.
-
-
-
[<a name="p314" href="#p314">page 314</a>] (<a href="#Contents">Contents</a>)
<a name="7.20.4" href="#7.20.4"><b> 7.20.4 Communication with the environment</b></a>
<b> Description</b>
2 The exit function causes normal program termination to occur. If more than one call to
the exit function is executed by a program, the behavior is undefined.
+
[<a name="p315" href="#p315">page 315</a>] (<a href="#Contents">Contents</a>)
3 First, all functions registered by the atexit function are called, in the reverse order of
command processor is available. If the argument is not a null pointer, and the system
function does return, it returns an implementation-defined value.
-
-
-
[<a name="p317" href="#p317">page 317</a>] (<a href="#Contents">Contents</a>)
<a name="7.20.5" href="#7.20.5"><b> 7.20.5 Searching and sorting utilities</b></a>
(char *)p >= (char *)base
(char *)p < (char *)base + nmemb * size
-
[<a name="p318" href="#p318">page 318</a>] (<a href="#Contents">Contents</a>)
size of each element of the array is specified by size.
returns the number of bytes modified, not including a terminating null character, if
any.267)
-
-
-
[<a name="p324" href="#p324">page 324</a>] (<a href="#Contents">Contents</a>)
<a name="7.21" href="#7.21"><b> 7.21 String handling <string.h></b></a>
2 The strncpy function copies not more than n characters (characters that follow a null
character are not copied) from the array pointed to by s2 to the array pointed to by
-
-
-
[<a name="p326" href="#p326">page 326</a>] (<a href="#Contents">Contents</a>)
s1.<sup><a href="#note269"><b>269)</b></a></sup> If copying takes place between objects that overlap, the behavior is undefined.
<b> Returns</b>
3 The strchr function returns a pointer to the located character, or a null pointer if the
character does not occur in the string.
+
[<a name="p330" href="#p330">page 330</a>] (<a href="#Contents">Contents</a>)
<a name="7.21.5.3" href="#7.21.5.3"><b> 7.21.5.3 The strcspn function</b></a>
3 The strrchr function returns a pointer to the character, or a null pointer if c does not
occur in the string.
-
-
-
[<a name="p331" href="#p331">page 331</a>] (<a href="#Contents">Contents</a>)
<a name="7.21.5.6" href="#7.21.5.6"><b> 7.21.5.6 The strspn function</b></a>
<b> Returns</b>
3 The memset function returns the value of s.
-
-
-
[<a name="p333" href="#p333">page 333</a>] (<a href="#Contents">Contents</a>)
<a name="7.21.6.2" href="#7.21.6.2"><b> 7.21.6.2 The strerror function</b></a>
3 The strlen function returns the number of characters that precede the terminating null
character.
-
-
-
[<a name="p334" href="#p334">page 334</a>] (<a href="#Contents">Contents</a>)
<a name="7.22" href="#7.22"><b> 7.22 Type-generic math <tgmath.h></b></a>
carg(dc) carg(dc), the function
cproj(ldc) cprojl(ldc)
-
-
-
[<a name="p337" href="#p337">page 337</a>] (<a href="#Contents">Contents</a>)
<a name="7.23" href="#7.23"><b> 7.23 Date and time <time.h></b></a>
broken-down time as argument.
Forward references: the localtime function (<a href="#7.23.3.4">7.23.3.4</a>).
-
-
-
[<a name="p342" href="#p342">page 342</a>] (<a href="#Contents">Contents</a>)
<a name="7.23.3.3" href="#7.23.3.3"><b> 7.23.3.3 The gmtime function</b></a>
consists of a % character, possibly followed by an E or O modifier character (described
below), followed by a character that determines the behavior of the conversion specifier.
All ordinary multibyte characters (including the terminating null character) are copied
+
[<a name="p343" href="#p343">page 343</a>] (<a href="#Contents">Contents</a>)
unchanged into the array. If copying takes place between objects that overlap, the
%OH is replaced by the hour (24-hour clock), using the locale's alternative numeric
symbols.
-
[<a name="p345" href="#p345">page 345</a>] (<a href="#Contents">Contents</a>)
%OI is replaced by the hour (12-hour clock), using the locale's alternative numeric
%X equivalent to %T.
%Z implementation-defined.
-
[<a name="p346" href="#p346">page 346</a>] (<a href="#Contents">Contents</a>)
<b> Returns</b>
into the array pointed to by s not including the terminating null character. Otherwise,
zero is returned and the contents of the array are indeterminate.
-
-
-
[<a name="p347" href="#p347">page 347</a>] (<a href="#Contents">Contents</a>)
<a name="7.24" href="#7.24"><b> 7.24 Extended multibyte and wide character utilities <wchar.h></b></a>
[-]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
+
[<a name="p352" href="#p352">page 352</a>] (<a href="#Contents">Contents</a>)
nan, respectively.<sup><a href="#note283"><b>283)</b></a></sup>
-- An optional decimal integer greater than zero that specifies the maximum field width
(in wide characters).
-
-
[<a name="p356" href="#p356">page 356</a>] (<a href="#Contents">Contents</a>)
-- An optional length modifier that specifies the size of the receiving object.
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
+
[<a name="p358" href="#p358">page 358</a>] (<a href="#Contents">Contents</a>)
integer.
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
+
[<a name="p360" href="#p360">page 360</a>] (<a href="#Contents">Contents</a>)
converted, but one is consumed. If the conversion specification includes an
items assigned, which can be fewer than provided for, or even zero, in the event of an
early matching failure.
-
-
-
[<a name="p362" href="#p362">page 362</a>] (<a href="#Contents">Contents</a>)
<a name="7.24.2.5" href="#7.24.2.5"><b> 7.24.2.5 The vfwprintf function</b></a>
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 generated.
-
[<a name="p364" href="#p364">page 364</a>] (<a href="#Contents">Contents</a>)
<a name="7.24.2.8" href="#7.24.2.8"><b> 7.24.2.8 The vswscanf function</b></a>
3 The vwprintf function returns the number of wide characters transmitted, or a negative
value if an output or encoding error occurred.
-
-
-
[<a name="p365" href="#p365">page 365</a>] (<a href="#Contents">Contents</a>)
<a name="7.24.2.10" href="#7.24.2.10"><b> 7.24.2.10 The vwscanf function</b></a>
2 The wscanf function is equivalent to fwscanf with the argument stdin interposed
before the arguments to wscanf.
-
[<a name="p366" href="#p366">page 366</a>] (<a href="#Contents">Contents</a>)
<b> Returns</b>
wide character sequences returns zero, and a function that copies wide characters copies
zero wide characters.
-
-
-
[<a name="p371" href="#p371">page 371</a>] (<a href="#Contents">Contents</a>)
<a name="7.24.4.1" href="#7.24.4.1"><b> 7.24.4.1 Wide string numeric conversion functions</b></a>
n-wchar-sequence nondigit
The subject sequence is defined as the longest initial subsequence of the input wide
string, starting with the first non-white-space wide character, that is of the expected form.
+
[<a name="p372" href="#p372">page 372</a>] (<a href="#Contents">Contents</a>)
The subject sequence contains no wide characters if the input wide string is not of the
<b> Returns</b>
3 The wcscpy function returns the value of s1.
-
[<a name="p376" href="#p376">page 376</a>] (<a href="#Contents">Contents</a>)
<a name="7.24.4.2.2" href="#7.24.4.2.2"><b> 7.24.4.2.2 The wcsncpy function</b></a>
4 EXAMPLE The value of the following expression is the length of the array needed to hold the
transformation of the wide string pointed to by s:
-
[<a name="p380" href="#p380">page 380</a>] (<a href="#Contents">Contents</a>)
1 + wcsxfrm(NULL, s, 0)
string pointed to by s1 which consists entirely of wide characters not from the wide
string pointed to by s2.
-
-
[<a name="p381" href="#p381">page 381</a>] (<a href="#Contents">Contents</a>)
<b> Returns</b>
<b> Returns</b>
3 The wcsspn function returns the length of the segment.
-
[<a name="p382" href="#p382">page 382</a>] (<a href="#Contents">Contents</a>)
<a name="7.24.4.5.6" href="#7.24.4.5.6"><b> 7.24.4.5.6 The wcsstr function</b></a>
the start of the first token.
5 The wcstok function then searches from there for a wide character that is contained in
the current separator wide string. If no such wide character is found, the current token
+
[<a name="p383" href="#p383">page 383</a>] (<a href="#Contents">Contents</a>)
extends to the end of the wide string pointed to by s1, and subsequent searches in the
3 The wmemchr function returns a pointer to the located wide character, or a null pointer if
the wide character does not occur in the object.
-
-
-
[<a name="p384" href="#p384">page 384</a>] (<a href="#Contents">Contents</a>)
<a name="7.24.4.6" href="#7.24.4.6"><b> 7.24.4.6 Miscellaneous functions</b></a>
-- The argument s points to the initial element of an array of wide characters into which
the generated output is to be placed.
-
[<a name="p385" href="#p385">page 385</a>] (<a href="#Contents">Contents</a>)
-- The argument maxsize indicates the limiting number of wide characters.
<b> Description</b>
2 If ps is not a null pointer, the mbsinit function determines whether the pointed-to
mbstate_t object describes an initial conversion state.
+
[<a name="p387" href="#p387">page 387</a>] (<a href="#Contents">Contents</a>)
<b> Returns</b>
or (size_t)(-1).
Forward references: the mbrtowc function (<a href="#7.24.6.3.2">7.24.6.3.2</a>).
-
-
-
[<a name="p388" href="#p388">page 388</a>] (<a href="#Contents">Contents</a>)
<a name="7.24.6.3.2" href="#7.24.6.3.2"><b> 7.24.6.3.2 The mbrtowc function</b></a>
when dst is not a null pointer), the pointer object pointed to by this parameter is updated
to reflect the amount of the source processed by that invocation.
-
-
-
[<a name="p390" href="#p390">page 390</a>] (<a href="#Contents">Contents</a>)
<a name="7.24.6.4.1" href="#7.24.6.4.1"><b> 7.24.6.4.1 The mbsrtowcs function</b></a>
3 Each of the following expressions has a truth-value equivalent to the call to the wide
character classification function (<a href="#7.25.2.1">7.25.2.1</a>) in the comment that follows the expression:
-
[<a name="p397" href="#p397">page 397</a>] (<a href="#Contents">Contents</a>)
iswctype(wc, wctype("alnum")) // iswalnum(wc)
category of the current locale, the wctype function returns a nonzero value that is valid
as the second argument to the iswctype function; otherwise, it returns zero. *
-
-
-
[<a name="p398" href="#p398">page 398</a>] (<a href="#Contents">Contents</a>)
<a name="7.25.3" href="#7.25.3"><b> 7.25.3 Wide character case mapping utilities</b></a>
well as case mapping equivalent to that performed by the functions described in the
previous subclause (<a href="#7.25.3.1">7.25.3.1</a>).
-
-
-
[<a name="p399" href="#p399">page 399</a>] (<a href="#Contents">Contents</a>)
<a name="7.25.3.2.1" href="#7.25.3.2.1"><b> 7.25.3.2.1 The towctrans function</b></a>
category of the current locale, the wctrans function returns a nonzero value that is valid
as the second argument to the towctrans function; otherwise, it returns zero.
-
-
-
[<a name="p400" href="#p400">page 400</a>] (<a href="#Contents">Contents</a>)
<a name="7.26" href="#7.26"><b> 7.26 Future library directions</b></a>
types defined in the <a href="#7.18"><stdint.h></a> header. Macro names beginning with INT or UINT
and ending with _MAX, _MIN, or _C may be added to the macros defined in the
<a href="#7.18"><stdint.h></a> header.
+
[<a name="p401" href="#p401">page 401</a>] (<a href="#Contents">Contents</a>)
<a name="7.26.9" href="#7.26.9"><b> 7.26.9 Input/output <stdio.h></b></a>
1 Function names that begin with is or to and a lowercase letter may be added to the
declarations in the <a href="#7.25"><wctype.h></a> header.
-
-
-
[<a name="p402" href="#p402">page 402</a>] (<a href="#Contents">Contents</a>)
<a name="A" href="#A"><b> Annex A</b></a>
double long typedef
else register union
-
-
-
[<a name="p403" href="#p403">page 403</a>] (<a href="#Contents">Contents</a>)
<a name="A.1.3" href="#A.1.3"><b>A.1.3 Identifiers</b></a>
(<a href="#6.4.4.1">6.4.4.1</a>) decimal-constant:
nonzero-digit
decimal-constant digit
+
[<a name="p404" href="#p404">page 404</a>] (<a href="#Contents">Contents</a>)
(<a href="#6.4.4.1">6.4.4.1</a>) octal-constant:
fractional-constant exponent-partopt floating-suffixopt
digit-sequence exponent-part floating-suffixopt
-
-
-
[<a name="p405" href="#p405">page 405</a>] (<a href="#Contents">Contents</a>)
(<a href="#6.4.4.2">6.4.4.2</a>) hexadecimal-floating-constant:
' c-char-sequence '
L' c-char-sequence '
-
-
-
[<a name="p406" href="#p406">page 406</a>] (<a href="#Contents">Contents</a>)
(<a href="#6.4.4.4">6.4.4.4</a>) c-char-sequence:
the double-quote ", backslash \, or new-line character
escape-sequence
-
-
-
[<a name="p407" href="#p407">page 407</a>] (<a href="#Contents">Contents</a>)
<a name="A.1.7" href="#A.1.7"><b>A.1.7 Punctuators</b></a>
pp-number P sign
pp-number .
-
[<a name="p408" href="#p408">page 408</a>] (<a href="#Contents">Contents</a>)
<a name="A.2" href="#A.2"><b>A.2 Phrase structure grammar</b></a>
auto
register
-
-
-
[<a name="p411" href="#p411">page 411</a>] (<a href="#Contents">Contents</a>)
(<a href="#6.7.2">6.7.2</a>) type-specifier:
declarator
declaratoropt : constant-expression
-
-
-
[<a name="p412" href="#p412">page 412</a>] (<a href="#Contents">Contents</a>)
(<a href="#6.7.2.2">6.7.2.2</a>) enum-specifier:
(<a href="#6.7.8">6.7.8</a>) designation:
designator-list =
-
-
[<a name="p414" href="#p414">page 414</a>] (<a href="#Contents">Contents</a>)
(<a href="#6.7.8">6.7.8</a>) designator-list:
if ( expression ) statement else statement
switch ( expression ) statement
-
-
-
[<a name="p415" href="#p415">page 415</a>] (<a href="#Contents">Contents</a>)
(<a href="#6.8.5">6.8.5</a>) iteration-statement:
(<a href="#6.10">6.10</a>) if-section:
if-group elif-groupsopt else-groupopt endif-line
-
[<a name="p416" href="#p416">page 416</a>] (<a href="#Contents">Contents</a>)
(<a href="#6.10">6.10</a>) if-group:
(<a href="#6.10">6.10</a>) replacement-list:
pp-tokensopt
-
-
-
[<a name="p417" href="#p417">page 417</a>] (<a href="#Contents">Contents</a>)
(<a href="#6.10">6.10</a>) pp-tokens:
(<a href="#6.10">6.10</a>) new-line:
the new-line character
-
-
-
[<a name="p418" href="#p418">page 418</a>] (<a href="#Contents">Contents</a>)
<a name="B" href="#B"><b> Annex B</b></a>
double complex catanh(double complex z);
float complex catanhf(float complex z);
long double complex catanhl(long double complex z);
+
[<a name="p419" href="#p419">page 419</a>] (<a href="#Contents">Contents</a>)
double complex ccosh(double complex z);
float crealf(float complex z);
long double creall(long double complex z);
-
[<a name="p420" href="#p420">page 420</a>] (<a href="#Contents">Contents</a>)
<a name="B.3" href="#B.3"><b>B.3 Character handling <ctype.h></b></a>
int fesetenv(const fenv_t *envp);
int feupdateenv(const fenv_t *envp);
-
-
[<a name="p421" href="#p421">page 421</a>] (<a href="#Contents">Contents</a>)
<a name="B.6" href="#B.6"><b>B.6 Characteristics of floating types <float.h></b></a>
uintmax_t wcstoumax(const wchar_t * restrict nptr,
wchar_t ** restrict endptr, int base);
-
-
-
[<a name="p422" href="#p422">page 422</a>] (<a href="#Contents">Contents</a>)
<a name="B.8" href="#B.8"><b>B.8 Alternative spellings <iso646.h></b></a>
float asinf(float x);
long double asinl(long double x);
double atan(double x);
+
[<a name="p423" href="#p423">page 423</a>] (<a href="#Contents">Contents</a>)
float atanf(float x);
false
__bool_true_false_are_defined
-
-
-
[<a name="p428" href="#p428">page 428</a>] (<a href="#Contents">Contents</a>)
<a name="B.16" href="#B.16"><b>B.16 Common definitions <stddef.h></b></a>
void setbuf(FILE * restrict stream,
char * restrict buf);
-
[<a name="p429" href="#p429">page 429</a>] (<a href="#Contents">Contents</a>)
int setvbuf(FILE * restrict stream,
int puts(const char *s);
int ungetc(int c, FILE *stream);
-
[<a name="p430" href="#p430">page 430</a>] (<a href="#Contents">Contents</a>)
size_t fread(void * restrict ptr,
const char * restrict nptr,
char ** restrict endptr, int base);
-
-
-
[<a name="p431" href="#p431">page 431</a>] (<a href="#Contents">Contents</a>)
unsigned long long int strtoull(
size_t wcstombs(char * restrict s,
const wchar_t * restrict pwcs, size_t n);
-
-
-
[<a name="p432" href="#p432">page 432</a>] (<a href="#Contents">Contents</a>)
<a name="B.20" href="#B.20"><b>B.20 String handling <string.h></b></a>
char *strerror(int errnum);
size_t strlen(const char *s);
-
-
-
[<a name="p433" href="#p433">page 433</a>] (<a href="#Contents">Contents</a>)
<a name="B.21" href="#B.21"><b>B.21 Type-generic math <tgmath.h></b></a>
const char * restrict format,
const struct tm * restrict timeptr);
-
-
-
[<a name="p434" href="#p434">page 434</a>] (<a href="#Contents">Contents</a>)
<a name="B.23" href="#B.23"><b>B.23 Extended multibyte/wide character utilities <wchar.h></b></a>
wint_t putwchar(wchar_t c);
wint_t ungetwc(wint_t c, FILE *stream);
-
-
[<a name="p435" href="#p435">page 435</a>] (<a href="#Contents">Contents</a>)
double wcstod(const wchar_t * restrict nptr,
int iswupper(wint_t wc);
int iswxdigit(wint_t wc);
int iswctype(wint_t wc, wctype_t desc);
+
[<a name="p437" href="#p437">page 437</a>] (<a href="#Contents">Contents</a>)
wctype_t wctype(const char *property);
wint_t towctrans(wint_t wc, wctrans_t desc);
wctrans_t wctrans(const char *property);
-
-
-
[<a name="p438" href="#p438">page 438</a>] (<a href="#Contents">Contents</a>)
<a name="C" href="#C"><b> Annex C</b></a>
also between any call to a comparison function and any movement of the objects
passed as arguments to that call (<a href="#7.20.5">7.20.5</a>).
-
-
-
[<a name="p439" href="#p439">page 439</a>] (<a href="#Contents">Contents</a>)
<a name="D" href="#D"><b> Annex D</b></a>
0AC7-0AC9, 0ACB-0ACD, 0AD0, 0AE0
Oriya: 0B01-0B03, 0B05-0B0C, 0B0F-0B10, 0B13-0B28, 0B2A-0B30,
0B32-0B33, 0B36-0B39, 0B3E-0B43, 0B47-0B48, 0B4B-0B4D,
+
[<a name="p440" href="#p440">page 440</a>] (<a href="#Contents">Contents</a>)
0B5C-0B5D, 0B5F-0B61
2107, 210A-2113, 2115, 2118-211D, 2124, 2126, 2128, 212A-2131,
2133-2138, 2160-2182, 3005-3007, 3021-3029
-
-
-
[<a name="p441" href="#p441">page 441</a>] (<a href="#Contents">Contents</a>)
<a name="E" href="#E"><b> Annex E</b></a>
4 The values given in the following list shall be replaced by implementation-defined
constant expressions that are greater or equal in magnitude (absolute value) to those
shown, with the same sign:
+
[<a name="p442" href="#p442">page 442</a>] (<a href="#Contents">Contents</a>)
#define DBL_DIG 10
#define LDBL_EPSILON 1E-9
#define LDBL_MIN 1E-37
-
-
-
[<a name="p443" href="#p443">page 443</a>] (<a href="#Contents">Contents</a>)
<a name="F" href="#F"><b> Annex F</b></a>
efficiency of translation-time evaluation through static initialization, such as
const static double one_third = 1.0/3.0;
-
[<a name="p449" href="#p449">page 449</a>] (<a href="#Contents">Contents</a>)
execution time.
floating-point exceptions need not be precise: the actual order and number of occurrences
of floating-point exceptions (> 1) may vary from what the source code expresses. Thus,
the preceding loop could be treated as
+
[<a name="p451" href="#p451">page 451</a>] (<a href="#Contents">Contents</a>)
if (0 < n) x + 1;
<a name="F.8.2" href="#F.8.2"><b> F.8.2 Expression transformations</b></a>
-1 x / 2 (<->) x * 0.5 Although similar transformations involving inexact
+1 x / 2 <-> x * 0.5 Although similar transformations involving inexact
constants generally do not yield numerically equivalent
expressions, if the constants are exact then such
transformations can be made on IEC 60559 machines
and others that round perfectly.
- 1 * x and x / 1 (->) x The expressions 1 * x, x / 1, and x are equivalent
+ 1 * x and x / 1 -> x The expressions 1 * x, x / 1, and x are equivalent
(on IEC 60559 machines, among others).<sup><a href="#note317"><b>317)</b></a></sup>
- x / x (->) 1.0 The expressions x / x and 1.0 are not equivalent if x
+ x / x -> 1.0 The expressions x / x and 1.0 are not equivalent if x
can be zero, infinite, or NaN.
- x - y (<->) x + (-y) The expressions x - y, x + (-y), and (-y) + x
+ x - y <-> x + (-y) The expressions x - y, x + (-y), and (-y) + x
are equivalent (on IEC 60559 machines, among others).
- x - y (<->) -(y - x) The expressions x - y and -(y - x) are not
+ x - y <-> -(y - x) The expressions x - y and -(y - x) are not
equivalent because 1 - 1 is +0 but -(1 - 1) is -0 (in the
default rounding direction).<sup><a href="#note318"><b>318)</b></a></sup>
- x - x (->) 0.0 The expressions x - x and 0.0 are not equivalent if
+ x - x -> 0.0 The expressions x - x and 0.0 are not equivalent if
x is a NaN or infinite.
- 0 * x (->) 0.0 The expressions 0 * x and 0.0 are not equivalent if
+ 0 * x -> 0.0 The expressions 0 * x and 0.0 are not equivalent if
x is a NaN, infinite, or -0.
- x + 0(->)x The expressions x + 0 and x are not equivalent if x is
+ x + 0->x The expressions x + 0 and x are not equivalent if x is
-0, because (-0) + (+0) yields +0 (in the default
rounding direction), not -0.
- x - 0(->)x (+0) - (+0) yields -0 when rounding is downward
+ x - 0->x (+0) - (+0) yields -0 when rounding is downward
(toward -(inf)), but +0 otherwise, and (-0) - (+0) always
yields -0; so, if the state of the FENV_ACCESS pragma
is ''off'', promising default rounding, then the
[<a name="p452" href="#p452">page 452</a>] (<a href="#Contents">Contents</a>)
might be zero.
- -x (<->) 0 - x The expressions -x and 0 - x are not equivalent if x
+ -x <-> 0 - x The expressions -x and 0 - x are not equivalent if x
is +0, because -(+0) yields -0, but 0 - (+0) yields +0
(unless rounding is downward).
<a name="F.8.3" href="#F.8.3"><b> F.8.3 Relational operators</b></a>
-1 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.
- x < y (->) isless(x,y) (and similarly for <=, >, >=) Though numerically
+1 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.
+ x < y -> isless(x,y) (and similarly for <=, >, >=) Though numerically
equal, these expressions are not equivalent because of
side effects when x or y is a NaN and the state of the
FENV_ACCESS pragma is ''on''. This transformation,
f();
nor, unless the state of the FENV_ACCESS pragma is ''off'', to
-
-
-
[<a name="p453" href="#p453">page 453</a>] (<a href="#Contents">Contents</a>)
// calls g without raising ''invalid'' if a and b are unordered
1 -- tanh((+-)0) returns (+-)0.
-- tanh((+-)(inf)) returns (+-)1.
-
-
-
[<a name="p457" href="#p457">page 457</a>] (<a href="#Contents">Contents</a>)
<a name="F.9.3" href="#F.9.3"><b> F.9.3 Exponential and logarithmic functions</b></a>
1 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.
-
-
-
[<a name="p458" href="#p458">page 458</a>] (<a href="#Contents">Contents</a>)
<a name="F.9.3.6" href="#F.9.3.6"><b> F.9.3.6 The ldexp functions</b></a>
1 -- logb((+-)0) returns -(inf) and raises the ''divide-by-zero'' floating-point exception.
-- logb((+-)(inf)) returns +(inf).
-
-
-
[<a name="p459" href="#p459">page 459</a>] (<a href="#Contents">Contents</a>)
<a name="F.9.3.12" href="#F.9.3.12"><b> F.9.3.12 The modf functions</b></a>
1 -- fabs((+-)0) returns +0.
-- fabs((+-)(inf)) returns +(inf).
-
-
-
[<a name="p460" href="#p460">page 460</a>] (<a href="#Contents">Contents</a>)
<a name="F.9.4.3" href="#F.9.4.3"><b> F.9.4.3 The hypot functions</b></a>
-- pow(+(inf), y) returns +0 for y < 0.
-- pow(+(inf), y) returns +(inf) for y > 0.
-
-
-
[<a name="p461" href="#p461">page 461</a>] (<a href="#Contents">Contents</a>)
<a name="F.9.4.5" href="#F.9.4.5"><b> F.9.4.5 The sqrt functions</b></a>
-- ceil((+-)(inf)) returns (+-)(inf).
2 The double version of ceil behaves as though implemented by
-
-
-
[<a name="p462" href="#p462">page 462</a>] (<a href="#Contents">Contents</a>)
#include <a href="#7.12"><math.h></a>
exception and the result differs from the argument, they raise the ''inexact'' floating-point
exception.
-
-
-
[<a name="p463" href="#p463">page 463</a>] (<a href="#Contents">Contents</a>)
<a name="F.9.6.6" href="#F.9.6.6"><b> F.9.6.6 The round functions</b></a>
-- trunc((+-)0) returns (+-)0.
-- trunc((+-)(inf)) returns (+-)(inf).
-
-
-
[<a name="p464" href="#p464">page 464</a>] (<a href="#Contents">Contents</a>)
<a name="F.9.7" href="#F.9.7"><b> F.9.7 Remainder functions</b></a>
<a name="F.9.8.2" href="#F.9.8.2"><b> F.9.8.2 The nan functions</b></a>
1 All IEC 60559 implementations support quiet NaNs, in all floating formats.
-
-
-
[<a name="p465" href="#p465">page 465</a>] (<a href="#Contents">Contents</a>)
<a name="F.9.8.3" href="#F.9.8.3"><b> F.9.8.3 The nextafter functions</b></a>
of its parts is a finite number (neither infinite nor NaN). A complex or imaginary value is
a zero if each of its parts is a zero.
-
-
-
[<a name="p467" href="#p467">page 467</a>] (<a href="#Contents">Contents</a>)
<a name="G.4" href="#G.4"><b> G.4 Conversions</b></a>
shown. Unless otherwise specified, where the symbol ''(+-)'' occurs in both an argument
and the result, the result has the same sign as the argument.
3 The functions are continuous onto both sides of their branch cuts, taking into account the
- sign of zero. For example, csqrt(-2 (+-) i0) = (+-)isqrt:2. ???
+ sign of zero. For example, csqrt(-2 (+-) i0) = (+-)i(sqrt)2. ???
4 Since complex and imaginary values are composed of real values, each function may be
regarded as computing real values from real values. Except as noted, the functions treat
real infinities, NaNs, signed zeros, subnormals, and the floating-point exception flags in a
-- cacosh(+(inf) + i (inf)) returns +(inf) + ipi /4.
-- cacosh((+-)(inf) + iNaN) returns +(inf) + iNaN.
-
[<a name="p474" href="#p474">page 474</a>] (<a href="#Contents">Contents</a>)
-- cacosh(NaN + iy) returns NaN + iNaN and optionally raises the ''invalid''
unspecified) and raises the ''invalid'' floating-point exception.
-- csinh(+0 + iNaN) returns (+-)0 + iNaN (where the sign of the real part of the result is
unspecified).
+
[<a name="p476" href="#p476">page 476</a>] (<a href="#Contents">Contents</a>)
-- csinh(x + i (inf)) returns NaN + iNaN and raises the ''invalid'' floating-point
point exception, for all nonzero numbers y.
-- ctanh(NaN + iNaN) returns NaN + iNaN.
-
-
-
[<a name="p477" href="#p477">page 477</a>] (<a href="#Contents">Contents</a>)
<a name="G.6.3" href="#G.6.3"><b> G.6.3 Exponential and logarithmic functions</b></a>
asinh(iy) = i asin(y)
atanh(iy) = i atan(y)
-
-
-
[<a name="p480" href="#p480">page 480</a>] (<a href="#Contents">Contents</a>)
<a name="H" href="#H"><b> Annex H</b></a>
3 The parameter ''bounded'' is always true, and is not provided. The parameter ''minint''
is always 0 for the unsigned types, and is not provided for those types.
-
-
-
[<a name="p481" href="#p481">page 481</a>] (<a href="#Contents">Contents</a>)
<a name="H.2.2.1" href="#H.2.2.1"><b> H.2.2.1 Integer operations</b></a>
emin FLT_MIN_EXP, DBL_MIN_EXP, LDBL_MIN_EXP
2 The derived constants for the floating point types are accessed by the following:
-
[<a name="p482" href="#p482">page 482</a>] (<a href="#Contents">Contents</a>)
fmax FLT_MAX, DBL_MAX, LDBL_MAX
in all relevant LIA-1 operations, not just addition as in C.
<a name="H.2.4" href="#H.2.4"><b> H.2.4 Type conversions</b></a>
1 The LIA-1 type conversions are the following type casts:
- cvtI' (->) I (int)i, (long int)i, (long long int)i,
+ cvtI' -> I (int)i, (long int)i, (long long int)i,
(unsigned int)i, (unsigned long int)i,
(unsigned long long int)i
- cvtF (->) I (int)x, (long int)x, (long long int)x,
+ cvtF -> I (int)x, (long int)x, (long long int)x,
(unsigned int)x, (unsigned long int)x,
(unsigned long long int)x
- cvtI (->) F (float)i, (double)i, (long double)i
- cvtF' (->) F (float)x, (double)x, (long double)x
+ cvtI -> F (float)i, (double)i, (long double)i
+ cvtF' -> F (float)x, (double)x, (long double)x
2 In the above conversions from floating to integer, the use of (cast)x can be replaced with
(cast)round(x), (cast)rint(x), (cast)nearbyint(x), (cast)trunc(x),
(cast)ceil(x), or (cast)floor(x). In addition, C's floating-point to integer
5 C's conversions (casts) from integer to floating-point can meet LIA-1 requirements if an
implementation uses round-to-nearest.
-
-
-
[<a name="p484" href="#p484">page 484</a>] (<a href="#Contents">Contents</a>)
<a name="H.3" href="#H.3"><b> H.3 Notification</b></a>
where i is an expression of type int representing a subset of the LIA-1 indicators.
4 C allows an implementation to provide the following LIA-1 required behavior: at
program termination if any indicator is set the implementation shall send an unambiguous
+
[<a name="p485" href="#p485">page 485</a>] (<a href="#Contents">Contents</a>)
and ''hard to ignore'' message (see LIA-1 subclause <a href="#6.1.2">6.1.2</a>)
terminate (either default implementation behavior or user replacement for it) or trap-and-
resume, at the programmer's option.
-
-
-
[<a name="p486" href="#p486">page 486</a>] (<a href="#Contents">Contents</a>)
<a name="I" href="#I"><b> Annex I</b></a>
-- A statement with no apparent effect is encountered (<a href="#6.8">6.8</a>).
-- A constant expression is used as the controlling expression of a selection statement
(<a href="#6.8.4">6.8.4</a>).
+
[<a name="p487" href="#p487">page 487</a>] (<a href="#Contents">Contents</a>)
-- An incorrectly formed preprocessing group is encountered while skipping a
preprocessing group (<a href="#6.10.1">6.10.1</a>).
-- An unrecognized #pragma directive is encountered (<a href="#6.10.6">6.10.6</a>).
-
-
-
[<a name="p488" href="#p488">page 488</a>] (<a href="#Contents">Contents</a>)
<a name="J" href="#J"><b> Annex J</b></a>
-- The order in which subexpressions are evaluated and the order in which side effects
take place, except as specified for the function-call (), &&, ||, ?:, and comma
operators (<a href="#6.5">6.5</a>).
+
[<a name="p489" href="#p489">page 489</a>] (<a href="#Contents">Contents</a>)
-- The order in which the function designator, arguments, and subexpressions within the
-- Whether conversion of non-integer IEC 60559 floating values to integer raises the
''inexact'' floating-point exception (<a href="#F.4">F.4</a>).
-
-
[<a name="p491" href="#p491">page 491</a>] (<a href="#Contents">Contents</a>)
-- Whether or when library functions in <a href="#7.12"><math.h></a> raise the ''inexact'' floating-point
-- Two identifiers differ only in nonsignificant characters (<a href="#6.4.2.1">6.4.2.1</a>).
-- The identifier __func__ is explicitly declared (<a href="#6.4.2.2">6.4.2.2</a>).
-
[<a name="p493" href="#p493">page 493</a>] (<a href="#Contents">Contents</a>)
-- The program attempts to modify a string literal (<a href="#6.4.5">6.4.5</a>).
than extern (<a href="#6.7.1">6.7.1</a>).
-- A structure or union is defined as containing no named members (<a href="#6.7.2.1">6.7.2.1</a>).
-
[<a name="p495" href="#p495">page 495</a>] (<a href="#Contents">Contents</a>)
-- An attempt is made to access, or generate a pointer to just past, a flexible array
compatible return types, or their parameters disagree in use of the ellipsis terminator
or the number and type of parameters (after default argument promotion, when there
is no parameter type list or when one type is specified by a function definition with an
+
[<a name="p496" href="#p496">page 496</a>] (<a href="#Contents">Contents</a>)
identifier list) (<a href="#6.7.5.3">6.7.5.3</a>).
-- The argument to the assert macro does not have a scalar type (<a href="#7.2">7.2</a>).
-- The CX_LIMITED_RANGE, FENV_ACCESS, or FP_CONTRACT pragma is used in
any context other than outside all external declarations or preceding all explicit
+
[<a name="p498" href="#p498">page 498</a>] (<a href="#Contents">Contents</a>)
declarations and statements inside a compound statement (<a href="#7.3.4">7.3.4</a>, <a href="#7.6.1">7.6.1</a>, <a href="#7.12.2">7.12.2</a>).
-- The parameter parmN of a va_start macro is declared with the register
storage class, with a function or array type, or with a type that is not compatible with
the type that results after application of the default argument promotions (<a href="#7.15.1.4">7.15.1.4</a>).
+
[<a name="p500" href="#p500">page 500</a>] (<a href="#Contents">Contents</a>)
-- The member designator parameter of an offsetof macro is an invalid right
-- A conversion specification for a formatted output function uses a # or 0 flag with a
conversion specifier other than those described (<a href="#7.19.6.1">7.19.6.1</a>, <a href="#7.24.2.1">7.24.2.1</a>).
-
[<a name="p501" href="#p501">page 501</a>] (<a href="#Contents">Contents</a>)
-- A conversion specification for one of the formatted input/output functions uses a
<a href="#7.24.2.5">7.24.2.5</a>, <a href="#7.24.2.6">7.24.2.6</a>, <a href="#7.24.2.7">7.24.2.7</a>, <a href="#7.24.2.8">7.24.2.8</a>, <a href="#7.24.2.9">7.24.2.9</a>, <a href="#7.24.2.10">7.24.2.10</a>).
-- The contents of the array supplied in a call to the fgets, gets, or fgetws function
are used after a read error occurred (<a href="#7.19.7.2">7.19.7.2</a>, <a href="#7.19.7.7">7.19.7.7</a>, <a href="#7.24.3.2">7.24.3.2</a>).
+
[<a name="p502" href="#p502">page 502</a>] (<a href="#Contents">Contents</a>)
-- The file position indicator for a binary stream is used after a call to the ungetc
contents of the array being searched or sorted, or returns ordering values
inconsistently (<a href="#7.20.5">7.20.5</a>).
-
[<a name="p503" href="#p503">page 503</a>] (<a href="#Contents">Contents</a>)
-- The array being searched by the bsearch function does not have its elements in
one in effect for the call to the wctrans function that returned the description
(<a href="#7.25.3.2.1">7.25.3.2.1</a>).
-
-
-
[<a name="p504" href="#p504">page 504</a>] (<a href="#Contents">Contents</a>)
<a name="J.3" href="#J.3"><b> J.3 Implementation-defined behavior</b></a>
correspondence to universal character names (<a href="#6.4.2">6.4.2</a>).
-- The number of significant initial characters in an identifier (<a href="#5.2.4.1">5.2.4.1</a>, <a href="#6.4.2">6.4.2</a>).
-
-
-
[<a name="p505" href="#p505">page 505</a>] (<a href="#Contents">Contents</a>)
<a name="J.3.4" href="#J.3.4"><b> J.3.4 Characters</b></a>
-- The result of, or the signal raised by, converting an integer to a signed integer type
when the value cannot be represented in an object of that type (<a href="#6.3.1.3">6.3.1.3</a>).
-
-
[<a name="p506" href="#p506">page 506</a>] (<a href="#Contents">Contents</a>)
-- The results of some bitwise operations on signed integers (<a href="#6.5">6.5</a>).
-- The size of the result of subtracting two pointers to elements of the same array
(<a href="#6.5.6">6.5.6</a>).
-
-
-
[<a name="p507" href="#p507">page 507</a>] (<a href="#Contents">Contents</a>)
<a name="J.3.8" href="#J.3.8"><b> J.3.8 Hints</b></a>
-- The base-2 logarithm of the modulus used by the remquo functions in reducing the
quotient (<a href="#7.12.10.3">7.12.10.3</a>).
-
-
[<a name="p509" href="#p509">page 509</a>] (<a href="#Contents">Contents</a>)
-- Whether a domain error occurs or zero is returned when a remquo function has a
-- The interpretation of a - character that is neither the first nor the last character, nor
the second where a ^ character is the first, in the scanlist for %[ conversion in the
fscanf or fwscanf function (<a href="#7.19.6.2">7.19.6.2</a>, <a href="#7.24.2.1">7.24.2.1</a>).
+
[<a name="p510" href="#p510">page 510</a>] (<a href="#Contents">Contents</a>)
-- The set of sequences matched by a %p conversion and the interpretation of the
in this International Standard) (<a href="#6.2.6.1">6.2.6.1</a>).
-- The value of the result of the sizeof operator (<a href="#6.5.3.4">6.5.3.4</a>).
-
-
-
[<a name="p511" href="#p511">page 511</a>] (<a href="#Contents">Contents</a>)
<a name="J.4" href="#J.4"><b> J.4 Locale-specific behavior</b></a>
-- Character mappings that are supported by the towctrans function (<a href="#7.25.1">7.25.1</a>).
-- Character classifications that are supported by the iswctype function (<a href="#7.25.1">7.25.1</a>).
-
-
-
[<a name="p512" href="#p512">page 512</a>] (<a href="#Contents">Contents</a>)
<a name="J.5" href="#J.5"><b> J.5 Common extensions</b></a>
more range or precision than long double, may be used for evaluating expressions of
other floating types, and may be used to define float_t or double_t.
-
-
-
[<a name="p513" href="#p513">page 513</a>] (<a href="#Contents">Contents</a>)
<a name="J.5.7" href="#J.5.7"><b> J.5.7 Function pointer casts</b></a>
registered by the atexit function have been made (see <a href="#7.20.4.3">7.20.4.3</a>), the implementation
writes some diagnostics indicating the fact to the stderr stream, if it is still open,
-
-
-
[<a name="p514" href="#p514">page 514</a>] (<a href="#Contents">Contents</a>)
<a name="J.5.14" href="#J.5.14"><b> J.5.14 Extra arguments for signal handlers</b></a>
instead of, or in addition to, setting errno or raising floating-point exceptions (<a href="#7.3">7.3</a>,
<a name="7.12)" href="#7.12)"><b> 7.12).</b></a>
-
-
-
[<a name="p515" href="#p515">page 515</a>] (<a href="#Contents">Contents</a>)
33. ISO/IEC 10967-1:1994, Information technology -- Language independent
arithmetic -- Part 1: Integer and floating point arithmetic.
-
-
-
[<a name="p517" href="#p517">page 517</a>] (<a href="#Contents">Contents</a>)
-
[<a name="p518" href="#p518">page 518</a>] (<a href="#Contents">Contents</a>)
++ (prefix increment operator), <a href="#6.3.2.1">6.3.2.1</a>, <a href="#6.5.3.1">6.5.3.1</a> <a href="#7.18"><stdint.h></a> header, <a href="#4">4</a>, <a href="#5.2.4.2">5.2.4.2</a>, <a href="#6.10.1">6.10.1</a>, <a href="#7.8">7.8</a>,
+= (addition assignment operator), <a href="#6.5.16.2">6.5.16.2</a> <a href="#7.18">7.18</a>, <a href="#7.26.8">7.26.8</a>
, (comma operator), <a href="#6.5.17">6.5.17</a>
+
[<a name="p519" href="#p519">page 519</a>] (<a href="#Contents">Contents</a>)
<a href="#7.19"><stdio.h></a> header, <a href="#5.2.4.2.2">5.2.4.2.2</a>, <a href="#7.19">7.19</a>, <a href="#7.26.9">7.26.9</a>, <a href="#F">F</a> __cplusplus macro, <a href="#6.10.8">6.10.8</a>
6.4.9 Comments . . . . . . . . . . . . . . . . . . . . . 66
6.5 Expressions . . . . . . . . . . . . . . . . . . . . . . . . 67
-
[page iii]
6.5.1 Primary expressions . . . . . . . . . . . . . . . . . 69
Bibliography . . . . . . . . . . . . . . . . . . . . . . . . . . . 516
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 519
-
-
-
[page ix]
-
[page x]
Foreword
-- type-generic math macros in <tgmath.h>
-- the long long int type and library functions
-
[page xi]
-- increased minimum translation limits
-- idempotent type qualifiers
-- empty macro arguments
-
[page xii]
-- new structure type compatibility rules (tag compatibility)
ISO/IEC Directives, this foreword, the introduction, notes, footnotes, and examples are
also for information only.
-
-
-
[page xiii]
Introduction
5 The language clause (clause 6) is derived from ''The C Reference Manual''.
6 The library clause (clause 7) is based on the 1984 /usr/group Standard.
-
-
-
[page xiv]
8 IEC 60559:1989, Binary floating-point arithmetic for microprocessor systems (previously
designated IEC 559:1989).
-
-
-
[page 2]
behavior that depends on local conventions of nationality, culture, and language that each
implementation documents
-
[page 3]
2 EXAMPLE An example of locale-specific behavior is whether the islower function returns true for
1 character
single-byte character
<C> bit representation that fits in a byte
+
[page 4]
3.7.2
floor of x: the greatest integer less than or equal to x
2 EXAMPLE ???2.4??? is 2, ???-2.4??? is -3.
-
-
-
[page 6]
that the result would be the same as if it were executed using double-precision arithmetic (for example, if d
were replaced by the constant 2.0, which has type double).
-
-
-
[page 14]
12 EXAMPLE 4 Implementations employing wide registers have to take care to honor appropriate
above expression statement can be rewritten by the implementation in any of the above ways because the
same result will occur.
-
-
-
[page 15]
15 EXAMPLE 7 The grouping of an expression does not completely determine its evaluation. In the
Forward references: expressions (6.5), type qualifiers (6.7.3), statements (6.8), the
signal function (7.14), files (7.19.3).
-
-
-
[page 16]
5.2 Environmental considerations
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
+
[page 19]
tabulation position, the behavior of the display device is unspecified.
-- maximum value for an object of type unsigned long int
ULONG_MAX 4294967295 // 232 - 1
-
[page 22]
-- minimum value for an object of type long long int
implementation-defined (positive) values that are less than or equal to those shown:
-- the difference between 1 and the least value greater than 1 that is representable in the
given floating point type, b1- p
+
[page 26]
FLT_EPSILON 1E-5
(7.24), floating-point environment <fenv.h> (7.6), general utilities <stdlib.h>
(7.20), input/output <stdio.h> (7.19), mathematics <math.h> (7.12).
-
-
-
[page 28]
declares the identifier appears inside a block or within the list of parameter declarations in
a function definition, the identifier has block scope, which terminates at the end of the
associated block. If the declarator or type specifier that declares the identifier appears
+
[page 29]
within the list of parameter declarations in a function prototype (not part of a function
The resulting composite type for the function is:
int f(int (*)(char *), double (*)[3]);
-
-
-
[page 41]
6.3 Conversions
Forward references: cast operators (6.5.4), equality operators (6.5.9), integer types
capable of holding object pointers (7.18.1.4), simple assignment (6.5.16.1).
-
-
-
[page 48]
6.4 Lexical elements
octal-digit: one of
0 1 2 3 4 5 6 7
-
-
-
[page 54]
hexadecimal-digit: one of
5 The type of an integer constant is the first of the corresponding list in which its value can
be represented.
-
-
-
[page 55]
Octal or Hexadecimal
may be signed or unsigned. If an integer constant cannot be represented by any type in
its list and has no extended integer type, then the integer constant has no type.
-
-
-
[page 56]
6.4.4.2 Floating constants
\x hexadecimal-digit
hexadecimal-escape-sequence hexadecimal-digit
-
-
[page 59]
Description
Forward references: common definitions <stddef.h> (7.17), the mbtowc function
(7.20.7.2).
-
-
-
[page 61]
6.4.5 String literals
in which case it is known as an operator (other forms of operator also exist in some
contexts). An operand is an entity on which an operator acts.
-
-
-
[page 63]
3 In all aspects of the language, the six tokens67)
Forward references: additive operators (6.5.6), address and indirection operators
(6.5.3.2), array declarators (6.7.5.2).
-
-
-
[page 70]
6.5.2.2 Function calls
structure'' or ''pointer to qualified or unqualified union'', and the second operand shall
name a member of the type pointed to.
-
-
-
[page 72]
Semantics
Forward references: address and indirection operators (6.5.3.2), structure and union
specifiers (6.7.2.1).
-
-
-
[page 74]
6.5.2.4 Postfix increment and decrement operators
Forward references: type names (6.7.6), initialization (6.7.8).
-
-
-
[page 77]
6.5.3 Unary operators
object of type ptrdiff_t. Moreover, if the expression P points either to an element of
an array object or one past the last element of an array object, and the expression Q points
to the last element of the same array object, the expression ((Q)+1)-(P) has the same
+
[page 83]
value as ((Q)-(P))+1 and as -((P)-((Q)+1)), and has the value zero if the
the result is set if and only if at least one of the corresponding bits in the converted
operands is set).
-
-
-
[page 88]
6.5.13 Logical AND operator
a sequence point after the evaluation of the first operand. If the first operand compares
unequal to 0, the second operand is not evaluated.
-
-
-
[page 89]
6.5.15 Conditional operator
the result of an assignment operator or to access it after the next sequence point, the
behavior is undefined.
-
[page 91]
6.5.16.1 Simple assignment
3 A compound assignment of the form E1 op = E2 differs from the simple assignment
expression E1 = E1 op (E2) only in that the lvalue E1 is evaluated only once.
-
-
-
[page 93]
6.5.17 Comma operator
-- unsigned short, or unsigned short int
-- int, signed, or signed int
-
[page 99]
-- unsigned, or unsigned int
4 A bit-field shall have a type that is a qualified or unqualified version of _Bool, signed
int, unsigned int, or some other implementation-defined type.
-
[page 101]
Semantics
not be the same).
18 Following the above declaration:
-
-
-
[page 103]
struct s t1 = { 0 }; // valid
function call and an equivalent nested block. With one exception, only ''outer-to-inner'' assignments
between restricted pointers declared in nested blocks have defined behavior.
-
-
-
[page 111]
{
implementation-defined.121)
6 Any function with internal linkage can be an inline function. For a function with external
linkage, the following restrictions apply: If a function is declared with an inline
+
[page 112]
function specifier, then it shall also be defined in the same translation unit. If all of the
scope, storage duration, and type indicated by the declaration specifiers.
3 A full declarator is a declarator that is not part of another declarator. The end of a full
declarator is a sequence point. If, in the nested sequence of declarators in a full
+
[page 114]
declarator, there is a declarator specifying a variable length array type, the type specified
3 EXAMPLE The following pair of declarations demonstrates the difference between a ''variable pointer
to a constant value'' and a ''constant pointer to a variable value''.
-
-
-
[page 115]
const int *ptr_to_constant;
The pointer returned by fpfi points to a function that has one int parameter and accepts zero or more
additional arguments of any type.
-
-
-
[page 120]
20 EXAMPLE 4 The following prototype has a variably modified parameter.
Forward references: function definitions (6.9.1), type names (6.7.6).
-
-
-
[page 121]
6.7.6 Type names
type t1 and the type pointed to by tp1 are compatible. Type t1 is also compatible with type struct
s1, but not compatible with the types struct s2, t2, the type pointed to by tp2, or int.
-
-
-
[page 123]
6 EXAMPLE 3 The following obscure constructions
a[i-1] = b[i];
}
-
-
-
[page 124]
6.7.8 Initialization
. identifier
then the current object (defined below) shall have structure or union type and the
identifier shall be the name of a member of that type.
+
[page 125]
Semantics
17 Each brace-enclosed initializer list has an associated current object. When no
designations are present, subobjects of the current object are initialized in order according
to the type of the current object: array elements in increasing subscript order, structure
+
[page 126]
members in declaration order, and the first named member of a union.129) In contrast, a
int a[] = { 1, 2 }, b[] = { 3, 4, 5 };
due to the rules for incomplete types.
-
-
[page 129]
32 EXAMPLE 8 The declaration
Forward references: common definitions <stddef.h> (7.17).
-
-
-
[page 130]
6.8 Statements and blocks
2 A case or default label shall appear only in a switch statement. Further
constraints on such labels are discussed under the switch statement.
-
[page 131]
3 Label names shall be unique within a function.
/* ... */
}
-
-
-
[page 137]
4 EXAMPLE 2 A goto statement is not allowed to jump past any declarations of objects with variably
int (*fp)(void); // fp points to a function that has type F
F *Fp; // Fp points to a function that has type F
-
[page 141]
Semantics
3 If the declaration of an identifier for an object is a tentative definition and has internal
linkage, the declared type shall not be an incomplete type.
-
-
-
[page 143]
4 EXAMPLE 1
the array i still has incomplete type, the implicit initializer causes it to have one element, which is set to
zero on program startup.
-
-
-
[page 144]
6.10 Preprocessing directives
endif-line:
# endif new-line
-
-
-
[page 145]
control-line:
string literal corresponding to an empty argument is "". The order of evaluation of # and
## operators is unspecified.
-
-
-
[page 153]
6.10.3.3 The ## operator
#define max(a, b) ((a) > (b) ? (a) : (b))
The parentheses ensure that the arguments and the resulting expression are bound properly.
-
-
-
[page 155]
5 EXAMPLE 3 To illustrate the rules for redefinition and reexamination, the sequence
xglue(HIGH, LOW)
results in
-
-
-
[page 156]
printf("x" "1" "= %d, x" "2" "= %s", x1, x2);
showlist(The first, second, and third items.);
report(x>y, "x is %d but y is %d", x, y);
-
[page 157]
results in
tokens). The directive resulting after all replacements shall match one of the two
previous forms and is then processed as appropriate.
-
-
-
[page 158]
6.10.5 Error directive
2 EXAMPLE A directive of the form:
#pragma listing on "..\listing.dir"
can also be expressed as:
+
[page 161]
_Pragma ( "listing on \"..\\listing.dir\"" )
#define PRAGMA(x) _Pragma(#x)
LISTING ( ..\listing.dir )
-
-
-
[page 162]
6.11 Future language directions
6.11.9 Predefined macro names
1 Macro names beginning with __STDC_ are reserved for future standardization.
-
-
-
[page 163]
/* ... */
i = atoi(str);
-
-
-
[page 168]
7.2 Diagnostics <assert.h>
165) The message written might be of the form:
Assertion failed: expression, function abc, file xyz, line nnn.
-
[page 169]
7.3 Complex arithmetic <complex.h>
169) The purpose of the pragma is to allow the implementation to use the formulas:
(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 | = (sqrt) x 2 + y 2
???????????????
where the programmer can determine they are safe.
2 The casinh functions compute the complex arc hyperbolic sine of z, with branch cuts
outside the interval [-i, +i] along the imaginary axis.
-
[page 174]
Returns
float complex csinhf(float complex z);
long double complex csinhl(long double complex z);
-
[page 175]
Description
float complex clogf(float complex z);
long double complex clogl(long double complex z);
-
-
[page 176]
Description
Returns
3 The cpow functions return the complex power function value.
-
-
-
[page 177]
7.3.8.3 The csqrt functions
float cimagf(float complex z);
long double cimagl(long double complex z);
-
-
-
[page 178]
Description
the tolower function returns one of the corresponding characters (always the same one
for any given locale); otherwise, the argument is returned unchanged.
-
-
-
[page 184]
7.4.2.2 The toupper function
the toupper function returns one of the corresponding characters (always the same one
for any given locale); otherwise, the argument is returned unchanged.
-
-
-
[page 185]
7.5 Errors <errno.h>
3 The fesetround function returns zero if and only if the requested rounding direction
was established.
-
[page 193]
4 EXAMPLE Save, set, and restore the rounding direction. Report an error and abort if setting the
return result;
}
-
-
-
[page 196]
7.7 Characteristics of floating types <float.h>
2 The macros, their meanings, and the constraints (or restrictions) on their values are listed
in 5.2.4.2.2.
-
-
-
[page 197]
7.8 Format conversion of integer types <inttypes.h>
Forward references: the strtol, strtoll, strtoul, and strtoull functions
(7.20.1.4).
-
-
[page 200]
7.8.2.4 The wcstoimax and wcstoumax functions
Forward references: the wcstol, wcstoll, wcstoul, and wcstoull functions
(7.24.4.1.2).
-
-
-
[page 201]
7.9 Alternative spellings <iso646.h>
xor ^
xor_eq ^=
-
-
-
[page 202]
7.10 Sizes of integer types <limits.h>
2 The macros, their meanings, and the constraints (or restrictions) on their values are listed
in 5.2.4.2.1.
-
-
-
[page 203]
7.11 Localization <locale.h>
char int_p_sign_posn; // CHAR_MAX
char int_n_sign_posn; // CHAR_MAX
-
-
-
[page 204]
3 The macros defined are NULL (described in 7.17); and
Set to 1 or 0 if the currency_symbol respectively precedes or
succeeds the value for a negative locally formatted monetary quantity.
-
[page 207]
char p_sep_by_space
sign string, and the value for a nonnegative internationally formatted
monetary quantity.
-
-
-
[page 208]
char int_n_sep_by_space
3 The sign string immediately precedes the currency symbol.
4 The sign string immediately succeeds the currency symbol.
-
[page 209]
7 The implementation shall behave as if no library function calls the localeconv
int_p_sign_posn 1 1 1 1
int_n_sign_posn 4 1 4 2
-
-
-
[page 210]
11 EXAMPLE 2 The following table illustrates how the cs_precedes, sep_by_space, and sign_posn members
3 +$1.25 +$ 1.25 + $1.25
4 $+1.25 $+ 1.25 $ +1.25
-
-
-
[page 211]
7.12 Mathematics <math.h>
Returns
3 The atan2 functions return arctan y/x in the interval [-pi , +pi ] radians.
-
[page 219]
7.12.4.5 The cos functions
Returns
3 The tan functions return tan x.
-
-
-
[page 220]
7.12.5 Hyperbolic functions
for arguments not in the interval [-1, +1]. A range error may occur if the argument
equals -1 or +1.
-
-
[page 221]
Returns
Description
2 The tanh functions compute the hyperbolic tangent of x.
-
-
[page 222]
Returns
float expm1f(float x);
long double expm1l(long double x);
-
-
-
[page 223]
Description
float log10f(float x);
long double log10l(long double x);
-
-
-
[page 225]
Description
Returns
3 The modf functions return the signed fractional part of value.
-
-
-
[page 227]
7.12.6.13 The scalbn and scalbln functions
Description
2 The fabs functions compute the absolute value of a floating-point number x.
-
[page 228]
Returns
2 The hypot functions compute the square root of the sum of the squares of x and y,
without undue overflow or underflow. A range error may occur.
3 Returns
-4 The hypot functions return sqrt:x2 + y2 .
+4 The hypot functions return (sqrt)x2 + y2 .
???
???????????????
7.12.7.4 The pow functions
float sqrtf(float x);
long double sqrtl(long double x);
-
-
-
[page 229]
Description
2 The sqrt functions compute the nonnegative square root of x. A domain error occurs if
the argument is less than zero.
Returns
-3 The sqrt functions return sqrt:x.
+3 The sqrt functions return (sqrt)x.
???
???
7.12.8 Error and gamma functions
2
- sqrt:pi
+ (sqrt)pi
???
??? 0
2
- sqrt:pi
+ (sqrt)pi
???
??? x
-
-
-
[page 230]
7.12.8.3 The lgamma functions
Description
2 The ceil functions compute the smallest integer value not less than x.
-
[page 231]
Returns
2 The rint functions differ from the nearbyint functions (7.12.9.3) only in that the
rint functions may raise the ''inexact'' floating-point exception if the result differs in
value from the argument.
+
[page 232]
Returns
Returns
3 The round functions return the rounded integer value.
-
-
-
[page 233]
7.12.9.7 The lround and llround functions
Returns
3 The trunc functions return the truncated integer value.
-
-
-
[page 234]
7.12.10 Remainder functions
Returns
3 The copysign functions return a value with the magnitude of x and the sign of y.
-
-
-
[page 236]
7.12.11.2 The nan functions
(x) < (y) || (x) > (y); however, islessgreater(x, y) does not raise
the ''invalid'' floating-point exception when x and y are unordered (nor does it evaluate x
and y twice).
+
[page 241]
Returns
Returns
3 The isunordered macro returns 1 if its arguments are unordered and 0 otherwise.
-
-
-
[page 242]
7.13 Nonlocal jumps <setjmp.h>
longjmp(buf, 2); // might cause memory loss
}
-
-
-
[page 245]
7.14 Signal handling <signal.h>
Returns
3 The raise function returns zero if successful, nonzero if unsuccessful.
-
-
-
[page 248]
7.15 Variable arguments <stdarg.h>
char *array[MAXARGS];
int ptr_no = 0;
-
-
-
[page 251]
if (n_ptrs > MAXARGS)
f4(n_ptrs, array);
}
-
-
-
[page 252]
7.16 Boolean type and values <stdbool.h>
large enough to make this necessary.
Forward references: localization (7.11).
-
-
-
[page 254]
7.18 Integer types <stdint.h>
-- maximum value of pointer-holding signed integer type
INTPTR_MAX 215 - 1
-
-
-[page 258]
+[page 258]
-- maximum value of pointer-holding unsigned integer type
UINTPTR_MAX 216 - 1
by its argument and the type uintmax_t:
UINTMAX_C(value)
-
-
-
[page 261]
7.19 Input/output <stdio.h>
which expands to an integer constant expression that is the size needed for an array of
char large enough to hold the longest file name string that the implementation
-
-
[page 262]
guarantees can be opened;231)
old is no longer accessible by that name. If a file named by the string pointed to by new
exists prior to the call to the rename function, the behavior is implementation-defined.
-
-
-
[page 268]
Returns
1 #include <stdio.h>
int fflush(FILE *stream);
-
-
-
[page 270]
Description
2 The freopen function opens the file whose name is the string pointed to by filename
and associates the stream pointed to by stream with it. The mode argument is used just
-
-
-
[page 272]
as in the fopen function.238)
with leading zeros. The default precision is 1. The result of converting a
zero value with a precision of zero is no characters.
-
[page 277]
f,F A double argument representing a floating-point number is converted to
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.
+
[page 284]
o Matches an optionally signed octal integer, whose format is the same as
entry into the alternate shift state.
23 After the call:
-
-
-
[page 288]
#include <stdio.h>
strtol, strtoll, strtoul, and strtoull functions (7.20.1.4), conversion state
(7.24.6), the wcrtomb function (7.24.6.3.3).
-
-
-
[page 289]
7.19.6.3 The printf function
items assigned, which can be fewer than provided for, or even zero, in the event of an
early matching failure.
-
-
-
[page 291]
7.19.6.8 The vfprintf function
3 The vprintf function returns the number of characters transmitted, or a negative value
if an output or encoding error occurred.
-
-
-
[page 293]
7.19.6.11 The vscanf function
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.
-
-
-
[page 294]
7.19.6.13 The vsprintf function
items assigned, which can be fewer than provided for, or even zero, in the event of an
early matching failure.
-
-
-
[page 295]
7.19.7 Character input/output functions
may evaluate stream more than once, so the argument should never be an expression
with side effects.
-
-
-
[page 297]
Returns
indeterminate and a null pointer is returned.
Forward references: future library directions (7.26.9).
-
-
-
[page 298]
7.19.7.8 The putc function
3 The puts function returns EOF if a write error occurs; otherwise it returns a nonnegative
value.
-
-
-
[page 299]
7.19.7.11 The ungetc function
error occurs, the resulting value of the file position indicator for the stream is
indeterminate.
-
-
-
[page 301]
Returns
Returns
3 The clearerr function returns no value.
-
-
-
[page 304]
7.19.10.2 The feof function
3 The perror function returns no value.
Forward references: the strerror function (7.21.6.2).
-
[page 305]
7.20 General utilities <stdlib.h>
Forward references: the strtol, strtoll, strtoul, and strtoull functions
(7.20.1.4).
-
-
[page 307]
7.20.1.3 The strtod, strtof, and strtold functions
4 If the subject sequence has the expected form for a floating-point number, the sequence of
characters starting with the first digit or the decimal-point character (whichever occurs
first) is interpreted as a floating constant according to the rules of 6.4.4.2, except that the
+
[page 308]
decimal-point character is used in place of a period, and that if neither an exponent part
LLONG_MAX, ULONG_MAX, or ULLONG_MAX is returned (according to the return type
and sign of the value, if any), and the value of the macro ERANGE is stored in errno.
-
-
-
[page 311]
7.20.2 Pseudo-random sequence generation functions
return (unsigned int)(next/65536) % 32768;
}
-
-
[page 312]
void srand(unsigned int seed)
value as a pointer to the old object), or a null pointer if the new object could not be
allocated.
-
-
-
[page 314]
7.20.4 Communication with the environment
Description
2 The exit function causes normal program termination to occur. If more than one call to
the exit function is executed by a program, the behavior is undefined.
+
[page 315]
3 First, all functions registered by the atexit function are called, in the reverse order of
command processor is available. If the argument is not a null pointer, and the system
function does return, it returns an implementation-defined value.
-
-
-
[page 317]
7.20.5 Searching and sorting utilities
(char *)p >= (char *)base
(char *)p < (char *)base + nmemb * size
-
[page 318]
size of each element of the array is specified by size.
returns the number of bytes modified, not including a terminating null character, if
any.267)
-
-
-
[page 324]
7.21 String handling <string.h>
2 The strncpy function copies not more than n characters (characters that follow a null
character are not copied) from the array pointed to by s2 to the array pointed to by
-
-
-
[page 326]
s1.269) If copying takes place between objects that overlap, the behavior is undefined.
Returns
3 The strchr function returns a pointer to the located character, or a null pointer if the
character does not occur in the string.
+
[page 330]
7.21.5.3 The strcspn function
3 The strrchr function returns a pointer to the character, or a null pointer if c does not
occur in the string.
-
-
-
[page 331]
7.21.5.6 The strspn function
Returns
3 The memset function returns the value of s.
-
-
-
[page 333]
7.21.6.2 The strerror function
3 The strlen function returns the number of characters that precede the terminating null
character.
-
-
-
[page 334]
7.22 Type-generic math <tgmath.h>
carg(dc) carg(dc), the function
cproj(ldc) cprojl(ldc)
-
-
-
[page 337]
7.23 Date and time <time.h>
broken-down time as argument.
Forward references: the localtime function (7.23.3.4).
-
-
-
[page 342]
7.23.3.3 The gmtime function
consists of a % character, possibly followed by an E or O modifier character (described
below), followed by a character that determines the behavior of the conversion specifier.
All ordinary multibyte characters (including the terminating null character) are copied
+
[page 343]
unchanged into the array. If copying takes place between objects that overlap, the
%OH is replaced by the hour (24-hour clock), using the locale's alternative numeric
symbols.
-
[page 345]
%OI is replaced by the hour (12-hour clock), using the locale's alternative numeric
%X equivalent to %T.
%Z implementation-defined.
-
[page 346]
Returns
into the array pointed to by s not including the terminating null character. Otherwise,
zero is returned and the contents of the array are indeterminate.
-
-
-
[page 347]
7.24 Extended multibyte and wide character utilities <wchar.h>
[-]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
+
[page 352]
nan, respectively.283)
-- An optional decimal integer greater than zero that specifies the maximum field width
(in wide characters).
-
-
[page 356]
-- An optional length modifier that specifies the size of the receiving object.
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
+
[page 358]
integer.
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
+
[page 360]
converted, but one is consumed. If the conversion specification includes an
items assigned, which can be fewer than provided for, or even zero, in the event of an
early matching failure.
-
-
-
[page 362]
7.24.2.5 The vfwprintf function
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 generated.
-
[page 364]
7.24.2.8 The vswscanf function
3 The vwprintf function returns the number of wide characters transmitted, or a negative
value if an output or encoding error occurred.
-
-
-
[page 365]
7.24.2.10 The vwscanf function
2 The wscanf function is equivalent to fwscanf with the argument stdin interposed
before the arguments to wscanf.
-
[page 366]
Returns
wide character sequences returns zero, and a function that copies wide characters copies
zero wide characters.
-
-
-
[page 371]
7.24.4.1 Wide string numeric conversion functions
n-wchar-sequence nondigit
The subject sequence is defined as the longest initial subsequence of the input wide
string, starting with the first non-white-space wide character, that is of the expected form.
+
[page 372]
The subject sequence contains no wide characters if the input wide string is not of the
Returns
3 The wcscpy function returns the value of s1.
-
[page 376]
7.24.4.2.2 The wcsncpy function
4 EXAMPLE The value of the following expression is the length of the array needed to hold the
transformation of the wide string pointed to by s:
-
[page 380]
1 + wcsxfrm(NULL, s, 0)
string pointed to by s1 which consists entirely of wide characters not from the wide
string pointed to by s2.
-
-
[page 381]
Returns
Returns
3 The wcsspn function returns the length of the segment.
-
[page 382]
7.24.4.5.6 The wcsstr function
the start of the first token.
5 The wcstok function then searches from there for a wide character that is contained in
the current separator wide string. If no such wide character is found, the current token
+
[page 383]
extends to the end of the wide string pointed to by s1, and subsequent searches in the
3 The wmemchr function returns a pointer to the located wide character, or a null pointer if
the wide character does not occur in the object.
-
-
-
[page 384]
7.24.4.6 Miscellaneous functions
-- The argument s points to the initial element of an array of wide characters into which
the generated output is to be placed.
-
[page 385]
-- The argument maxsize indicates the limiting number of wide characters.
Description
2 If ps is not a null pointer, the mbsinit function determines whether the pointed-to
mbstate_t object describes an initial conversion state.
+
[page 387]
Returns
or (size_t)(-1).
Forward references: the mbrtowc function (7.24.6.3.2).
-
-
-
[page 388]
7.24.6.3.2 The mbrtowc function
when dst is not a null pointer), the pointer object pointed to by this parameter is updated
to reflect the amount of the source processed by that invocation.
-
-
-
[page 390]
7.24.6.4.1 The mbsrtowcs function
3 Each of the following expressions has a truth-value equivalent to the call to the wide
character classification function (7.25.2.1) in the comment that follows the expression:
-
[page 397]
iswctype(wc, wctype("alnum")) // iswalnum(wc)
category of the current locale, the wctype function returns a nonzero value that is valid
as the second argument to the iswctype function; otherwise, it returns zero. *
-
-
-
[page 398]
7.25.3 Wide character case mapping utilities
well as case mapping equivalent to that performed by the functions described in the
previous subclause (7.25.3.1).
-
-
-
[page 399]
7.25.3.2.1 The towctrans function
category of the current locale, the wctrans function returns a nonzero value that is valid
as the second argument to the towctrans function; otherwise, it returns zero.
-
-
-
[page 400]
7.26 Future library directions
types defined in the <stdint.h> header. Macro names beginning with INT or UINT
and ending with _MAX, _MIN, or _C may be added to the macros defined in the
<stdint.h> header.
+
[page 401]
7.26.9 Input/output <stdio.h>
1 Function names that begin with is or to and a lowercase letter may be added to the
declarations in the <wctype.h> header.
-
-
-
[page 402]
Annex A
double long typedef
else register union
-
-
-
[page 403]
A.1.3 Identifiers
(6.4.4.1) decimal-constant:
nonzero-digit
decimal-constant digit
+
[page 404]
(6.4.4.1) octal-constant:
fractional-constant exponent-partopt floating-suffixopt
digit-sequence exponent-part floating-suffixopt
-
-
-
[page 405]
(6.4.4.2) hexadecimal-floating-constant:
' c-char-sequence '
L' c-char-sequence '
-
-
-
[page 406]
(6.4.4.4) c-char-sequence:
the double-quote ", backslash \, or new-line character
escape-sequence
-
-
-
[page 407]
A.1.7 Punctuators
pp-number P sign
pp-number .
-
[page 408]
A.2 Phrase structure grammar
auto
register
-
-
-
[page 411]
(6.7.2) type-specifier:
declarator
declaratoropt : constant-expression
-
-
-
[page 412]
(6.7.2.2) enum-specifier:
(6.7.8) designation:
designator-list =
-
-
[page 414]
(6.7.8) designator-list:
if ( expression ) statement else statement
switch ( expression ) statement
-
-
-
[page 415]
(6.8.5) iteration-statement:
(6.10) if-section:
if-group elif-groupsopt else-groupopt endif-line
-
[page 416]
(6.10) if-group:
(6.10) replacement-list:
pp-tokensopt
-
-
-
[page 417]
(6.10) pp-tokens:
(6.10) new-line:
the new-line character
-
-
-
[page 418]
Annex B
double complex catanh(double complex z);
float complex catanhf(float complex z);
long double complex catanhl(long double complex z);
+
[page 419]
double complex ccosh(double complex z);
float crealf(float complex z);
long double creall(long double complex z);
-
[page 420]
B.3 Character handling <ctype.h>
int fesetenv(const fenv_t *envp);
int feupdateenv(const fenv_t *envp);
-
-
[page 421]
B.6 Characteristics of floating types <float.h>
uintmax_t wcstoumax(const wchar_t * restrict nptr,
wchar_t ** restrict endptr, int base);
-
-
-
[page 422]
B.8 Alternative spellings <iso646.h>
float asinf(float x);
long double asinl(long double x);
double atan(double x);
+
[page 423]
float atanf(float x);
false
__bool_true_false_are_defined
-
-
-
[page 428]
B.16 Common definitions <stddef.h>
void setbuf(FILE * restrict stream,
char * restrict buf);
-
[page 429]
int setvbuf(FILE * restrict stream,
int puts(const char *s);
int ungetc(int c, FILE *stream);
-
[page 430]
size_t fread(void * restrict ptr,
const char * restrict nptr,
char ** restrict endptr, int base);
-
-
-
[page 431]
unsigned long long int strtoull(
size_t wcstombs(char * restrict s,
const wchar_t * restrict pwcs, size_t n);
-
-
-
[page 432]
B.20 String handling <string.h>
char *strerror(int errnum);
size_t strlen(const char *s);
-
-
-
[page 433]
B.21 Type-generic math <tgmath.h>
const char * restrict format,
const struct tm * restrict timeptr);
-
-
-
[page 434]
B.23 Extended multibyte/wide character utilities <wchar.h>
wint_t putwchar(wchar_t c);
wint_t ungetwc(wint_t c, FILE *stream);
-
-
[page 435]
double wcstod(const wchar_t * restrict nptr,
int iswupper(wint_t wc);
int iswxdigit(wint_t wc);
int iswctype(wint_t wc, wctype_t desc);
+
[page 437]
wctype_t wctype(const char *property);
wint_t towctrans(wint_t wc, wctrans_t desc);
wctrans_t wctrans(const char *property);
-
-
-
[page 438]
Annex C
also between any call to a comparison function and any movement of the objects
passed as arguments to that call (7.20.5).
-
-
-
[page 439]
Annex D
0AC7-0AC9, 0ACB-0ACD, 0AD0, 0AE0
Oriya: 0B01-0B03, 0B05-0B0C, 0B0F-0B10, 0B13-0B28, 0B2A-0B30,
0B32-0B33, 0B36-0B39, 0B3E-0B43, 0B47-0B48, 0B4B-0B4D,
+
[page 440]
0B5C-0B5D, 0B5F-0B61
2107, 210A-2113, 2115, 2118-211D, 2124, 2126, 2128, 212A-2131,
2133-2138, 2160-2182, 3005-3007, 3021-3029
-
-
-
[page 441]
Annex E
4 The values given in the following list shall be replaced by implementation-defined
constant expressions that are greater or equal in magnitude (absolute value) to those
shown, with the same sign:
+
[page 442]
#define DBL_DIG 10
#define LDBL_EPSILON 1E-9
#define LDBL_MIN 1E-37
-
-
-
[page 443]
Annex F
efficiency of translation-time evaluation through static initialization, such as
const static double one_third = 1.0/3.0;
-
[page 449]
execution time.
floating-point exceptions need not be precise: the actual order and number of occurrences
of floating-point exceptions (> 1) may vary from what the source code expresses. Thus,
the preceding loop could be treated as
+
[page 451]
if (0 < n) x + 1;
F.8.2 Expression transformations
-1 x / 2 (<->) x * 0.5 Although similar transformations involving inexact
+1 x / 2 <-> x * 0.5 Although similar transformations involving inexact
constants generally do not yield numerically equivalent
expressions, if the constants are exact then such
transformations can be made on IEC 60559 machines
and others that round perfectly.
- 1 * x and x / 1 (->) x The expressions 1 * x, x / 1, and x are equivalent
+ 1 * x and x / 1 -> x The expressions 1 * x, x / 1, and x are equivalent
(on IEC 60559 machines, among others).317)
- x / x (->) 1.0 The expressions x / x and 1.0 are not equivalent if x
+ x / x -> 1.0 The expressions x / x and 1.0 are not equivalent if x
can be zero, infinite, or NaN.
- x - y (<->) x + (-y) The expressions x - y, x + (-y), and (-y) + x
+ x - y <-> x + (-y) The expressions x - y, x + (-y), and (-y) + x
are equivalent (on IEC 60559 machines, among others).
- x - y (<->) -(y - x) The expressions x - y and -(y - x) are not
+ x - y <-> -(y - x) The expressions x - y and -(y - x) are not
equivalent because 1 - 1 is +0 but -(1 - 1) is -0 (in the
default rounding direction).318)
- x - x (->) 0.0 The expressions x - x and 0.0 are not equivalent if
+ x - x -> 0.0 The expressions x - x and 0.0 are not equivalent if
x is a NaN or infinite.
- 0 * x (->) 0.0 The expressions 0 * x and 0.0 are not equivalent if
+ 0 * x -> 0.0 The expressions 0 * x and 0.0 are not equivalent if
x is a NaN, infinite, or -0.
- x + 0(->)x The expressions x + 0 and x are not equivalent if x is
+ x + 0->x The expressions x + 0 and x are not equivalent if x is
-0, because (-0) + (+0) yields +0 (in the default
rounding direction), not -0.
- x - 0(->)x (+0) - (+0) yields -0 when rounding is downward
+ x - 0->x (+0) - (+0) yields -0 when rounding is downward
(toward -(inf)), but +0 otherwise, and (-0) - (+0) always
yields -0; so, if the state of the FENV_ACCESS pragma
is ''off'', promising default rounding, then the
[page 452]
might be zero.
- -x (<->) 0 - x The expressions -x and 0 - x are not equivalent if x
+ -x <-> 0 - x The expressions -x and 0 - x are not equivalent if x
is +0, because -(+0) yields -0, but 0 - (+0) yields +0
(unless rounding is downward).
F.8.3 Relational operators
-1 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.
- x < y (->) isless(x,y) (and similarly for <=, >, >=) Though numerically
+1 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.
+ x < y -> isless(x,y) (and similarly for <=, >, >=) Though numerically
equal, these expressions are not equivalent because of
side effects when x or y is a NaN and the state of the
FENV_ACCESS pragma is ''on''. This transformation,
f();
nor, unless the state of the FENV_ACCESS pragma is ''off'', to
-
-
-
[page 453]
// calls g without raising ''invalid'' if a and b are unordered
1 -- tanh((+-)0) returns (+-)0.
-- tanh((+-)(inf)) returns (+-)1.
-
-
-
[page 457]
F.9.3 Exponential and logarithmic functions
1 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.
-
-
-
[page 458]
F.9.3.6 The ldexp functions
1 -- logb((+-)0) returns -(inf) and raises the ''divide-by-zero'' floating-point exception.
-- logb((+-)(inf)) returns +(inf).
-
-
-
[page 459]
F.9.3.12 The modf functions
1 -- fabs((+-)0) returns +0.
-- fabs((+-)(inf)) returns +(inf).
-
-
-
[page 460]
F.9.4.3 The hypot functions
-- pow(+(inf), y) returns +0 for y < 0.
-- pow(+(inf), y) returns +(inf) for y > 0.
-
-
-
[page 461]
F.9.4.5 The sqrt functions
-- ceil((+-)(inf)) returns (+-)(inf).
2 The double version of ceil behaves as though implemented by
-
-
-
[page 462]
#include <math.h>
exception and the result differs from the argument, they raise the ''inexact'' floating-point
exception.
-
-
-
[page 463]
F.9.6.6 The round functions
-- trunc((+-)0) returns (+-)0.
-- trunc((+-)(inf)) returns (+-)(inf).
-
-
-
[page 464]
F.9.7 Remainder functions
F.9.8.2 The nan functions
1 All IEC 60559 implementations support quiet NaNs, in all floating formats.
-
-
-
[page 465]
F.9.8.3 The nextafter functions
of its parts is a finite number (neither infinite nor NaN). A complex or imaginary value is
a zero if each of its parts is a zero.
-
-
-
[page 467]
G.4 Conversions
shown. Unless otherwise specified, where the symbol ''(+-)'' occurs in both an argument
and the result, the result has the same sign as the argument.
3 The functions are continuous onto both sides of their branch cuts, taking into account the
- sign of zero. For example, csqrt(-2 (+-) i0) = (+-)isqrt:2. ???
+ sign of zero. For example, csqrt(-2 (+-) i0) = (+-)i(sqrt)2. ???
4 Since complex and imaginary values are composed of real values, each function may be
regarded as computing real values from real values. Except as noted, the functions treat
real infinities, NaNs, signed zeros, subnormals, and the floating-point exception flags in a
-- cacosh(+(inf) + i (inf)) returns +(inf) + ipi /4.
-- cacosh((+-)(inf) + iNaN) returns +(inf) + iNaN.
-
[page 474]
-- cacosh(NaN + iy) returns NaN + iNaN and optionally raises the ''invalid''
unspecified) and raises the ''invalid'' floating-point exception.
-- csinh(+0 + iNaN) returns (+-)0 + iNaN (where the sign of the real part of the result is
unspecified).
+
[page 476]
-- csinh(x + i (inf)) returns NaN + iNaN and raises the ''invalid'' floating-point
point exception, for all nonzero numbers y.
-- ctanh(NaN + iNaN) returns NaN + iNaN.
-
-
-
[page 477]
G.6.3 Exponential and logarithmic functions
asinh(iy) = i asin(y)
atanh(iy) = i atan(y)
-
-
-
[page 480]
Annex H
3 The parameter ''bounded'' is always true, and is not provided. The parameter ''minint''
is always 0 for the unsigned types, and is not provided for those types.
-
-
-
[page 481]
H.2.2.1 Integer operations
emin FLT_MIN_EXP, DBL_MIN_EXP, LDBL_MIN_EXP
2 The derived constants for the floating point types are accessed by the following:
-
[page 482]
fmax FLT_MAX, DBL_MAX, LDBL_MAX
in all relevant LIA-1 operations, not just addition as in C.
H.2.4 Type conversions
1 The LIA-1 type conversions are the following type casts:
- cvtI' (->) I (int)i, (long int)i, (long long int)i,
+ cvtI' -> I (int)i, (long int)i, (long long int)i,
(unsigned int)i, (unsigned long int)i,
(unsigned long long int)i
- cvtF (->) I (int)x, (long int)x, (long long int)x,
+ cvtF -> I (int)x, (long int)x, (long long int)x,
(unsigned int)x, (unsigned long int)x,
(unsigned long long int)x
- cvtI (->) F (float)i, (double)i, (long double)i
- cvtF' (->) F (float)x, (double)x, (long double)x
+ cvtI -> F (float)i, (double)i, (long double)i
+ cvtF' -> F (float)x, (double)x, (long double)x
2 In the above conversions from floating to integer, the use of (cast)x can be replaced with
(cast)round(x), (cast)rint(x), (cast)nearbyint(x), (cast)trunc(x),
(cast)ceil(x), or (cast)floor(x). In addition, C's floating-point to integer
5 C's conversions (casts) from integer to floating-point can meet LIA-1 requirements if an
implementation uses round-to-nearest.
-
-
-
[page 484]
H.3 Notification
where i is an expression of type int representing a subset of the LIA-1 indicators.
4 C allows an implementation to provide the following LIA-1 required behavior: at
program termination if any indicator is set the implementation shall send an unambiguous
+
[page 485]
and ''hard to ignore'' message (see LIA-1 subclause 6.1.2)
terminate (either default implementation behavior or user replacement for it) or trap-and-
resume, at the programmer's option.
-
-
-
[page 486]
Annex I
-- A statement with no apparent effect is encountered (6.8).
-- A constant expression is used as the controlling expression of a selection statement
(6.8.4).
+
[page 487]
-- An incorrectly formed preprocessing group is encountered while skipping a
preprocessing group (6.10.1).
-- An unrecognized #pragma directive is encountered (6.10.6).
-
-
-
[page 488]
Annex J
-- The order in which subexpressions are evaluated and the order in which side effects
take place, except as specified for the function-call (), &&, ||, ?:, and comma
operators (6.5).
+
[page 489]
-- The order in which the function designator, arguments, and subexpressions within the
-- Whether conversion of non-integer IEC 60559 floating values to integer raises the
''inexact'' floating-point exception (F.4).
-
-
[page 491]
-- Whether or when library functions in <math.h> raise the ''inexact'' floating-point
-- Two identifiers differ only in nonsignificant characters (6.4.2.1).
-- The identifier __func__ is explicitly declared (6.4.2.2).
-
[page 493]
-- The program attempts to modify a string literal (6.4.5).
than extern (6.7.1).
-- A structure or union is defined as containing no named members (6.7.2.1).
-
[page 495]
-- An attempt is made to access, or generate a pointer to just past, a flexible array
compatible return types, or their parameters disagree in use of the ellipsis terminator
or the number and type of parameters (after default argument promotion, when there
is no parameter type list or when one type is specified by a function definition with an
+
[page 496]
identifier list) (6.7.5.3).
-- The argument to the assert macro does not have a scalar type (7.2).
-- The CX_LIMITED_RANGE, FENV_ACCESS, or FP_CONTRACT pragma is used in
any context other than outside all external declarations or preceding all explicit
+
[page 498]
declarations and statements inside a compound statement (7.3.4, 7.6.1, 7.12.2).
-- The parameter parmN of a va_start macro is declared with the register
storage class, with a function or array type, or with a type that is not compatible with
the type that results after application of the default argument promotions (7.15.1.4).
+
[page 500]
-- The member designator parameter of an offsetof macro is an invalid right
-- A conversion specification for a formatted output function uses a # or 0 flag with a
conversion specifier other than those described (7.19.6.1, 7.24.2.1).
-
[page 501]
-- A conversion specification for one of the formatted input/output functions uses a
7.24.2.5, 7.24.2.6, 7.24.2.7, 7.24.2.8, 7.24.2.9, 7.24.2.10).
-- The contents of the array supplied in a call to the fgets, gets, or fgetws function
are used after a read error occurred (7.19.7.2, 7.19.7.7, 7.24.3.2).
+
[page 502]
-- The file position indicator for a binary stream is used after a call to the ungetc
contents of the array being searched or sorted, or returns ordering values
inconsistently (7.20.5).
-
[page 503]
-- The array being searched by the bsearch function does not have its elements in
one in effect for the call to the wctrans function that returned the description
(7.25.3.2.1).
-
-
-
[page 504]
J.3 Implementation-defined behavior
correspondence to universal character names (6.4.2).
-- The number of significant initial characters in an identifier (5.2.4.1, 6.4.2).
-
-
-
[page 505]
J.3.4 Characters
-- The result of, or the signal raised by, converting an integer to a signed integer type
when the value cannot be represented in an object of that type (6.3.1.3).
-
-
[page 506]
-- The results of some bitwise operations on signed integers (6.5).
-- The size of the result of subtracting two pointers to elements of the same array
(6.5.6).
-
-
-
[page 507]
J.3.8 Hints
-- The base-2 logarithm of the modulus used by the remquo functions in reducing the
quotient (7.12.10.3).
-
-
[page 509]
-- Whether a domain error occurs or zero is returned when a remquo function has a
-- The interpretation of a - character that is neither the first nor the last character, nor
the second where a ^ character is the first, in the scanlist for %[ conversion in the
fscanf or fwscanf function (7.19.6.2, 7.24.2.1).
+
[page 510]
-- The set of sequences matched by a %p conversion and the interpretation of the
in this International Standard) (6.2.6.1).
-- The value of the result of the sizeof operator (6.5.3.4).
-
-
-
[page 511]
J.4 Locale-specific behavior
-- Character mappings that are supported by the towctrans function (7.25.1).
-- Character classifications that are supported by the iswctype function (7.25.1).
-
-
-
[page 512]
J.5 Common extensions
more range or precision than long double, may be used for evaluating expressions of
other floating types, and may be used to define float_t or double_t.
-
-
-
[page 513]
J.5.7 Function pointer casts
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,
-
-
-
[page 514]
J.5.14 Extra arguments for signal handlers
instead of, or in addition to, setting errno or raising floating-point exceptions (7.3,
7.12).
-
-
-
[page 515]
33. ISO/IEC 10967-1:1994, Information technology -- Language independent
arithmetic -- Part 1: Integer and floating point arithmetic.
-
-
-
[page 517]
-
[page 518]
++ (prefix increment operator), 6.3.2.1, 6.5.3.1 <stdint.h> header, 4, 5.2.4.2, 6.10.1, 7.8,
+= (addition assignment operator), 6.5.16.2 7.18, 7.26.8
, (comma operator), 6.5.17
+
[page 519]
<stdio.h> header, 5.2.4.2.2, 7.19, 7.26.9, F __cplusplus macro, 6.10.8
Changes from the previous draft (N1256) are indicated by ''diff marks'' in the right
margin: deleted text is marked with ''*'', new or changed text with '' ''.
-
-
-
[page i]
-
[page ii]
<a name="Contents" href="#Contents">Contents</a>
<a href="#6.4.8"> 6.4.8 Preprocessing numbers . . . . . . . . . . . . . . . . 74</a>
<a href="#6.4.9"> 6.4.9 Comments . . . . . . . . . . . . . . . . . . . . . 75</a>
-
[page iii]
<a href="#6.5"> 6.5 Expressions . . . . . . . . . . . . . . . . . . . . . . . . 76</a>
<a href="#6.10.2"> 6.10.2 Source file inclusion . . . . . . . . . . . . . . . . . 163</a>
<a href="#6.10.3"> 6.10.3 Macro replacement . . . . . . . . . . . . . . . . . . 165</a>
-
[page iv]
<a href="#6.10.4"> 6.10.4 Line control . . . . . . . . . . . . . . . . . . . . . 172</a>
<a href="#7.19"> 7.19 Common definitions <stddef.h> . . . . . . . . . . . . . . . 287</a>
<a href="#7.20"> 7.20 Integer types <stdint.h> . . . . . . . . . . . . . . . . . . 289</a>
-
[page vi]
<a href="#7.20.1"> 7.20.1 Integer types . . . . . . . . . . . . . . . . . . . . 289</a>
<a href="#7.26.2"> 7.26.2 Time manipulation functions . . . . . . . . . . . . . . 386</a>
<a href="#7.26.3"> 7.26.3 Time conversion functions . . . . . . . . . . . . . . . 388</a>
-
[page vii]
<a href="#7.27"> 7.27 Unicode utilities <uchar.h> . . . . . . . . . . . . . . . . . 395</a>
<a href="#7.30.10"> 7.30.10 General utilities <stdlib.h> . . . . . . . . . . . . . 453</a>
<a href="#7.30.11"> 7.30.11 String handling <string.h> . . . . . . . . . . . . . 453</a>
-
-
[page viii]
<a href="#7.30.12"> 7.30.12 Extended multibyte and wide character utilities
<a href="#H.2"> H.2 Types . . . . . . . . . . . . . . . . . . . . . . . . . . . 542</a>
<a href="#H.3"> H.3 Notification . . . . . . . . . . . . . . . . . . . . . . . . 546</a>
-
[page x]
<a href="#I">Annex I (informative) Common warnings . . . . . . . . . . . . . . . . 548</a>
<a href="#K.3.9.1"> K.3.9.1 Formatted wide character input/output functions . . . 624</a>
<a href="#K.3.9.2"> K.3.9.2 General wide string utilities . . . . . . . . . . . 635</a>
-
-
[page xi]
<a href="#K.3.9.3"> K.3.9.3 Extended multibyte/wide character conversion
<a href="#Bibliography">Bibliography . . . . . . . . . . . . . . . . . . . . . . . . . . . 650</a>
<a href="#Index">Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 653</a>
-
-
-
[<a name="pxii" href="#pxii">page xii</a>] (<a href="#Contents">Contents</a>)
<a name="Foreword" href="#Foreword"><b> Foreword</b></a>
ISO/IEC TR 19769:2004)
-- type-generic expressions
-
[<a name="pxiii" href="#pxiii">page xiii</a>] (<a href="#Contents">Contents</a>)
-- static assertions
-- hexadecimal floating-point constants and %a and %A printf/scanf conversion
specifiers
-
-
[<a name="pxiv" href="#pxiv">page xiv</a>] (<a href="#Contents">Contents</a>)
-- compound literals
-- additional strftime conversion specifiers
-- LIA compatibility annex
-
[<a name="pxv" href="#pxv">page xv</a>] (<a href="#Contents">Contents</a>)
-- deprecate ungetc at the beginning of a binary file
the ISO/IEC Directives, this foreword, the introduction, notes, footnotes, and examples
are also for information only.
-
-
-
[<a name="pxvi" href="#pxvi">page xvi</a>] (<a href="#Contents">Contents</a>)
<a name="Introduction" href="#Introduction"><b> Introduction</b></a>
5 The language clause (clause 6) is derived from ''The C Reference Manual''.
6 The library clause (clause 7) is based on the 1984 /usr/group Standard.
-
-
-
[<a name="pxvii" href="#pxvii">page xvii</a>] (<a href="#Contents">Contents</a>)
-
[<a name="pxviii" href="#pxviii">page xviii</a>] (<a href="#Contents">Contents</a>)
8 IEC 60559:1989, Binary floating-point arithmetic for microprocessor systems (previously
designated IEC 559:1989).
-
-
-
[<a name="p2" href="#p2">page 2</a>] (<a href="#Contents">Contents</a>)
behavior that depends on local conventions of nationality, culture, and language that each
implementation documents
-
[<a name="p3" href="#p3">page 3</a>] (<a href="#Contents">Contents</a>)
2 EXAMPLE An example of locale-specific behavior is whether the islower function returns true for
1 character
single-byte character
<C> bit representation that fits in a byte
+
[<a name="p4" href="#p4">page 4</a>] (<a href="#Contents">Contents</a>)
<a name="3.7.2" href="#3.7.2"><b> 3.7.2</b></a>
since if the values for a and b were, respectively, -32754 and -15, the sum a + b would produce a trap
while the original expression would not; nor can the expression be rewritten either as
-
[<a name="p16" href="#p16">page 16</a>] (<a href="#Contents">Contents</a>)
a = ((a + 32765) + b);
machine with well-defined semantics for data races. They would be invalid for a hypothetical machine that
is not tolerant of races or provides hardware race detection.
-
-
-
[<a name="p21" href="#p21">page 21</a>] (<a href="#Contents">Contents</a>)
<a name="5.2" href="#5.2"><b> 5.2 Environmental considerations</b></a>
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
+
[<a name="p24" href="#p24">page 24</a>] (<a href="#Contents">Contents</a>)
tabulation position, the behavior of the display device is unspecified.
-- maximum value for an object of type unsigned long int
ULONG_MAX 4294967295 // 232 - 1
-
[<a name="p27" href="#p27">page 27</a>] (<a href="#Contents">Contents</a>)
-- minimum value for an object of type long long int
DBL_MIN_EXP
LDBL_MIN_EXP
-
-
-
[<a name="p31" href="#p31">page 31</a>] (<a href="#Contents">Contents</a>)
-- minimum negative integer such that 10 raised to that power is in the range of
DBL_MIN 1E-37
LDBL_MIN 1E-37
-
-
-
[<a name="p32" href="#p32">page 32</a>] (<a href="#Contents">Contents</a>)
-- minimum positive floating-point number<sup><a href="#note27"><b>27)</b></a></sup>
(<a href="#7.28">7.28</a>), floating-point environment <a href="#7.6"><fenv.h></a> (<a href="#7.6">7.6</a>), general utilities <a href="#7.22"><stdlib.h></a>
(<a href="#7.22">7.22</a>), input/output <a href="#7.21"><stdio.h></a> (<a href="#7.21">7.21</a>), mathematics <a href="#7.12"><math.h></a> (<a href="#7.12">7.12</a>).
-
-
-
[<a name="p34" href="#p34">page 34</a>] (<a href="#Contents">Contents</a>)
-- Two alignments are different when their numeric values are not equal.
-- When an alignment is larger than another it represents a stricter alignment.
-
-
-
[<a name="p49" href="#p49">page 49</a>] (<a href="#Contents">Contents</a>)
<a name="6.3" href="#6.3"><b> 6.3 Conversions</b></a>
<b> Semantics</b>
2 The above tokens (case sensitive) are reserved (in translation phases 7 and 8) for use as
keywords, and shall not be used otherwise. The keyword _Imaginary is reserved for
+
[<a name="p58" href="#p58">page 58</a>] (<a href="#Contents">Contents</a>)
specifying imaginary types.<sup><a href="#note70"><b>70)</b></a></sup>
octal-digit: one of
0 1 2 3 4 5 6 7
-
-
-
[<a name="p62" href="#p62">page 62</a>] (<a href="#Contents">Contents</a>)
hexadecimal-digit: one of
5 The type of an integer constant is the first of the corresponding list in which its value can
be represented.
-
-
-
[<a name="p63" href="#p63">page 63</a>] (<a href="#Contents">Contents</a>)
Octal or Hexadecimal
may be signed or unsigned. If an integer constant cannot be represented by any type in
its list and has no extended integer type, then the integer constant has no type.
-
-
-
[<a name="p64" href="#p64">page 64</a>] (<a href="#Contents">Contents</a>)
<a name="6.4.4.2" href="#6.4.4.2"><b> 6.4.4.2 Floating constants</b></a>
\ octal-digit octal-digit
\ octal-digit octal-digit octal-digit
-
-
-
[<a name="p67" href="#p67">page 67</a>] (<a href="#Contents">Contents</a>)
hexadecimal-escape-sequence:
consisting of the backslash \ followed by a lowercase letter: \a, \b, \f, \n, \r, \t,
and \v.<sup><a href="#note77"><b>77)</b></a></sup>
-
-
[<a name="p68" href="#p68">page 68</a>] (<a href="#Contents">Contents</a>)
<b> Constraints</b>
were in an integer character constant (for a character or UTF-8 string literal) or a wide
character constant (for a wide string literal), except that the single-quote ' is
representable either by itself or by the escape sequence \', but the double-quote " shall
+
[<a name="p70" href="#p70">page 70</a>] (<a href="#Contents">Contents</a>)
be represented by the escape sequence \".
in which case it is known as an operator (other forms of operator also exist in some
contexts). An operand is an entity on which an operator acts.
-
-
-
[<a name="p72" href="#p72">page 72</a>] (<a href="#Contents">Contents</a>)
3 In all aspects of the language, the six tokens<sup><a href="#note79"><b>79)</b></a></sup>
assignment-expression
argument-expression-list , assignment-expression
-
-
-
[<a name="p79" href="#p79">page 79</a>] (<a href="#Contents">Contents</a>)
<a name="6.5.2.1" href="#6.5.2.1"><b> 6.5.2.1 Array subscripting</b></a>
Forward references: address and indirection operators (<a href="#6.5.3.2">6.5.3.2</a>), structure and union
specifiers (<a href="#6.7.2.1">6.7.2.1</a>).
-
-
-
[<a name="p84" href="#p84">page 84</a>] (<a href="#Contents">Contents</a>)
<a name="6.5.2.4" href="#6.5.2.4"><b> 6.5.2.4 Postfix increment and decrement operators</b></a>
Forward references: type names (<a href="#6.7.7">6.7.7</a>), initialization (<a href="#6.7.9">6.7.9</a>).
-
-
-
[<a name="p87" href="#p87">page 87</a>] (<a href="#Contents">Contents</a>)
<a name="6.5.3" href="#6.5.3"><b> 6.5.3 Unary operators</b></a>
the result is set if and only if at least one of the corresponding bits in the converted
operands is set).
-
-
-
[<a name="p98" href="#p98">page 98</a>] (<a href="#Contents">Contents</a>)
<a name="6.5.13" href="#6.5.13"><b> 6.5.13 Logical AND operator</b></a>
and second operands. If the first operand compares unequal to 0, the second operand is
not evaluated.
-
-
-
[<a name="p99" href="#p99">page 99</a>] (<a href="#Contents">Contents</a>)
<a name="6.5.15" href="#6.5.15"><b> 6.5.15 Conditional operator</b></a>
3 A compound assignment of the form E1 op = E2 is equivalent to the simple assignment
expression E1 = E1 op (E2), except that the lvalue E1 is evaluated only once, and with
respect to an indeterminately-sequenced function call, the operation of a compound
+
[<a name="p103" href="#p103">page 103</a>] (<a href="#Contents">Contents</a>)
assignment is a single evaluation. If E1 has an atomic type, compound assignment is a
3 The type specifier _Complex shall not be used if the implementation does not support
complex types (see <a href="#6.10.8.3">6.10.8.3</a>).
-
-
-
[<a name="p110" href="#p110">page 110</a>] (<a href="#Contents">Contents</a>)
<b> Semantics</b>
2 A struct-declaration that does not declare an anonymous structure or anonymous union
shall contain a struct-declarator-list.
-
[<a name="p111" href="#p111">page 111</a>] (<a href="#Contents">Contents</a>)
3 A structure or union shall not contain a member with incomplete or function type (hence,
Forward references: declarators (<a href="#6.7.6">6.7.6</a>), tags (<a href="#6.7.2.3">6.7.2.3</a>).
-
-
-
[<a name="p115" href="#p115">page 115</a>] (<a href="#Contents">Contents</a>)
<a name="6.7.2.2" href="#6.7.2.2"><b> 6.7.2.2 Enumeration specifiers</b></a>
lvalues. If the _Atomic keyword is immediately followed by a left parenthesis, it is
interpreted as a type specifier (with a type name), not as a type qualifier.
-
-
-
[<a name="p119" href="#p119">page 119</a>] (<a href="#Contents">Contents</a>)
<a name="6.7.3" href="#6.7.3"><b> 6.7.3 Type qualifiers</b></a>
}
}
-
-
-
[<a name="p123" href="#p123">page 123</a>] (<a href="#Contents">Contents</a>)
12 The one exception allows the value of a restricted pointer to be carried out of the block in which it (or, more
scope, storage duration, and type indicated by the declaration specifiers.
3 A full declarator is a declarator that is not part of another declarator. The end of a full
declarator is a sequence point. If, in the nested sequence of declarators in a full
+
[<a name="p127" href="#p127">page 127</a>] (<a href="#Contents">Contents</a>)
declarator, there is a declarator specifying a variable length array type, the type specified
3 EXAMPLE The following pair of declarations demonstrates the difference between a ''variable pointer
to a constant value'' and a ''constant pointer to a variable value''.
-
-
-
[<a name="p128" href="#p128">page 128</a>] (<a href="#Contents">Contents</a>)
const int *ptr_to_constant;
<b> Semantics</b>
5 If, in the declaration ''T D1'', D1 has the form
-
-
-
[<a name="p131" href="#p131">page 131</a>] (<a href="#Contents">Contents</a>)
D( parameter-type-list )
Forward references: function definitions (<a href="#6.9.1">6.9.1</a>), type names (<a href="#6.7.7">6.7.7</a>).
-
-
-
[<a name="p134" href="#p134">page 134</a>] (<a href="#Contents">Contents</a>)
<a name="6.7.7" href="#6.7.7"><b> 6.7.7 Type names</b></a>
type t1 and the type pointed to by tp1 are compatible. Type t1 is also compatible with type struct
s1, but not compatible with the types struct s2, t2, the type pointed to by tp2, or int.
-
-
-
[<a name="p136" href="#p136">page 136</a>] (<a href="#Contents">Contents</a>)
6 EXAMPLE 3 The following obscure constructions
a[i-1] = b[i];
}
-
-
-
[<a name="p137" href="#p137">page 137</a>] (<a href="#Contents">Contents</a>)
<a name="6.7.9" href="#6.7.9"><b> 6.7.9 Initialization</b></a>
. identifier
then the current object (defined below) shall have structure or union type and the
identifier shall be the name of a member of that type.
+
[<a name="p138" href="#p138">page 138</a>] (<a href="#Contents">Contents</a>)
<b> Semantics</b>
16 Otherwise, the initializer for an object that has aggregate or union type shall be a brace-
enclosed list of initializers for the elements or named members.
-
[<a name="p139" href="#p139">page 139</a>] (<a href="#Contents">Contents</a>)
17 Each brace-enclosed initializer list has an associated current object. When no
Forward references: common definitions <a href="#7.19"><stddef.h></a> (<a href="#7.19">7.19</a>).
-
-
-
[<a name="p143" href="#p143">page 143</a>] (<a href="#Contents">Contents</a>)
<a name="6.7.10" href="#6.7.10"><b> 6.7.10 Static assertions</b></a>
character set are not required to appear in the message.
Forward references: diagnostics (<a href="#7.2">7.2</a>).
-
-
-
[<a name="p144" href="#p144">page 144</a>] (<a href="#Contents">Contents</a>)
<a name="6.8" href="#6.8"><b> 6.8 Statements and blocks</b></a>
2 In both forms, the first substatement is executed if the expression compares unequal to 0.
In the else form, the second substatement is executed if the expression compares equal
-
[<a name="p147" href="#p147">page 147</a>] (<a href="#Contents">Contents</a>)
to 0. If the first substatement is reached via a label, the second substatement is not
/* ... */
}
-
-
-
[<a name="p151" href="#p151">page 151</a>] (<a href="#Contents">Contents</a>)
4 EXAMPLE 2 A goto statement is not allowed to jump past any declarations of objects with variably
int (*fp)(void); // fp points to a function that has type F
F *Fp; // Fp points to a function that has type F
-
[<a name="p155" href="#p155">page 155</a>] (<a href="#Contents">Contents</a>)
<b> Semantics</b>
3 If the declaration of an identifier for an object is a tentative definition and has internal
linkage, the declared type shall not be an incomplete type.
-
-
-
[<a name="p157" href="#p157">page 157</a>] (<a href="#Contents">Contents</a>)
4 EXAMPLE 1
the array i still has incomplete type, the implicit initializer causes it to have one element, which is set to
zero on program startup.
-
-
-
[<a name="p158" href="#p158">page 158</a>] (<a href="#Contents">Contents</a>)
<a name="6.10" href="#6.10"><b> 6.10 Preprocessing directives</b></a>
endif-line:
# endif new-line
-
-
-
[<a name="p159" href="#p159">page 159</a>] (<a href="#Contents">Contents</a>)
control-line:
#if 'z' - 'a' == 25
if ('z' - 'a' == 25)
-
[<a name="p162" href="#p162">page 162</a>] (<a href="#Contents">Contents</a>)
5 Preprocessing directives of the forms
string literal corresponding to an empty argument is "". The order of evaluation of # and
## operators is unspecified.
-
-
-
[<a name="p167" href="#p167">page 167</a>] (<a href="#Contents">Contents</a>)
<a name="6.10.3.3" href="#6.10.3.3"><b> 6.10.3.3 The ## operator</b></a>
#define max(a, b) ((a) > (b) ? (a) : (b))
The parentheses ensure that the arguments and the resulting expression are bound properly.
-
-
-
[<a name="p169" href="#p169">page 169</a>] (<a href="#Contents">Contents</a>)
5 EXAMPLE 3 To illustrate the rules for redefinition and reexamination, the sequence
xglue(HIGH, LOW)
results in
-
-
-
[<a name="p170" href="#p170">page 170</a>] (<a href="#Contents">Contents</a>)
printf("x" "1" "= %d, x" "2" "= %s", x1, x2);
showlist(The first, second, and third items.);
report(x>y, "x is %d but y is %d", x, y);
-
[<a name="p171" href="#p171">page 171</a>] (<a href="#Contents">Contents</a>)
results in
tokens). The directive resulting after all replacements shall match one of the two
previous forms and is then processed as appropriate.
-
-
-
[<a name="p172" href="#p172">page 172</a>] (<a href="#Contents">Contents</a>)
<a name="6.10.5" href="#6.10.5"><b> 6.10.5 Error directive</b></a>
#define PRAGMA(x) _Pragma(#x)
LISTING ( ..\listing.dir )
-
-
-
[<a name="p177" href="#p177">page 177</a>] (<a href="#Contents">Contents</a>)
<a name="6.11" href="#6.11"><b> 6.11 Future language directions</b></a>
<a name="6.11.9" href="#6.11.9"><b> 6.11.9 Predefined macro names</b></a>
1 Macro names beginning with __STDC_ are reserved for future standardization.
-
-
-
[<a name="p178" href="#p178">page 178</a>] (<a href="#Contents">Contents</a>)
/* ... */
i = atoi(str);
-
-
-
[<a name="p184" href="#p184">page 184</a>] (<a href="#Contents">Contents</a>)
<a name="7.2" href="#7.2"><b> 7.2 Diagnostics <assert.h></b></a>
<sup><a name="note191" href="#note191"><b>191)</b></a></sup> The message written might be of the form:
Assertion failed: expression, function abc, file xyz, line nnn.
-
[<a name="p185" href="#p185">page 185</a>] (<a href="#Contents">Contents</a>)
<b> Returns</b>
3 The assert macro returns no value.
Forward references: the abort function (<a href="#7.22.4.1">7.22.4.1</a>).
-
-
-
[<a name="p186" href="#p186">page 186</a>] (<a href="#Contents">Contents</a>)
<a name="7.3" href="#7.3"><b> 7.3 Complex arithmetic <complex.h></b></a>
<sup><a name="note195" href="#note195"><b>195)</b></a></sup> The purpose of the pragma is to allow the implementation to use the formulas:
(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 | = (sqrt) x 2 + y 2
-----
where the programmer can determine they are safe.
<b> Description</b>
2 The csin functions compute the complex sine of z.
-
-
[<a name="p190" href="#p190">page 190</a>] (<a href="#Contents">Contents</a>)
<b> Returns</b>
float complex casinhf(float complex z);
long double complex casinhl(long double complex z);
-
-
[<a name="p191" href="#p191">page 191</a>] (<a href="#Contents">Contents</a>)
<b> Description</b>
<b> Returns</b>
3 The ccosh functions return the complex hyperbolic cosine value.
-
-
-
[<a name="p192" href="#p192">page 192</a>] (<a href="#Contents">Contents</a>)
<a name="7.3.6.5" href="#7.3.6.5"><b> 7.3.6.5 The csinh functions</b></a>
<b> Returns</b>
3 The cexp functions return the complex base-e exponential value.
-
-
[<a name="p193" href="#p193">page 193</a>] (<a href="#Contents">Contents</a>)
<a name="7.3.7.2" href="#7.3.7.2"><b> 7.3.7.2 The clog functions</b></a>
long double complex cpowl(long double complex x,
long double complex y);
-
-
-
[<a name="p194" href="#p194">page 194</a>] (<a href="#Contents">Contents</a>)
<b> Description</b>
<b> Returns</b>
3 The carg functions return the value of the argument in the interval [-pi , +pi ].
-
-
-
[<a name="p195" href="#p195">page 195</a>] (<a href="#Contents">Contents</a>)
<a name="7.3.9.2" href="#7.3.9.2"><b> 7.3.9.2 The cimag functions</b></a>
<b> Description</b>
2 The creal functions compute the real part of z.<sup><a href="#note197"><b>197)</b></a></sup>
-
[<a name="p197" href="#p197">page 197</a>] (<a href="#Contents">Contents</a>)
<b> Returns</b>
the tolower function returns one of the corresponding characters (always the same one
for any given locale); otherwise, the argument is returned unchanged.
-
-
-
[<a name="p202" href="#p202">page 202</a>] (<a href="#Contents">Contents</a>)
<a name="7.4.2.2" href="#7.4.2.2"><b> 7.4.2.2 The toupper function</b></a>
the toupper function returns one of the corresponding characters (always the same one
for any given locale); otherwise, the argument is returned unchanged.
-
-
-
[<a name="p203" href="#p203">page 203</a>] (<a href="#Contents">Contents</a>)
<a name="7.5" href="#7.5"><b> 7.5 Errors <errno.h></b></a>
3 The fesetround function returns zero if and only if the requested rounding direction
was established.
-
[<a name="p211" href="#p211">page 211</a>] (<a href="#Contents">Contents</a>)
4 EXAMPLE Save, set, and restore the rounding direction. Report an error and abort if setting the
return result;
}
-
-
-
[<a name="p214" href="#p214">page 214</a>] (<a href="#Contents">Contents</a>)
<a name="7.7" href="#7.7"><b> 7.7 Characteristics of floating types <float.h></b></a>
2 The macros, their meanings, and the constraints (or restrictions) on their values are listed
in <a href="#5.2.4.2.2">5.2.4.2.2</a>.
-
-
-
[<a name="p215" href="#p215">page 215</a>] (<a href="#Contents">Contents</a>)
<a name="7.8" href="#7.8"><b> 7.8 Format conversion of integer types <inttypes.h></b></a>
Forward references: the strtol, strtoll, strtoul, and strtoull functions
(<a href="#7.22.1.4">7.22.1.4</a>).
-
-
-
[<a name="p218" href="#p218">page 218</a>] (<a href="#Contents">Contents</a>)
<a name="7.8.2.4" href="#7.8.2.4"><b> 7.8.2.4 The wcstoimax and wcstoumax functions</b></a>
Forward references: the wcstol, wcstoll, wcstoul, and wcstoull functions
(<a href="#7.28.4.1.2">7.28.4.1.2</a>).
-
-
-
[<a name="p219" href="#p219">page 219</a>] (<a href="#Contents">Contents</a>)
<a name="7.9" href="#7.9"><b> 7.9 Alternative spellings <iso646.h></b></a>
xor ^
xor_eq ^=
-
-
-
[<a name="p220" href="#p220">page 220</a>] (<a href="#Contents">Contents</a>)
<a name="7.10" href="#7.10"><b> 7.10 Sizes of integer types <limits.h></b></a>
2 The macros, their meanings, and the constraints (or restrictions) on their values are listed
in <a href="#5.2.4.2.1">5.2.4.2.1</a>.
-
-
-
[<a name="p221" href="#p221">page 221</a>] (<a href="#Contents">Contents</a>)
<a name="7.11" href="#7.11"><b> 7.11 Localization <locale.h></b></a>
char int_p_sign_posn; // CHAR_MAX
char int_n_sign_posn; // CHAR_MAX
-
-
-
[<a name="p222" href="#p222">page 222</a>] (<a href="#Contents">Contents</a>)
3 The macros defined are NULL (described in <a href="#7.19">7.19</a>); and
Set to 1 or 0 if the currency_symbol respectively precedes or
succeeds the value for a nonnegative locally formatted monetary quantity.
-
-
[<a name="p225" href="#p225">page 225</a>] (<a href="#Contents">Contents</a>)
char n_cs_precedes
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.
+
[<a name="p226" href="#p226">page 226</a>] (<a href="#Contents">Contents</a>)
char int_n_sep_by_space
3 The sign string immediately precedes the currency symbol.
4 The sign string immediately succeeds the currency symbol.
-
[<a name="p227" href="#p227">page 227</a>] (<a href="#Contents">Contents</a>)
7 The implementation shall behave as if no library function calls the localeconv
int_p_sign_posn 1 1 1 1
int_n_sign_posn 4 1 4 2
-
-
-
[<a name="p228" href="#p228">page 228</a>] (<a href="#Contents">Contents</a>)
11 EXAMPLE 2 The following table illustrates how the cs_precedes, sep_by_space, and sign_posn members
3 +$1.25 +$ <a href="#1.25">1.25</a> + $1.25
4 $+1.25 $+ <a href="#1.25">1.25</a> $ +1.25
-
-
-
[<a name="p229" href="#p229">page 229</a>] (<a href="#Contents">Contents</a>)
<a name="7.12" href="#7.12"><b> 7.12 Mathematics <math.h></b></a>
<b> Description</b>
2 The atan functions compute the principal value of the arc tangent of x.
-
-
-
[<a name="p237" href="#p237">page 237</a>] (<a href="#Contents">Contents</a>)
<b> Returns</b>
<b> Description</b>
2 The sin functions compute the sine of x (measured in radians).
-
-
[<a name="p238" href="#p238">page 238</a>] (<a href="#Contents">Contents</a>)
<b> Returns</b>
<b> Description</b>
2 The asinh functions compute the arc hyperbolic sine of x.
-
[<a name="p239" href="#p239">page 239</a>] (<a href="#Contents">Contents</a>)
<b> Returns</b>
<b> Description</b>
2 The sinh functions compute the hyperbolic sine of x. A range error occurs if the
magnitude of x is too large.
+
[<a name="p240" href="#p240">page 240</a>] (<a href="#Contents">Contents</a>)
<b> Returns</b>
float logf(float x);
long double logl(long double x);
-
-
[<a name="p243" href="#p243">page 243</a>] (<a href="#Contents">Contents</a>)
<b> Description</b>
<b> Description</b>
2 The modf functions break the argument value into integral and fractional parts, each of
which has the same type and sign as the argument. They store the integral part (in
+
[<a name="p245" href="#p245">page 245</a>] (<a href="#Contents">Contents</a>)
floating-point format) in the object pointed to by iptr.
<b> Returns</b>
3 The cbrt functions return x1/3 .
-
-
-
[<a name="p246" href="#p246">page 246</a>] (<a href="#Contents">Contents</a>)
<a name="7.12.7.2" href="#7.12.7.2"><b> 7.12.7.2 The fabs functions</b></a>
2 The hypot functions compute the square root of the sum of the squares of x and y,
without undue overflow or underflow. A range error may occur.
3 Returns
-4 The hypot functions return sqrt:x2 + y2 .
+4 The hypot functions return (sqrt)x2 + y2 .
-
-----
<a name="7.12.7.4" href="#7.12.7.4"><b> 7.12.7.4 The pow functions</b></a>
error may occur if x is zero and y is zero. A domain error or pole error may occur if x is
zero and y is less than zero.
-
-
-
[<a name="p247" href="#p247">page 247</a>] (<a href="#Contents">Contents</a>)
<b> Returns</b>
2 The sqrt functions compute the nonnegative square root of x. A domain error occurs if
the argument is less than zero.
<b> Returns</b>
-3 The sqrt functions return sqrt:x.
+3 The sqrt functions return (sqrt)x.
-
-
<a name="7.12.8" href="#7.12.8"><b> 7.12.8 Error and gamma functions</b></a>
(integral) e-t dt.
2
The erf functions return erf x =
- sqrt:pi
+ (sqrt)pi
-
- 0
<b> Description</b>
2 The erfc functions compute the complementary error function of x. A range error
occurs if x is too large.
+
[<a name="p248" href="#p248">page 248</a>] (<a href="#Contents">Contents</a>)
<b> Returns</b>
(integral) e-t dt.
2
The erfc functions return erfc x = 1 - erf x =
- sqrt:pi
+ (sqrt)pi
-
- x
<b> Returns</b>
3 The tgamma functions return (Gamma)(x).
-
-
-
[<a name="p249" href="#p249">page 249</a>] (<a href="#Contents">Contents</a>)
<a name="7.12.9" href="#7.12.9"><b> 7.12.9 Nearest integer functions</b></a>
format, using the current rounding direction and without raising the ''inexact'' floating-
point exception.
-
-
-
[<a name="p250" href="#p250">page 250</a>] (<a href="#Contents">Contents</a>)
<b> Returns</b>
<b> Returns</b>
3 The lrint and llrint functions return the rounded integer value.
-
-
-
[<a name="p251" href="#p251">page 251</a>] (<a href="#Contents">Contents</a>)
<a name="7.12.9.6" href="#7.12.9.6"><b> 7.12.9.6 The round functions</b></a>
float truncf(float x);
long double truncl(long double x);
-
[<a name="p252" href="#p252">page 252</a>] (<a href="#Contents">Contents</a>)
<b> Description</b>
<b> Returns</b>
3 The copysign functions return a value with the magnitude of x and the sign of y.
-
-
[<a name="p254" href="#p254">page 254</a>] (<a href="#Contents">Contents</a>)
<a name="7.12.11.2" href="#7.12.11.2"><b> 7.12.11.2 The nan functions</b></a>
<b> Returns</b>
3 The islessequal macro returns the value of (x) <= (y).
-
-
-
[<a name="p259" href="#p259">page 259</a>] (<a href="#Contents">Contents</a>)
<a name="7.12.14.5" href="#7.12.14.5"><b> 7.12.14.5 The islessgreater macro</b></a>
<b> Returns</b>
3 The isunordered macro returns 1 if its arguments are unordered and 0 otherwise.
-
-
-
[<a name="p260" href="#p260">page 260</a>] (<a href="#Contents">Contents</a>)
<a name="7.13" href="#7.13"><b> 7.13 Nonlocal jumps <setjmp.h></b></a>
longjmp(buf, 2); // might cause memory loss
}
-
-
-
[<a name="p263" href="#p263">page 263</a>] (<a href="#Contents">Contents</a>)
<a name="7.14" href="#7.14"><b> 7.14 Signal handling <signal.h></b></a>
<b> Returns</b>
3 The raise function returns zero if successful, nonzero if unsuccessful.
-
-
-
-[<a name="p266" href="#p266">page 266</a>] (<a href="#Contents">Contents</a>)
+[<a name="p266" href="#p266">page 266</a>] (<a href="#Contents">Contents</a>)
<a name="7.15" href="#7.15"><b> 7.15 Alignment <stdalign.h></b></a>
1 The header <a href="#7.15"><stdalign.h></a> defines two macros.
__alignas_is_defined
which expands to the integer constant 1.
-
-
-
[<a name="p267" href="#p267">page 267</a>] (<a href="#Contents">Contents</a>)
<a name="7.16" href="#7.16"><b> 7.16 Variable arguments <stdarg.h></b></a>
char *array[MAXARGS];
int ptr_no = 0;
-
-
-
[<a name="p270" href="#p270">page 270</a>] (<a href="#Contents">Contents</a>)
if (n_ptrs > MAXARGS)
f4(n_ptrs, array);
}
-
-
-
[<a name="p271" href="#p271">page 271</a>] (<a href="#Contents">Contents</a>)
<a name="7.17" href="#7.17"><b> 7.17 Atomics <stdatomic.h></b></a>
5 In the following operation definitions:
-- An A refers to one of the atomic types.
-
[<a name="p272" href="#p272">page 272</a>] (<a href="#Contents">Contents</a>)
-- A C refers to its corresponding non-atomic type. The atomic_address atomic
the value value, while also initializing any additional state that the implementation
might need to carry for the atomic object.
-
-
[<a name="p273" href="#p273">page 273</a>] (<a href="#Contents">Contents</a>)
3 Although this function initializes an atomic object, it does not avoid data races;
2 The kill_dependency macro terminates a dependency chain; the argument does not
carry a dependency to the return value.
-
-
[<a name="p276" href="#p276">page 276</a>] (<a href="#Contents">Contents</a>)
<b> Returns</b>
-- is a sequentially consistent acquire and release fence, if order ==
memory_order_seq_cst.
-
[<a name="p277" href="#p277">page 277</a>] (<a href="#Contents">Contents</a>)
<b> Returns</b>
1 For each line in the following table, the atomic type name is declared as the
corresponding direct type.
-
-
-
[<a name="p279" href="#p279">page 279</a>] (<a href="#Contents">Contents</a>)
Atomic type name Direct type
2 The semantics of the operations on these types are defined in <a href="#7.17.7">7.17.7</a>.
3 The atomic_bool type provides an atomic boolean.
-
[<a name="p280" href="#p280">page 280</a>] (<a href="#Contents">Contents</a>)
4 The atomic_address type provides atomic void * operations. The unit of
<b> Returns</b>
Atomically returns the value pointed to by object.
-
-
-
[<a name="p281" href="#p281">page 281</a>] (<a href="#Contents">Contents</a>)
<a name="7.17.7.3" href="#7.17.7.3"><b> 7.17.7.3 The atomic_exchange generic functions</b></a>
failure. These operations are atomic read-modify-write operations (<a href="#5.1.2.4">5.1.2.4</a>).
3 NOTE 1 The effect of the compare-and-exchange operations is
-
-
-
[<a name="p282" href="#p282">page 282</a>] (<a href="#Contents">Contents</a>)
if (*object == *expected)
3 Atomically replaces the value pointed to by object with the result of the computation
applied to the value pointed to by object and the given operand. Memory is affected
according to the value of order. These operations are atomic read-modify-write
+
[<a name="p283" href="#p283">page 283</a>] (<a href="#Contents">Contents</a>)
operations (<a href="#5.1.2.4">5.1.2.4</a>). For signed integer types, arithmetic is defined to use two's
to the value of order. These operations are atomic read-modify-write operations
(<a href="#5.1.2.4">5.1.2.4</a>).
-
-
-
[<a name="p284" href="#p284">page 284</a>] (<a href="#Contents">Contents</a>)
<b> Returns</b>
<b> Returns</b>
3 The atomic_flag_clear functions return no value.
-
-
-
[<a name="p285" href="#p285">page 285</a>] (<a href="#Contents">Contents</a>)
<a name="7.18" href="#7.18"><b> 7.18 Boolean type and values <stdbool.h></b></a>
Forward references: localization (<a href="#7.11">7.11</a>).
-
-
-
[<a name="p288" href="#p288">page 288</a>] (<a href="#Contents">Contents</a>)
<a name="7.20" href="#7.20"><b> 7.20 Integer types <stdint.h></b></a>
-- maximum value of pointer-holding unsigned integer type
UINTPTR_MAX 216 - 1
-
-
[<a name="p292" href="#p292">page 292</a>] (<a href="#Contents">Contents</a>)
<a name="7.20.2.5" href="#7.20.2.5"><b> 7.20.2.5 Limits of greatest-width integer types</b></a>
by its argument and the type uintmax_t:
UINTMAX_C(value)
-
-
-
[<a name="p295" href="#p295">page 295</a>] (<a href="#Contents">Contents</a>)
<a name="7.21" href="#7.21"><b> 7.21 Input/output <stdio.h></b></a>
which expands to an integer constant expression that is the size needed for an array of
char large enough to hold the longest file name string that the implementation
-
-
[<a name="p296" href="#p296">page 296</a>] (<a href="#Contents">Contents</a>)
guarantees can be opened;<sup><a href="#note258"><b>258)</b></a></sup>
old is no longer accessible by that name. If a file named by the string pointed to by new
exists prior to the call to the rename function, the behavior is implementation-defined.
-
-
-
[<a name="p302" href="#p302">page 302</a>] (<a href="#Contents">Contents</a>)
<b> Returns</b>
3 The fclose function returns zero if the stream was successfully closed, or EOF if any
errors were detected.
-
-
-
[<a name="p304" href="#p304">page 304</a>] (<a href="#Contents">Contents</a>)
<a name="7.21.5.2" href="#7.21.5.2"><b> 7.21.5.2 The fflush function</b></a>
operation fails, fopen returns a null pointer.
Forward references: file positioning functions (<a href="#7.21.9">7.21.9</a>).
-
-
[<a name="p306" href="#p306">page 306</a>] (<a href="#Contents">Contents</a>)
<a name="7.21.5.4" href="#7.21.5.4"><b> 7.21.5.4 The freopen function</b></a>
following n conversion specifier applies to a pointer to a ptrdiff_t
argument.
-
[<a name="p311" href="#p311">page 311</a>] (<a href="#Contents">Contents</a>)
L Specifies that a following a, A, e, E, f, F, g, or G conversion specifier
Forward references: conversion state (<a href="#7.28.6">7.28.6</a>), the wcrtomb function (<a href="#7.28.6.3.3">7.28.6.3.3</a>).
-
-
[<a name="p316" href="#p316">page 316</a>] (<a href="#Contents">Contents</a>)
<a name="7.21.6.2" href="#7.21.6.2"><b> 7.21.6.2 The fscanf function</b></a>
format is the same as expected for the subject sequence of the strtod
function. The corresponding argument shall be a pointer to floating.
-
[<a name="p319" href="#p319">page 319</a>] (<a href="#Contents">Contents</a>)
c Matches a sequence of characters of exactly the number specified by the field
terminating null wide character.
25 However, the call:
-
-
-
[<a name="p323" href="#p323">page 323</a>] (<a href="#Contents">Contents</a>)
#include <a href="#7.21"><stdio.h></a>
2 The scanf function is equivalent to fscanf with the argument stdin interposed
before the arguments to scanf.
-
-
[<a name="p324" href="#p324">page 324</a>] (<a href="#Contents">Contents</a>)
<b> Returns</b>
va_end macro.281) If copying takes place between objects that overlap, the behavior is
undefined.
-
-
[<a name="p328" href="#p328">page 328</a>] (<a href="#Contents">Contents</a>)
<b> Returns</b>
<b> Returns</b>
3 The vsscanf function returns the value of the macro EOF if an input failure occurs
before the first conversion (if any) has completed. Otherwise, the vsscanf function
+
[<a name="p329" href="#p329">page 329</a>] (<a href="#Contents">Contents</a>)
returns the number of input items assigned, which can be fewer than provided for, or even
may evaluate stream more than once, so the argument should never be an expression
with side effects.
-
-
-
[<a name="p331" href="#p331">page 331</a>] (<a href="#Contents">Contents</a>)
<b> Returns</b>
<b> Description</b>
2 The putchar function is equivalent to putc with the second argument stdout.
-
[<a name="p332" href="#p332">page 332</a>] (<a href="#Contents">Contents</a>)
<b> Returns</b>
returns nonzero and stores an implementation-defined positive value in errno.
Forward references: the fsetpos function (<a href="#7.21.9.3">7.21.9.3</a>).
-
-
-
[<a name="p335" href="#p335">page 335</a>] (<a href="#Contents">Contents</a>)
<a name="7.21.9.2" href="#7.21.9.2"><b> 7.21.9.2 The fseek function</b></a>
<b> Returns</b>
3 The rewind function returns no value.
-
-
-
[<a name="p337" href="#p337">page 337</a>] (<a href="#Contents">Contents</a>)
<a name="7.21.10" href="#7.21.10"><b> 7.21.10 Error-handling functions</b></a>
3 The ferror function returns nonzero if and only if the error indicator is set for
stream.
-
-
-
[<a name="p338" href="#p338">page 338</a>] (<a href="#Contents">Contents</a>)
<a name="7.21.10.4" href="#7.21.10.4"><b> 7.21.10.4 The perror function</b></a>
3 The perror function returns no value.
Forward references: the strerror function (<a href="#7.23.6.2">7.23.6.2</a>).
-
-
-
[<a name="p339" href="#p339">page 339</a>] (<a href="#Contents">Contents</a>)
<a name="7.22" href="#7.22"><b> 7.22 General utilities <stdlib.h></b></a>
Forward references: the strtol, strtoll, strtoul, and strtoull functions
(<a href="#7.22.1.4">7.22.1.4</a>).
-
-
[<a name="p341" href="#p341">page 341</a>] (<a href="#Contents">Contents</a>)
<a name="7.22.1.3" href="#7.22.1.3"><b> 7.22.1.3 The strtod, strtof, and strtold functions</b></a>
4 If the subject sequence has the expected form for a floating-point number, the sequence of
characters starting with the first digit or the decimal-point character (whichever occurs
first) is interpreted as a floating constant according to the rules of <a href="#6.4.4.2">6.4.4.2</a>, except that the
+
[<a name="p342" href="#p342">page 342</a>] (<a href="#Contents">Contents</a>)
decimal-point character is used in place of a period, and that if neither an exponent part
LLONG_MAX, ULONG_MAX, or ULLONG_MAX is returned (according to the return type
and sign of the value, if any), and the value of the macro ERANGE is stored in errno.
-
-
-
[<a name="p345" href="#p345">page 345</a>] (<a href="#Contents">Contents</a>)
<a name="7.22.2" href="#7.22.2"><b> 7.22.2 Pseudo-random sequence generation functions</b></a>
3 The aligned_alloc function returns either a null pointer or a pointer to the allocated
space.
-
-
-
[<a name="p347" href="#p347">page 347</a>] (<a href="#Contents">Contents</a>)
<a name="7.22.3.2" href="#7.22.3.2"><b> 7.22.3.2 The calloc function</b></a>
unsuccessful termination is returned to the host environment by means of the function
call raise(SIGABRT).
-
-
-
[<a name="p349" href="#p349">page 349</a>] (<a href="#Contents">Contents</a>)
<b> Returns</b>
5 In no case will the value returned be greater than n or the value of the MB_CUR_MAX
macro.
-
[<a name="p357" href="#p357">page 357</a>] (<a href="#Contents">Contents</a>)
<a name="7.22.7.3" href="#7.22.7.3"><b> 7.22.7.3 The wctomb function</b></a>
No multibyte characters that follow a null character (which is converted into a null wide
character) will be examined or converted. Each multibyte character is converted as if by
a call to the mbtowc function, except that the conversion state of the mbtowc function is
+
[<a name="p358" href="#p358">page 358</a>] (<a href="#Contents">Contents</a>)
not affected.
2 The strncpy function copies not more than n characters (characters that follow a null
character are not copied) from the array pointed to by s2 to the array pointed to by
-
-
-
[<a name="p361" href="#p361">page 361</a>] (<a href="#Contents">Contents</a>)
s1.<sup><a href="#note301"><b>301)</b></a></sup> If copying takes place between objects that overlap, the behavior is undefined.
string pointed to by s. The terminating null character is considered to be part of the
string.
-
-
[<a name="p365" href="#p365">page 365</a>] (<a href="#Contents">Contents</a>)
<b> Returns</b>
string pointed to by s. The terminating null character is considered to be part of the
string.
-
-
-
[<a name="p366" href="#p366">page 366</a>] (<a href="#Contents">Contents</a>)
<b> Returns</b>
by s2. The first call in the sequence has a non-null first argument; subsequent calls in the
sequence have a null first argument. The separator string pointed to by s2 may be
different from call to call.
+
[<a name="p367" href="#p367">page 367</a>] (<a href="#Contents">Contents</a>)
3 The first call in the sequence searches the string pointed to by s1 for the first character
<b> Returns</b>
3 The memset function returns the value of s.
-
-
[<a name="p368" href="#p368">page 368</a>] (<a href="#Contents">Contents</a>)
<a name="7.23.6.2" href="#7.23.6.2"><b> 7.23.6.2 The strerror function</b></a>
3 The strlen function returns the number of characters that precede the terminating null
character.
-
-
-
[<a name="p369" href="#p369">page 369</a>] (<a href="#Contents">Contents</a>)
<a name="7.24" href="#7.24"><b> 7.24 Type-generic math <tgmath.h></b></a>
If all arguments for generic parameters are real, then use of the macro invokes a real
function; otherwise, use of the macro results in undefined behavior.
-
-
-
[<a name="p371" href="#p371">page 371</a>] (<a href="#Contents">Contents</a>)
6 For each unsuffixed function in <a href="#7.3"><complex.h></a> that is not a c-prefixed counterpart to a
carg(dc) carg(dc), the function
cproj(ldc) cprojl(ldc)
-
-
-
[<a name="p372" href="#p372">page 372</a>] (<a href="#Contents">Contents</a>)
<a name="7.25" href="#7.25"><b> 7.25 Threads <threads.h></b></a>
once_flag
which is a complete object type that holds a flag for use by call_once; and
-
[<a name="p373" href="#p373">page 373</a>] (<a href="#Contents">Contents</a>)
xtime
which is returned by a function to indicate that the requested operation failed because it
was unable to allocate memory.
-
-
-
[<a name="p374" href="#p374">page 374</a>] (<a href="#Contents">Contents</a>)
<a name="7.25.2" href="#7.25.2"><b> 7.25.2 Initialization functions</b></a>
int cnd_timedwait(cnd_t *cond, mtx_t *mtx,
const xtime *xt);
-
-
-
[<a name="p376" href="#p376">page 376</a>] (<a href="#Contents">Contents</a>)
<b> Description</b>
2 The mtx_destroy function releases any resources used by the mutex pointed to by
mtx. No threads can be blocked waiting for the mutex pointed to by mtx.
-
-
[<a name="p377" href="#p377">page 377</a>] (<a href="#Contents">Contents</a>)
<b> Returns</b>
resource requested is already in use, or thrd_error if the request could not be
honored.
-
-
-
[<a name="p378" href="#p378">page 378</a>] (<a href="#Contents">Contents</a>)
<a name="7.25.4.4" href="#7.25.4.4"><b> 7.25.4.4 The mtx_timedlock function</b></a>
1 #include <a href="#7.25"><threads.h></a>
int thrd_detach(thrd_t thr);
-
-
[<a name="p380" href="#p380">page 380</a>] (<a href="#Contents">Contents</a>)
<b> Description</b>
2 The tss_create function creates a thread-specific storage pointer with destructor
dtor, which may be null.
-
[<a name="p382" href="#p382">page 382</a>] (<a href="#Contents">Contents</a>)
<b> Returns</b>
2 The tss_set function sets the value for the current thread held in the thread-specific
storage identified by key to val.
-
-
-
[<a name="p383" href="#p383">page 383</a>] (<a href="#Contents">Contents</a>)
<b> Returns</b>
const char * restrict format,
const struct tm * restrict timeptr);
-
-
-
[<a name="p390" href="#p390">page 390</a>] (<a href="#Contents">Contents</a>)
<b> Description</b>
%b the first three characters of %B.
%B one of ''January'', ''February'', ... , ''December''.
%c equivalent to ''%a %b %e %T %Y''.
+
[<a name="p393" href="#p393">page 393</a>] (<a href="#Contents">Contents</a>)
%p one of ''AM'' or ''PM''.
into the array pointed to by s not including the terminating null character. Otherwise,
zero is returned and the contents of the array are indeterminate.
-
-
-
[<a name="p394" href="#p394">page 394</a>] (<a href="#Contents">Contents</a>)
<a name="7.27" href="#7.27"><b> 7.27 Unicode utilities <uchar.h></b></a>
next multibyte character is complete and valid, it determines the values of the
corresponding wide characters and then, if pc16 is not a null pointer, stores the value of
the first (or only) such character in the object pointed to by pc16. Subsequent calls will
+
[<a name="p395" href="#p395">page 395</a>] (<a href="#Contents">Contents</a>)
store successive wide characters without consuming any additional input until all the
character (which is the value stored); the value returned is the number
of bytes that complete the multibyte character.
-
[<a name="p397" href="#p397">page 397</a>] (<a href="#Contents">Contents</a>)
(size_t)(-3) if the next character resulting from a previous call has been stored (no
-- An optional decimal integer greater than zero that specifies the maximum field width
(in wide characters).
-
-
[<a name="p407" href="#p407">page 407</a>] (<a href="#Contents">Contents</a>)
-- An optional length modifier that specifies the size of the receiving object.
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
+
[<a name="p411" href="#p411">page 411</a>] (<a href="#Contents">Contents</a>)
converted, but one is consumed. If the conversion specification includes an
returns the number of input items assigned, which can be fewer than provided for, or even
zero, in the event of an early matching failure.
-
-
-
[<a name="p413" href="#p413">page 413</a>] (<a href="#Contents">Contents</a>)
<a name="7.28.2.5" href="#7.28.2.5"><b> 7.28.2.5 The vfwprintf function</b></a>
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 generated.
-
[<a name="p415" href="#p415">page 415</a>] (<a href="#Contents">Contents</a>)
<a name="7.28.2.8" href="#7.28.2.8"><b> 7.28.2.8 The vswscanf function</b></a>
3 The vwprintf function returns the number of wide characters transmitted, or a negative
value if an output or encoding error occurred.
-
-
-
[<a name="p416" href="#p416">page 416</a>] (<a href="#Contents">Contents</a>)
<a name="7.28.2.10" href="#7.28.2.10"><b> 7.28.2.10 The vwscanf function</b></a>
2 The wscanf function is equivalent to fwscanf with the argument stdin interposed
before the arguments to wscanf.
-
[<a name="p417" href="#p417">page 417</a>] (<a href="#Contents">Contents</a>)
<b> Returns</b>
wide character sequences returns zero, and a function that copies wide characters copies
zero wide characters.
-
-
-
[<a name="p422" href="#p422">page 422</a>] (<a href="#Contents">Contents</a>)
<a name="7.28.4.1" href="#7.28.4.1"><b> 7.28.4.1 Wide string numeric conversion functions</b></a>
n-wchar-sequence nondigit
The subject sequence is defined as the longest initial subsequence of the input wide
string, starting with the first non-white-space wide character, that is of the expected form.
+
[<a name="p423" href="#p423">page 423</a>] (<a href="#Contents">Contents</a>)
The subject sequence contains no wide characters if the input wide string is not of the
<b> Returns</b>
3 The wcscpy function returns the value of s1.
-
[<a name="p427" href="#p427">page 427</a>] (<a href="#Contents">Contents</a>)
<a name="7.28.4.2.2" href="#7.28.4.2.2"><b> 7.28.4.2.2 The wcsncpy function</b></a>
4 EXAMPLE The value of the following expression is the length of the array needed to hold the
transformation of the wide string pointed to by s:
-
[<a name="p431" href="#p431">page 431</a>] (<a href="#Contents">Contents</a>)
1 + wcsxfrm(NULL, s, 0)
string pointed to by s1 which consists entirely of wide characters not from the wide
string pointed to by s2.
-
-
[<a name="p432" href="#p432">page 432</a>] (<a href="#Contents">Contents</a>)
<b> Returns</b>
<b> Returns</b>
3 The wcsspn function returns the length of the segment.
-
[<a name="p433" href="#p433">page 433</a>] (<a href="#Contents">Contents</a>)
<a name="7.28.4.5.6" href="#7.28.4.5.6"><b> 7.28.4.5.6 The wcsstr function</b></a>
the start of the first token.
5 The wcstok function then searches from there for a wide character that is contained in
the current separator wide string. If no such wide character is found, the current token
+
[<a name="p434" href="#p434">page 434</a>] (<a href="#Contents">Contents</a>)
extends to the end of the wide string pointed to by s1, and subsequent searches in the
3 The wmemchr function returns a pointer to the located wide character, or a null pointer if
the wide character does not occur in the object.
-
-
-
[<a name="p435" href="#p435">page 435</a>] (<a href="#Contents">Contents</a>)
<a name="7.28.4.6" href="#7.28.4.6"><b> 7.28.4.6 Miscellaneous functions</b></a>
-- The argument s points to the initial element of an array of wide characters into which
the generated output is to be placed.
-
[<a name="p436" href="#p436">page 436</a>] (<a href="#Contents">Contents</a>)
-- The argument maxsize indicates the limiting number of wide characters.
2 If ps is not a null pointer, the mbsinit function determines whether the referenced
mbstate_t object describes an initial conversion state.
-
-
[<a name="p438" href="#p438">page 438</a>] (<a href="#Contents">Contents</a>)
<b> Returns</b>
or (size_t)(-1).
Forward references: the mbrtowc function (<a href="#7.28.6.3.2">7.28.6.3.2</a>).
-
-
-
[<a name="p439" href="#p439">page 439</a>] (<a href="#Contents">Contents</a>)
<a name="7.28.6.3.2" href="#7.28.6.3.2"><b> 7.28.6.3.2 The mbrtowc function</b></a>
when dst is not a null pointer), the pointer object pointed to by this parameter is updated
to reflect the amount of the source processed by that invocation.
-
-
-
[<a name="p441" href="#p441">page 441</a>] (<a href="#Contents">Contents</a>)
<a name="7.28.6.4.1" href="#7.28.6.4.1"><b> 7.28.6.4.1 The mbsrtowcs function</b></a>
3 Each of the following expressions has a truth-value equivalent to the call to the wide
character classification function (<a href="#7.29.2.1">7.29.2.1</a>) in the comment that follows the expression:
-
[<a name="p448" href="#p448">page 448</a>] (<a href="#Contents">Contents</a>)
iswctype(wc, wctype("alnum")) // iswalnum(wc)
category of the current locale, the wctype function returns a nonzero value that is valid
as the second argument to the iswctype function; otherwise, it returns zero.
-
-
-
[<a name="p449" href="#p449">page 449</a>] (<a href="#Contents">Contents</a>)
<a name="7.29.3" href="#7.29.3"><b> 7.29.3 Wide character case mapping utilities</b></a>
well as case mapping equivalent to that performed by the functions described in the
previous subclause (<a href="#7.29.3.1">7.29.3.1</a>).
-
-
-
[<a name="p450" href="#p450">page 450</a>] (<a href="#Contents">Contents</a>)
<a name="7.29.3.2.1" href="#7.29.3.2.1"><b> 7.29.3.2.1 The towctrans function</b></a>
category of the current locale, the wctrans function returns a nonzero value that is valid
as the second argument to the towctrans function; otherwise, it returns zero.
-
-
-
[<a name="p451" href="#p451">page 451</a>] (<a href="#Contents">Contents</a>)
<a name="7.30" href="#7.30"><b> 7.30 Future library directions</b></a>
1 Function names that begin with is or to and a lowercase letter may be added to the
declarations in the <a href="#7.29"><wctype.h></a> header.
-
-
-
[<a name="p453" href="#p453">page 453</a>] (<a href="#Contents">Contents</a>)
<a name="A" href="#A"><b> Annex A</b></a>
punctuator
each non-white-space character that cannot be one of the above
-
-
-
[<a name="p454" href="#p454">page 454</a>] (<a href="#Contents">Contents</a>)
<a name="A.1.2" href="#A.1.2"><b>A.1.2 Keywords</b></a>
(<a href="#6.4.2.1">6.4.2.1</a>) digit: one of
0 1 2 3 4 5 6 7 8 9
-
-
-
[<a name="p455" href="#p455">page 455</a>] (<a href="#Contents">Contents</a>)
<a name="A.1.4" href="#A.1.4"><b>A.1.4 Universal character names</b></a>
(<a href="#6.4.4.1">6.4.4.1</a>) octal-digit: one of
0 1 2 3 4 5 6 7
-
-
-
[<a name="p456" href="#p456">page 456</a>] (<a href="#Contents">Contents</a>)
(<a href="#6.4.4.1">6.4.4.1</a>) hexadecimal-digit: one of
(<a href="#6.4.4.2">6.4.4.2</a>) sign: one of
+ -
-
-
[<a name="p457" href="#p457">page 457</a>] (<a href="#Contents">Contents</a>)
(<a href="#6.4.4.2">6.4.4.2</a>) digit-sequence:
hexadecimal-escape-sequence
universal-character-name
-
-
-
[<a name="p458" href="#p458">page 458</a>] (<a href="#Contents">Contents</a>)
(<a href="#6.4.4.4">6.4.4.4</a>) simple-escape-sequence: one of
, # ##
<: :> <% %> %: %:%:
-
-
-
[<a name="p459" href="#p459">page 459</a>] (<a href="#Contents">Contents</a>)
<a name="A.1.8" href="#A.1.8"><b>A.1.8 Header names</b></a>
pp-number P sign
pp-number .
-
-
-
[<a name="p460" href="#p460">page 460</a>] (<a href="#Contents">Contents</a>)
<a name="A.2" href="#A.2"><b>A.2 Phrase structure grammar</b></a>
AND-expression
exclusive-OR-expression ^ AND-expression
-
-
-
[<a name="p462" href="#p462">page 462</a>] (<a href="#Contents">Contents</a>)
(<a href="#6.5.12">6.5.12</a>) inclusive-OR-expression:
init-declarator
init-declarator-list , init-declarator
-
[<a name="p463" href="#p463">page 463</a>] (<a href="#Contents">Contents</a>)
(<a href="#6.7">6.7</a>) init-declarator:
(<a href="#6.7.6">6.7.6</a>) declarator:
pointeropt direct-declarator
-
-
[<a name="p465" href="#p465">page 465</a>] (<a href="#Contents">Contents</a>)
(<a href="#6.7.6">6.7.6</a>) direct-declarator:
pointer
pointeropt direct-abstract-declarator
-
-
-
[<a name="p466" href="#p466">page 466</a>] (<a href="#Contents">Contents</a>)
(<a href="#6.7.7">6.7.7</a>) direct-abstract-declarator:
(<a href="#6.7.10">6.7.10</a>) static_assert-declaration:
_Static_assert ( constant-expression , string-literal ) ;
-
-
-
[<a name="p467" href="#p467">page 467</a>] (<a href="#Contents">Contents</a>)
<a name="A.2.3" href="#A.2.3"><b>A.2.3 Statements</b></a>
(<a href="#6.10">6.10</a>) elif-group:
# elif constant-expression new-line groupopt
-
[<a name="p469" href="#p469">page 469</a>] (<a href="#Contents">Contents</a>)
(<a href="#6.10">6.10</a>) else-group:
(<a href="#6.10">6.10</a>) new-line:
the new-line character
-
-
-
[<a name="p470" href="#p470">page 470</a>] (<a href="#Contents">Contents</a>)
<a name="B" href="#B"><b> Annex B</b></a>
int isnan(real-floating x);
int isnormal(real-floating x);
int signbit(real-floating x);
+
[<a name="p475" href="#p475">page 475</a>] (<a href="#Contents">Contents</a>)
double acos(double x);
void (*signal(int sig, void (*func)(int)))(int);
int raise(int sig);
-
-
-
[<a name="p480" href="#p480">page 480</a>] (<a href="#Contents">Contents</a>)
<a name="B.14" href="#B.14"><b>B.14 Alignment <stdalign.h></b></a>
atomic_ushort atomic_intptr_t
atomic_int atomic_uintptr_t
-
-
[<a name="p481" href="#p481">page 481</a>] (<a href="#Contents">Contents</a>)
atomic_size_t atomic_intmax_t
void atomic_flag_clear_explicit(
volatile atomic_flag *object, memory_order order);
-
-
-
[<a name="p482" href="#p482">page 482</a>] (<a href="#Contents">Contents</a>)
<a name="B.17" href="#B.17"><b>B.17 Boolean type and values <stdbool.h></b></a>
__STDC_WANT_LIB_EXT1__
RSIZE_MAX
-
-
-
[<a name="p483" href="#p483">page 483</a>] (<a href="#Contents">Contents</a>)
<a name="B.20" href="#B.20"><b>B.20 Input/output <stdio.h></b></a>
errno_t tmpfile_s(FILE * restrict * restrict streamptr);
errno_t tmpnam_s(char *s, rsize_t maxsize);
-
-
[<a name="p485" href="#p485">page 485</a>] (<a href="#Contents">Contents</a>)
errno_t fopen_s(FILE * restrict * restrict streamptr,
va_list arg);
char *gets_s(char *s, rsize_t n);
-
-
[<a name="p486" href="#p486">page 486</a>] (<a href="#Contents">Contents</a>)
<a name="B.21" href="#B.21"><b>B.21 General utilities <stdlib.h></b></a>
_Noreturn void quick_exit(int status);
int system(const char *string);
-
[<a name="p487" href="#p487">page 487</a>] (<a href="#Contents">Contents</a>)
void *bsearch(const void *key, const void *base,
char * restrict value, rsize_t maxsize,
const char * restrict name);
-
-
-
[<a name="p488" href="#p488">page 488</a>] (<a href="#Contents">Contents</a>)
void *bsearch_s(const void *key, const void *base,
size_t strxfrm(char * restrict s1,
const char * restrict s2, size_t n);
void *memchr(const void *s, int c, size_t n);
+
[<a name="p489" href="#p489">page 489</a>] (<a href="#Contents">Contents</a>)
char *strchr(const char *s, int c);
void mtx_destroy(mtx_t *mtx);
int mtx_init(mtx_t *mtx, int type);
int mtx_lock(mtx_t *mtx);
+
[<a name="p491" href="#p491">page 491</a>] (<a href="#Contents">Contents</a>)
int mtx_timedlock(mtx_t *mtx, const xtime *xt);
errno_t asctime_s(char *s, rsize_t maxsize,
const struct tm *timeptr);
-
-
[<a name="p492" href="#p492">page 492</a>] (<a href="#Contents">Contents</a>)
errno_t ctime_s(char *s, rsize_t maxsize,
int vswprintf(wchar_t * restrict s, size_t n,
const wchar_t * restrict format, va_list arg);
-
-
[<a name="p493" href="#p493">page 493</a>] (<a href="#Contents">Contents</a>)
int vswscanf(const wchar_t * restrict s,
wchar_t *wcsncpy(wchar_t * restrict s1,
const wchar_t * restrict s2, size_t n);
-
-
[<a name="p494" href="#p494">page 494</a>] (<a href="#Contents">Contents</a>)
wchar_t *wmemcpy(wchar_t * restrict s1,
const char * restrict s, size_t n,
mbstate_t * restrict ps);
-
-
[<a name="p495" href="#p495">page 495</a>] (<a href="#Contents">Contents</a>)
size_t wcrtomb(char * restrict s, wchar_t wc,
const wchar_t * restrict format,
va_list arg);
-
-
[<a name="p496" href="#p496">page 496</a>] (<a href="#Contents">Contents</a>)
int vwprintf_s(const wchar_t * restrict format,
const char ** restrict src, rsize_t len,
mbstate_t * restrict ps);
-
-
-
[<a name="p497" href="#p497">page 497</a>] (<a href="#Contents">Contents</a>)
errno_t wcsrtombs_s(size_t * restrict retval,
wint_t towctrans(wint_t wc, wctrans_t desc);
wctrans_t wctrans(const char *property);
-
-
-
[<a name="p498" href="#p498">page 498</a>] (<a href="#Contents">Contents</a>)
<a name="C" href="#C"><b> Annex C</b></a>
also between any call to a comparison function and any movement of the objects
passed as arguments to that call (<a href="#7.22.5">7.22.5</a>).
-
-
-
[<a name="p499" href="#p499">page 499</a>] (<a href="#Contents">Contents</a>)
<a name="D" href="#D"><b> Annex D</b></a>
<a name="D.2" href="#D.2"><b> D.2 Ranges of characters disallowed initially</b></a>
1 0300-036F, 1DC0-1DFF, 20D0-20FF, FE20-FE2F
-
-
-
[<a name="p500" href="#p500">page 500</a>] (<a href="#Contents">Contents</a>)
<a name="E" href="#E"><b> Annex E</b></a>
4 The values given in the following list shall be replaced by implementation-defined
constant expressions that are greater or equal in magnitude (absolute value) to those
shown, with the same sign:
+
[<a name="p501" href="#p501">page 501</a>] (<a href="#Contents">Contents</a>)
#define DLB_DECIMAL_DIG 10
#define LDBL_EPSILON 1E-9
#define LDBL_MIN 1E-37
-
-
-
[<a name="p502" href="#p502">page 502</a>] (<a href="#Contents">Contents</a>)
<a name="F" href="#F"><b> Annex F</b></a>
efficiency of translation-time evaluation through static initialization, such as
const static double one_third = 1.0/3.0;
-
[<a name="p508" href="#p508">page 508</a>] (<a href="#Contents">Contents</a>)
#include <a href="#7.6"><fenv.h></a>
about the order or count of floating-point exceptions. Therefore, between function calls,
floating-point exceptions need not be precise: the actual order and number of occurrences
of floating-point exceptions (> 1) may vary from what the source code expresses. Thus,
+
[<a name="p510" href="#p510">page 510</a>] (<a href="#Contents">Contents</a>)
the preceding loop could be treated as
if (0 < n) x + 1;
<a name="F.9.2" href="#F.9.2"><b> F.9.2 Expression transformations</b></a>
-1 x/2 (<->) x x 0.5 Although similar transformations involving inexact constants
+1 x/2 <-> x x 0.5 Although similar transformations involving inexact constants
generally do not yield numerically equivalent expressions, if the
constants are exact then such transformations can be made on
IEC 60559 machines and others that round perfectly.
- 1 x x and x/1 (->) x The expressions 1 x x, x/1, and x are equivalent (on IEC 60559
+ 1 x x and x/1 -> x The expressions 1 x x, x/1, and x are equivalent (on IEC 60559
machines, among others).<sup><a href="#note355"><b>355)</b></a></sup>
- x/x (->) 1.0 The expressions x/x and 1.0 are not equivalent if x can be zero,
+ x/x -> 1.0 The expressions x/x and 1.0 are not equivalent if x can be zero,
infinite, or NaN.
- x - y (<->) x + (-y) The expressions x - y, x + (-y), and (-y) + x are equivalent (on
+ x - y <-> x + (-y) The expressions x - y, x + (-y), and (-y) + x are equivalent (on
IEC 60559 machines, among others).
- x - y (<->) -(y - x) The expressions x - y and -(y - x) are not equivalent because 1 - 1
+ x - y <-> -(y - x) The expressions x - y and -(y - x) are not equivalent because 1 - 1
is +0 but -(1 - 1) is -0 (in the default rounding direction).<sup><a href="#note356"><b>356)</b></a></sup>
- x - x (->) 0.0 The expressions x - x and 0.0 are not equivalent if x is a NaN or
+ x - x -> 0.0 The expressions x - x and 0.0 are not equivalent if x is a NaN or
infinite.
- 0 x x (->) 0.0 The expressions 0 x x and 0.0 are not equivalent if x is a NaN,
+ 0 x x -> 0.0 The expressions 0 x x and 0.0 are not equivalent if x is a NaN,
infinite, or -0.
- x+0(->) x The expressions x + 0 and x are not equivalent if x is -0, because
+ x+0-> x The expressions x + 0 and x are not equivalent if x is -0, because
(-0) + (+0) yields +0 (in the default rounding direction), not -0.
- x-0(->) x (+0) - (+0) yields -0 when rounding is downward (toward -(inf)), but
+ x-0-> x (+0) - (+0) yields -0 when rounding is downward (toward -(inf)), but
+0 otherwise, and (-0) - (+0) always yields -0; so, if the state of the
FENV_ACCESS pragma is ''off'', promising default rounding, then
the implementation can replace x - 0 by x, even if x might be zero.
- -x (<->) 0 - x The expressions -x and 0 - x are not equivalent if x is +0, because
+ -x <-> 0 - x The expressions -x and 0 - x are not equivalent if x is +0, because
-(+0) yields -0, but 0 - (+0) yields +0 (unless rounding is
downward).
[<a name="p511" href="#p511">page 511</a>] (<a href="#Contents">Contents</a>)
<a name="F.9.3" href="#F.9.3"><b> F.9.3 Relational operators</b></a>
-1 x != x (->) false The expression x != x is true if x is a NaN.
- x = x (->) true The expression x = x is false if x is a NaN.
- x < y (->) isless(x,y) (and similarly for <=, >, >=) Though numerically equal, these
+1 x != x -> false The expression x != x is true if x is a NaN.
+ x = x -> true The expression x = x is false if x is a NaN.
+ x < y -> isless(x,y) (and similarly for <=, >, >=) Though numerically equal, these
expressions are not equivalent because of side effects when x or y is a
NaN and the state of the FENV_ACCESS pragma is ''on''. This
transformation, which would be desirable if extra code were required
g();
but is equivalent to
-
-
-
[<a name="p512" href="#p512">page 512</a>] (<a href="#Contents">Contents</a>)
if (!(a < b))
-- exp(-(inf)) returns +0.
-- exp(+(inf)) returns +(inf).
-
-
-
[<a name="p516" href="#p516">page 516</a>] (<a href="#Contents">Contents</a>)
<a name="F.10.3.2" href="#F.10.3.2"><b> F.10.3.2 The exp2 functions</b></a>
2 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.
-
-
-
[<a name="p517" href="#p517">page 517</a>] (<a href="#Contents">Contents</a>)
<a name="F.10.3.6" href="#F.10.3.6"><b> F.10.3.6 The ldexp functions</b></a>
-- logb((+-)(inf)) returns +(inf).
2 The returned value is exact and is independent of the current rounding direction mode.
-
-
-
[<a name="p518" href="#p518">page 518</a>] (<a href="#Contents">Contents</a>)
<a name="F.10.3.12" href="#F.10.3.12"><b> F.10.3.12 The modf functions</b></a>
2 If the calculation does not overflow or underflow, the returned value is exact and
independent of the current rounding direction mode.
-
-
-
[<a name="p519" href="#p519">page 519</a>] (<a href="#Contents">Contents</a>)
<a name="F.10.4" href="#F.10.4"><b> F.10.4 Power and absolute value functions</b></a>
-- pow(x, +(inf)) returns +0 for | x | < 1.
-- pow(x, +(inf)) returns +(inf) for | x | > 1.
-
[<a name="p520" href="#p520">page 520</a>] (<a href="#Contents">Contents</a>)
-- pow(-(inf), y) returns -0 for y an odd integer < 0.
-- tgamma(-(inf)) returns a NaN and raises the ''invalid'' floating-point exception.
-- tgamma(+(inf)) returns +(inf).
-
-
[<a name="p521" href="#p521">page 521</a>] (<a href="#Contents">Contents</a>)
<a name="F.10.6" href="#F.10.6"><b> F.10.6 Nearest integer functions</b></a>
-- nearbyint((+-)0) returns (+-)0 (for all rounding directions).
-- nearbyint((+-)(inf)) returns (+-)(inf) (for all rounding directions).
-
-
[<a name="p522" href="#p522">page 522</a>] (<a href="#Contents">Contents</a>)
<a name="F.10.6.4" href="#F.10.6.4"><b> F.10.6.4 The rint functions</b></a>
The round functions may, but are not required to, raise the ''inexact'' floating-point
exception for finite non-integer numeric arguments, as this implementation does.
-
-
-
[<a name="p523" href="#p523">page 523</a>] (<a href="#Contents">Contents</a>)
<a name="F.10.6.7" href="#F.10.6.7"><b> F.10.6.7 The lround and llround functions</b></a>
return copysign(result, x);
}
-
-
-
[<a name="p524" href="#p524">page 524</a>] (<a href="#Contents">Contents</a>)
<a name="F.10.7.2" href="#F.10.7.2"><b> F.10.7.2 The remainder functions</b></a>
2 Even though underflow or overflow can occur, the returned value is independent of the
current rounding direction mode.
-
-
-
[<a name="p525" href="#p525">page 525</a>] (<a href="#Contents">Contents</a>)
<a name="F.10.9" href="#F.10.9"><b> F.10.9 Maximum, minimum, and positive difference functions</b></a>
characterized by FLT_EVAL_METHOD equal to 1 or 2 (<a href="#5.2.4.2.2">5.2.4.2.2</a>), do not convert
operands of relational operators to their semantic types.
-
-
-
[<a name="p527" href="#p527">page 527</a>] (<a href="#Contents">Contents</a>)
<a name="G" href="#G"><b> Annex G</b></a>
shown. Unless otherwise specified, where the symbol ''(+-)'' occurs in both an argument
and the result, the result has the same sign as the argument.
3 The functions are continuous onto both sides of their branch cuts, taking into account the
- sign of zero. For example, csqrt(-2 (+-) i0) = (+-)isqrt:2. -
+ sign of zero. For example, csqrt(-2 (+-) i0) = (+-)i(sqrt)2. -
4 Since complex and imaginary values are composed of real values, each function may be
regarded as computing real values from real values. Except as noted, the functions treat
real infinities, NaNs, signed zeros, subnormals, and the floating-point exception flags in a
-- cacosh(+(inf) + i (inf)) returns +(inf) + ipi /4.
-- cacosh((+-)(inf) + iNaN) returns +(inf) + iNaN.
-
[<a name="p535" href="#p535">page 535</a>] (<a href="#Contents">Contents</a>)
-- cacosh(NaN + iy) returns NaN + iNaN and optionally raises the ''invalid''
unspecified) and raises the ''invalid'' floating-point exception.
-- csinh(+0 + iNaN) returns (+-)0 + iNaN (where the sign of the real part of the result is
unspecified).
+
[<a name="p537" href="#p537">page 537</a>] (<a href="#Contents">Contents</a>)
-- csinh(x + i (inf)) returns NaN + iNaN and raises the ''invalid'' floating-point
point exception, for all nonzero numbers y.
-- ctanh(NaN + iNaN) returns NaN + iNaN.
-
-
-
[<a name="p538" href="#p538">page 538</a>] (<a href="#Contents">Contents</a>)
<a name="G.6.3" href="#G.6.3"><b> G.6.3 Exponential and logarithmic functions</b></a>
asinh(iy) = i asin(y)
atanh(iy) = i atan(y)
-
-
-
[<a name="p541" href="#p541">page 541</a>] (<a href="#Contents">Contents</a>)
<a name="H" href="#H"><b> Annex H</b></a>
3 The parameter ''bounded'' is always true, and is not provided. The parameter ''minint''
is always 0 for the unsigned types, and is not provided for those types.
-
-
-
[<a name="p542" href="#p542">page 542</a>] (<a href="#Contents">Contents</a>)
<a name="H.2.2.1" href="#H.2.2.1"><b> H.2.2.1 Integer operations</b></a>
emin FLT_MIN_EXP, DBL_MIN_EXP, LDBL_MIN_EXP
2 The derived constants for the floating point types are accessed by the following:
-
[<a name="p543" href="#p543">page 543</a>] (<a href="#Contents">Contents</a>)
fmax FLT_MAX, DBL_MAX, LDBL_MAX
2 The FLT_ROUNDS parameter can be used to indicate the LIA-1 rounding styles:
truncate FLT_ROUNDS == 0
-
[<a name="p544" href="#p544">page 544</a>] (<a href="#Contents">Contents</a>)
nearest FLT_ROUNDS == 1
in all relevant LIA-1 operations, not just addition as in C.
<a name="H.2.4" href="#H.2.4"><b> H.2.4 Type conversions</b></a>
1 The LIA-1 type conversions are the following type casts:
- cvtI' (->) I (int)i, (long int)i, (long long int)i,
+ cvtI' -> I (int)i, (long int)i, (long long int)i,
(unsigned int)i, (unsigned long int)i,
(unsigned long long int)i
- cvtF (->) I (int)x, (long int)x, (long long int)x,
+ cvtF -> I (int)x, (long int)x, (long long int)x,
(unsigned int)x, (unsigned long int)x,
(unsigned long long int)x
- cvtI (->) F (float)i, (double)i, (long double)i
- cvtF' (->) F (float)x, (double)x, (long double)x
+ cvtI -> F (float)i, (double)i, (long double)i
+ cvtF' -> F (float)x, (double)x, (long double)x
2 In the above conversions from floating to integer, the use of (cast)x can be replaced with
(cast)round(x), (cast)rint(x), (cast)nearbyint(x), (cast)trunc(x),
(cast)ceil(x), or (cast)floor(x). In addition, C's floating-point to integer
5 C's conversions (casts) from integer to floating-point can meet LIA-1 requirements if an
implementation uses round-to-nearest.
-
-
-
[<a name="p545" href="#p545">page 545</a>] (<a href="#Contents">Contents</a>)
<a name="H.3" href="#H.3"><b> H.3 Notification</b></a>
where i is an expression of type int representing a subset of the LIA-1 indicators.
4 C allows an implementation to provide the following LIA-1 required behavior: at
program termination if any indicator is set the implementation shall send an unambiguous
+
[<a name="p546" href="#p546">page 546</a>] (<a href="#Contents">Contents</a>)
and ''hard to ignore'' message (see LIA-1 subclause <a href="#6.1.2">6.1.2</a>)
allows trap-and-terminate (either default implementation behavior or user replacement for
it) or trap-and-resume, at the programmer's option.
-
-
-
[<a name="p547" href="#p547">page 547</a>] (<a href="#Contents">Contents</a>)
<a name="I" href="#I"><b> Annex I</b></a>
-- A statement with no apparent effect is encountered (<a href="#6.8">6.8</a>).
-- A constant expression is used as the controlling expression of a selection statement
(<a href="#6.8.4">6.8.4</a>).
+
[<a name="p548" href="#p548">page 548</a>] (<a href="#Contents">Contents</a>)
-- An incorrectly formed preprocessing group is encountered while skipping a
preprocessing group (<a href="#6.10.1">6.10.1</a>).
-- An unrecognized #pragma directive is encountered (<a href="#6.10.6">6.10.6</a>).
-
-
-
[<a name="p549" href="#p549">page 549</a>] (<a href="#Contents">Contents</a>)
<a name="J" href="#J"><b> Annex J</b></a>
-- Whether two string literals result in distinct arrays (<a href="#6.4.5">6.4.5</a>).
-- The order in which subexpressions are evaluated and the order in which side effects
take place, except as specified for the function-call (), &&, ||, ? :, and comma
+
[<a name="p550" href="#p550">page 550</a>] (<a href="#Contents">Contents</a>)
operators (<a href="#6.5">6.5</a>).
range of the return type (<a href="#7.12.6.5">7.12.6.5</a>, <a href="#F.10.3.5">F.10.3.5</a>).
-- The result of rounding when the value is out of range (<a href="#7.12.9.5">7.12.9.5</a>, <a href="#7.12.9.7">7.12.9.7</a>, <a href="#F.10.6.5">F.10.6.5</a>).
-
[<a name="p551" href="#p551">page 551</a>] (<a href="#Contents">Contents</a>)
-- The value stored by the remquo functions in the object pointed to by quo when y is
-- The resulting value when the ''invalid'' floating-point exception is raised during
IEC 60559 floating to integer conversion (<a href="#F.4">F.4</a>).
-
-
[<a name="p552" href="#p552">page 552</a>] (<a href="#Contents">Contents</a>)
-- Whether conversion of non-integer IEC 60559 floating values to integer raises the
(<a href="#6.2.2">6.2.2</a>).
-- An object is referred to outside of its lifetime (<a href="#6.2.4">6.2.4</a>).
-
-
[<a name="p553" href="#p553">page 553</a>] (<a href="#Contents">Contents</a>)
-- The value of a pointer to an object whose lifetime has ended is used (<a href="#6.2.4">6.2.4</a>).
-- A pointer is used to call a function whose type is not compatible with the referenced
type (<a href="#6.3.2.3">6.3.2.3</a>).
-
-
[<a name="p554" href="#p554">page 554</a>] (<a href="#Contents">Contents</a>)
-- An unmatched ' or " character is encountered on a logical source line during
-- A member of an atomic structure or union is accessed (<a href="#6.5.2.3">6.5.2.3</a>).
-- The operand of the unary * operator has an invalid value (<a href="#6.5.3.2">6.5.3.2</a>).
-
[<a name="p555" href="#p555">page 555</a>] (<a href="#Contents">Contents</a>)
-- A pointer is converted to other than an integer or pointer type (<a href="#6.5.4">6.5.4</a>).
-- The definition of an object has an alignment specifier and another declaration of that
object has a different alignment specifier (<a href="#6.7.5">6.7.5</a>).
-
[<a name="p557" href="#p557">page 557</a>] (<a href="#Contents">Contents</a>)
-- Declarations of an object in different translation units have different alignment
exactly match one of the specified character sequences (<a href="#7.21.5.3">7.21.5.3</a>).
-- An output operation on an update stream is followed by an input operation without an
intervening call to the fflush function or a file positioning function, or an input
+
[<a name="p562" href="#p562">page 562</a>] (<a href="#Contents">Contents</a>)
operation on an update stream is followed by an output operation with an intervening
-- The number of characters transmitted by a formatted output function is greater than
INT_MAX (<a href="#7.21.6.1">7.21.6.1</a>, <a href="#7.21.6.3">7.21.6.3</a>, <a href="#7.21.6.8">7.21.6.8</a>, <a href="#7.21.6.10">7.21.6.10</a>).
-
[<a name="p563" href="#p563">page 563</a>] (<a href="#Contents">Contents</a>)
-- The result of a conversion by one of the formatted input functions cannot be
-- The value of a pointer that refers to space deallocated by a call to the free or
realloc function is used (<a href="#7.22.3">7.22.3</a>).
-
[<a name="p564" href="#p564">page 564</a>] (<a href="#Contents">Contents</a>)
-- The alignment requested of the aligned_alloc function is not valid or not
1 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:
-
-
-
[<a name="p566" href="#p566">page 566</a>] (<a href="#Contents">Contents</a>)
<a name="J.3.1" href="#J.3.1"><b> J.3.1 Translation</b></a>
correspondence to universal character names (<a href="#6.4.2">6.4.2</a>).
-- The number of significant initial characters in an identifier (<a href="#5.2.4.1">5.2.4.1</a>, <a href="#6.4.2">6.4.2</a>).
-
-
-
[<a name="p567" href="#p567">page 567</a>] (<a href="#Contents">Contents</a>)
<a name="J.3.4" href="#J.3.4"><b> J.3.4 Characters</b></a>
corresponding standard encoding macro (__STDC_ISO_10646__,
__STDC_UTF_16__, or __STDC_UTF_32__) is not defined (<a href="#6.10.8.2">6.10.8.2</a>).
-
-
-
[<a name="p568" href="#p568">page 568</a>] (<a href="#Contents">Contents</a>)
<a name="J.3.5" href="#J.3.5"><b> J.3.5 Integers</b></a>
classifications, and their macro names (<a href="#7.6">7.6</a>, <a href="#7.12">7.12</a>).
-- The default state for the FP_CONTRACT pragma (<a href="#7.12.2">7.12.2</a>).
-
[<a name="p569" href="#p569">page 569</a>] (<a href="#Contents">Contents</a>)
<a name="J.3.7" href="#J.3.7"><b> J.3.7 Arrays and pointers</b></a>
-- Whether the value of a single-character character constant in a constant expression
that controls conditional inclusion may have a negative value (<a href="#6.10.1">6.10.1</a>).
-
[<a name="p570" href="#p570">page 570</a>] (<a href="#Contents">Contents</a>)
-- The places that are searched for an included < > delimited header, and how the places
-- Whether the functions in <a href="#7.12"><math.h></a> honor the rounding direction mode in an
IEC 60559 conformant implementation, unless explicitly specified otherwise (<a href="#F.10">F.10</a>).
-
-
-
[<a name="p573" href="#p573">page 573</a>] (<a href="#Contents">Contents</a>)
<a name="J.3.13" href="#J.3.13"><b> J.3.13 Architecture</b></a>
<a href="#7.28.4.1">7.28.4.1</a>).
-- The collation sequence of the execution character set (<a href="#7.23.4.3">7.23.4.3</a>, <a href="#7.28.4.4.2">7.28.4.4.2</a>).
-
[<a name="p574" href="#p574">page 574</a>] (<a href="#Contents">Contents</a>)
-- The contents of the error message strings set up by the strerror function
1 String literals are modifiable (in which case, identical string literals should denote distinct
objects) (<a href="#6.4.5">6.4.5</a>).
-
-
-
[<a name="p575" href="#p575">page 575</a>] (<a href="#Contents">Contents</a>)
<a name="J.5.6" href="#J.5.6"><b> J.5.6 Other arithmetic types</b></a>
execution environments, are defined by the implementation before translation begins
(<a href="#6.10.8">6.10.8</a>).
-
-
-
[<a name="p576" href="#p576">page 576</a>] (<a href="#Contents">Contents</a>)
<a name="J.5.13" href="#J.5.13"><b> J.5.13 Floating-point status flags</b></a>
instead of, or in addition to, setting errno or raising floating-point exceptions (<a href="#7.3">7.3</a>,
<a name="7.12)" href="#7.12)"><b> 7.12).</b></a>
-
-
-
[<a name="p577" href="#p577">page 577</a>] (<a href="#Contents">Contents</a>)
<a name="K" href="#K"><b> Annex K</b></a>
function. Such functions can be troublesome since a previously returned result can
change if the function is called again, perhaps by another thread.
-
-
-
[<a name="p578" href="#p578">page 578</a>] (<a href="#Contents">Contents</a>)
<a name="K.2" href="#K.2"><b> K.2 Scope</b></a>
with the meaning that mode has in the fopen_s function (including the mode's effect
on exclusive access and file permissions).
-
[<a name="p582" href="#p582">page 582</a>] (<a href="#Contents">Contents</a>)
5 If the file was created successfully, then the pointer to FILE pointed to by streamptr
2 Neither s nor format shall be a null pointer. n shall neither equal zero nor be greater
than RSIZE_MAX. The %n specifier<sup><a href="#note382"><b>382)</b></a></sup> (modified or not by flags, field width, or
precision) shall not appear in the string pointed to by format. Any argument to
+
[<a name="p590" href="#p590">page 590</a>] (<a href="#Contents">Contents</a>)
snprintf_s corresponding to a %s specifier shall not be a null pointer. No encoding
return value of the function is passed. Otherwise, a positive value of type
errno_t is passed.
-
-
[<a name="p600" href="#p600">page 600</a>] (<a href="#Contents">Contents</a>)
4 The implementation has a default constraint handler that is used if no calls to the
(char *)p >= (char *)base
(char *)p < (char *)base + nmemb * size
-
[<a name="p603" href="#p603">page 603</a>] (<a href="#Contents">Contents</a>)
5 A sequence point occurs immediately before and immediately after each call to the
wide characters. If dst is not a null pointer, the converted characters are stored into the
array pointed to by dst. Conversion continues up to and including a terminating null
character, which is also stored. Conversion stops earlier in two cases: when a sequence of
+
[<a name="p607" href="#p607">page 607</a>] (<a href="#Contents">Contents</a>)
bytes is encountered that does not form a valid multibyte character, or (if dst is not a
5 The memcpy_s function returns zero if there was no runtime-constraint violation.
Otherwise, a nonzero value is returned.
-
-
-
[<a name="p610" href="#p610">page 610</a>] (<a href="#Contents">Contents</a>)
<a name="K.3.7.1.2" href="#K.3.7.1.2"><b> K.3.7.1.2 The memmove_s function</b></a>
that is not contained in the current separator string pointed to by s2. If no such character
is found, then there are no tokens in the string pointed to by s1 and the strtok_s
function returns a null pointer. If such a character is found, it is the start of the first token.
+
[<a name="p616" href="#p616">page 616</a>] (<a href="#Contents">Contents</a>)
7 The strtok_s function then searches from there for the first character in s1 that is
greater than RSIZE_MAX, the memset_s function stores the value of c (converted to an
unsigned char) into each of the first smax characters of the object pointed to by s.
-
-
[<a name="p617" href="#p617">page 617</a>] (<a href="#Contents">Contents</a>)
<b> Description</b>
<b> Returns</b>
5 The asctime_s function returns zero if the time was successfully converted and stored
into the array pointed to by s. Otherwise, it returns a nonzero value.
+
[<a name="p621" href="#p621">page 621</a>] (<a href="#Contents">Contents</a>)
<a name="K.3.8.2.2" href="#K.3.8.2.2"><b> K.3.8.2.2 The ctime_s function</b></a>
<b> Description</b>
4 The gmtime_s function converts the calendar time pointed to by timer into a broken-
down time, expressed as UTC. The broken-down time is stored in the structure pointed
+
[<a name="p622" href="#p622">page 622</a>] (<a href="#Contents">Contents</a>)
to by result.
subclause causes copying to take place between objects that overlap, the objects take on
unspecified values.
-
-
-
[<a name="p623" href="#p623">page 623</a>] (<a href="#Contents">Contents</a>)
<a name="K.3.9.1" href="#K.3.9.1"><b> K.3.9.1 Formatted wide character input/output functions</b></a>
before any conversion or if there is a runtime-constraint violation. Otherwise, the
swscanf_s function returns the number of input items assigned, which can be fewer
than provided for, or even zero, in the event of an early matching failure.
+
[<a name="p627" href="#p627">page 627</a>] (<a href="#Contents">Contents</a>)
<a name="K.3.9.1.6" href="#K.3.9.1.6"><b> K.3.9.1.6 The vfwprintf_s function</b></a>
wscanf_s function returns the number of input items assigned, which can be fewer than
provided for, or even zero, in the event of an early matching failure.
-
-
-
[<a name="p634" href="#p634">page 634</a>] (<a href="#Contents">Contents</a>)
<a name="K.3.9.2" href="#K.3.9.2"><b> K.3.9.2 General wide string utilities</b></a>
18 The wmemcpy_s function returns zero if there was no runtime-constraint violation.
Otherwise, a nonzero value is returned.
-
-
-
[<a name="p637" href="#p637">page 637</a>] (<a href="#Contents">Contents</a>)
<a name="K.3.9.2.1.4" href="#K.3.9.2.1.4"><b> K.3.9.2.1.4 The wmemmove_s function</b></a>
and the wcstok_s function returns a null pointer. If such a wide character is found, it is
the start of the first token.
-
[<a name="p641" href="#p641">page 641</a>] (<a href="#Contents">Contents</a>)
7 The wcstok_s function then searches from there for the first wide character in s1 that
continues up to and including a terminating null character, which is also stored.
Conversion stops earlier in two cases: when a sequence of bytes is encountered that does
not form a valid multibyte character, or (if dst is not a null pointer) when len wide
+
[<a name="p644" href="#p644">page 644</a>] (<a href="#Contents">Contents</a>)
characters have been stored into the array pointed to by dst.<sup><a href="#note439"><b>439)</b></a></sup> If dst is not a null
-- A string or wide string utility function is instructed to access an array beyond the end
of an object (<a href="#7.23.1">7.23.1</a>, <a href="#7.28.4">7.28.4</a>).
-
-
-
[<a name="p649" href="#p649">page 649</a>] (<a href="#Contents">Contents</a>)
18. ISO/IEC 9899:1999/Cor.2:2004, Technical Corrigendum 2.
19. ISO/IEC 9899:1999/Cor.3:2007, Technical Corrigendum 3.
-
-
[<a name="p650" href="#p650">page 650</a>] (<a href="#Contents">Contents</a>)
20. ISO/IEC 9945-2:1993, Information technology -- Portable Operating System
37. ISO/IEC 10967-1:1994, Information technology -- Language independent
arithmetic -- Part 1: Integer and floating point arithmetic.
-
[<a name="p651" href="#p651">page 651</a>] (<a href="#Contents">Contents</a>)
38. ISO/IEC TR 19769:2004, Information technology -- Programming languages,
their environments and system software interfaces -- Extensions to the C library
-- Part 1: Bounds-checking interfaces.
-
-
-
[<a name="p652" href="#p652">page 652</a>] (<a href="#Contents">Contents</a>)
++ (postfix increment operator), <a href="#6.3.2.1">6.3.2.1</a>, <a href="#6.5.2.4">6.5.2.4</a> <a href="#7.18"><stdbool.h></a> header, <a href="#4">4</a>, <a href="#7.18">7.18</a>, <a href="#7.30.7">7.30.7</a>, <a href="#H">H</a>
++ (prefix increment operator), <a href="#6.3.2.1">6.3.2.1</a>, <a href="#6.5.3.1">6.5.3.1</a> <a href="#7.19"><stddef.h></a> header, <a href="#4">4</a>, <a href="#6.3.2.1">6.3.2.1</a>, <a href="#6.3.2.3">6.3.2.3</a>, <a href="#6.4.4.4">6.4.4.4</a>,
+= (addition assignment operator), <a href="#6.5.16.2">6.5.16.2</a>
+
[<a name="p653" href="#p653">page 653</a>] (<a href="#Contents">Contents</a>)
<a href="#6.4.5">6.4.5</a>, <a href="#6.5.3.4">6.5.3.4</a>, <a href="#6.5.6">6.5.6</a>, <a href="#7.19">7.19</a>, <a href="#K.3.3">K.3.3</a> \x hexadecimal digits (hexadecimal-character
Changes from the previous draft (N1256) are indicated by ''diff marks'' in the right
margin: deleted text is marked with ''*'', new or changed text with '' ''.
-
-
-
[page i]
-
[page ii]
Contents
6.4.8 Preprocessing numbers . . . . . . . . . . . . . . . . 74
6.4.9 Comments . . . . . . . . . . . . . . . . . . . . . 75
-
[page iii]
6.5 Expressions . . . . . . . . . . . . . . . . . . . . . . . . 76
6.10.2 Source file inclusion . . . . . . . . . . . . . . . . . 163
6.10.3 Macro replacement . . . . . . . . . . . . . . . . . . 165
-
[page iv]
6.10.4 Line control . . . . . . . . . . . . . . . . . . . . . 172
7.19 Common definitions <stddef.h> . . . . . . . . . . . . . . . 287
7.20 Integer types <stdint.h> . . . . . . . . . . . . . . . . . . 289
-
[page vi]
7.20.1 Integer types . . . . . . . . . . . . . . . . . . . . 289
7.26.2 Time manipulation functions . . . . . . . . . . . . . . 386
7.26.3 Time conversion functions . . . . . . . . . . . . . . . 388
-
[page vii]
7.27 Unicode utilities <uchar.h> . . . . . . . . . . . . . . . . . 395
7.30.10 General utilities <stdlib.h> . . . . . . . . . . . . . 453
7.30.11 String handling <string.h> . . . . . . . . . . . . . 453
-
-
[page viii]
7.30.12 Extended multibyte and wide character utilities
H.2 Types . . . . . . . . . . . . . . . . . . . . . . . . . . . 542
H.3 Notification . . . . . . . . . . . . . . . . . . . . . . . . 546
-
[page x]
Annex I (informative) Common warnings . . . . . . . . . . . . . . . . 548
K.3.9.1 Formatted wide character input/output functions . . . 624
K.3.9.2 General wide string utilities . . . . . . . . . . . 635
-
-
[page xi]
K.3.9.3 Extended multibyte/wide character conversion
Bibliography . . . . . . . . . . . . . . . . . . . . . . . . . . . 650
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 653
-
-
-
[page xii]
Foreword
ISO/IEC TR 19769:2004)
-- type-generic expressions
-
[page xiii]
-- static assertions
-- hexadecimal floating-point constants and %a and %A printf/scanf conversion
specifiers
-
-
[page xiv]
-- compound literals
-- additional strftime conversion specifiers
-- LIA compatibility annex
-
[page xv]
-- deprecate ungetc at the beginning of a binary file
the ISO/IEC Directives, this foreword, the introduction, notes, footnotes, and examples
are also for information only.
-
-
-
[page xvi]
Introduction
5 The language clause (clause 6) is derived from ''The C Reference Manual''.
6 The library clause (clause 7) is based on the 1984 /usr/group Standard.
-
-
-
[page xvii]
-
[page xviii]
8 IEC 60559:1989, Binary floating-point arithmetic for microprocessor systems (previously
designated IEC 559:1989).
-
-
-
[page 2]
behavior that depends on local conventions of nationality, culture, and language that each
implementation documents
-
[page 3]
2 EXAMPLE An example of locale-specific behavior is whether the islower function returns true for
1 character
single-byte character
<C> bit representation that fits in a byte
+
[page 4]
3.7.2
since if the values for a and b were, respectively, -32754 and -15, the sum a + b would produce a trap
while the original expression would not; nor can the expression be rewritten either as
-
[page 16]
a = ((a + 32765) + b);
machine with well-defined semantics for data races. They would be invalid for a hypothetical machine that
is not tolerant of races or provides hardware race detection.
-
-
-
[page 21]
5.2 Environmental considerations
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
+
[page 24]
tabulation position, the behavior of the display device is unspecified.
-- maximum value for an object of type unsigned long int
ULONG_MAX 4294967295 // 232 - 1
-
[page 27]
-- minimum value for an object of type long long int
DBL_MIN_EXP
LDBL_MIN_EXP
-
-
-
[page 31]
-- minimum negative integer such that 10 raised to that power is in the range of
DBL_MIN 1E-37
LDBL_MIN 1E-37
-
-
-
[page 32]
-- minimum positive floating-point number27)
(7.28), floating-point environment <fenv.h> (7.6), general utilities <stdlib.h>
(7.22), input/output <stdio.h> (7.21), mathematics <math.h> (7.12).
-
-
-
[page 34]
-- Two alignments are different when their numeric values are not equal.
-- When an alignment is larger than another it represents a stricter alignment.
-
-
-
[page 49]
6.3 Conversions
Semantics
2 The above tokens (case sensitive) are reserved (in translation phases 7 and 8) for use as
keywords, and shall not be used otherwise. The keyword _Imaginary is reserved for
+
[page 58]
specifying imaginary types.70)
octal-digit: one of
0 1 2 3 4 5 6 7
-
-
-
[page 62]
hexadecimal-digit: one of
5 The type of an integer constant is the first of the corresponding list in which its value can
be represented.
-
-
-
[page 63]
Octal or Hexadecimal
may be signed or unsigned. If an integer constant cannot be represented by any type in
its list and has no extended integer type, then the integer constant has no type.
-
-
-
[page 64]
6.4.4.2 Floating constants
\ octal-digit octal-digit
\ octal-digit octal-digit octal-digit
-
-
-
[page 67]
hexadecimal-escape-sequence:
consisting of the backslash \ followed by a lowercase letter: \a, \b, \f, \n, \r, \t,
and \v.77)
-
-
[page 68]
Constraints
were in an integer character constant (for a character or UTF-8 string literal) or a wide
character constant (for a wide string literal), except that the single-quote ' is
representable either by itself or by the escape sequence \', but the double-quote " shall
+
[page 70]
be represented by the escape sequence \".
in which case it is known as an operator (other forms of operator also exist in some
contexts). An operand is an entity on which an operator acts.
-
-
-
[page 72]
3 In all aspects of the language, the six tokens79)
assignment-expression
argument-expression-list , assignment-expression
-
-
-
[page 79]
6.5.2.1 Array subscripting
Forward references: address and indirection operators (6.5.3.2), structure and union
specifiers (6.7.2.1).
-
-
-
[page 84]
6.5.2.4 Postfix increment and decrement operators
Forward references: type names (6.7.7), initialization (6.7.9).
-
-
-
[page 87]
6.5.3 Unary operators
the result is set if and only if at least one of the corresponding bits in the converted
operands is set).
-
-
-
[page 98]
6.5.13 Logical AND operator
and second operands. If the first operand compares unequal to 0, the second operand is
not evaluated.
-
-
-
[page 99]
6.5.15 Conditional operator
3 A compound assignment of the form E1 op = E2 is equivalent to the simple assignment
expression E1 = E1 op (E2), except that the lvalue E1 is evaluated only once, and with
respect to an indeterminately-sequenced function call, the operation of a compound
+
[page 103]
assignment is a single evaluation. If E1 has an atomic type, compound assignment is a
3 The type specifier _Complex shall not be used if the implementation does not support
complex types (see 6.10.8.3).
-
-
-
[page 110]
Semantics
2 A struct-declaration that does not declare an anonymous structure or anonymous union
shall contain a struct-declarator-list.
-
[page 111]
3 A structure or union shall not contain a member with incomplete or function type (hence,
Forward references: declarators (6.7.6), tags (6.7.2.3).
-
-
-
[page 115]
6.7.2.2 Enumeration specifiers
lvalues. If the _Atomic keyword is immediately followed by a left parenthesis, it is
interpreted as a type specifier (with a type name), not as a type qualifier.
-
-
-
[page 119]
6.7.3 Type qualifiers
}
}
-
-
-
[page 123]
12 The one exception allows the value of a restricted pointer to be carried out of the block in which it (or, more
scope, storage duration, and type indicated by the declaration specifiers.
3 A full declarator is a declarator that is not part of another declarator. The end of a full
declarator is a sequence point. If, in the nested sequence of declarators in a full
+
[page 127]
declarator, there is a declarator specifying a variable length array type, the type specified
3 EXAMPLE The following pair of declarations demonstrates the difference between a ''variable pointer
to a constant value'' and a ''constant pointer to a variable value''.
-
-
-
[page 128]
const int *ptr_to_constant;
Semantics
5 If, in the declaration ''T D1'', D1 has the form
-
-
-
[page 131]
D( parameter-type-list )
Forward references: function definitions (6.9.1), type names (6.7.7).
-
-
-
[page 134]
6.7.7 Type names
type t1 and the type pointed to by tp1 are compatible. Type t1 is also compatible with type struct
s1, but not compatible with the types struct s2, t2, the type pointed to by tp2, or int.
-
-
-
[page 136]
6 EXAMPLE 3 The following obscure constructions
a[i-1] = b[i];
}
-
-
-
[page 137]
6.7.9 Initialization
. identifier
then the current object (defined below) shall have structure or union type and the
identifier shall be the name of a member of that type.
+
[page 138]
Semantics
16 Otherwise, the initializer for an object that has aggregate or union type shall be a brace-
enclosed list of initializers for the elements or named members.
-
[page 139]
17 Each brace-enclosed initializer list has an associated current object. When no
Forward references: common definitions <stddef.h> (7.19).
-
-
-
[page 143]
6.7.10 Static assertions
character set are not required to appear in the message.
Forward references: diagnostics (7.2).
-
-
-
[page 144]
6.8 Statements and blocks
2 In both forms, the first substatement is executed if the expression compares unequal to 0.
In the else form, the second substatement is executed if the expression compares equal
-
[page 147]
to 0. If the first substatement is reached via a label, the second substatement is not
/* ... */
}
-
-
-
[page 151]
4 EXAMPLE 2 A goto statement is not allowed to jump past any declarations of objects with variably
int (*fp)(void); // fp points to a function that has type F
F *Fp; // Fp points to a function that has type F
-
[page 155]
Semantics
3 If the declaration of an identifier for an object is a tentative definition and has internal
linkage, the declared type shall not be an incomplete type.
-
-
-
[page 157]
4 EXAMPLE 1
the array i still has incomplete type, the implicit initializer causes it to have one element, which is set to
zero on program startup.
-
-
-
[page 158]
6.10 Preprocessing directives
endif-line:
# endif new-line
-
-
-
[page 159]
control-line:
#if 'z' - 'a' == 25
if ('z' - 'a' == 25)
-
[page 162]
5 Preprocessing directives of the forms
string literal corresponding to an empty argument is "". The order of evaluation of # and
## operators is unspecified.
-
-
-
[page 167]
6.10.3.3 The ## operator
#define max(a, b) ((a) > (b) ? (a) : (b))
The parentheses ensure that the arguments and the resulting expression are bound properly.
-
-
-
[page 169]
5 EXAMPLE 3 To illustrate the rules for redefinition and reexamination, the sequence
xglue(HIGH, LOW)
results in
-
-
-
[page 170]
printf("x" "1" "= %d, x" "2" "= %s", x1, x2);
showlist(The first, second, and third items.);
report(x>y, "x is %d but y is %d", x, y);
-
[page 171]
results in
tokens). The directive resulting after all replacements shall match one of the two
previous forms and is then processed as appropriate.
-
-
-
[page 172]
6.10.5 Error directive
#define PRAGMA(x) _Pragma(#x)
LISTING ( ..\listing.dir )
-
-
-
[page 177]
6.11 Future language directions
6.11.9 Predefined macro names
1 Macro names beginning with __STDC_ are reserved for future standardization.
-
-
-
[page 178]
/* ... */
i = atoi(str);
-
-
-
[page 184]
7.2 Diagnostics <assert.h>
191) The message written might be of the form:
Assertion failed: expression, function abc, file xyz, line nnn.
-
[page 185]
Returns
3 The assert macro returns no value.
Forward references: the abort function (7.22.4.1).
-
-
-
[page 186]
7.3 Complex arithmetic <complex.h>
195) The purpose of the pragma is to allow the implementation to use the formulas:
(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 | = (sqrt) x 2 + y 2
-----
where the programmer can determine they are safe.
Description
2 The csin functions compute the complex sine of z.
-
-
[page 190]
Returns
float complex casinhf(float complex z);
long double complex casinhl(long double complex z);
-
-
[page 191]
Description
Returns
3 The ccosh functions return the complex hyperbolic cosine value.
-
-
-
[page 192]
7.3.6.5 The csinh functions
Returns
3 The cexp functions return the complex base-e exponential value.
-
-
[page 193]
7.3.7.2 The clog functions
long double complex cpowl(long double complex x,
long double complex y);
-
-
-
[page 194]
Description
Returns
3 The carg functions return the value of the argument in the interval [-pi , +pi ].
-
-
-
[page 195]
7.3.9.2 The cimag functions
Description
2 The creal functions compute the real part of z.197)
-
[page 197]
Returns
the tolower function returns one of the corresponding characters (always the same one
for any given locale); otherwise, the argument is returned unchanged.
-
-
-
[page 202]
7.4.2.2 The toupper function
the toupper function returns one of the corresponding characters (always the same one
for any given locale); otherwise, the argument is returned unchanged.
-
-
-
[page 203]
7.5 Errors <errno.h>
3 The fesetround function returns zero if and only if the requested rounding direction
was established.
-
[page 211]
4 EXAMPLE Save, set, and restore the rounding direction. Report an error and abort if setting the
return result;
}
-
-
-
[page 214]
7.7 Characteristics of floating types <float.h>
2 The macros, their meanings, and the constraints (or restrictions) on their values are listed
in 5.2.4.2.2.
-
-
-
[page 215]
7.8 Format conversion of integer types <inttypes.h>
Forward references: the strtol, strtoll, strtoul, and strtoull functions
(7.22.1.4).
-
-
-
[page 218]
7.8.2.4 The wcstoimax and wcstoumax functions
Forward references: the wcstol, wcstoll, wcstoul, and wcstoull functions
(7.28.4.1.2).
-
-
-
[page 219]
7.9 Alternative spellings <iso646.h>
xor ^
xor_eq ^=
-
-
-
[page 220]
7.10 Sizes of integer types <limits.h>
2 The macros, their meanings, and the constraints (or restrictions) on their values are listed
in 5.2.4.2.1.
-
-
-
[page 221]
7.11 Localization <locale.h>
char int_p_sign_posn; // CHAR_MAX
char int_n_sign_posn; // CHAR_MAX
-
-
-
[page 222]
3 The macros defined are NULL (described in 7.19); and
Set to 1 or 0 if the currency_symbol respectively precedes or
succeeds the value for a nonnegative locally formatted monetary quantity.
-
-
[page 225]
char n_cs_precedes
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.
+
[page 226]
char int_n_sep_by_space
3 The sign string immediately precedes the currency symbol.
4 The sign string immediately succeeds the currency symbol.
-
[page 227]
7 The implementation shall behave as if no library function calls the localeconv
int_p_sign_posn 1 1 1 1
int_n_sign_posn 4 1 4 2
-
-
-
[page 228]
11 EXAMPLE 2 The following table illustrates how the cs_precedes, sep_by_space, and sign_posn members
3 +$1.25 +$ 1.25 + $1.25
4 $+1.25 $+ 1.25 $ +1.25
-
-
-
[page 229]
7.12 Mathematics <math.h>
Description
2 The atan functions compute the principal value of the arc tangent of x.
-
-
-
[page 237]
Returns
Description
2 The sin functions compute the sine of x (measured in radians).
-
-
[page 238]
Returns
Description
2 The asinh functions compute the arc hyperbolic sine of x.
-
[page 239]
Returns
Description
2 The sinh functions compute the hyperbolic sine of x. A range error occurs if the
magnitude of x is too large.
+
[page 240]
Returns
float logf(float x);
long double logl(long double x);
-
-
[page 243]
Description
Description
2 The modf functions break the argument value into integral and fractional parts, each of
which has the same type and sign as the argument. They store the integral part (in
+
[page 245]
floating-point format) in the object pointed to by iptr.
Returns
3 The cbrt functions return x1/3 .
-
-
-
[page 246]
7.12.7.2 The fabs functions
2 The hypot functions compute the square root of the sum of the squares of x and y,
without undue overflow or underflow. A range error may occur.
3 Returns
-4 The hypot functions return sqrt:x2 + y2 .
+4 The hypot functions return (sqrt)x2 + y2 .
-
-----
7.12.7.4 The pow functions
error may occur if x is zero and y is zero. A domain error or pole error may occur if x is
zero and y is less than zero.
-
-
-
[page 247]
Returns
2 The sqrt functions compute the nonnegative square root of x. A domain error occurs if
the argument is less than zero.
Returns
-3 The sqrt functions return sqrt:x.
+3 The sqrt functions return (sqrt)x.
-
-
7.12.8 Error and gamma functions
(integral) e-t dt.
2
The erf functions return erf x =
- sqrt:pi
+ (sqrt)pi
-
- 0
Description
2 The erfc functions compute the complementary error function of x. A range error
occurs if x is too large.
+
[page 248]
Returns
(integral) e-t dt.
2
The erfc functions return erfc x = 1 - erf x =
- sqrt:pi
+ (sqrt)pi
-
- x
Returns
3 The tgamma functions return (Gamma)(x).
-
-
-
[page 249]
7.12.9 Nearest integer functions
format, using the current rounding direction and without raising the ''inexact'' floating-
point exception.
-
-
-
[page 250]
Returns
Returns
3 The lrint and llrint functions return the rounded integer value.
-
-
-
[page 251]
7.12.9.6 The round functions
float truncf(float x);
long double truncl(long double x);
-
[page 252]
Description
Returns
3 The copysign functions return a value with the magnitude of x and the sign of y.
-
-
[page 254]
7.12.11.2 The nan functions
Returns
3 The islessequal macro returns the value of (x) <= (y).
-
-
-
[page 259]
7.12.14.5 The islessgreater macro
Returns
3 The isunordered macro returns 1 if its arguments are unordered and 0 otherwise.
-
-
-
[page 260]
7.13 Nonlocal jumps <setjmp.h>
longjmp(buf, 2); // might cause memory loss
}
-
-
-
[page 263]
7.14 Signal handling <signal.h>
Returns
3 The raise function returns zero if successful, nonzero if unsuccessful.
-
-
-
-[page 266]
+[page 266]
7.15 Alignment <stdalign.h>
1 The header <stdalign.h> defines two macros.
__alignas_is_defined
which expands to the integer constant 1.
-
-
-
[page 267]
7.16 Variable arguments <stdarg.h>
char *array[MAXARGS];
int ptr_no = 0;
-
-
-
[page 270]
if (n_ptrs > MAXARGS)
f4(n_ptrs, array);
}
-
-
-
[page 271]
7.17 Atomics <stdatomic.h>
5 In the following operation definitions:
-- An A refers to one of the atomic types.
-
[page 272]
-- A C refers to its corresponding non-atomic type. The atomic_address atomic
the value value, while also initializing any additional state that the implementation
might need to carry for the atomic object.
-
-
[page 273]
3 Although this function initializes an atomic object, it does not avoid data races;
2 The kill_dependency macro terminates a dependency chain; the argument does not
carry a dependency to the return value.
-
-
[page 276]
Returns
-- is a sequentially consistent acquire and release fence, if order ==
memory_order_seq_cst.
-
[page 277]
Returns
1 For each line in the following table, the atomic type name is declared as the
corresponding direct type.
-
-
-
[page 279]
Atomic type name Direct type
2 The semantics of the operations on these types are defined in 7.17.7.
3 The atomic_bool type provides an atomic boolean.
-
[page 280]
4 The atomic_address type provides atomic void * operations. The unit of
Returns
Atomically returns the value pointed to by object.
-
-
-
[page 281]
7.17.7.3 The atomic_exchange generic functions
failure. These operations are atomic read-modify-write operations (5.1.2.4).
3 NOTE 1 The effect of the compare-and-exchange operations is
-
-
-
[page 282]
if (*object == *expected)
3 Atomically replaces the value pointed to by object with the result of the computation
applied to the value pointed to by object and the given operand. Memory is affected
according to the value of order. These operations are atomic read-modify-write
+
[page 283]
operations (5.1.2.4). For signed integer types, arithmetic is defined to use two's
to the value of order. These operations are atomic read-modify-write operations
(5.1.2.4).
-
-
-
[page 284]
Returns
Returns
3 The atomic_flag_clear functions return no value.
-
-
-
[page 285]
7.18 Boolean type and values <stdbool.h>
Forward references: localization (7.11).
-
-
-
[page 288]
7.20 Integer types <stdint.h>
-- maximum value of pointer-holding unsigned integer type
UINTPTR_MAX 216 - 1
-
-
[page 292]
7.20.2.5 Limits of greatest-width integer types
by its argument and the type uintmax_t:
UINTMAX_C(value)
-
-
-
[page 295]
7.21 Input/output <stdio.h>
which expands to an integer constant expression that is the size needed for an array of
char large enough to hold the longest file name string that the implementation
-
-
[page 296]
guarantees can be opened;258)
old is no longer accessible by that name. If a file named by the string pointed to by new
exists prior to the call to the rename function, the behavior is implementation-defined.
-
-
-
[page 302]
Returns
3 The fclose function returns zero if the stream was successfully closed, or EOF if any
errors were detected.
-
-
-
[page 304]
7.21.5.2 The fflush function
operation fails, fopen returns a null pointer.
Forward references: file positioning functions (7.21.9).
-
-
[page 306]
7.21.5.4 The freopen function
following n conversion specifier applies to a pointer to a ptrdiff_t
argument.
-
[page 311]
L Specifies that a following a, A, e, E, f, F, g, or G conversion specifier
Forward references: conversion state (7.28.6), the wcrtomb function (7.28.6.3.3).
-
-
[page 316]
7.21.6.2 The fscanf function
format is the same as expected for the subject sequence of the strtod
function. The corresponding argument shall be a pointer to floating.
-
[page 319]
c Matches a sequence of characters of exactly the number specified by the field
terminating null wide character.
25 However, the call:
-
-
-
[page 323]
#include <stdio.h>
2 The scanf function is equivalent to fscanf with the argument stdin interposed
before the arguments to scanf.
-
-
[page 324]
Returns
va_end macro.281) If copying takes place between objects that overlap, the behavior is
undefined.
-
-
[page 328]
Returns
Returns
3 The vsscanf function returns the value of the macro EOF if an input failure occurs
before the first conversion (if any) has completed. Otherwise, the vsscanf function
+
[page 329]
returns the number of input items assigned, which can be fewer than provided for, or even
may evaluate stream more than once, so the argument should never be an expression
with side effects.
-
-
-
[page 331]
Returns
Description
2 The putchar function is equivalent to putc with the second argument stdout.
-
[page 332]
Returns
returns nonzero and stores an implementation-defined positive value in errno.
Forward references: the fsetpos function (7.21.9.3).
-
-
-
[page 335]
7.21.9.2 The fseek function
Returns
3 The rewind function returns no value.
-
-
-
[page 337]
7.21.10 Error-handling functions
3 The ferror function returns nonzero if and only if the error indicator is set for
stream.
-
-
-
[page 338]
7.21.10.4 The perror function
3 The perror function returns no value.
Forward references: the strerror function (7.23.6.2).
-
-
-
[page 339]
7.22 General utilities <stdlib.h>
Forward references: the strtol, strtoll, strtoul, and strtoull functions
(7.22.1.4).
-
-
[page 341]
7.22.1.3 The strtod, strtof, and strtold functions
4 If the subject sequence has the expected form for a floating-point number, the sequence of
characters starting with the first digit or the decimal-point character (whichever occurs
first) is interpreted as a floating constant according to the rules of 6.4.4.2, except that the
+
[page 342]
decimal-point character is used in place of a period, and that if neither an exponent part
LLONG_MAX, ULONG_MAX, or ULLONG_MAX is returned (according to the return type
and sign of the value, if any), and the value of the macro ERANGE is stored in errno.
-
-
-
[page 345]
7.22.2 Pseudo-random sequence generation functions
3 The aligned_alloc function returns either a null pointer or a pointer to the allocated
space.
-
-
-
[page 347]
7.22.3.2 The calloc function
unsuccessful termination is returned to the host environment by means of the function
call raise(SIGABRT).
-
-
-
[page 349]
Returns
5 In no case will the value returned be greater than n or the value of the MB_CUR_MAX
macro.
-
[page 357]
7.22.7.3 The wctomb function
No multibyte characters that follow a null character (which is converted into a null wide
character) will be examined or converted. Each multibyte character is converted as if by
a call to the mbtowc function, except that the conversion state of the mbtowc function is
+
[page 358]
not affected.
2 The strncpy function copies not more than n characters (characters that follow a null
character are not copied) from the array pointed to by s2 to the array pointed to by
-
-
-
[page 361]
s1.301) If copying takes place between objects that overlap, the behavior is undefined.
string pointed to by s. The terminating null character is considered to be part of the
string.
-
-
[page 365]
Returns
string pointed to by s. The terminating null character is considered to be part of the
string.
-
-
-
[page 366]
Returns
by s2. The first call in the sequence has a non-null first argument; subsequent calls in the
sequence have a null first argument. The separator string pointed to by s2 may be
different from call to call.
+
[page 367]
3 The first call in the sequence searches the string pointed to by s1 for the first character
Returns
3 The memset function returns the value of s.
-
-
[page 368]
7.23.6.2 The strerror function
3 The strlen function returns the number of characters that precede the terminating null
character.
-
-
-
[page 369]
7.24 Type-generic math <tgmath.h>
If all arguments for generic parameters are real, then use of the macro invokes a real
function; otherwise, use of the macro results in undefined behavior.
-
-
-
[page 371]
6 For each unsuffixed function in <complex.h> that is not a c-prefixed counterpart to a
carg(dc) carg(dc), the function
cproj(ldc) cprojl(ldc)
-
-
-
[page 372]
7.25 Threads <threads.h>
once_flag
which is a complete object type that holds a flag for use by call_once; and
-
[page 373]
xtime
which is returned by a function to indicate that the requested operation failed because it
was unable to allocate memory.
-
-
-
[page 374]
7.25.2 Initialization functions
int cnd_timedwait(cnd_t *cond, mtx_t *mtx,
const xtime *xt);
-
-
-
[page 376]
Description
2 The mtx_destroy function releases any resources used by the mutex pointed to by
mtx. No threads can be blocked waiting for the mutex pointed to by mtx.
-
-
[page 377]
Returns
resource requested is already in use, or thrd_error if the request could not be
honored.
-
-
-
[page 378]
7.25.4.4 The mtx_timedlock function
1 #include <threads.h>
int thrd_detach(thrd_t thr);
-
-
[page 380]
Description
2 The tss_create function creates a thread-specific storage pointer with destructor
dtor, which may be null.
-
[page 382]
Returns
2 The tss_set function sets the value for the current thread held in the thread-specific
storage identified by key to val.
-
-
-
[page 383]
Returns
const char * restrict format,
const struct tm * restrict timeptr);
-
-
-
[page 390]
Description
%b the first three characters of %B.
%B one of ''January'', ''February'', ... , ''December''.
%c equivalent to ''%a %b %e %T %Y''.
+
[page 393]
%p one of ''AM'' or ''PM''.
into the array pointed to by s not including the terminating null character. Otherwise,
zero is returned and the contents of the array are indeterminate.
-
-
-
[page 394]
7.27 Unicode utilities <uchar.h>
next multibyte character is complete and valid, it determines the values of the
corresponding wide characters and then, if pc16 is not a null pointer, stores the value of
the first (or only) such character in the object pointed to by pc16. Subsequent calls will
+
[page 395]
store successive wide characters without consuming any additional input until all the
character (which is the value stored); the value returned is the number
of bytes that complete the multibyte character.
-
[page 397]
(size_t)(-3) if the next character resulting from a previous call has been stored (no
-- An optional decimal integer greater than zero that specifies the maximum field width
(in wide characters).
-
-
[page 407]
-- An optional length modifier that specifies the size of the receiving object.
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
+
[page 411]
converted, but one is consumed. If the conversion specification includes an
returns the number of input items assigned, which can be fewer than provided for, or even
zero, in the event of an early matching failure.
-
-
-
[page 413]
7.28.2.5 The vfwprintf function
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 generated.
-
[page 415]
7.28.2.8 The vswscanf function
3 The vwprintf function returns the number of wide characters transmitted, or a negative
value if an output or encoding error occurred.
-
-
-
[page 416]
7.28.2.10 The vwscanf function
2 The wscanf function is equivalent to fwscanf with the argument stdin interposed
before the arguments to wscanf.
-
[page 417]
Returns
wide character sequences returns zero, and a function that copies wide characters copies
zero wide characters.
-
-
-
[page 422]
7.28.4.1 Wide string numeric conversion functions
n-wchar-sequence nondigit
The subject sequence is defined as the longest initial subsequence of the input wide
string, starting with the first non-white-space wide character, that is of the expected form.
+
[page 423]
The subject sequence contains no wide characters if the input wide string is not of the
Returns
3 The wcscpy function returns the value of s1.
-
[page 427]
7.28.4.2.2 The wcsncpy function
4 EXAMPLE The value of the following expression is the length of the array needed to hold the
transformation of the wide string pointed to by s:
-
[page 431]
1 + wcsxfrm(NULL, s, 0)
string pointed to by s1 which consists entirely of wide characters not from the wide
string pointed to by s2.
-
-
[page 432]
Returns
Returns
3 The wcsspn function returns the length of the segment.
-
[page 433]
7.28.4.5.6 The wcsstr function
the start of the first token.
5 The wcstok function then searches from there for a wide character that is contained in
the current separator wide string. If no such wide character is found, the current token
+
[page 434]
extends to the end of the wide string pointed to by s1, and subsequent searches in the
3 The wmemchr function returns a pointer to the located wide character, or a null pointer if
the wide character does not occur in the object.
-
-
-
[page 435]
7.28.4.6 Miscellaneous functions
-- The argument s points to the initial element of an array of wide characters into which
the generated output is to be placed.
-
[page 436]
-- The argument maxsize indicates the limiting number of wide characters.
2 If ps is not a null pointer, the mbsinit function determines whether the referenced
mbstate_t object describes an initial conversion state.
-
-
[page 438]
Returns
or (size_t)(-1).
Forward references: the mbrtowc function (7.28.6.3.2).
-
-
-
[page 439]
7.28.6.3.2 The mbrtowc function
when dst is not a null pointer), the pointer object pointed to by this parameter is updated
to reflect the amount of the source processed by that invocation.
-
-
-
[page 441]
7.28.6.4.1 The mbsrtowcs function
3 Each of the following expressions has a truth-value equivalent to the call to the wide
character classification function (7.29.2.1) in the comment that follows the expression:
-
[page 448]
iswctype(wc, wctype("alnum")) // iswalnum(wc)
category of the current locale, the wctype function returns a nonzero value that is valid
as the second argument to the iswctype function; otherwise, it returns zero.
-
-
-
[page 449]
7.29.3 Wide character case mapping utilities
well as case mapping equivalent to that performed by the functions described in the
previous subclause (7.29.3.1).
-
-
-
[page 450]
7.29.3.2.1 The towctrans function
category of the current locale, the wctrans function returns a nonzero value that is valid
as the second argument to the towctrans function; otherwise, it returns zero.
-
-
-
[page 451]
7.30 Future library directions
1 Function names that begin with is or to and a lowercase letter may be added to the
declarations in the <wctype.h> header.
-
-
-
[page 453]
Annex A
punctuator
each non-white-space character that cannot be one of the above
-
-
-
[page 454]
A.1.2 Keywords
(6.4.2.1) digit: one of
0 1 2 3 4 5 6 7 8 9
-
-
-
[page 455]
A.1.4 Universal character names
(6.4.4.1) octal-digit: one of
0 1 2 3 4 5 6 7
-
-
-
[page 456]
(6.4.4.1) hexadecimal-digit: one of
(6.4.4.2) sign: one of
+ -
-
-
[page 457]
(6.4.4.2) digit-sequence:
hexadecimal-escape-sequence
universal-character-name
-
-
-
[page 458]
(6.4.4.4) simple-escape-sequence: one of
, # ##
<: :> <% %> %: %:%:
-
-
-
[page 459]
A.1.8 Header names
pp-number P sign
pp-number .
-
-
-
[page 460]
A.2 Phrase structure grammar
AND-expression
exclusive-OR-expression ^ AND-expression
-
-
-
[page 462]
(6.5.12) inclusive-OR-expression:
init-declarator
init-declarator-list , init-declarator
-
[page 463]
(6.7) init-declarator:
(6.7.6) declarator:
pointeropt direct-declarator
-
-
[page 465]
(6.7.6) direct-declarator:
pointer
pointeropt direct-abstract-declarator
-
-
-
[page 466]
(6.7.7) direct-abstract-declarator:
(6.7.10) static_assert-declaration:
_Static_assert ( constant-expression , string-literal ) ;
-
-
-
[page 467]
A.2.3 Statements
(6.10) elif-group:
# elif constant-expression new-line groupopt
-
[page 469]
(6.10) else-group:
(6.10) new-line:
the new-line character
-
-
-
[page 470]
Annex B
int isnan(real-floating x);
int isnormal(real-floating x);
int signbit(real-floating x);
+
[page 475]
double acos(double x);
void (*signal(int sig, void (*func)(int)))(int);
int raise(int sig);
-
-
-
[page 480]
B.14 Alignment <stdalign.h>
atomic_ushort atomic_intptr_t
atomic_int atomic_uintptr_t
-
-
[page 481]
atomic_size_t atomic_intmax_t
void atomic_flag_clear_explicit(
volatile atomic_flag *object, memory_order order);
-
-
-
[page 482]
B.17 Boolean type and values <stdbool.h>
__STDC_WANT_LIB_EXT1__
RSIZE_MAX
-
-
-
[page 483]
B.20 Input/output <stdio.h>
errno_t tmpfile_s(FILE * restrict * restrict streamptr);
errno_t tmpnam_s(char *s, rsize_t maxsize);
-
-
[page 485]
errno_t fopen_s(FILE * restrict * restrict streamptr,
va_list arg);
char *gets_s(char *s, rsize_t n);
-
-
[page 486]
B.21 General utilities <stdlib.h>
_Noreturn void quick_exit(int status);
int system(const char *string);
-
[page 487]
void *bsearch(const void *key, const void *base,
char * restrict value, rsize_t maxsize,
const char * restrict name);
-
-
-
[page 488]
void *bsearch_s(const void *key, const void *base,
size_t strxfrm(char * restrict s1,
const char * restrict s2, size_t n);
void *memchr(const void *s, int c, size_t n);
+
[page 489]
char *strchr(const char *s, int c);
void mtx_destroy(mtx_t *mtx);
int mtx_init(mtx_t *mtx, int type);
int mtx_lock(mtx_t *mtx);
+
[page 491]
int mtx_timedlock(mtx_t *mtx, const xtime *xt);
errno_t asctime_s(char *s, rsize_t maxsize,
const struct tm *timeptr);
-
-
[page 492]
errno_t ctime_s(char *s, rsize_t maxsize,
int vswprintf(wchar_t * restrict s, size_t n,
const wchar_t * restrict format, va_list arg);
-
-
[page 493]
int vswscanf(const wchar_t * restrict s,
wchar_t *wcsncpy(wchar_t * restrict s1,
const wchar_t * restrict s2, size_t n);
-
-
[page 494]
wchar_t *wmemcpy(wchar_t * restrict s1,
const char * restrict s, size_t n,
mbstate_t * restrict ps);
-
-
[page 495]
size_t wcrtomb(char * restrict s, wchar_t wc,
const wchar_t * restrict format,
va_list arg);
-
-
[page 496]
int vwprintf_s(const wchar_t * restrict format,
const char ** restrict src, rsize_t len,
mbstate_t * restrict ps);
-
-
-
[page 497]
errno_t wcsrtombs_s(size_t * restrict retval,
wint_t towctrans(wint_t wc, wctrans_t desc);
wctrans_t wctrans(const char *property);
-
-
-
[page 498]
Annex C
also between any call to a comparison function and any movement of the objects
passed as arguments to that call (7.22.5).
-
-
-
[page 499]
Annex D
D.2 Ranges of characters disallowed initially
1 0300-036F, 1DC0-1DFF, 20D0-20FF, FE20-FE2F
-
-
-
[page 500]
Annex E
4 The values given in the following list shall be replaced by implementation-defined
constant expressions that are greater or equal in magnitude (absolute value) to those
shown, with the same sign:
+
[page 501]
#define DLB_DECIMAL_DIG 10
#define LDBL_EPSILON 1E-9
#define LDBL_MIN 1E-37
-
-
-
[page 502]
Annex F
efficiency of translation-time evaluation through static initialization, such as
const static double one_third = 1.0/3.0;
-
[page 508]
#include <fenv.h>
about the order or count of floating-point exceptions. Therefore, between function calls,
floating-point exceptions need not be precise: the actual order and number of occurrences
of floating-point exceptions (> 1) may vary from what the source code expresses. Thus,
+
[page 510]
the preceding loop could be treated as
if (0 < n) x + 1;
F.9.2 Expression transformations
-1 x/2 (<->) x x 0.5 Although similar transformations involving inexact constants
+1 x/2 <-> x x 0.5 Although similar transformations involving inexact constants
generally do not yield numerically equivalent expressions, if the
constants are exact then such transformations can be made on
IEC 60559 machines and others that round perfectly.
- 1 x x and x/1 (->) x The expressions 1 x x, x/1, and x are equivalent (on IEC 60559
+ 1 x x and x/1 -> x The expressions 1 x x, x/1, and x are equivalent (on IEC 60559
machines, among others).355)
- x/x (->) 1.0 The expressions x/x and 1.0 are not equivalent if x can be zero,
+ x/x -> 1.0 The expressions x/x and 1.0 are not equivalent if x can be zero,
infinite, or NaN.
- x - y (<->) x + (-y) The expressions x - y, x + (-y), and (-y) + x are equivalent (on
+ x - y <-> x + (-y) The expressions x - y, x + (-y), and (-y) + x are equivalent (on
IEC 60559 machines, among others).
- x - y (<->) -(y - x) The expressions x - y and -(y - x) are not equivalent because 1 - 1
+ x - y <-> -(y - x) The expressions x - y and -(y - x) are not equivalent because 1 - 1
is +0 but -(1 - 1) is -0 (in the default rounding direction).356)
- x - x (->) 0.0 The expressions x - x and 0.0 are not equivalent if x is a NaN or
+ x - x -> 0.0 The expressions x - x and 0.0 are not equivalent if x is a NaN or
infinite.
- 0 x x (->) 0.0 The expressions 0 x x and 0.0 are not equivalent if x is a NaN,
+ 0 x x -> 0.0 The expressions 0 x x and 0.0 are not equivalent if x is a NaN,
infinite, or -0.
- x+0(->) x The expressions x + 0 and x are not equivalent if x is -0, because
+ x+0-> x The expressions x + 0 and x are not equivalent if x is -0, because
(-0) + (+0) yields +0 (in the default rounding direction), not -0.
- x-0(->) x (+0) - (+0) yields -0 when rounding is downward (toward -(inf)), but
+ x-0-> x (+0) - (+0) yields -0 when rounding is downward (toward -(inf)), but
+0 otherwise, and (-0) - (+0) always yields -0; so, if the state of the
FENV_ACCESS pragma is ''off'', promising default rounding, then
the implementation can replace x - 0 by x, even if x might be zero.
- -x (<->) 0 - x The expressions -x and 0 - x are not equivalent if x is +0, because
+ -x <-> 0 - x The expressions -x and 0 - x are not equivalent if x is +0, because
-(+0) yields -0, but 0 - (+0) yields +0 (unless rounding is
downward).
[page 511]
F.9.3 Relational operators
-1 x != x (->) false The expression x != x is true if x is a NaN.
- x = x (->) true The expression x = x is false if x is a NaN.
- x < y (->) isless(x,y) (and similarly for <=, >, >=) Though numerically equal, these
+1 x != x -> false The expression x != x is true if x is a NaN.
+ x = x -> true The expression x = x is false if x is a NaN.
+ x < y -> isless(x,y) (and similarly for <=, >, >=) Though numerically equal, these
expressions are not equivalent because of side effects when x or y is a
NaN and the state of the FENV_ACCESS pragma is ''on''. This
transformation, which would be desirable if extra code were required
g();
but is equivalent to
-
-
-
[page 512]
if (!(a < b))
-- exp(-(inf)) returns +0.
-- exp(+(inf)) returns +(inf).
-
-
-
[page 516]
F.10.3.2 The exp2 functions
2 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.
-
-
-
[page 517]
F.10.3.6 The ldexp functions
-- logb((+-)(inf)) returns +(inf).
2 The returned value is exact and is independent of the current rounding direction mode.
-
-
-
[page 518]
F.10.3.12 The modf functions
2 If the calculation does not overflow or underflow, the returned value is exact and
independent of the current rounding direction mode.
-
-
-
[page 519]
F.10.4 Power and absolute value functions
-- pow(x, +(inf)) returns +0 for | x | < 1.
-- pow(x, +(inf)) returns +(inf) for | x | > 1.
-
[page 520]
-- pow(-(inf), y) returns -0 for y an odd integer < 0.
-- tgamma(-(inf)) returns a NaN and raises the ''invalid'' floating-point exception.
-- tgamma(+(inf)) returns +(inf).
-
-
[page 521]
F.10.6 Nearest integer functions
-- nearbyint((+-)0) returns (+-)0 (for all rounding directions).
-- nearbyint((+-)(inf)) returns (+-)(inf) (for all rounding directions).
-
-
[page 522]
F.10.6.4 The rint functions
The round functions may, but are not required to, raise the ''inexact'' floating-point
exception for finite non-integer numeric arguments, as this implementation does.
-
-
-
[page 523]
F.10.6.7 The lround and llround functions
return copysign(result, x);
}
-
-
-
[page 524]
F.10.7.2 The remainder functions
2 Even though underflow or overflow can occur, the returned value is independent of the
current rounding direction mode.
-
-
-
[page 525]
F.10.9 Maximum, minimum, and positive difference functions
characterized by FLT_EVAL_METHOD equal to 1 or 2 (5.2.4.2.2), do not convert
operands of relational operators to their semantic types.
-
-
-
[page 527]
Annex G
shown. Unless otherwise specified, where the symbol ''(+-)'' occurs in both an argument
and the result, the result has the same sign as the argument.
3 The functions are continuous onto both sides of their branch cuts, taking into account the
- sign of zero. For example, csqrt(-2 (+-) i0) = (+-)isqrt:2. -
+ sign of zero. For example, csqrt(-2 (+-) i0) = (+-)i(sqrt)2. -
4 Since complex and imaginary values are composed of real values, each function may be
regarded as computing real values from real values. Except as noted, the functions treat
real infinities, NaNs, signed zeros, subnormals, and the floating-point exception flags in a
-- cacosh(+(inf) + i (inf)) returns +(inf) + ipi /4.
-- cacosh((+-)(inf) + iNaN) returns +(inf) + iNaN.
-
[page 535]
-- cacosh(NaN + iy) returns NaN + iNaN and optionally raises the ''invalid''
unspecified) and raises the ''invalid'' floating-point exception.
-- csinh(+0 + iNaN) returns (+-)0 + iNaN (where the sign of the real part of the result is
unspecified).
+
[page 537]
-- csinh(x + i (inf)) returns NaN + iNaN and raises the ''invalid'' floating-point
point exception, for all nonzero numbers y.
-- ctanh(NaN + iNaN) returns NaN + iNaN.
-
-
-
[page 538]
G.6.3 Exponential and logarithmic functions
asinh(iy) = i asin(y)
atanh(iy) = i atan(y)
-
-
-
[page 541]
Annex H
3 The parameter ''bounded'' is always true, and is not provided. The parameter ''minint''
is always 0 for the unsigned types, and is not provided for those types.
-
-
-
[page 542]
H.2.2.1 Integer operations
emin FLT_MIN_EXP, DBL_MIN_EXP, LDBL_MIN_EXP
2 The derived constants for the floating point types are accessed by the following:
-
[page 543]
fmax FLT_MAX, DBL_MAX, LDBL_MAX
2 The FLT_ROUNDS parameter can be used to indicate the LIA-1 rounding styles:
truncate FLT_ROUNDS == 0
-
[page 544]
nearest FLT_ROUNDS == 1
in all relevant LIA-1 operations, not just addition as in C.
H.2.4 Type conversions
1 The LIA-1 type conversions are the following type casts:
- cvtI' (->) I (int)i, (long int)i, (long long int)i,
+ cvtI' -> I (int)i, (long int)i, (long long int)i,
(unsigned int)i, (unsigned long int)i,
(unsigned long long int)i
- cvtF (->) I (int)x, (long int)x, (long long int)x,
+ cvtF -> I (int)x, (long int)x, (long long int)x,
(unsigned int)x, (unsigned long int)x,
(unsigned long long int)x
- cvtI (->) F (float)i, (double)i, (long double)i
- cvtF' (->) F (float)x, (double)x, (long double)x
+ cvtI -> F (float)i, (double)i, (long double)i
+ cvtF' -> F (float)x, (double)x, (long double)x
2 In the above conversions from floating to integer, the use of (cast)x can be replaced with
(cast)round(x), (cast)rint(x), (cast)nearbyint(x), (cast)trunc(x),
(cast)ceil(x), or (cast)floor(x). In addition, C's floating-point to integer
5 C's conversions (casts) from integer to floating-point can meet LIA-1 requirements if an
implementation uses round-to-nearest.
-
-
-
[page 545]
H.3 Notification
where i is an expression of type int representing a subset of the LIA-1 indicators.
4 C allows an implementation to provide the following LIA-1 required behavior: at
program termination if any indicator is set the implementation shall send an unambiguous
+
[page 546]
and ''hard to ignore'' message (see LIA-1 subclause 6.1.2)
allows trap-and-terminate (either default implementation behavior or user replacement for
it) or trap-and-resume, at the programmer's option.
-
-
-
[page 547]
Annex I
-- A statement with no apparent effect is encountered (6.8).
-- A constant expression is used as the controlling expression of a selection statement
(6.8.4).
+
[page 548]
-- An incorrectly formed preprocessing group is encountered while skipping a
preprocessing group (6.10.1).
-- An unrecognized #pragma directive is encountered (6.10.6).
-
-
-
[page 549]
Annex J
-- Whether two string literals result in distinct arrays (6.4.5).
-- The order in which subexpressions are evaluated and the order in which side effects
take place, except as specified for the function-call (), &&, ||, ? :, and comma
+
[page 550]
operators (6.5).
range of the return type (7.12.6.5, F.10.3.5).
-- The result of rounding when the value is out of range (7.12.9.5, 7.12.9.7, F.10.6.5).
-
[page 551]
-- The value stored by the remquo functions in the object pointed to by quo when y is
-- The resulting value when the ''invalid'' floating-point exception is raised during
IEC 60559 floating to integer conversion (F.4).
-
-
[page 552]
-- Whether conversion of non-integer IEC 60559 floating values to integer raises the
(6.2.2).
-- An object is referred to outside of its lifetime (6.2.4).
-
-
[page 553]
-- The value of a pointer to an object whose lifetime has ended is used (6.2.4).
-- A pointer is used to call a function whose type is not compatible with the referenced
type (6.3.2.3).
-
-
[page 554]
-- An unmatched ' or " character is encountered on a logical source line during
-- A member of an atomic structure or union is accessed (6.5.2.3).
-- The operand of the unary * operator has an invalid value (6.5.3.2).
-
[page 555]
-- A pointer is converted to other than an integer or pointer type (6.5.4).
-- The definition of an object has an alignment specifier and another declaration of that
object has a different alignment specifier (6.7.5).
-
[page 557]
-- Declarations of an object in different translation units have different alignment
exactly match one of the specified character sequences (7.21.5.3).
-- An output operation on an update stream is followed by an input operation without an
intervening call to the fflush function or a file positioning function, or an input
+
[page 562]
operation on an update stream is followed by an output operation with an intervening
-- The number of characters transmitted by a formatted output function is greater than
INT_MAX (7.21.6.1, 7.21.6.3, 7.21.6.8, 7.21.6.10).
-
[page 563]
-- The result of a conversion by one of the formatted input functions cannot be
-- The value of a pointer that refers to space deallocated by a call to the free or
realloc function is used (7.22.3).
-
[page 564]
-- The alignment requested of the aligned_alloc function is not valid or not
1 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:
-
-
-
[page 566]
J.3.1 Translation
correspondence to universal character names (6.4.2).
-- The number of significant initial characters in an identifier (5.2.4.1, 6.4.2).
-
-
-
[page 567]
J.3.4 Characters
corresponding standard encoding macro (__STDC_ISO_10646__,
__STDC_UTF_16__, or __STDC_UTF_32__) is not defined (6.10.8.2).
-
-
-
[page 568]
J.3.5 Integers
classifications, and their macro names (7.6, 7.12).
-- The default state for the FP_CONTRACT pragma (7.12.2).
-
[page 569]
J.3.7 Arrays and pointers
-- Whether the value of a single-character character constant in a constant expression
that controls conditional inclusion may have a negative value (6.10.1).
-
[page 570]
-- The places that are searched for an included < > delimited header, and how the places
-- Whether the functions in <math.h> honor the rounding direction mode in an
IEC 60559 conformant implementation, unless explicitly specified otherwise (F.10).
-
-
-
[page 573]
J.3.13 Architecture
7.28.4.1).
-- The collation sequence of the execution character set (7.23.4.3, 7.28.4.4.2).
-
[page 574]
-- The contents of the error message strings set up by the strerror function
1 String literals are modifiable (in which case, identical string literals should denote distinct
objects) (6.4.5).
-
-
-
[page 575]
J.5.6 Other arithmetic types
execution environments, are defined by the implementation before translation begins
(6.10.8).
-
-
-
[page 576]
J.5.13 Floating-point status flags
instead of, or in addition to, setting errno or raising floating-point exceptions (7.3,
7.12).
-
-
-
[page 577]
Annex K
function. Such functions can be troublesome since a previously returned result can
change if the function is called again, perhaps by another thread.
-
-
-
[page 578]
K.2 Scope
with the meaning that mode has in the fopen_s function (including the mode's effect
on exclusive access and file permissions).
-
[page 582]
5 If the file was created successfully, then the pointer to FILE pointed to by streamptr
2 Neither s nor format shall be a null pointer. n shall neither equal zero nor be greater
than RSIZE_MAX. The %n specifier382) (modified or not by flags, field width, or
precision) shall not appear in the string pointed to by format. Any argument to
+
[page 590]
snprintf_s corresponding to a %s specifier shall not be a null pointer. No encoding
return value of the function is passed. Otherwise, a positive value of type
errno_t is passed.
-
-
[page 600]
4 The implementation has a default constraint handler that is used if no calls to the
(char *)p >= (char *)base
(char *)p < (char *)base + nmemb * size
-
[page 603]
5 A sequence point occurs immediately before and immediately after each call to the
wide characters. If dst is not a null pointer, the converted characters are stored into the
array pointed to by dst. Conversion continues up to and including a terminating null
character, which is also stored. Conversion stops earlier in two cases: when a sequence of
+
[page 607]
bytes is encountered that does not form a valid multibyte character, or (if dst is not a
5 The memcpy_s function returns zero if there was no runtime-constraint violation.
Otherwise, a nonzero value is returned.
-
-
-
[page 610]
K.3.7.1.2 The memmove_s function
that is not contained in the current separator string pointed to by s2. If no such character
is found, then there are no tokens in the string pointed to by s1 and the strtok_s
function returns a null pointer. If such a character is found, it is the start of the first token.
+
[page 616]
7 The strtok_s function then searches from there for the first character in s1 that is
greater than RSIZE_MAX, the memset_s function stores the value of c (converted to an
unsigned char) into each of the first smax characters of the object pointed to by s.
-
-
[page 617]
Description
Returns
5 The asctime_s function returns zero if the time was successfully converted and stored
into the array pointed to by s. Otherwise, it returns a nonzero value.
+
[page 621]
K.3.8.2.2 The ctime_s function
Description
4 The gmtime_s function converts the calendar time pointed to by timer into a broken-
down time, expressed as UTC. The broken-down time is stored in the structure pointed
+
[page 622]
to by result.
subclause causes copying to take place between objects that overlap, the objects take on
unspecified values.
-
-
-
[page 623]
K.3.9.1 Formatted wide character input/output functions
before any conversion or if there is a runtime-constraint violation. Otherwise, the
swscanf_s function returns the number of input items assigned, which can be fewer
than provided for, or even zero, in the event of an early matching failure.
+
[page 627]
K.3.9.1.6 The vfwprintf_s function
wscanf_s function returns the number of input items assigned, which can be fewer than
provided for, or even zero, in the event of an early matching failure.
-
-
-
[page 634]
K.3.9.2 General wide string utilities
18 The wmemcpy_s function returns zero if there was no runtime-constraint violation.
Otherwise, a nonzero value is returned.
-
-
-
[page 637]
K.3.9.2.1.4 The wmemmove_s function
and the wcstok_s function returns a null pointer. If such a wide character is found, it is
the start of the first token.
-
[page 641]
7 The wcstok_s function then searches from there for the first wide character in s1 that
continues up to and including a terminating null character, which is also stored.
Conversion stops earlier in two cases: when a sequence of bytes is encountered that does
not form a valid multibyte character, or (if dst is not a null pointer) when len wide
+
[page 644]
characters have been stored into the array pointed to by dst.439) If dst is not a null
-- A string or wide string utility function is instructed to access an array beyond the end
of an object (7.23.1, 7.28.4).
-
-
-
[page 649]
18. ISO/IEC 9899:1999/Cor.2:2004, Technical Corrigendum 2.
19. ISO/IEC 9899:1999/Cor.3:2007, Technical Corrigendum 3.
-
-
[page 650]
20. ISO/IEC 9945-2:1993, Information technology -- Portable Operating System
37. ISO/IEC 10967-1:1994, Information technology -- Language independent
arithmetic -- Part 1: Integer and floating point arithmetic.
-
[page 651]
38. ISO/IEC TR 19769:2004, Information technology -- Programming languages,
their environments and system software interfaces -- Extensions to the C library
-- Part 1: Bounds-checking interfaces.
-
-
-
[page 652]
++ (postfix increment operator), 6.3.2.1, 6.5.2.4 <stdbool.h> header, 4, 7.18, 7.30.7, H
++ (prefix increment operator), 6.3.2.1, 6.5.3.1 <stddef.h> header, 4, 6.3.2.1, 6.3.2.3, 6.4.4.4,
+= (addition assignment operator), 6.5.16.2
+
[page 653]
6.4.5, 6.5.3.4, 6.5.6, 7.19, K.3.3 \x hexadecimal digits (hexadecimal-character
s/≥/>=/g
s/≠/!=/g
s/Σ/(Sum)/g
-s/√/sqrt:/g
+s/√/(sqrt)/g
s/π/pi/g
s/∞/(inf)/g
s/ƒ/fl./g
s/⎯/-/g
s/↑/(uparrow)/g
s/↓/(downarrow)/g
-s/↔/(<->)/g
-s/→/(->)/g
+s/↔/<->/g
+s/→/->/g
s/‘/'\''/g
s/’/'\''/g
# pdftotext layout fixes
last=$0
side=0
}
+/^$/ {
+ nl=nl "\n"
+ next
+}
/^\(newpage\)/ {
n=split(last,a)
if(side)
else
p=a[n]
side=!side
- print "[page " p "]"
+ print "\n[page " p "]"
getline
getline
last=$0
}
{
print last
- last=$0
-}
-'
+ last=nl $0
+ nl=""
+}'