I'm specifically looking for the word in the C11 standard (ISO/IEC 9899:2011), or a POSIX page. I checked the POSIX manual for fwrite out, but it doesn't mention undefined behavior at all. However, the manual for fclose does say that
After the call to fclose(), any use of stream results in undefined behavior.
But I still don't see whether a NULL
stream causes UB.