public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
* [Bug libstdc++/38678] [DR XXX] istream::read() calls streambuf::sgetn() [not found] <bug-38678-4@http.gcc.gnu.org/bugzilla/> @ 2010-10-01 11:58 ` jakub at gcc dot gnu.org 2011-04-16 10:45 ` jakub at gcc dot gnu.org ` (2 subsequent siblings) 3 siblings, 0 replies; 11+ messages in thread From: jakub at gcc dot gnu.org @ 2010-10-01 11:58 UTC (permalink / raw) To: gcc-bugs http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38678 Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|4.4.5 |4.4.6 ^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug libstdc++/38678] [DR XXX] istream::read() calls streambuf::sgetn() [not found] <bug-38678-4@http.gcc.gnu.org/bugzilla/> 2010-10-01 11:58 ` [Bug libstdc++/38678] [DR XXX] istream::read() calls streambuf::sgetn() jakub at gcc dot gnu.org @ 2011-04-16 10:45 ` jakub at gcc dot gnu.org 2011-04-28 16:39 ` rguenth at gcc dot gnu.org 2024-06-13 15:26 ` redi at gcc dot gnu.org 3 siblings, 0 replies; 11+ messages in thread From: jakub at gcc dot gnu.org @ 2011-04-16 10:45 UTC (permalink / raw) To: gcc-bugs http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38678 Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|4.4.6 |4.4.7 ^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug libstdc++/38678] [DR XXX] istream::read() calls streambuf::sgetn() [not found] <bug-38678-4@http.gcc.gnu.org/bugzilla/> 2010-10-01 11:58 ` [Bug libstdc++/38678] [DR XXX] istream::read() calls streambuf::sgetn() jakub at gcc dot gnu.org 2011-04-16 10:45 ` jakub at gcc dot gnu.org @ 2011-04-28 16:39 ` rguenth at gcc dot gnu.org 2024-06-13 15:26 ` redi at gcc dot gnu.org 3 siblings, 0 replies; 11+ messages in thread From: rguenth at gcc dot gnu.org @ 2011-04-28 16:39 UTC (permalink / raw) To: gcc-bugs http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38678 Richard Guenther <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|4.4.7 |--- ^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug libstdc++/38678] [DR XXX] istream::read() calls streambuf::sgetn() [not found] <bug-38678-4@http.gcc.gnu.org/bugzilla/> ` (2 preceding siblings ...) 2011-04-28 16:39 ` rguenth at gcc dot gnu.org @ 2024-06-13 15:26 ` redi at gcc dot gnu.org 3 siblings, 0 replies; 11+ messages in thread From: redi at gcc dot gnu.org @ 2024-06-13 15:26 UTC (permalink / raw) To: gcc-bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38678 --- Comment #6 from Jonathan Wakely <redi at gcc dot gnu.org> --- MSVC and libc++ both behave the same as libstdc++, calling rdbuf()->sgetn(): https://github.com/microsoft/STL/blob/e36ee6c2b9bc6f5b1f70776c18cf5d3a93a69798/stl/inc/istream#L522 https://github.com/llvm/llvm-project/blob/525c25acd364f018b4fa55e941bd702587478b1c/libcxx/include/istream#L897 I think at this point it seems pretty clear we should open a new issue as the istream counterpart to https://cplusplus.github.io/LWG/issue165 and make the spec match reality. I can't find an issue on the topic from Martin, so I don't think it was ever opened. ^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug libstdc++/38678] New: istream::read() calls streambuf::xsgetn() @ 2008-12-30 22:24 sebor at roguewave dot com 2009-01-03 22:37 ` [Bug libstdc++/38678] [DR XXX] istream::read() calls streambuf::sgetn() paolo dot carlini at oracle dot com ` (6 more replies) 0 siblings, 7 replies; 11+ messages in thread From: sebor at roguewave dot com @ 2008-12-30 22:24 UTC (permalink / raw) To: gcc-bugs As mentioned in bug 38476, [lib.istream], p2 specifies that: Both [formatted and unformatted] input functions are described as if they obtain (or extract) input characters by calling rdbuf()->sbumpc() or rdbuf()->sgetc(). They may use other public members of istream. sgetc() is required to return the result of underflow() and sbumpc() is required to return the result of uflow(). An implementation of istream::read() may call streambuf::xsgetn() but it must do so in a way that achieves the "as if" effect described above. Notably, it must avoid calling an xsgetn() overridden in a derived class. The test case below shows that the gcc implementation fails to do so. $ cat z.cpp && g++ z.cpp && ./a.out #include <cassert> #include <istream> #include <streambuf> int main () { static int x = '0'; struct: std::streambuf { char c; int_type underflow () { c = x++; setg (&c, &c, &c + 1); return c; } std::streamsize xsgetn (char*, std::streamsize) { assert (!"xsgetn should not be called"); return 0; } } sb; std::istream in (&sb); char s [4] = ""; in.read (s, sizeof s); assert (in.good ()); assert (sizeof s == in.gcount ()); assert ('0' == s [0] && '1' == s [1] && '2' == s [2] && '3' == s [3]); } a.out: z.cpp:19: virtual std::streamsize main()::<anonymous struct>::xsgetn(char*, std::streamsize): Assertion `!"xsgetn should not be called"' failed. Aborted -- Summary: istream::read() calls streambuf::xsgetn() Product: gcc Version: 4.3.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: sebor at roguewave dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38678 ^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug libstdc++/38678] [DR XXX] istream::read() calls streambuf::sgetn() 2008-12-30 22:24 [Bug libstdc++/38678] New: istream::read() calls streambuf::xsgetn() sebor at roguewave dot com @ 2009-01-03 22:37 ` paolo dot carlini at oracle dot com 2009-01-03 22:37 ` paolo dot carlini at oracle dot com ` (5 subsequent siblings) 6 siblings, 0 replies; 11+ messages in thread From: paolo dot carlini at oracle dot com @ 2009-01-03 22:37 UTC (permalink / raw) To: gcc-bugs ------- Comment #5 from paolo dot carlini at oracle dot com 2009-01-03 22:37 ------- Changes reverted for now, consistently with the discussion: http://gcc.gnu.org/ml/gcc-patches/2009-01/msg00004.html Waiting for the resolution of a new DR (# to be added Summary). -- paolo dot carlini at oracle dot com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |REOPENED Resolution|FIXED | Summary|istream::read() calls |[DR XXX] istream::read() |streambuf::sgetn() |calls streambuf::sgetn() http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38678 ^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug libstdc++/38678] [DR XXX] istream::read() calls streambuf::sgetn() 2008-12-30 22:24 [Bug libstdc++/38678] New: istream::read() calls streambuf::xsgetn() sebor at roguewave dot com 2009-01-03 22:37 ` [Bug libstdc++/38678] [DR XXX] istream::read() calls streambuf::sgetn() paolo dot carlini at oracle dot com @ 2009-01-03 22:37 ` paolo dot carlini at oracle dot com 2009-04-21 16:02 ` jakub at gcc dot gnu dot org ` (4 subsequent siblings) 6 siblings, 0 replies; 11+ messages in thread From: paolo dot carlini at oracle dot com @ 2009-01-03 22:37 UTC (permalink / raw) To: gcc-bugs -- paolo dot carlini at oracle dot com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|REOPENED |SUSPENDED http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38678 ^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug libstdc++/38678] [DR XXX] istream::read() calls streambuf::sgetn() 2008-12-30 22:24 [Bug libstdc++/38678] New: istream::read() calls streambuf::xsgetn() sebor at roguewave dot com 2009-01-03 22:37 ` [Bug libstdc++/38678] [DR XXX] istream::read() calls streambuf::sgetn() paolo dot carlini at oracle dot com 2009-01-03 22:37 ` paolo dot carlini at oracle dot com @ 2009-04-21 16:02 ` jakub at gcc dot gnu dot org 2009-07-22 10:35 ` jakub at gcc dot gnu dot org ` (3 subsequent siblings) 6 siblings, 0 replies; 11+ messages in thread From: jakub at gcc dot gnu dot org @ 2009-04-21 16:02 UTC (permalink / raw) To: gcc-bugs -- jakub at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|4.4.0 |4.4.1 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38678 ^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug libstdc++/38678] [DR XXX] istream::read() calls streambuf::sgetn() 2008-12-30 22:24 [Bug libstdc++/38678] New: istream::read() calls streambuf::xsgetn() sebor at roguewave dot com ` (2 preceding siblings ...) 2009-04-21 16:02 ` jakub at gcc dot gnu dot org @ 2009-07-22 10:35 ` jakub at gcc dot gnu dot org 2009-10-15 12:58 ` jakub at gcc dot gnu dot org ` (2 subsequent siblings) 6 siblings, 0 replies; 11+ messages in thread From: jakub at gcc dot gnu dot org @ 2009-07-22 10:35 UTC (permalink / raw) To: gcc-bugs -- jakub at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|4.4.1 |4.4.2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38678 ^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug libstdc++/38678] [DR XXX] istream::read() calls streambuf::sgetn() 2008-12-30 22:24 [Bug libstdc++/38678] New: istream::read() calls streambuf::xsgetn() sebor at roguewave dot com ` (3 preceding siblings ...) 2009-07-22 10:35 ` jakub at gcc dot gnu dot org @ 2009-10-15 12:58 ` jakub at gcc dot gnu dot org 2010-01-21 13:16 ` jakub at gcc dot gnu dot org 2010-04-30 8:59 ` jakub at gcc dot gnu dot org 6 siblings, 0 replies; 11+ messages in thread From: jakub at gcc dot gnu dot org @ 2009-10-15 12:58 UTC (permalink / raw) To: gcc-bugs -- jakub at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|4.4.2 |4.4.3 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38678 ^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug libstdc++/38678] [DR XXX] istream::read() calls streambuf::sgetn() 2008-12-30 22:24 [Bug libstdc++/38678] New: istream::read() calls streambuf::xsgetn() sebor at roguewave dot com ` (4 preceding siblings ...) 2009-10-15 12:58 ` jakub at gcc dot gnu dot org @ 2010-01-21 13:16 ` jakub at gcc dot gnu dot org 2010-04-30 8:59 ` jakub at gcc dot gnu dot org 6 siblings, 0 replies; 11+ messages in thread From: jakub at gcc dot gnu dot org @ 2010-01-21 13:16 UTC (permalink / raw) To: gcc-bugs -- jakub at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|4.4.3 |4.4.4 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38678 ^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug libstdc++/38678] [DR XXX] istream::read() calls streambuf::sgetn() 2008-12-30 22:24 [Bug libstdc++/38678] New: istream::read() calls streambuf::xsgetn() sebor at roguewave dot com ` (5 preceding siblings ...) 2010-01-21 13:16 ` jakub at gcc dot gnu dot org @ 2010-04-30 8:59 ` jakub at gcc dot gnu dot org 6 siblings, 0 replies; 11+ messages in thread From: jakub at gcc dot gnu dot org @ 2010-04-30 8:59 UTC (permalink / raw) To: gcc-bugs -- jakub at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|4.4.4 |4.4.5 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38678 ^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2024-06-13 15:26 UTC | newest] Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- [not found] <bug-38678-4@http.gcc.gnu.org/bugzilla/> 2010-10-01 11:58 ` [Bug libstdc++/38678] [DR XXX] istream::read() calls streambuf::sgetn() jakub at gcc dot gnu.org 2011-04-16 10:45 ` jakub at gcc dot gnu.org 2011-04-28 16:39 ` rguenth at gcc dot gnu.org 2024-06-13 15:26 ` redi at gcc dot gnu.org 2008-12-30 22:24 [Bug libstdc++/38678] New: istream::read() calls streambuf::xsgetn() sebor at roguewave dot com 2009-01-03 22:37 ` [Bug libstdc++/38678] [DR XXX] istream::read() calls streambuf::sgetn() paolo dot carlini at oracle dot com 2009-01-03 22:37 ` paolo dot carlini at oracle dot com 2009-04-21 16:02 ` jakub at gcc dot gnu dot org 2009-07-22 10:35 ` jakub at gcc dot gnu dot org 2009-10-15 12:58 ` jakub at gcc dot gnu dot org 2010-01-21 13:16 ` jakub at gcc dot gnu dot org 2010-04-30 8:59 ` jakub at gcc dot gnu dot org
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).