exceptions for the function value subnormal or zero and x ≠ y.
F.9.8.4 [The nexttoward functions]
1 No additional requirements beyond those on nextafter.
F.9.9 [Maximum, minimum, and positive difference functions]
F.9.9.1 [The fdim functions]
1 No additional requirements.
F.9.9.2 [The fmax functions]
1 If just one argument is a NaN, the fmax functions return the other argument (if both
arguments are NaNs, the functions return a NaN).
2 The body of the fmax function might be[323]
{ return (isgreaterequal(x, y) ||
isnan(y)) ? x : y; }
Footnote 323) Ideally, fmax would be sensitive to the sign of zero, for example fmax(−0. 0, +0. 0) would
return +0; however, implementation in software might be impractical.
F.9.9.3 [The fmin functions]
1 The fmin functions are analogous to the fmax functions (see F.9.9.2).
F.9.10 [Floating multiply-add]
F.9.10.1 [The fma functions]
1 — fma(x, y, z) computes xy + z, correctly rounded once.
— fma(x, y, z) returns a NaN and optionally raises the ‘‘invalid’’ floating-point
exception if one of x and y is infinite, the other is zero, and z is a NaN.
— fma(x, y, z) returns a NaN and raises the ‘‘invalid’’ floating-point exception if
one of x and y is infinite, the other is zero, and z is not a NaN.
— fma(x, y, z) returns a NaN and raises the ‘‘invalid’’ floating-point exception if x
times y is an exact infinity and z is also an infinity but with the opposite sign.
G. [Annex G (informative) IEC 60559-compatible complex arithmetic]
G.1 [Introduction]
1 This annex supplements annex F to specify complex arithmetic for compatibility with
IEC 60559 real floating-point arithmetic. Although these specifications have been
carefully designed, there is little existing practice to validate the design decisions.
Therefore, these specifications are not normative, but should be viewed more as
recommended practice. An implementation that defines
_ _STDC_IEC_559_COMPLEX_ _ should conform to the specifications in this annex.
G.2 [Types]
1 There is a new keyword _Imaginary, which is used to specify imaginary types. It is
used as a type specifier within declaration specifiers in the same way as _Complex is
(thus, _Imaginary float is a valid type name).
2 There are three imaginary types, designated as float _Imaginary, double
_Imaginary, and long double _Imaginary. The imaginary types (along with
the real floating and complex types) are floating types.
3 For imaginary types, the corresponding real type is given by deleting the keyword
_Imaginary from the type name.
4 Each imaginary type has the same representation and alignment requirements as the
corresponding real type. The value of an object of imaginary type is the value of the real
representation times the imaginary unit.
5 The imaginary type domain comprises the imaginary types.
G.3 [Conventions]
1 A complex or imaginary value with at least one infinite part is regarded as an infinity
(even if its other part is a NaN). A complex or imaginary value is a finite number if each
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.
G.4 [Conversions]
G.4.1 [Imaginary types]
1 Conversions among imaginary types follow rules analogous to those for real floating
types.
G.4.2 [Real and imaginary]
1 When a value of imaginary type is converted to a real type other than _Bool,[324] the
result is a positive zero.
Footnote 324) See <IP_ADDRESS>.
2 When a value of real type is converted to an imaginary type, the result is a positive
imaginary zero.
G.4.3 [Imaginary and complex]
1 When a value of imaginary type is converted to a complex type, the real part of the
complex result value is a positive zero and the imaginary part of the complex result value
is determined by the conversion rules for the corresponding real types.
2 When a value of complex type is converted to an imaginary type, the real part of the
complex value is discarded and the value of the imaginary part is converted according to
the conversion rules for the corresponding real types.
G.5 [Binary operators]
1 The following subclauses supplement 6.5 in order to specify the type of the result for an
operation with an imaginary operand.
2 For most operand types, the value of the result of a binary operator with an imaginary or
complex operand is completely determined, with reference to real arithmetic, by the usual
mathematical formula. For some operand types, the usual mathematical formula is
problematic because of its treatment of infinities and because of undue overflow or
underflow; in these cases the result satisfies certain properties (specified in G.5.1), but is
not completely determined.
G.5.1 [Multiplicative operators]
1 Semantics
If one operand has real type and the other operand has imaginary type, then the result has
imaginary type. If both operands have imaginary type, then the result has real type. (If
either operand has complex type, then the result has complex type.)
2 If the operands are not both complex, then the result and floating-point exception
behavior of the * operator is defined by the usual mathematical formula:
* u iv u + iv
x xu i(xv) (xu) + i(xv)
iy i(yu) −yv (−yv) + i(yu)
x + iy (xu) + i(yu) (−yv) + i(xv)
3 If the second operand is not complex, then the result and floating-point exception
behavior of the / operator is defined by the usual mathematical formula:
/ u iv
x x/u i(−x/v)
iy i(y/u) y/v
x + iy (x/u) + i(y/u) (y/v) + i(−x/v)
4 The * and / operators satisfy the following infinity properties for all real, imaginary, and
complex operands:[325]
— if one operand is an infinity and the other operand is a nonzero finite number or an
infinity, then the result of the * operator is an infinity;
— if the first operand is an infinity and the second operand is a finite number, then the
result of the / operator is an infinity;
— if the first operand is a finite number and the second operand is an infinity, then the
result of the / operator is a zero;
— if the first operand is a nonzero finite number or an infinity and the second operand is
a zero, then the result of the / operator is an infinity.
Footnote 325) These properties are already implied for those cases covered in the tables, but are required for all cases
(at least where the state for CX_LIMITED_RANGE is ‘‘off’’).
5 If both operands of the * operator are complex or if the second operand of the / operator
is complex, the operator raises floating-point exceptions if appropriate for the calculation
of the parts of the result, and may raise spurious floating-point exceptions.
6 EXAMPLE 1 Multiplication of double _Complex operands could be implemented as follows. Note
that the imaginary unit I has imaginary type (see G.6).
#include <math.h>
#include <complex.h>
/* Multiply z * w ... */
double complex _Cmultd(double complex z, double complex w)
{
#pragma STDC FP_CONTRACT OFF
double a, b, c, d, ac, bd, ad, bc, x, y;
a = creal(z); b = cimag(z);
c = creal(w); d = cimag(w);
ac = a * c; bd = b * d;
ad = a * d; bc = b * c;
x = ac - bd; y = ad + bc;
if (isnan(x) && isnan(y)) {
/* Recover infinities that computed as NaN+iNaN ... */
int recalc = 0;
if ( isinf(a) || isinf(b) ) { // z is infinite
/* "Box" the infinity and change NaNs in the other factor to 0 */
a = copysign(isinf(a) ? 1.0 : 0.0, a);
b = copysign(isinf(b) ? 1.0 : 0.0, b);
if (isnan(c)) c = copysign(0.0, c);
if (isnan(d)) d = copysign(0.0, d);
recalc = 1;
}
if ( isinf(c) || isinf(d) ) { // w is infinite
/* "Box" the infinity and change NaNs in the other factor to 0 */
c = copysign(isinf(c) ? 1.0 : 0.0, c);
d = copysign(isinf(d) ? 1.0 : 0.0, d);
if (isnan(a)) a = copysign(0.0, a);
if (isnan(b)) b = copysign(0.0, b);
recalc = 1;
}
if (!recalc && (isinf(ac) || isinf(bd) ||
isinf(ad) || isinf(bc))) {
/* Recover infinities from overflow by changing NaNs to 0 ... */
if (isnan(a)) a = copysign(0.0, a);
if (isnan(b)) b = copysign(0.0, b);
if (isnan(c)) c = copysign(0.0, c);
if (isnan(d)) d = copysign(0.0, d);
recalc = 1;
}
if (recalc) {
x = INFINITY * ( a * c - b * d );
y = INFINITY * ( a * d + b * c );
}
}
return x + I * y;
}
7 This implementation achieves the required treatment of infinities at the cost of only one isnan test in
ordinary (finite) cases. It is less than ideal in that undue overflow and underflow may occur.
8 EXAMPLE 2 Division of two double _Complex operands could be implemented as follows.
#include <math.h>
#include <complex.h>
/* Divide z / w ... */
double complex _Cdivd(double complex z, double complex w)
{
#pragma STDC FP_CONTRACT OFF
double a, b, c, d, logbw, denom, x, y;
int ilogbw = 0;
a = creal(z); b = cimag(z);
c = creal(w); d = cimag(w);
logbw = logb(fmax(fabs(c), fabs(d)));
if (isfinite(logbw)) {
ilogbw = (int)logbw;
c = scalbn(c, -ilogbw); d = scalbn(d, -ilogbw);
}
denom = c * c + d * d;
x = scalbn((a * c + b * d) / denom, -ilogbw);
y = scalbn((b * c - a * d) / denom, -ilogbw);
/* Recover infinities and zeros that computed as NaN+iNaN; */
/* the only cases are nonzero/zero, infinite/finite, and finite/infinite, ... */
if (isnan(x) && isnan(y)) {
if ((denom == 0.0) &&
(!isnan(a) || !isnan(b))) {
x = copysign(INFINITY, c) * a;
y = copysign(INFINITY, c) * b;
}
else if ((isinf(a) || isinf(b)) &&
isfinite(c) && isfinite(d)) {
a = copysign(isinf(a) ? 1.0 : 0.0, a);
b = copysign(isinf(b) ? 1.0 : 0.0, b);
x = INFINITY * ( a * c + b * d );
y = INFINITY * ( b * c - a * d );
}
else if (isinf(logbw) &&
isfinite(a) && isfinite(b)) {
c = copysign(isinf(c) ? 1.0 : 0.0, c);
d = copysign(isinf(d) ? 1.0 : 0.0, d);
x = 0.0 * ( a * c + b * d );
y = 0.0 * ( b * c - a * d );
}
}
return x + I * y;
}
9 Scaling the denominator alleviates the main overflow and underflow problem, which is more serious than
for multiplication. In the spirit of the multiplication example above, this code does not defend against
overflow and underflow in the calculation of the numerator. Scaling with the scalbn function, instead of
with division, provides better roundoff characteristics.
G.5.2 [Additive operators]
1 Semantics
If both operands have imaginary type, then the result has imaginary type. (If one operand
has real type and the other operand has imaginary type, or if either operand has complex
type, then the result has complex type.)
2 In all cases the result and floating-point exception behavior of a + or - operator is defined
by the usual mathematical formula:
+ or − u iv u + iv
x x±u x ± iv (x ± u) ± iv
iy ±u + iy i(y ± v) ±u + i(y ± v)
x + iy (x ± u) + iy x + i(y ± v) (x ± u) + i(y ± v)
G.6 [Complex arithmetic <complex.h>]
1 The macros
imaginary
and
_Imaginary_I
are defined, respectively, as _Imaginary and a constant expression of type const
float _Imaginary with the value of the imaginary unit. The macro
I
is defined to be _Imaginary_I (not _Complex_I as stated in 7.3). Notwithstanding
the provisions of 7.1.3, a program may undefine and then perhaps redefine the macro
imaginary.
2 This subclause contains specifications for the <complex.h> functions that are
particularly suited to IEC 60559 implementations. For families of functions, the
specifications apply to all of the functions even though only the principal function is
shown. Unless otherwise specified, where the symbol ‘‘±’’ occurs in both an argument
and the result, the result has the same sign as the argument.
3 The functions are continuous onto both sides of their branch cuts, taking into account the
sign of zero. For example, csqrt(−2 ± i0) = ±i√ 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
manner consistent with the specifications for real functions in F.9.[326]
Footnote 326) As noted in G.3, a complex value with at least one infinite part is regarded as an infinity even if its
other part is a NaN.
5 The functions cimag, conj, cproj, and creal are fully specified for all
implementations, including IEC 60559 ones, in 7.3.9. These functions raise no floating-
point exceptions.
6 Each of the functions cabs and carg is specified by a formula in terms of a real
function (whose special cases are covered in annex F):
cabs(x + iy) = hypot(x, y)
carg(x + iy) = atan2(y, x)
7 Each of the functions casin, catan, ccos, csin, and ctan is specified implicitly by
a formula in terms of other complex functions (whose special cases are specified below):
casin(z) = −i casinh(iz)
catan(z) = −i catanh(iz)
ccos(z) = ccosh(iz)
csin(z) = −i csinh(iz)
ctan(z) = −i ctanh(iz)
8 For the other functions, the following subclauses specify behavior for special cases,
including treatment of the ‘‘invalid’’ and ‘‘divide-by-zero’’ floating-point exceptions. For
families of functions, the specifications apply to all of the functions even though only the
principal function is shown. For a function f satisfying f (conj(z)) = conj( f (z)), the
specifications for the upper half-plane imply the specifications for the lower half-plane; if
the function f is also either even, f (−z) = f (z), or odd, f (−z) = − f (z), then the
specifications for the first quadrant imply the specifications for the other three quadrants.
9 In the following subclauses, cis(y) is defined as cos(y) + i sin(y).
G.6.1 [Trigonometric functions]
G.6.1.1 [The cacos functions]
1 — cacos(conj(z)) = conj(cacos(z)).
— cacos(±0 + i0) returns π /2 − i0.
— cacos(±0 + iNaN) returns π /2 + iNaN.
— cacos(x + i ∞) returns π /2 − i ∞, for finite x.
— cacos(x + iNaN) returns NaN + iNaN and optionally raises the ‘‘invalid’’ floating-
point exception, for nonzero finite x.
— cacos(−∞ + iy) returns π − i ∞, for positive-signed finite y.
— cacos(+∞ + iy) returns +0 − i ∞, for positive-signed finite y.
— cacos(−∞ + i ∞) returns 3π /4 − i ∞.
— cacos(+∞ + i ∞) returns π /4 − i ∞.
— cacos(±∞ + iNaN) returns NaN ± i ∞ (where the sign of the imaginary part of the
result is unspecified).
— cacos(NaN + iy) returns NaN + iNaN and optionally raises the ‘‘invalid’’ floating-
point exception, for finite y.
— cacos(NaN + i ∞) returns NaN − i ∞.
— cacos(NaN + iNaN) returns NaN + iNaN.
G.6.2 [Hyperbolic functions]
G.6.2.1 [The cacosh functions]
1 — cacosh(conj(z)) = conj(cacosh(z)).
— cacosh(±0 + i0) returns +0 + iπ /2.
— cacosh(x + i ∞) returns +∞ + iπ /2, for finite x.
— cacosh(x + iNaN) returns NaN + iNaN and optionally raises the ‘‘invalid’’
floating-point exception, for finite x.
— cacosh(−∞ + iy) returns +∞ + iπ , for positive-signed finite y.
— cacosh(+∞ + iy) returns +∞ + i0, for positive-signed finite y.
— cacosh(−∞ + i ∞) returns +∞ + i3π /4.
— cacosh(+∞ + i ∞) returns +∞ + iπ /4.
— cacosh(±∞ + iNaN) returns +∞ + iNaN.
— cacosh(NaN + iy) returns NaN + iNaN and optionally raises the ‘‘invalid’’
floating-point exception, for finite y.
— cacosh(NaN + i ∞) returns +∞ + iNaN.
— cacosh(NaN + iNaN) returns NaN + iNaN.
G.6.2.2 [The casinh functions]
1 — casinh(conj(z)) = conj(casinh(z)) and casinh is odd.
— casinh(+0 + i0) returns 0 + i0.
— casinh(x + i ∞) returns +∞ + iπ /2 for positive-signed finite x.
— casinh(x + iNaN) returns NaN + iNaN and optionally raises the ‘‘invalid’’
floating-point exception, for finite x.
— casinh(+∞ + iy) returns +∞ + i0 for positive-signed finite y.
— casinh(+∞ + i ∞) returns +∞ + iπ /4.
— casinh(+∞ + iNaN) returns +∞ + iNaN.
— casinh(NaN + i0) returns NaN + i0.
— casinh(NaN + iy) returns NaN + iNaN and optionally raises the ‘‘invalid’’
floating-point exception, for finite nonzero y.
— casinh(NaN + i ∞) returns ±∞ + iNaN (where the sign of the real part of the result
is unspecified).
— casinh(NaN + iNaN) returns NaN + iNaN.
G.6.2.3 [The catanh functions]
1 — catanh(conj(z)) = conj(catanh(z)) and catanh is odd.
— catanh(+0 + i0) returns +0 + i0.
— catanh(+0 + iNaN) returns +0 + iNaN.
— catanh(+1 + i0) returns +∞ + i0 and raises the ‘‘divide-by-zero’’ floating-point
exception.
— catanh(x + i ∞) returns +0 + iπ /2, for finite positive-signed x.
— catanh(x + iNaN) returns NaN + iNaN and optionally raises the ‘‘invalid’’
floating-point exception, for nonzero finite x.
— catanh(+∞ + iy) returns +0 + iπ /2, for finite positive-signed y.
— catanh(+∞ + i ∞) returns +0 + iπ /2.
— catanh(+∞ + iNaN) returns +0 + iNaN.
— catanh(NaN + iy) returns NaN + iNaN and optionally raises the ‘‘invalid’’
floating-point exception, for finite y.
— catanh(NaN + i ∞) returns ±0 + iπ /2 (where the sign of the real part of the result is
unspecified).
— catanh(NaN + iNaN) returns NaN + iNaN.
G.6.2.4 [The ccosh functions]
1 — ccosh(conj(z)) = conj(ccosh(z)) and ccosh is even.
— ccosh(+0 + i0) returns 1 + i0.
— ccosh(+0 + i ∞) returns NaN ± i0 (where the sign of the imaginary part of the
result is unspecified) and raises the ‘‘invalid’’ floating-point exception.
— ccosh(+0 + iNaN) returns NaN ± i0 (where the sign of the imaginary part of the
result is unspecified).
— ccosh(x + i ∞) returns NaN + iNaN and raises the ‘‘invalid’’ floating-point
exception, for finite nonzero x.
— ccosh(x + iNaN) returns NaN + iNaN and optionally raises the ‘‘invalid’’ floating-
point exception, for finite nonzero x.
— ccosh(+∞ + i0) returns +∞ + i0.
— ccosh(+∞ + iy) returns +∞ cis(y), for finite nonzero y.
— ccosh(+∞ + i ∞) returns ±∞ + iNaN (where the sign of the real part of the result is
unspecified) and raises the ‘‘invalid’’ floating-point exception.
— ccosh(+∞ + iNaN) returns +∞ + iNaN.
— ccosh(NaN + i0) returns NaN ± i0 (where the sign of the imaginary part of the
result is unspecified).
— ccosh(NaN + iy) returns NaN + iNaN and optionally raises the ‘‘invalid’’ floating-
point exception, for all nonzero numbers y.
— ccosh(NaN + iNaN) returns NaN + iNaN.
G.6.2.5 [The csinh functions]
1 — csinh(conj(z)) = conj(csinh(z)) and csinh is odd.
— csinh(+0 + i0) returns +0 + i0.
— csinh(+0 + i ∞) returns ±0 + iNaN (where the sign of the real part of the result is
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
— csinh(x + i ∞) returns NaN + iNaN and raises the ‘‘invalid’’ floating-point
exception, for positive finite x.
— csinh(x + iNaN) returns NaN + iNaN and optionally raises the ‘‘invalid’’ floating-
point exception, for finite nonzero x.
— csinh(+∞ + i0) returns +∞ + i0.
— csinh(+∞ + iy) returns +∞ cis(y), for positive finite y.
— csinh(+∞ + i ∞) returns ±∞ + iNaN (where the sign of the real part of the result is
unspecified) and raises the ‘‘invalid’’ floating-point exception.
— csinh(+∞ + iNaN) returns ±∞ + iNaN (where the sign of the real part of the result
is unspecified).
— csinh(NaN + i0) returns NaN + i0.
— csinh(NaN + iy) returns NaN + iNaN and optionally raises the ‘‘invalid’’ floating-
point exception, for all nonzero numbers y.
— csinh(NaN + iNaN) returns NaN + iNaN.
G.6.2.6 [The ctanh functions]
1 — ctanh(conj(z)) = conj(ctanh(z))and ctanh is odd.
— ctanh(+0 + i0) returns +0 + i0.
— ctanh(x + i ∞) returns NaN + iNaN and raises the ‘‘invalid’’ floating-point
exception, for finite x.
— ctanh(x + iNaN) returns NaN + iNaN and optionally raises the ‘‘invalid’’ floating-
point exception, for finite x.
— ctanh(+∞ + iy) returns 1 + i0 sin(2y), for positive-signed finite y.
— ctanh(+∞ + i ∞) returns 1 ± i0 (where the sign of the imaginary part of the result
is unspecified).
— ctanh(+∞ + iNaN) returns 1 ± i0 (where the sign of the imaginary part of the
result is unspecified).
— ctanh(NaN + i0) returns NaN + i0.
— ctanh(NaN + iy) returns NaN + iNaN and optionally raises the ‘‘invalid’’ floating-
point exception, for all nonzero numbers y.
— ctanh(NaN + iNaN) returns NaN + iNaN.
G.6.3 [Exponential and logarithmic functions]
G.6.3.1 [The cexp functions]
1 — cexp(conj(z)) = conj(cexp(z)).
— cexp(±0 + i0) returns 1 + i0.
— cexp(x + i ∞) returns NaN + iNaN and raises the ‘‘invalid’’ floating-point
exception, for finite x.
— cexp(x + iNaN) returns NaN + iNaN and optionally raises the ‘‘invalid’’ floating-
point exception, for finite x.
— cexp(+∞ + i0) returns +∞ + i0.
— cexp(−∞ + iy) returns +0 cis(y), for finite y.
— cexp(+∞ + iy) returns +∞ cis(y), for finite nonzero y.
— cexp(−∞ + i ∞) returns ±0 ± i0 (where the signs of the real and imaginary parts of
the result are unspecified).
— cexp(+∞ + i ∞) returns ±∞ + iNaN and raises the ‘‘invalid’’ floating-point
exception (where the sign of the real part of the result is unspecified).
— cexp(−∞ + iNaN) returns ±0 ± i0 (where the signs of the real and imaginary parts
of the result are unspecified).
— cexp(+∞ + iNaN) returns ±∞ + iNaN (where the sign of the real part of the result
is unspecified).
— cexp(NaN + i0) returns NaN + i0.
— cexp(NaN + iy) returns NaN + iNaN and optionally raises the ‘‘invalid’’ floating-
point exception, for all nonzero numbers y.
— cexp(NaN + iNaN) returns NaN + iNaN.
G.6.3.2 [The clog functions]
1 — clog(conj(z)) = conj(clog(z)).
— clog(−0 + i0) returns −∞ + iπ and raises the ‘‘divide-by-zero’’ floating-point
exception.
— clog(+0 + i0) returns −∞ + i0 and raises the ‘‘divide-by-zero’’ floating-point
exception.
— clog(x + i ∞) returns +∞ + iπ /2, for finite x.
— clog(x + iNaN) returns NaN + iNaN and optionally raises the ‘‘invalid’’ floating-
point exception, for finite x.
— clog(−∞ + iy) returns +∞ + iπ , for finite positive-signed y.
— clog(+∞ + iy) returns +∞ + i0, for finite positive-signed y.
— clog(−∞ + i ∞) returns +∞ + i3π /4.
— clog(+∞ + i ∞) returns +∞ + iπ /4.
— clog(±∞ + iNaN) returns +∞ + iNaN.
— clog(NaN + iy) returns NaN + iNaN and optionally raises the ‘‘invalid’’ floating-
point exception, for finite y.
— clog(NaN + i ∞) returns +∞ + iNaN.
— clog(NaN + iNaN) returns NaN + iNaN.
G.6.4 [Power and absolute-value functions]
G.6.4.1 [The cpow functions]
1 The cpow functions raise floating-point exceptions if appropriate for the calculation of
the parts of the result, and may raise spurious exceptions.[327]
Footnote 327) This allows cpow( z , c ) to be implemented as cexp(c clog( z )) without precluding
implementations that treat special cases more carefully.
G.6.4.2 [The csqrt functions]
1 — csqrt(conj(z)) = conj(csqrt(z)).
— csqrt(±0 + i0) returns +0 + i0.
— csqrt(x + i ∞) returns +∞ + i ∞, for all x (including NaN).
— csqrt(x + iNaN) returns NaN + iNaN and optionally raises the ‘‘invalid’’ floating-
point exception, for finite x.
— csqrt(−∞ + iy) returns +0 + i ∞, for finite positive-signed y.
— csqrt(+∞ + iy) returns +∞ + i0, for finite positive-signed y.
— csqrt(−∞ + iNaN) returns NaN ± i ∞ (where the sign of the imaginary part of the
result is unspecified).
— csqrt(+∞ + iNaN) returns +∞ + iNaN.
— csqrt(NaN + iy) returns NaN + iNaN and optionally raises the ‘‘invalid’’ floating-
point exception, for finite y.
— csqrt(NaN + iNaN) returns NaN + iNaN.
G.7 [Type-generic math <tgmath.h>]
1 Type-generic macros that accept complex arguments also accept imaginary arguments. If
an argument is imaginary, the macro expands to an expression whose type is real,
imaginary, or complex, as appropriate for the particular function: if the argument is
imaginary, then the types of cos, cosh, fabs, carg, cimag, and creal are real; the
types of sin, tan, sinh, tanh, asin, atan, asinh, and atanh are imaginary; and
the types of the others are complex.
2 Given an imaginary argument, each of the type-generic macros cos, sin, tan, cosh,
sinh, tanh, asin, atan, asinh, atanh is specified by a formula in terms of real
functions:
cos(iy) = cosh(y)
sin(iy) = i sinh(y)
tan(iy) = i tanh(y)
cosh(iy) = cos(y)
sinh(iy) = i sin(y)
tanh(iy) = i tan(y)
asin(iy) = i asinh(y)
atan(iy) = i atanh(y)
asinh(iy) = i asin(y)
atanh(iy) = i atan(y)
H. [Annex H (informative) Language independent arithmetic]
H.1 [Introduction]
1 This annex documents the extent to which the C language supports the ISO/IEC 10967−1
standard for language-independent arithmetic (LIA−1). LIA−1 is more general than
IEC 60559 (annex F) in that it covers integer and diverse floating-point arithmetics.
H.2 [Types]
1 The relevant C arithmetic types meet the requirements of LIA−1 types if an
implementation adds notification of exceptional arithmetic operations and meets the 1
unit in the last place (ULP) accuracy requirement (LIA−1 subclause 5.2.8).
H.2.1 [Boolean type]
1 The LIA−1 data type Boolean is implemented by the C data type bool with values of
true and false, all from <stdbool.h>.
H.2.2 [Integer types]
1 The signed C integer types int, long int, long long int, and the corresponding
unsigned types are compatible with LIA−1. If an implementation adds support for the
LIA−1 exceptional values ‘‘integer_overflow’’ and ‘‘undefined’’, then those types are
LIA−1 conformant types. C’s unsigned integer types are ‘‘modulo’’ in the LIA−1 sense
in that overflows or out-of-bounds results silently wrap. An implementation that defines
signed integer types as also being modulo need not detect integer overflow, in which case,
only integer divide-by-zero need be detected.
2 The parameters for the integer data types can be accessed by the following:
maxint INT_MAX, LONG_MAX, LLONG_MAX, UINT_MAX, ULONG_MAX,
ULLONG_MAX
minint INT_MIN, LONG_MIN, LLONG_MIN
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.
H.2.2.1 [Integer operations]
1 The integer operations on integer types are the following:
addI x + y
subI x - y
mulI x * y
divI, divtI x / y
remI, remtI x % y
negI -x
absI abs(x), labs(x), llabs(x)
eqI x == y
neqI x != y
lssI x < y
leqI x <= y
gtrI x > y
geqI x >= y
where x and y are expressions of the same integer type.
H.2.3 [Floating-point types]
1 The C floating-point types float, double, and long double are compatible with
LIA−1. If an implementation adds support for the LIA−1 exceptional values
‘‘underflow’’, ‘‘floating_overflow’’, and ‘‘"undefined’’, then those types are conformant
with LIA−1. An implementation that uses IEC 60559 floating-point formats and
operations (see annex F) along with IEC 60559 status flags and traps has LIA−1
conformant types.
H.2.3.1 [Floating-point parameters]
1 The parameters for a floating point data type can be accessed by the following:
r FLT_RADIX
p FLT_MANT_DIG, DBL_MANT_DIG, LDBL_MANT_DIG
emax FLT_MAX_EXP, DBL_MAX_EXP, LDBL_MAX_EXP
emin FLT_MIN_EXP, DBL_MIN_EXP, LDBL_MIN_EXP
2 The derived constants for the floating point types are accessed by the following:
fmax FLT_MAX, DBL_MAX, LDBL_MAX
fminN FLT_MIN, DBL_MIN, LDBL_MIN
epsilon FLT_EPSILON, DBL_EPSILON, LDBL_EPSILON
rnd_style FLT_ROUNDS
H.2.3.2 [Floating-point operations]
1 The floating-point operations on floating-point types are the following:
addF x + y
subF x - y
mulF x * y
divF x / y
negF -x
absF fabsf(x), fabs(x), fabsl(x)
exponentF 1.f+logbf(x), 1.0+logb(x), 1.L+logbl(x)
scaleF scalbnf(x, n), scalbn(x, n), scalbnl(x, n),
scalblnf(x, li), scalbln(x, li), scalblnl(x, li)
intpartF modff(x, &y), modf(x, &y), modfl(x, &y)
fractpartF modff(x, &y), modf(x, &y), modfl(x, &y)
eqF x == y
neqF x != y
lssF x < y
leqF x <= y
gtrF x > y
geqF x >= y
where x and y are expressions of the same floating point type, n is of type int, and li
is of type long int.
H.2.3.3 [Rounding styles]
1 The C Standard requires all floating types to use the same radix and rounding style, so
that only one identifier for each is provided to map to LIA−1.
2 The FLT_ROUNDS parameter can be used to indicate the LIA−1 rounding styles:
truncate FLT_ROUNDS == 0
nearest FLT_ROUNDS == 1
other FLT_ROUNDS != 0 && FLT_ROUNDS != 1
provided that an implementation extends FLT_ROUNDS to cover the rounding style used
in all relevant LIA−1 operations, not just addition as in C.
H.2.4 [Type conversions]
1 The LIA−1 type conversions are the following type casts:
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,
(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
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
conversion functions, lrint(), llrint(), lround(), and llround(), can be
used. They all meet LIA−1’s requirements on floating to integer rounding for in-range
values. For out-of-range values, the conversions shall silently wrap for the modulo types.
3 The fmod() function is useful for doing silent wrapping to unsigned integer types, e.g.,
fmod( fabs(rint(x)), 65536.0 ) or (0.0 <= (y = fmod( rint(x),
65536.0 )) ? y : 65536.0 + y) will compute an integer value in the range 0.0
to 65535.0 which can then be cast to unsigned short int. But, the
remainder() function is not useful for doing silent wrapping to signed integer types,
e.g., remainder( rint(x), 65536.0 ) will compute an integer value in the
range −32767.0 to +32768.0 which is not, in general, in the range of signed short
int.
4 C’s conversions (casts) from floating-point to floating-point can meet LIA−1
requirements if an implementation uses round-to-nearest (IEC 60559 default).
5 C’s conversions (casts) from integer to floating-point can meet LIA−1 requirements if an
implementation uses round-to-nearest.
H.3 [Notification]
1 Notification is the process by which a user or program is informed that an exceptional
arithmetic operation has occurred. C’s operations are compatible with LIA−1 in that C
allows an implementation to cause a notification to occur when any arithmetic operation
returns an exceptional value as defined in LIA−1 clause 5.
H.3.1 [Notification alternatives]
1 LIA−1 requires at least the following two alternatives for handling of notifications:
setting indicators or trap-and-terminate. LIA−1 allows a third alternative: trap-and-
resume.
2 An implementation need only support a given notification alternative for the entire
program. An implementation may support the ability to switch between notification
alternatives during execution, but is not required to do so. An implementation can
provide separate selection for each kind of notification, but this is not required.
3 C allows an implementation to provide notification. C’s SIGFPE (for traps) and
FE_INVALID, FE_DIVBYZERO, FE_OVERFLOW, FE_UNDERFLOW (for indicators)
can provide LIA−1 notification.
4 C’s signal handlers are compatible with LIA−1. Default handling of SIGFPE can
provide trap-and-terminate behavior, except for those LIA−1 operations implemented by
math library function calls. User-provided signal handlers for SIGFPE allow for trap-
and-resume behavior with the same constraint.
H.3.1.1 [Indicators]
1 C’s <fenv.h> status flags are compatible with the LIA−1 indicators.
2 The following mapping is for floating-point types:
undefined FE_INVALID, FE_DIVBYZERO
floating_overflow FE_OVERFLOW
underflow FE_UNDERFLOW
3 The floating-point indicator interrogation and manipulation operations are:
set_indicators feraiseexcept(i)
clear_indicators feclearexcept(i)
test_indicators fetestexcept(i)
current_indicators fetestexcept(FE_ALL_EXCEPT)
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
and ‘‘hard to ignore’’ message (see LIA−1 subclause 6.1.2)
5 LIA−1 does not make the distinction between floating-point and integer for ‘‘undefined’’.
This documentation makes that distinction because <fenv.h> covers only the floating-
point indicators.
H.3.1.2 [Traps]
1 C is compatible with LIA−1’s trap requirements for arithmetic operations, but not for
math library functions (which are not permitted to generate any externally visible
exceptional conditions). An implementation can provide an alternative of notification
through termination with a ‘‘hard-to-ignore’’ message (see LIA−1 subclause 6.1.3).
2 LIA−1 does not require that traps be precise.
3 C does require that SIGFPE be the signal corresponding to arithmetic exceptions, if there
is any signal raised for them.
4 C supports signal handlers for SIGFPE and allows trapping of arithmetic exceptions.
When arithmetic exceptions do trap, C’s signal-handler mechanism allows trap-and-
terminate (either default implementation behavior or user replacement for it) or trap-and-
resume, at the programmer’s option.
I. [Annex I (informative) Common warnings]
1 An implementation may generate warnings in many situations, none of which are
specified as part of this International Standard. The following are a few of the more
common situations.
2 — A new struct or union type appears in a function prototype (6.2.1, <IP_ADDRESS>).
— A block with initialization of an object that has automatic storage duration is jumped
into (6.2.4).
— An implicit narrowing conversion is encountered, such as the assignment of a long
int or a double to an int, or a pointer to void to a pointer to any type other than
a character type (6.3).
— A hexadecimal floating constant cannot be represented exactly in its evaluation format
(<IP_ADDRESS>).
— An integer character constant includes more than one character or a wide character
constant includes more than one multibyte character (<IP_ADDRESS>).
— The characters /* are found in a comment (6.4.7).
— An ‘‘unordered’’ binary operator (not comma, &&, or ||) contains a side effect to an
lvalue in one operand, and a side effect to, or an access to the value of, the identical
lvalue in the other operand (6.5).
— A function is called but no prototype has been supplied (<IP_ADDRESS>).
— The arguments in a function call do not agree in number and type with those of the
parameters in a function definition that is not a prototype (<IP_ADDRESS>).
— An object is defined but not used (6.7).
— A value is given to an object of an enumerated type other than by assignment of an
enumeration constant that is a member of that type, or an enumeration object that has
the same type, or the value of a function that returns the same enumerated type
(<IP_ADDRESS>).
— An aggregate has a partly bracketed initialization (6.7.7).
— A statement cannot be reached (6.8).
— A statement with no apparent effect is encountered (6.8).
— A constant expression is used as the controlling expression of a selection statement
— An incorrectly formed preprocessing group is encountered while skipping a
preprocessing group (6.10.1).
— An unrecognized #pragma directive is encountered (6.10.6).
J. [Annex J (informative) Portability issues]
1 This annex collects some information about portability that appears in this International
Standard.
J.1 [Unspecified behavior]
1 The following are unspecified:
— The manner and timing of static initialization (5.1.2).
— The termination status returned to the hosted environment if the return type of main
is not compatible with int (<IP_ADDRESS>.3).
— The behavior of the display device if a printing character is written when the active
position is at the final position of a line (5.2.2).
— The behavior of the display device if a backspace character is written when the active
position is at the initial position of a line (5.2.2).
— The behavior of the display device if a horizontal tab character is written when the
active position is at or past the last defined horizontal tabulation position (5.2.2).
— The behavior of the display device if a vertical tab character is written when the active
position is at or past the last defined vertical tabulation position (5.2.2).
— How an extended source character that does not correspond to a universal character
name counts toward the significant initial characters in an external identifier (<IP_ADDRESS>).
— Many aspects of the representations of types (6.2.6).
— The value of padding bytes when storing values in structures or unions (<IP_ADDRESS>).
— The value of a union member other than the last one stored into (<IP_ADDRESS>).
— The representation used when storing a value in an object that has more than one
object representation for that value (<IP_ADDRESS>).
— The values of any padding bits in integer representations (<IP_ADDRESS>).
— Whether certain operators can generate negative zeros and whether a negative zero
becomes a normal zero when stored in an object (<IP_ADDRESS>).
— 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
— The order in which the function designator, arguments, and subexpressions within the
arguments are evaluated in a function call (<IP_ADDRESS>).
— The order of side effects among compound literal initialization list expressions
(<IP_ADDRESS>).
— The order in which the operands of an assignment operator are evaluated (6.5.16).
— The alignment of the addressable storage unit allocated to hold a bit-field (<IP_ADDRESS>).
— Whether a call to an inline function uses the inline definition or the external definition
of the function (6.7.4).
— Whether or not a size expression is evaluated when it is part of the operand of a
sizeof operator and changing the value of the size expression would not affect the
result of the operator (<IP_ADDRESS>).
— The order in which any side effects occur among the initialization list expressions in
an initializer (6.7.8).
— The layout of storage for function parameters (6.9.1).
— When a fully expanded macro replacement list contains a function-like macro name
as its last preprocessing token and the next preprocessing token from the source file is
a (, and the fully expanded replacement of that macro ends with the name of the first
macro and the next preprocessing token from the source file is again a (, whether that
is considered a nested replacement (6.10.3).
— The order in which # and ## operations are evaluated during macro substitution
(<IP_ADDRESS>, <IP_ADDRESS>).
— Whether errno is a macro or an identifier with external linkage (7.5).
— The state of the floating-point status flags when execution passes from a part of the
program translated with FENV_ACCESS ‘‘off’’ to a part translated with
FENV_ACCESS ‘‘on’’ (7.6.1).
— The order in which feraiseexcept raises floating-point exceptions, except as
stated in F.7.6 (<IP_ADDRESS>).
— Whether math_errhandling is a macro or an identifier with external linkage
(7.12).
— The results of the frexp functions when the specified value is not a floating-point
number (<IP_ADDRESS>).
— The numeric result of the ilogb functions when the correct value is outside the
range of the return type (<IP_ADDRESS>, F.9.3.5).
— The result of rounding when the value is out of range (<IP_ADDRESS>, <IP_ADDRESS>, F.9.6.5).
— The value stored by the remquo functions in the object pointed to by quo when y is
zero (<IP_ADDRESS>).
— Whether setjmp is a macro or an identifier with external linkage (7.13).
— Whether va_copy and va_end are macros or identifiers with external linkage
(7.15.1).
— The hexadecimal digit before the decimal point when a non-normalized floating-point
number is printed with an a or A conversion specifier (<IP_ADDRESS>, <IP_ADDRESS>).
— The value of the file position indicator after a successful call to the ungetc function
for a text stream, or the ungetwc function for any stream, until all pushed-back
characters are read or discarded (<IP_ADDRESS>, <IP_ADDRESS>).
— The details of the value stored by the fgetpos function (<IP_ADDRESS>).
— The details of the value returned by the ftell function for a text stream (<IP_ADDRESS>).
— Whether the strtod, strtof, strtold, wcstod, wcstof, and wcstold
functions convert a minus-signed sequence to a negative number directly or by
negating the value resulting from converting the corresponding unsigned sequence
(<IP_ADDRESS>, <IP_ADDRESS>.1).
— The order and contiguity of storage allocated by successive calls to the calloc,
malloc, and realloc functions (7.20.3).
— The amount of storage allocated by a successful call to the calloc, malloc, or
realloc function when 0 bytes was requested (7.20.3).
— Which of two elements that compare as equal is matched by the bsearch function
(<IP_ADDRESS>).
— The order of two elements that compare as equal in an array sorted by the qsort
function (<IP_ADDRESS>).
— The encoding of the calendar time returned by the time function (<IP_ADDRESS>).
— The characters stored by the strftime or wcsftime function if any of the time
values being converted is outside the normal range (<IP_ADDRESS>, <IP_ADDRESS>).
— The conversion state after an encoding error occurs (<IP_ADDRESS>.2, <IP_ADDRESS>.3, <IP_ADDRESS>.1,
<IP_ADDRESS>.2,
— The resulting value when the ‘‘invalid’’ floating-point exception is raised during
IEC 60559 floating to integer conversion (F.4).
— Whether conversion of non-integer IEC 60559 floating values to integer raises the
‘‘inexact’’ floating-point exception (F.4).
— Whether or when library functions in <math.h> raise the ‘‘inexact’’ floating-point
exception in an IEC 60559 conformant implementation (F.9).
— Whether or when library functions in <math.h> raise an undeserved ‘‘underflow’’
floating-point exception in an IEC 60559 conformant implementation (F.9).
— The exponent value stored by frexp for a NaN or infinity (F.9.3.4).
— The numeric result returned by the lrint, llrint, lround, and llround
functions if the rounded value is outside the range of the return type (F.9.6.5, F.9.6.7).
— The sign of one part of the complex result of several math functions for certain
exceptional values in IEC 60559 compatible implementations (G.6.1.1, G.6.2.2,
G.6.2.3, G.6.2.4, G.6.2.5, G.6.2.6, G.6.3.1, G.6.4.2).
J.2 [Undefined behavior]
1 The behavior is undefined in the following circumstances:
— A ‘‘shall’’ or ‘‘shall not’’ requirement that appears outside of a constraint is violated
(clause 4).
— A nonempty source file does not end in a new-line character which is not immediately
preceded by a backslash character or ends in a partial preprocessing token or
comment (<IP_ADDRESS>).
— Token concatenation produces a character sequence matching the syntax of a
universal character name (<IP_ADDRESS>).
— A program in a hosted environment does not define a function named main using one
of the specified forms (<IP_ADDRESS>.1).
— A character not in the basic source character set is encountered in a source file, except
in an identifier, a character constant, a string literal, a header name, a comment, or a
preprocessing token that is never converted to a token (5.2.1).
— An identifier, comment, string literal, character constant, or header name contains an
invalid multibyte character or does not begin and end in the initial shift state (<IP_ADDRESS>).
— The same identifier has both internal and external linkage in the same translation unit
(6.2.2).
— An object is referred to outside of its lifetime (6.2.4).
— The value of a pointer to an object whose lifetime has ended is used (6.2.4).
— The value of an object with automatic storage duration is used while it is
indeterminate (6.2.4, 6.7.8, 6.8).
— A trap representation is read by an lvalue expression that does not have character type
(<IP_ADDRESS>).
— A trap representation is produced by a side effect that modifies any part of the object
using an lvalue expression that does not have character type (<IP_ADDRESS>).
— The arguments to certain operators are such that could produce a negative zero result,
but the implementation does not support negative zeros (<IP_ADDRESS>).
— Two declarations of the same object or function specify types that are not compatible
(6.2.7).
— Conversion to or from an integer type produces a value outside the range that can be
represented (<IP_ADDRESS>).
— Demotion of one real floating type to another produces a value outside the range that
can be represented (<IP_ADDRESS>).
— An lvalue does not designate an object when evaluated (<IP_ADDRESS>).
— A non-array lvalue with an incomplete type is used in a context that requires the value
of the designated object (<IP_ADDRESS>).
— An lvalue having array type is converted to a pointer to the initial element of the
array, and the array object has register storage class (<IP_ADDRESS>).
— An attempt is made to use the value of a void expression, or an implicit or explicit
conversion (except to void) is applied to a void expression (<IP_ADDRESS>).
— Conversion of a pointer to an integer type produces a value outside the range that can
be represented (<IP_ADDRESS>).
— Conversion between two pointer types produces a result that is incorrectly aligned
(<IP_ADDRESS>).
— A pointer is used to call a function whose type is not compatible with the pointed-to
type (<IP_ADDRESS>).
— An unmatched ' or " character is encountered on a logical source line during
tokenization (6.4).
— A reserved keyword token is used in translation phase 7 or 8 for some purpose other
than as a keyword (6.4.1).
— A universal character name in an identifier does not designate a character whose
encoding falls into one of the specified ranges (<IP_ADDRESS>).
— The initial character of an identifier is a universal character name designating a digit
(<IP_ADDRESS>).
— Two identifiers differ only in nonsignificant characters (<IP_ADDRESS>).
— The identifier _ _func_ _ is explicitly declared (<IP_ADDRESS>).
— The program attempts to modify a string literal (6.4.5).
— The characters ', \, ", //, or /* occur in the sequence between the < and >
delimiters, or the characters ', \, //, or /* occur in the sequence between the "
delimiters, in a header name preprocessing token (6.4.7).
— Between two sequence points, an object is modified more than once, or is modified
and the prior value is read other than to determine the value to be stored (6.5).
— An exceptional condition occurs during the evaluation of an expression (6.5).
— An object has its stored value accessed other than by an lvalue of an allowable type
(6.5).
— An attempt is made to modify the result of a function call, a conditional operator, an
assignment operator, or a comma operator, or to access it after the next sequence
point (<IP_ADDRESS>, 6.5.15, 6.5.16, 6.5.17).
— For a call to a function without a function prototype in scope, the number of
arguments does not equal the number of parameters (<IP_ADDRESS>).
— For call to a function without a function prototype in scope where the function is
defined with a function prototype, either the prototype ends with an ellipsis or the
types of the arguments after promotion are not compatible with the types of the
parameters (<IP_ADDRESS>).
— For a call to a function without a function prototype in scope where the function is not
defined with a function prototype, the types of the arguments after promotion are not
compatible with those of the parameters after promotion (with certain exceptions)
(<IP_ADDRESS>).
— A function is defined with a type that is not compatible with the type (of the
expression) pointed to by the expression that denotes the called function (<IP_ADDRESS>).
— The operand of the unary * operator has an invalid value (<IP_ADDRESS>).
— A pointer is converted to other than an integer or pointer type (6.5.4).
— The value of the second operand of the / or % operator is zero (6.5.5).
— Addition or subtraction of a pointer into, or just beyond, an array object and an
integer type produces a result that does not point into, or just beyond, the same array
object (6.5.6).
— Addition or subtraction of a pointer into, or just beyond, an array object and an
integer type produces a result that points just beyond the array object and is used as
the operand of a unary * operator that is evaluated (6.5.6).
— Pointers that do not point into, or just beyond, the same array object are subtracted
(6.5.6).
— An array subscript is out of range, even if an object is apparently accessible with the
given subscript (as in the lvalue expression a[1][7] given the declaration int
a[4][5]) (6.5.6).
— The result of subtracting two pointers is not representable in an object of type
ptrdiff_t (6.5.6).
— An expression is shifted by a negative number or by an amount greater than or equal
to the width of the promoted expression (6.5.7).
— An expression having signed promoted type is left-shifted and either the value of the
expression is negative or the result of shifting would be not be representable in the
promoted type (6.5.7).
— Pointers that do not point to the same aggregate or union (nor just beyond the same
array object) are compared using relational operators (6.5.8).
— An object is assigned to an inexactly overlapping object or to an exactly overlapping
object with incompatible type (<IP_ADDRESS>).
— An expression that is required to be an integer constant expression does not have an
integer type; has operands that are not integer constants, enumeration constants,
character constants, sizeof expressions whose results are integer constants, or
immediately-cast floating constants; or contains casts (outside operands to sizeof
operators) other than conversions of arithmetic types to integer types (6.6).
— A constant expression in an initializer is not, or does not evaluate to, one of the
following: an arithmetic constant expression, a null pointer constant, an address
constant, or an address constant for an object type plus or minus an integer constant
expression (6.6).
— An arithmetic constant expression does not have arithmetic type; has operands that
are not integer constants, floating constants, enumeration constants, character
constants, or sizeof expressions; or contains casts (outside operands to sizeof
operators) other than conversions of arithmetic types to arithmetic types (6.6).
— The value of an object is accessed by an array-subscript [], member-access . or −>,
address &, or indirection * operator or a pointer cast in creating an address constant
(6.6).
— An identifier for an object is declared with no linkage and the type of the object is
incomplete after its declarator, or after its init-declarator if it has an initializer (6.7).
— A function is declared at block scope with an explicit storage-class specifier other
than extern (6.7.1).
— A structure or union is defined as containing no named members (<IP_ADDRESS>).
— An attempt is made to access, or generate a pointer to just past, a flexible array
member of a structure when the referenced object provides no elements for that array
(<IP_ADDRESS>).
— When the complete type is needed, an incomplete structure or union type is not
completed in the same scope by another declaration of the tag that defines the content
(<IP_ADDRESS>).
— An attempt is made to modify an object defined with a const-qualified type through
use of an lvalue with non-const-qualified type (6.7.3).
— An attempt is made to refer to an object defined with a volatile-qualified type through
use of an lvalue with non-volatile-qualified type (6.7.3).
— The specification of a function type includes any type qualifiers (6.7.3).
— Two qualified types that are required to be compatible do not have the identically
qualified version of a compatible type (6.7.3).
— An object which has been modified is accessed through a restrict-qualified pointer to
a const-qualified type, or through a restrict-qualified pointer and another pointer that
are not both based on the same object (<IP_ADDRESS>).
— A restrict-qualified pointer is assigned a value based on another restricted pointer
whose associated block neither began execution before the block associated with this
pointer, nor ended before the assignment (<IP_ADDRESS>).
— A function with external linkage is declared with an inline function specifier, but is
not also defined in the same translation unit (6.7.4).
— Two pointer types that are required to be compatible are not identically qualified, or
are not pointers to compatible types (<IP_ADDRESS>).
— The size expression in an array declaration is not a constant expression and evaluates
at program execution time to a nonpositive value (<IP_ADDRESS>).
— In a context requiring two array types to be compatible, they do not have compatible
element types, or their size specifiers evaluate to unequal values (<IP_ADDRESS>).
— A declaration of an array parameter includes the keyword static within the [ and
] and the corresponding argument does not provide access to the first element of an
array with at least the specified number of elements (<IP_ADDRESS>).
— A storage-class specifier or type qualifier modifies the keyword void as a function
parameter type list (<IP_ADDRESS>).
— In a context requiring two function types to be compatible, they do not have
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
identifier list) (<IP_ADDRESS>).
— The value of an unnamed member of a structure or union is used (6.7.8).
— The initializer for a scalar is neither a single expression nor a single expression
enclosed in braces (6.7.8).
— The initializer for a structure or union object that has automatic storage duration is
neither an initializer list nor a single expression that has compatible structure or union
type (6.7.8).
— The initializer for an aggregate or union, other than an array initialized by a string
literal, is not a brace-enclosed list of initializers for its elements or members (6.7.8).
— An identifier with external linkage is used, but in the program there does not exist
exactly one external definition for the identifier, or the identifier is not used and there
exist multiple external definitions for the identifier (6.9).
— A function definition includes an identifier list, but the types of the parameters are not
declared in a following declaration list (6.9.1).
— An adjusted parameter type in a function definition is not an object type (6.9.1).
— A function that accepts a variable number of arguments is defined without a
parameter type list that ends with the ellipsis notation (6.9.1).
— The } that terminates a function is reached, and the value of the function call is used
by the caller (6.9.1).
— An identifier for an object with internal linkage and an incomplete type is declared
with a tentative definition (6.9.2).
— The token defined is generated during the expansion of a #if or #elif
preprocessing directive, or the use of the defined unary operator does not match
one of the two specified forms prior to macro replacement (6.10.1).
— The #include preprocessing directive that results after expansion does not match
one of the two header name forms (6.10.2).
— The character sequence in an #include preprocessing directive does not start with a
letter (6.10.2).
— There are sequences of preprocessing tokens within the list of macro arguments that
would otherwise act as preprocessing directives (6.10.3).
— The result of the preprocessing operator # is not a valid character string literal
(<IP_ADDRESS>).
— The result of the preprocessing operator ## is not a valid preprocessing token
(<IP_ADDRESS>).
— The #line preprocessing directive that results after expansion does not match one of
the two well-defined forms, or its digit sequence specifies zero or a number greater
than<PHONE_NUMBER> (6.10.4).
— A non-STDC #pragma preprocessing directive that is documented as causing
translation failure or some other form of undefined behavior is encountered (6.10.6).
— A #pragma STDC preprocessing directive does not match one of the well-defined
forms (6.10.6).
— The name of a predefined macro, or the identifier defined, is the subject of a
#define or #undef preprocessing directive (6.10.8).
— An attempt is made to copy an object to an overlapping object by use of a library
function, other than as explicitly allowed (e.g., memmove) (clause 7).
— A file with the same name as one of the standard headers, not provided as part of the
implementation, is placed in any of the standard places that are searched for included
source files (7.1.2).
— A header is included within an external declaration or definition (7.1.2).
— A function, object, type, or macro that is specified as being declared or defined by
some standard header is used before any header that declares or defines it is included
(7.1.2).
— A standard header is included while a macro is defined with the same name as a
keyword (7.1.2).
— The program attempts to declare a library function itself, rather than via a standard
header, but the declaration does not have external linkage (7.1.2).
— The program declares or defines a reserved identifier, other than as allowed by 7.1.4
(7.1.3).
— The program removes the definition of a macro whose name begins with an
underscore and either an uppercase letter or another underscore (7.1.3).
— An argument to a library function has an invalid value or a type not expected by a
function with variable number of arguments (7.1.4).
— The pointer passed to a library function array parameter does not have a value such
that all address computations and object accesses are valid (7.1.4).
— The macro definition of assert is suppressed in order to access an actual function
(7.2).
— 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
declarations and statements inside a compound statement (7.3.4, 7.6.1, 7.12.2).
— The value of an argument to a character handling function is neither equal to the value
of EOF nor representable as an unsigned char (7.4).
— A macro definition of errno is suppressed in order to access an actual object, or the
program defines an identifier with the name errno (7.5).
— Part of the program tests floating-point status flags, sets floating-point control modes,
or runs under non-default mode settings, but was translated with the state for the
FENV_ACCESS pragma ‘‘off’’ (7.6.1).
— The exception-mask argument for one of the functions that provide access to the
floating-point status flags has a nonzero value not obtained by bitwise OR of the
floating-point exception macros (7.6.2).
— The fesetexceptflag function is used to set floating-point status flags that were
not specified in the call to the fegetexceptflag function that provided the value
of the corresponding fexcept_t object (<IP_ADDRESS>).
— The argument to fesetenv or feupdateenv is neither an object set by a call to
fegetenv or feholdexcept, nor is it an environment macro (<IP_ADDRESS>, <IP_ADDRESS>).
— The value of the result of an integer arithmetic or conversion function cannot be
represented (<IP_ADDRESS>, <IP_ADDRESS>, <IP_ADDRESS>, <IP_ADDRESS>, <IP_ADDRESS>, <IP_ADDRESS>, 7.20.1).
— The program modifies the string pointed to by the value returned by the setlocale
function (<IP_ADDRESS>).
— The program modifies the structure pointed to by the value returned by the
localeconv function (<IP_ADDRESS>).
— A macro definition of math_errhandling is suppressed or the program defines
an identifier with the name math_errhandling (7.12).
— An argument to a floating-point classification or comparison macro is not of real
floating type (7.12.3, 7.12.14).
— A macro definition of setjmp is suppressed in order to access an actual function, or
the program defines an external identifier with the name setjmp (7.13).
— An invocation of the setjmp macro occurs other than in an allowed context
(<IP_ADDRESS>).
— The longjmp function is invoked to restore a nonexistent environment (<IP_ADDRESS>).
— After a longjmp, there is an attempt to access the value of an object of automatic
storage class with non-volatile-qualified type, local to the function containing the
invocation of the corresponding setjmp macro, that was changed between the
setjmp invocation and longjmp call (<IP_ADDRESS>).
— The program specifies an invalid pointer to a signal handler function (<IP_ADDRESS>).
— A signal handler returns when the signal corresponded to a computational exception
(<IP_ADDRESS>).
— A signal occurs as the result of calling the abort or raise function, and the signal
handler calls the raise function (<IP_ADDRESS>).
— A signal occurs other than as the result of calling the abort or raise function, and
the signal handler refers to an object with static storage duration other than by
assigning a value to an object declared as volatile sig_atomic_t, or calls any
function in the standard library other than the abort function, the _Exit function,
or the signal function (for the same signal number) (<IP_ADDRESS>).
— The value of errno is referred to after a signal occurred other than as the result of
calling the abort or raise function and the corresponding signal handler obtained
a SIG_ERR return from a call to the signal function (<IP_ADDRESS>).
— A signal is generated by an asynchronous signal handler (<IP_ADDRESS>).
— A function with a variable number of arguments attempts to access its varying
arguments other than through a properly declared and initialized va_list object, or
before the va_start macro is invoked (7.15, <IP_ADDRESS>, <IP_ADDRESS>).
— The macro va_arg is invoked using the parameter ap that was passed to a function
that invoked the macro va_arg with the same parameter (7.15).
— A macro definition of va_start, va_arg, va_copy, or va_end is suppressed in
order to access an actual function, or the program defines an external identifier with
the name va_copy or va_end (7.15.1).
— The va_start or va_copy macro is invoked without a corresponding invocation
of the va_end macro in the same function, or vice versa (7.15.1, <IP_ADDRESS>, <IP_ADDRESS>,
<IP_ADDRESS>).
— The type parameter to the va_arg macro is not such that a pointer to an object of
that type can be obtained simply by postfixing a * (<IP_ADDRESS>).
— The va_arg macro is invoked when there is no actual next argument, or with a
specified type that is not compatible with the promoted type of the actual next
argument, with certain exceptions (<IP_ADDRESS>).
— The va_copy or va_start macro is called to initialize a va_list that was
previously initialized by either macro without an intervening invocation of the
va_end macro for the same va_list (<IP_ADDRESS>, <IP_ADDRESS>).
— 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 (<IP_ADDRESS>).
— The member designator parameter of an offsetof macro is an invalid right
operand of the . operator for the type parameter, or designates a bit-field (7.17).
— The argument in an instance of one of the integer-constant macros is not a decimal,
octal, or hexadecimal constant, or it has a value that exceeds the limits for the
corresponding type (7.18.4).
— A byte input/output function is applied to a wide-oriented stream, or a wide character
input/output function is applied to a byte-oriented stream (7.19.2).
— Use is made of any portion of a file beyond the most recent wide character written to
a wide-oriented stream (7.19.2).
— The value of a pointer to a FILE object is used after the associated file is closed
(7.19.3).
— The stream for the fflush function points to an input stream or to an update stream
in which the most recent operation was input (<IP_ADDRESS>).
— The string pointed to by the mode argument in a call to the fopen function does not
exactly match one of the specified character sequences (<IP_ADDRESS>).
— 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
operation on an update stream is followed by an output operation with an intervening
call to a file positioning function (<IP_ADDRESS>).
— An attempt is made to use the contents of the array that was supplied in a call to the
setvbuf function (<IP_ADDRESS>).
— There are insufficient arguments for the format in a call to one of the formatted
input/output functions, or an argument does not have an appropriate type (<IP_ADDRESS>,
<IP_ADDRESS>, <IP_ADDRESS>, <IP_ADDRESS>).
— The format in a call to one of the formatted input/output functions or to the
strftime or wcsftime function is not a valid multibyte character sequence that
begins and ends in its initial shift state (<IP_ADDRESS>, <IP_ADDRESS>, <IP_ADDRESS>, <IP_ADDRESS>, <IP_ADDRESS>,
<IP_ADDRESS>).
— In a call to one of the formatted output functions, a precision appears with a
conversion specifier other than those described (<IP_ADDRESS>, <IP_ADDRESS>).
— A conversion specification for a formatted output function uses an asterisk to denote
an argument-supplied field width or precision, but the corresponding argument is not
provided (<IP_ADDRESS>, <IP_ADDRESS>).
— A conversion specification for a formatted output function uses a # or 0 flag with a
conversion specifier other than those described (<IP_ADDRESS>, <IP_ADDRESS>).
— A conversion specification for one of the formatted input/output functions uses a
length modifier with a conversion specifier other than those described (<IP_ADDRESS>,
<IP_ADDRESS>, <IP_ADDRESS>, <IP_ADDRESS>).
— An s conversion specifier is encountered by one of the formatted output functions,
and the argument is missing the null terminator (unless a precision is specified that
does not require null termination) (<IP_ADDRESS>, <IP_ADDRESS>).
— An n conversion specification for one of the formatted input/output functions includes
any flags, an assignment-suppressing character, a field width, or a precision (<IP_ADDRESS>,
<IP_ADDRESS>, <IP_ADDRESS>, <IP_ADDRESS>).
— A % conversion specifier is encountered by one of the formatted input/output
functions, but the complete conversion specification is not exactly %% (<IP_ADDRESS>,
<IP_ADDRESS>, <IP_ADDRESS>, <IP_ADDRESS>).
— An invalid conversion specification is found in the format for one of the formatted
input/output functions, or the strftime or wcsftime function (<IP_ADDRESS>, <IP_ADDRESS>,
<IP_ADDRESS>, <IP_ADDRESS>, <IP_ADDRESS>, <IP_ADDRESS>).
— The number of characters transmitted by a formatted output function is greater than
INT_MAX (<IP_ADDRESS>, <IP_ADDRESS>, <IP_ADDRESS>, <IP_ADDRESS>).
— The result of a conversion by one of the formatted input functions cannot be
represented in the corresponding object, or the receiving object does not have an
appropriate type (<IP_ADDRESS>, <IP_ADDRESS>).
— A c, s, or [ conversion specifier is encountered by one of the formatted input
functions, and the array pointed to by the corresponding argument is not large enough
to accept the input sequence (and a null terminator if the conversion specifier is s or
[) (<IP_ADDRESS>, <IP_ADDRESS>).
— A c, s, or [ conversion specifier with an l qualifier is encountered by one of the
formatted input functions, but the input is not a valid multibyte character sequence
that begins in the initial shift state (<IP_ADDRESS>, <IP_ADDRESS>).
— The input item for a %p conversion by one of the formatted input functions is not a
value converted earlier during the same program execution (<IP_ADDRESS>, <IP_ADDRESS>).
— The vfprintf, vfscanf, vprintf, vscanf, vsnprintf, vsprintf,
vsscanf, vfwprintf, vfwscanf, vswprintf, vswscanf, vwprintf, or
vwscanf function is called with an improperly initialized va_list argument, or
the argument is used (other than in an invocation of va_end) after the function
returns (<IP_ADDRESS>, <IP_ADDRESS>, <IP_ADDRESS>, <IP_ADDRESS>, <IP_ADDRESS>, <IP_ADDRESS>, <IP_ADDRESS>,
<IP_ADDRESS>, <IP_ADDRESS>, <IP_ADDRESS>, <IP_ADDRESS>, <IP_ADDRESS>, <IP_ADDRESS>).
— The contents of the array supplied in a call to the fgets, gets, or fgetws function
— The file position indicator for a binary stream is used after a call to the ungetc
function where its value was zero before the call (<IP_ADDRESS>).
— The file position indicator for a stream is used after an error occurred during a call to
the fread or fwrite function (<IP_ADDRESS>, <IP_ADDRESS>).
— A partial element read by a call to the fread function is used (<IP_ADDRESS>).
— The fseek function is called for a text stream with a nonzero offset and either the
offset was not returned by a previous successful call to the ftell function on a
stream associated with the same file or whence is not SEEK_SET (<IP_ADDRESS>).
— The fsetpos function is called to set a position that was not returned by a previous
successful call to the fgetpos function on a stream associated with the same file
(<IP_ADDRESS>).
— A non-null pointer returned by a call to the calloc, malloc, or realloc function
with a zero requested size is used to access an object (7.20.3).
— The value of a pointer that refers to space deallocated by a call to the free or
realloc function is used (7.20.3).
— The pointer argument to the free or realloc function does not match a pointer
earlier returned by calloc, malloc, or realloc, or the space has been
deallocated by a call to free or realloc (<IP_ADDRESS>, <IP_ADDRESS>).
— The value of the object allocated by the malloc function is used (<IP_ADDRESS>).
— The value of any bytes in a new object allocated by the realloc function beyond
the size of the old object are used (<IP_ADDRESS>).
— The program executes more than one call to the exit function (<IP_ADDRESS>).
— During the call to a function registered with the atexit function, a call is made to
the longjmp function that would terminate the call to the registered function
(<IP_ADDRESS>).
— The string set up by the getenv or strerror function is modified by the program
(<IP_ADDRESS>, <IP_ADDRESS>).
— A command is executed through the system function in a way that is documented as
causing termination or some other form of undefined behavior (<IP_ADDRESS>).
— A searching or sorting utility function is called with an invalid pointer argument, even
if the number of elements is zero (7.20.5).
— The comparison function called by a searching or sorting utility function alters the
contents of the array being searched or sorted, or returns ordering values
inconsistently (7.20.5).
— The array being searched by the bsearch function does not have its elements in
proper order (<IP_ADDRESS>).
— The current conversion state is used by a multibyte/wide character conversion
function after changing the LC_CTYPE category (7.20.7).
— A string or wide string utility function is instructed to access an array beyond the end
of an object (7.21.1, 7.24.4).
— A string or wide string utility function is called with an invalid pointer argument, even
if the length is zero (7.21.1, 7.24.4).
— The contents of the destination array are used after a call to the strxfrm,
strftime, wcsxfrm, or wcsftime function in which the specified length was
too small to hold the entire null-terminated result (<IP_ADDRESS>, <IP_ADDRESS>, <IP_ADDRESS>.4,
<IP_ADDRESS>).
— The first argument in the very first call to the strtok or wcstok is a null pointer
(<IP_ADDRESS>, <IP_ADDRESS>.7).
— The type of an argument to a type-generic macro is not compatible with the type of
the corresponding parameter of the selected function (7.22).
— A complex argument is supplied for a generic parameter of a type-generic macro that
has no corresponding complex function (7.22).
— The argument corresponding to an s specifier without an l qualifier in a call to the
fwprintf function does not point to a valid multibyte character sequence that
begins in the initial shift state (<IP_ADDRESS>).
— In a call to the wcstok function, the object pointed to by ptr does not have the
value stored by the previous call for the same wide string (<IP_ADDRESS>.7).
— An mbstate_t object is used inappropriately (7.24.6).
— The value of an argument of type wint_t to a wide character classification or case
mapping function is neither equal to the value of WEOF nor representable as a
wchar_t (7.25.1).
— The iswctype function is called using a different LC_CTYPE category from the
one in effect for the call to the wctype function that returned the description
(<IP_ADDRESS>.1).
— The towctrans function is called using a different LC_CTYPE category from the
one in effect for the call to the wctrans function that returned the description
(<IP_ADDRESS>.1).
J.3 [Implementation-defined behavior]
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:
J.3.1 [Translation]
1 — How a diagnostic is identified (3.10, <IP_ADDRESS>).
— Whether each nonempty sequence of white-space characters other than new-line is
retained or replaced by one space character in translation phase 3 (<IP_ADDRESS>).
J.3.2 [Environment]
1 — The mapping between physical source file multibyte characters and the source
character set in translation phase 1 (<IP_ADDRESS>).
— The name and type of the function called at program startup in a freestanding
environment (<IP_ADDRESS>).
— The effect of program termination in a freestanding environment (<IP_ADDRESS>).
— An alternative manner in which the main function may be defined (<IP_ADDRESS>.1).
— The values given to the strings pointed to by the argv argument to main (<IP_ADDRESS>.1).
— What constitutes an interactive device (<IP_ADDRESS>).
— The set of signals, their semantics, and their default handling (7.14).
— Signal values other than SIGFPE, SIGILL, and SIGSEGV that correspond to a
computational exception (<IP_ADDRESS>).
— Signals for which the equivalent of signal(sig, SIG_IGN); is executed at
program startup (<IP_ADDRESS>).
— The set of environment names and the method for altering the environment list used
by the getenv function (<IP_ADDRESS>).
— The manner of execution of the string by the system function (<IP_ADDRESS>).
J.3.3 [Identifiers]
1 — Which additional multibyte characters may appear in identifiers and their
correspondence to universal character names (6.4.2).
— The number of significant initial characters in an identifier (<IP_ADDRESS>, 6.4.2).
J.3.4 [Characters]
1 — The number of bits in a byte (3.6).
— The values of the members of the execution character set (5.2.1).
— The unique value of the member of the execution character set produced for each of
the standard alphabetic escape sequences (5.2.2).
— The value of a char object into which has been stored any character other than a
member of the basic execution character set (6.2.5).
— Which of signed char or unsigned char has the same range, representation,
and behavior as ‘‘plain’’ char (6.2.5, <IP_ADDRESS>).
— The mapping of members of the source character set (in character constants and string
literals) to members of the execution character set (<IP_ADDRESS>, <IP_ADDRESS>).
— The value of an integer character constant containing more than one character or
containing a character or escape sequence that does not map to a single-byte
execution character (<IP_ADDRESS>).
— The value of a wide character constant containing more than one multibyte character,
or containing a multibyte character or escape sequence not represented in the
extended execution character set (<IP_ADDRESS>).
— The current locale used to convert a wide character constant consisting of a single
multibyte character that maps to a member of the extended execution character set
into a corresponding wide character code (<IP_ADDRESS>).
— The current locale used to convert a wide string literal into corresponding wide
character codes (6.4.5).
— The value of a string literal containing a multibyte character or escape sequence not
represented in the execution character set (6.4.5).
J.3.5 [Integers]
1 — Any extended integer types that exist in the implementation (6.2.5).
— Whether signed integer types are represented using sign and magnitude, two’s
complement, or ones’ complement, and whether the extraordinary value is a trap
representation or an ordinary value (<IP_ADDRESS>).
— The rank of any extended integer type relative to another extended integer type with
the same precision (<IP_ADDRESS>).
— 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 (<IP_ADDRESS>).
— The results of some bitwise operations on signed integers (6.5).
J.3.6 [Floating point]
1 — The accuracy of the floating-point operations and of the library functions in
<math.h> and <complex.h> that return floating-point results (<IP_ADDRESS>.2).
— The accuracy of the conversions between floating-point internal representations and
string representations performed by the library functions in <stdio.h>,
<stdlib.h>, and <wchar.h> (<IP_ADDRESS>.2).
— The rounding behaviors characterized by non-standard values of FLT_ROUNDS
(<IP_ADDRESS>.2).
— The evaluation methods characterized by non-standard negative values of
FLT_EVAL_METHOD (<IP_ADDRESS>.2).
— The direction of rounding when an integer is converted to a floating-point number that
cannot exactly represent the original value (<IP_ADDRESS>).
— The direction of rounding when a floating-point number is converted to a narrower
floating-point number (<IP_ADDRESS>).
— How the nearest representable value or the larger or smaller representable value
immediately adjacent to the nearest representable value is chosen for certain floating
constants (<IP_ADDRESS>).
— Whether and how floating expressions are contracted when not disallowed by the
FP_CONTRACT pragma (6.5).
— The default state for the FENV_ACCESS pragma (7.6.1).
— Additional floating-point exceptions, rounding modes, environments, and
classifications, and their macro names (7.6, 7.12).
— The default state for the FP_CONTRACT pragma (7.12.2). ∗
J.3.7 [Arrays and pointers]
1 — The result of converting a pointer to an integer or vice versa (<IP_ADDRESS>).
— The size of the result of subtracting two pointers to elements of the same array
(6.5.6).
J.3.8 [Hints]
1 — The extent to which suggestions made by using the register storage-class
specifier are effective (6.7.1).
— The extent to which suggestions made by using the inline function specifier are
effective (6.7.4).
J.3.9 [Structures, unions, enumerations, and bit-fields]
1 — Whether a ‘‘plain’’ int bit-field is treated as a signed int bit-field or as an
unsigned int bit-field (6.7.2, <IP_ADDRESS>).
— Allowable bit-field types other than _Bool, signed int, and unsigned int
(<IP_ADDRESS>).
— Whether a bit-field can straddle a storage-unit boundary (<IP_ADDRESS>).
— The order of allocation of bit-fields within a unit (<IP_ADDRESS>).
— The alignment of non-bit-field members of structures (<IP_ADDRESS>). This should present
no problem unless binary data written by one implementation is read by another.
— The integer type compatible with each enumerated type (<IP_ADDRESS>).
J.3.10 [Qualifiers]
1 — What constitutes an access to an object that has volatile-qualified type (6.7.3).
J.3.11 [Preprocessing directives]
1 — The locations within #pragma directives where header name preprocessing tokens
are recognized (6.4, 6.4.7).
— How sequences in both forms of header names are mapped to headers or external
source file names (6.4.7).
— Whether the value of a character constant in a constant expression that controls
conditional inclusion matches the value of the same character constant in the
execution character set (6.10.1).
— 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).
— The places that are searched for an included < > delimited header, and how the places
are specified or the header is identified (6.10.2).
— How the named source file is searched for in an included " " delimited header
(6.10.2).
— The method by which preprocessing tokens (possibly resulting from macro
expansion) in a #include directive are combined into a header name (6.10.2).
— The nesting limit for #include processing (6.10.2).
— Whether the # operator inserts a \ character before the \ character that begins a
universal character name in a character constant or string literal (<IP_ADDRESS>).
— The behavior on each recognized non-STDC #pragma directive (6.10.6).
— The definitions for _ _DATE_ _ and _ _TIME_ _ when respectively, the date and
time of translation are not available (6.10.8).
J.3.12 [Library functions]
1 — Any library facilities available to a freestanding program, other than the minimal set
required by clause 4 (<IP_ADDRESS>).
— The format of the diagnostic printed by the assert macro (<IP_ADDRESS>).
— The representation of the floating-point status flags stored by the
fegetexceptflag function (<IP_ADDRESS>).
— Whether the feraiseexcept function raises the ‘‘inexact’’ floating-point
exception in addition to the ‘‘overflow’’ or ‘‘underflow’’ floating-point exception
(<IP_ADDRESS>).
— Strings other than "C" and "" that may be passed as the second argument to the
setlocale function (<IP_ADDRESS>).
— The types defined for float_t and double_t when the value of the
FLT_EVAL_METHOD macro is less than 0 (7.12).
— Domain errors for the mathematics functions, other than those required by this
International Standard (7.12.1).
— The values returned by the mathematics functions on domain errors (7.12.1).
— The values returned by the mathematics functions on underflow range errors, whether
errno is set to the value of the macro ERANGE when the integer expression
math_errhandling & MATH_ERRNO is nonzero, and whether the ‘‘underflow’’
floating-point exception is raised when the integer expression math_errhandling
& MATH_ERREXCEPT is nonzero. (7.12.1).
— Whether a domain error occurs or zero is returned when an fmod function has a
second argument of zero (<IP_ADDRESS>).
— Whether a domain error occurs or zero is returned when a remainder function has
a second argument of zero (<IP_ADDRESS>).
— The base-2 logarithm of the modulus used by the remquo functions in reducing the
quotient (<IP_ADDRESS>).
— Whether a domain error occurs or zero is returned when a remquo function has a
second argument of zero (<IP_ADDRESS>).
— Whether the equivalent of signal(sig, SIG_DFL); is executed prior to the call
of a signal handler, and, if not, the blocking of signals that is performed (<IP_ADDRESS>).
— The null pointer constant to which the macro NULL expands (7.17).
— Whether the last line of a text stream requires a terminating new-line character
(7.19.2).
— Whether space characters that are written out to a text stream immediately before a
new-line character appear when read in (7.19.2).
— The number of null characters that may be appended to data written to a binary
stream (7.19.2).
— Whether the file position indicator of an append-mode stream is initially positioned at
the beginning or end of the file (7.19.3).
— Whether a write on a text stream causes the associated file to be truncated beyond that
point (7.19.3).
— The characteristics of file buffering (7.19.3).
— Whether a zero-length file actually exists (7.19.3).
— The rules for composing valid file names (7.19.3).
— Whether the same file can be simultaneously open multiple times (7.19.3).
— The nature and choice of encodings used for multibyte characters in files (7.19.3).
— The effect of the remove function on an open file (<IP_ADDRESS>).
— The effect if a file with the new name exists prior to a call to the rename function
(<IP_ADDRESS>).
— Whether an open temporary file is removed upon abnormal program termination
(<IP_ADDRESS>).
— Which changes of mode are permitted (if any), and under what circumstances
(<IP_ADDRESS>).
— The style used to print an infinity or NaN, and the meaning of any n-char or n-wchar
sequence printed for a NaN (<IP_ADDRESS>, <IP_ADDRESS>).
— The output for %p conversion in the fprintf or fwprintf function (<IP_ADDRESS>,
<IP_ADDRESS>).
— 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
— The set of sequences matched by a %p conversion and the interpretation of the
corresponding input item in the fscanf or fwscanf function (<IP_ADDRESS>, <IP_ADDRESS>).
— The value to which the macro errno is set by the fgetpos, fsetpos, or ftell
functions on failure (<IP_ADDRESS>, <IP_ADDRESS>, <IP_ADDRESS>).
— The meaning of any n-char or n-wchar sequence in a string representing a NaN that is
converted by the strtod, strtof, strtold, wcstod, wcstof, or wcstold
function (<IP_ADDRESS>, <IP_ADDRESS>.1).
— Whether or not the strtod, strtof, strtold, wcstod, wcstof, or wcstold
function sets errno to ERANGE when underflow occurs (<IP_ADDRESS>, <IP_ADDRESS>.1).
— Whether the calloc, malloc, and realloc functions return a null pointer or a
pointer to an allocated object when the size requested is zero (7.20.3).
— Whether open streams with unwritten buffered data are flushed, open streams are
closed, or temporary files are removed when the abort or _Exit function is called
(<IP_ADDRESS>, <IP_ADDRESS>).
— The termination status returned to the host environment by the abort, exit, or
_Exit function (<IP_ADDRESS>, <IP_ADDRESS>, <IP_ADDRESS>).
— The value returned by the system function when its argument is not a null pointer
(<IP_ADDRESS>).
— The local time zone and Daylight Saving Time (7.23.1).
— The range and precision of times representable in clock_t and time_t (7.23).
— The era for the clock function (<IP_ADDRESS>).
— The replacement string for the %Z specifier to the strftime, and wcsftime
functions in the "C" locale (<IP_ADDRESS>, <IP_ADDRESS>).
— Whether the functions in <math.h> honor the rounding direction mode in an
IEC 60559 conformant implementation, unless explicitly specified otherwise (F.9).
J.3.13 [Architecture]
1 — The values or expressions assigned to the macros specified in the headers
<float.h>, <limits.h>, and <stdint.h> (<IP_ADDRESS>, 7.18.2, 7.18.3).
— The number, order, and encoding of bytes in any object (when not explicitly specified
in this International Standard) (<IP_ADDRESS>).
— The value of the result of the sizeof operator (<IP_ADDRESS>).
J.4 [Locale-specific behavior]
1 The following characteristics of a hosted environment are locale-specific and are required
to be documented by the implementation:
— Additional members of the source and execution character sets beyond the basic
character set (5.2.1).
— The presence, meaning, and representation of additional multibyte characters in the
execution character set beyond the basic character set (<IP_ADDRESS>).
— The shift states used for the encoding of multibyte characters (<IP_ADDRESS>).
— The direction of writing of successive printing characters (5.2.2).
— The decimal-point character (7.1.1).
— The set of printing characters (7.4, 7.25.2).
— The set of control characters (7.4, 7.25.2).
— The sets of characters tested for by the isalpha, isblank, islower, ispunct,
isspace, isupper, iswalpha, iswblank, iswlower, iswpunct,
iswspace, or iswupper functions (<IP_ADDRESS>, <IP_ADDRESS>, <IP_ADDRESS>, <IP_ADDRESS>, <IP_ADDRESS>,
<IP_ADDRESS>, <IP_ADDRESS>.2, <IP_ADDRESS>.3, <IP_ADDRESS>.7, <IP_ADDRESS>.9, <IP_ADDRESS>.10, <IP_ADDRESS>.11).
— The native environment (<IP_ADDRESS>).
— Additional subject sequences accepted by the numeric conversion functions (7.20.1,
<IP_ADDRESS>).
— The collation sequence of the execution character set (<IP_ADDRESS>, <IP_ADDRESS>.2).
— The contents of the error message strings set up by the strerror function
(<IP_ADDRESS>).
— The formats for time and date (<IP_ADDRESS>, <IP_ADDRESS>).
— Character mappings that are supported by the towctrans function (7.25.1).
— Character classifications that are supported by the iswctype function (7.25.1).
J.5 [Common extensions]
1 The following extensions are widely used in many systems, but are not portable to all
implementations. The inclusion of any extension that may cause a strictly conforming
program to become invalid renders an implementation nonconforming. Examples of such
extensions are new keywords, extra library functions declared in standard headers, or
predefined macros with names that do not begin with an underscore.
J.5.1 [Environment arguments]
1 In a hosted environment, the main function receives a third argument, char *envp[],
that points to a null-terminated array of pointers to char, each of which points to a string
that provides information about the environment for this execution of the program
(<IP_ADDRESS>.1).
J.5.2 [Specialized identifiers]
1 Characters other than the underscore _, letters, and digits, that are not part of the basic
source character set (such as the dollar sign $, or characters in national character sets)
may appear in an identifier (6.4.2).
J.5.3 [Lengths and cases of identifiers]
1 All characters in identifiers (with or without external linkage) are significant (6.4.2).
J.5.4 [Scopes of identifiers]
1 A function identifier, or the identifier of an object the declaration of which contains the
keyword extern, has file scope (6.2.1).
J.5.5 [Writable string literals]
1 String literals are modifiable (in which case, identical string literals should denote distinct
objects) (6.4.5).
J.5.6 [Other arithmetic types]
1 Additional arithmetic types, such as _ _int128 or double double, and their
appropriate conversions are defined (6.2.5, 6.3.1). Additional floating types may have
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.
J.5.7 [Function pointer casts]
1 A pointer to an object or to void may be cast to a pointer to a function, allowing data to
be invoked as a function (6.5.4).
2 A pointer to a function may be cast to a pointer to an object or to void, allowing a
function to be inspected or modified (for example, by a debugger) (6.5.4).
J.5.8 [Extended bit-field types]
1 A bit-field may be declared with a type other than _Bool, unsigned int, or
signed int, with an appropriate maximum width (<IP_ADDRESS>).
J.5.9 [The fortran keyword]
1 The fortran function specifier may be used in a function declaration to indicate that
calls suitable for FORTRAN should be generated, or that a different representation for the
external name is to be generated (6.7.4).
J.5.10 [The asm keyword]
1 The asm keyword may be used to insert assembly language directly into the translator
output (6.8). The most common implementation is via a statement of the form:
asm ( character-string-literal );
J.5.11 [Multiple external definitions]
1 There may be more than one external definition for the identifier of an object, with or
without the explicit use of the keyword extern; if the definitions disagree, or more than
one is initialized, the behavior is undefined (6.9.2).
J.5.12 [Predefined macro names]
1 Macro names that do not begin with an underscore, describing the translation and
execution environments, are defined by the implementation before translation begins
(6.10.8).
J.5.13 [Floating-point status flags]
1 If any floating-point status flags are set on normal termination after all calls to functions
registered by the atexit function have been made (see <IP_ADDRESS>), the implementation
writes some diagnostics indicating the fact to the stderr stream, if it is still open,
J.5.14 [Extra arguments for signal handlers]
1 Handlers for specific signals are called with extra arguments in addition to the signal
number (<IP_ADDRESS>).
J.5.15 [Additional stream types and file-opening modes]
1 Additional mappings from files to streams are supported (7.19.2).
2 Additional file-opening modes may be specified by characters appended to the mode
argument of the fopen function (<IP_ADDRESS>).
J.5.16 [Defined file position indicator]
1 The file position indicator is decremented by each successful call to the ungetc or
ungetwc function for a text stream, except if its value was zero before a call (<IP_ADDRESS>,
<IP_ADDRESS>).
J.5.17 [Math error reporting]
1 Functions declared in <complex.h> and <math.h> raise SIGFPE to report errors
instead of, or in addition to, setting errno or raising floating-point exceptions (7.3,
7.12).


Welcome to Salmon Cookies!
Click here for Pat's Sales Data!
Click here to learn about our history
Unfortunately, Pat has completely run out of merchandise. Check back soon!


Facebook agrees to provide additional documents in California AG data privacy probe
WASHINGTON (Reuters) - Facebook Inc has agreed to turn over additional documents after the California state attorney general’s office went to court earlier this month to compel the social media firm to comply with requests for information in its privacy investigation.
Under a joint stipulation filed in San Francisco Superior Court, the company agreed by Nov. 26 to respond some of the document requests. It also agreed to a schedule to provide additional documents in December and January.
For California’s document requests that remain in dispute, a judge will hold a Feb. 19 hearing. Facebook did not immediately comment.
In July, Facebook agreed to pay a record-breaking $5-billion fine to resolve a Federal Trade Commission probe into its privacy practices and said it would will boost safeguards on user data.
Facebook also faces an investigation by 47 U.S. states and territories over concerns the company engaged in anti-competitive practices, put consumer data at risk and pushed up advertising prices. Additionally, it is under investigation by the FTC and the Justice Department.


| Package | org.restfulx.models |
| Class | public class RxTreeModel |
| Inheritance | RxTreeModel RxModel flash.events.EventDispatcher |
| Property | Defined by | ||
|---|---|---|---|
| attachment : Object any model can have one attachment, this can be either RxFileRefrence or BinaryAttachment
| RxModel | ||
| children : ModelsCollection | RxTreeModel | ||
| cloned : Boolean indicates if this is a clone
| RxModel | ||
| dirty : Boolean can be used to see if this model's properties have been changed
| RxModel | ||
| id : String all models have an id.
| RxModel | ||
| rev : String some models have a revision number
| RxModel | ||
| sync : String tracks if this model needs to be synchornized
| RxModel | ||
| xrev : String if we have a revision number, it's also a good idea to keep track of the previous one
| RxModel |
| Method | Defined by | ||
|---|---|---|---|
|
RxTreeModel(label:String = "id")
| RxTreeModel | ||
|
create(optsOrOnSuccess:Object = null, onFailure:Function = null, nestedBy:Array = null, metadata:Object = null, recursive:Boolean = false, targetServiceId:int = -1, customProcessor:Function = null):void
Wrapper around Rx.models.create
| RxModel | ||
|
destroy(optsOrOnSuccess:Object = null, onFailure:Function = null, nestedBy:Array = null, metadata:Object = null, recursive:Boolean = false, targetServiceId:int = -1, customProcessor:Function = null):void
Wrapper around Rx.models.destroy
| RxModel | ||
|
reload(optsOrOnSuccess:Object = null, onFailure:Function = null, nestedBy:Array = null, metadata:Object = null, fetchDependencies:Boolean = true, useLazyMode:Boolean = true, targetServiceId:int = -1, customProcessor:Function = null):void
Wrapper around Rx.models.reload
| RxModel | ||
|
show(optsOrOnSuccess:Object = null, onFailure:Function = null, nestedBy:Array = null, metadata:Object = null, fetchDependencies:Boolean = true, useLazyMode:Boolean = false, targetServiceId:int = -1, customProcessor:Function = null):Object
Wrapper around Rx.models.show
| RxModel | ||
|
shown():Boolean
Wrapper around Rx.models.shown
| RxModel | ||
|
toString():String
Default toString implementation for models
| RxModel | ||
|
update(optsOrOnSuccess:Object = null, onFailure:Function = null, nestedBy:Array = null, metadata:Object = null, recursive:Boolean = false, targetServiceId:int = -1, customProcessor:Function = null):void
Wrapper around Rx.models.update
| RxModel |
| children | property |
public var children:ModelsCollection
| RxTreeModel | () | constructor |
public function RxTreeModel(label:String = "id")
Parameters
label:String (default = "id ")
|