The assert
macro and the perror
function write to the standard error stream. So does the abort_handler_s
function (in optional Annex K).
exit
closes files and flushes streams, so it implicitly acts on the standard error stream. _Exit
and abort
may do so; the C standard permits but does not require it. fflush(NULL)
flushes all streams.
C 2018 7.21.3 3 describes some interaction between input and output streams: Requesting input on an unbuffered stream or on a line buffered stream and that requires characters from the host environment, then line buffered streams are flushed. This may affect the standard error stream.
Per C 2018 Annex J, which is optional, the C implementation may write some floating-point diagnostics to the standard error stream as part of normal program termination.
Searching for “standard error stream” and “stderr”?in the C 2018 standard does not reveal any other implicit uses of the standard error stream in the standard library.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…