J.3.12 Library functions
Additional library facilities (5.1.2.1)
Most of the standard library facilities are supported. Some of them—the ones that need an operating system—require a low-level implementation in the application. For more information, see The DLIB runtime environment.
Diagnostic printed by the assert function (7.2.1.1)
filename:linenrexpression‑‑ assertion failed
when the parameter evaluates to zero.
Representation of the floating-point status flags (7.6.2.2)
For information about the floating-point status flags, see fenv.h.
Feraiseexcept raising floating-point exception (7.6.2.3)
For information about the feraiseexcept function raising floating-point exceptions, see Floating-point environment.
Strings passed to the setlocale function (7.11.1.1)
For information about strings passed to the setlocale function, see Locale.
Types defined for float_t and double_t (7.12)
Domain errors (7.12.1)
No function generates other domain errors than what the standard requires.
Return values on domain errors (7.12.1)
Mathematic functions return a floating-point NaN (not a number) for domain errors.
Underflow errors (7.12.1)
Mathematic functions set errno to the macro ERANGE (a macro in errno.h) and return zero for underflow errors.
fmod return value (7.12.10.1)
The fmod function sets errno to a domain error and returns a floating-point NaN when the second argument is zero.
remainder return value (7.12.10.2)
The remainder function sets errno to a domain error and returns a floating-point NaN when the second argument is zero.
The magnitude of remquo (7.12.10.3)
The magnitude is congruent modulo INT_MAX.
remquo return value (7.12.10.3)
The remquo function sets errno to a domain error and returns a floating-point NaN when the second argument is zero.
signal() (7.14.1.1)
The signal part of the library is not supported.
NULL macro (7.19)
Terminating newline character (7.21.2)
Stream functions recognize either newline or endoffile(EOF) as the terminating character for a line.
Space characters before a newline character (7.21.2)
Space characters written to a stream immediately before a newline character are preserved.
Null characters appended to data written to binary streams (7.21.2)
No null characters are appended to data written to binary streams.
File position in append mode (7.21.3)
The file position is initially placed at the beginning of the file when it is opened in append-mode.
Truncation of files (7.21.3)
Whether a write operation on a text stream causes the associated file to be truncated beyond that point, depends on the application-specific implementation of the low-level file routines. See Briefly about input and output (I/O).
File buffering (7.21.3)
An open file can be either block-buffered, line-buffered, or unbuffered.
A zero-length file (7.21.3)
Whether a zero-length file exists depends on the application-specific implementation of the low-level file routines.
Legal file names (7.21.3)
The legality of a filename depends on the application-specific implementation of the low-level file routines.
Number of times a file can be opened (7.21.3)
Whether a file can be opened more than once depends on the application-specific implementation of the low-level file routines.
Multibyte characters in a file (7.21.3)
The encoding of multibyte characters in a file depends on the application-specific implementation of the low-level file routines.
remove() (7.21.4.1)
The effect of a remove operation on an open file depends on the application-specific implementation of the low-level file routines. See Briefly about input and output (I/O).
rename() (7.21.4.2)
The effect of renaming a file to an already existing filename depends on the application-specific implementation of the low-level file routines. See Briefly about input and output (I/O).
Removal of open temporary files (7.21.4.3)
Whether an open temporary file is removed depends on the application-specific implementation of the low-level file routines.
Mode changing (7.21.5.4)
freopen closes the named stream, then reopens it in the new mode. The streams stdin, stdout, and stderr can be reopened in any new mode.
Style for printing infinity or NaN (7.21.6.1, 7.29.2.1)
The style used for printing infinity or NaN for a floating-point constant is inf and nan (INF and NAN for the F conversion specifier), respectively. The n-char-sequence is not used for nan.
%p in printf() (7.21.6.1, 7.29.2.1)
The argument to a %p conversion specifier, print pointer, to printf() is treated as having the type void *. The value will be printed as a hexadecimal number, similar to using the %x conversion specifier.
Reading ranges in scanf (7.21.6.2, 7.29.2.1)
A - (dash) character is always treated as a range symbol.
%p in scanf (7.21.6.2, 7.29.2.2)
The %p conversion specifier, scan pointer, to scanf() reads a hexadecimal number and converts it into a value with the type void *.
File position errors (7.21.9.1, 7.21.9.3, 7.21.9.4)
On file position errors, the functions fgetpos, ftell, and fsetpos store EFPOS in errno.
An n-char-sequence after nan (7.22.1.3, 7.29.4.1.1)
An n-char-sequence after a NaN is read and ignored.
errno value at underflow (7.22.1.3, 7.29.4.1.1)
Zero-sized heap objects (7.22.3)
A request for a zero-sized heap object will return a valid pointer and not a null pointer.
Behavior of abort and exit (7.22.4.1, 7.22.4.5)
A call to abort() or _Exit() will not flush stream buffers, not close open streams, and not remove temporary files.
Termination status (7.22.4.1, 7.22.4.4, 7.22.4.5, 7.22.4.7)
The termination status will be propagated to __exit() as a parameter. exit(), _Exit(), and quick_exit use the input parameter, whereas abort uses EXIT_FAILURE.
The system function return value (7.22.4.8)
The system function returns -1 when its argument is not a null pointer.
Range and precision of clock_t and time_t (7.27)
The range and precision of clock_t is up to your implementation. The range and precision of time_t is 19000101 up to 20351231 in tics of a second if the 32-bit time_t is used. It is -9999 up to 9999 years in tics of a second if the 64-bit time_t is used. See time.h
The time zone (7.27.1)
The local time zone and daylight savings time must be defined by the application. For more information, see time.h.
The era for clock() (7.27.2.1)
The era for the clock function is up to your implementation.
TIME_UTC epoch (7.27.2.5)
The epoch for TIME_UTC is up to your implementation.
%Z replacement string (7.27.3.5, 7.29.5.1)
By default, ":" or "" (an empty string) is used as a replacement for %Z. Your application should implement the time zone handling. See __time32, __time64.
Math functions rounding mode (F.10)
The functions in math.h honor the rounding direction mode in FLT-ROUNDS.