This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

c++/6795: stringbuf failure

>Number:         6795
>Category:       c++
>Synopsis:       stringbuf failure
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          wrong-code
>Submitter-Id:   net
>Arrival-Date:   Fri May 24 03:16:02 PDT 2002
>Originator:     Stein Somers
>Release:        3.1
OPNET Technologies
System: SunOS zweistein 5.6 Generic_105181-20 sun4u sparc SUNW,Ultra-5_10
Architecture: sun4

host: sparc-sun-solaris2.6
build: sparc-sun-solaris2.6
target: sparc-sun-solaris2.6
configured with: ../gcc-3.1/configure --prefix=/opt/gcc-3.1
istringstream doesn't seem to work here since upgrading from 3.0.4.
I didn't run the test suite (very tight on disk space).
SEGV during operator >>, after first underflow() in buffer

#include <sstream>

int main (int argc, char** argv)
    std::string mytext = "hello \nworld";
    std::istringstream i(mytext);
// alternative:   std::stringbuf buf(mytext, std::ios_base::in);
// alternative:   std::istream i(&buf);
    std::string word;
    i >> word;
    return word == "hello";

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]