This is the mail archive of the gcc@gcc.gnu.org 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]

Re: Building dejagnu with latest GCC


Jason Merrill <jason@redhat.com> writes:

| Does -fpermissive help?

Hi,

  -fpermissive doesn't help for the accessibility problem 

  /usr/local/include/c++/3.2/streambuf:416: `std::basic_streambuf<_CharT,
     _Traits>* std::basic_streambuf<_CharT, _Traits>::setbuf(_CharT*, long int)
     [with _CharT = char, _Traits = std::char_traits<char>]' is protected
  unit.cc:53: within this context

The piece of code incrimintated is:

    streambuf *sb =  cout.rdbuf();
    char bbuuff[5120];
    sb->setbuf(bbuuff, 5120);

streambuf::setbuf() is protected and is there only for derived
classes. For public use, the right function is streambuf::pubsetbuf().
Kenner, please could try to replace

    sb->setbuf(bbuuff, 5120);

with

    sb->pubsetbuf(bbuuff, 5120);

and report what happens?

Thanks,

-- Gaby


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