[Bug stdio/32909] char buffer set by setbuf() flushed before fflush() or exit() called
singlerr at naver dot com
sourceware-bugzilla@sourceware.org
Thu May 8 13:52:15 GMT 2025
https://sourceware.org/bugzilla/show_bug.cgi?id=32909
--- Comment #7 from 유서웅 <singlerr at naver dot com> ---
(In reply to Carlos O'Donell from comment #6)
> (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".
Thanks!
--
You are receiving this mail because:
You are on the CC list for the bug.
More information about the Glibc-bugs
mailing list