[Bug stdio/32909] char buffer set by setbuf() flushed before fflush() or exit() called
carlos at redhat dot com
sourceware-bugzilla@sourceware.org
Thu May 8 13:18:46 GMT 2025
https://sourceware.org/bugzilla/show_bug.cgi?id=32909
Carlos O'Donell <carlos at redhat dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |carlos at redhat dot com
--- Comment #6 from Carlos O'Donell <carlos at redhat dot com> ---
(In reply to 유서웅 from comment #5)
> (In reply to Andreas Schwab from comment #4)
> > https://pubs.opengroup.org/onlinepubs/9799919799/functions/setvbuf.html
>
> I read the link. Then may I say calling setbuf/setvbuf after any operation
> which affects the stream causes unexpected behaviour?(In this case, "How" is
> flushed before exit(0) called)
Yes, any time the standard (either POSIX or ISO C) requirements are violated it
is considered undefined behaviour. The strongest case is when the standard says
"undefined behaviour", the next strongest case is when the standard says
"shall" and the constraint is violated, and the weakest case is present in
setvbuf where the constraints of runtime use are violated but it is written as
"but before any other operation".
--
You are receiving this mail because:
You are on the CC list for the bug.
More information about the Glibc-bugs
mailing list