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