There are very few failure conditions on output streams that set failbit. The easiest to test, specifically for the output file streams that you are showing, is double-close.
> "when is the fail bit set for output streams, but the bad bit isn't?"
In cases where the ouput operation has failed, but if we clear the failed state and try another correct output operation, it is likely to succeed. For instance,
Cubbi's example above.
> LWS's default options for clang++ select GNU stdlibc++ as the library
Thanks; didn't know that.
EDIT: Alas, -stdlib=libc++ is not supported by LWS.
l