[Bug libstdc++/123100] std::ostringstream:str() (r-value version) returns garbage
terra at gnome dot org
gcc-bugzilla@gcc.gnu.org
Fri Dec 12 13:51:39 GMT 2025
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123100
--- Comment #7 from M Welinder <terra at gnome dot org> ---
> What do you expect this to do?
> "Effects: implementation-defined, except that setbuf(0, 0) has no effect."
I expect the writes from then on to go into buf. And that is indeed what
happens with gcc and that has been the case for decades. I understand that
leaving to a different library could leave with with a bleeding foot.
This is perhaps not the nicest part of the library's design
More information about the Gcc-bugs
mailing list