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: v3.0.4 vs. v2.95.3, Solaris 8, basic_ostream/fstream weirdness


On Thu, Apr 11, 2002 at 03:41:38PM -0600, David P. Michaels wrote:
> include/rsdr_file.h:320: no matching function for call to 
>    `std::basic_fstream<char, std::char_traits<char> >::write(unsigned
> char*, 
>    unsigned int)'

It might be useful if you could post a bit of this code.  Perhaps line 320?


> /usr/local/include/g++-v3/bits/ostream.tcc:370: candidates are: 
>    std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, 
>    _Traits>::write(const _CharT*, int) [with _CharT = char, _Traits = 
>    std::char_traits<char>]

The C++ standard points out (footnote 299, for what it's worth; the focal
point of many conversations in my office) that ostream::write() is /not/
overloaded on signed versus unsigned char.  So it may be that you only
need to do a cast in your call to write(), like

    f.write( (const char*) foo, .... );

or, more portably,

    f.write( static_cast<const ostream::char_type*>(foo), .... );


> I've tried putting the bits/std_fstream.h in there, but that didn't
> work.

Advice:  stay out of the bits directory.  :-)


> I've tried referencing these header files without the .h's, and
> that didn't work.

That's actually the correct way to do it, but you then need to be more
strict about proper use of namespaces.  The forms with .h dump everything
into the global namespace for backwards contemptibility.  The extensionless
forms keep their declarations in std.  For more, see

    http://gcc.gnu.org/onlinedocs/libstdc++/17_intro/howto.html#4


> I'm presently working
> on installing DejaGnus so I can run the testsuite for more insight.

I suggest finding a large brick wall and smashing your head into it
repeatedly.  This is often less painful than installing dejagnu from
scratch...


> laurel:smi-src>/usr/local/bin/g++ -v
> Reading specs from
> /usr/local/lib/gcc-lib/sparc-sun-solaris2.8/3.0.4/specs
> Configured with: ../configure --prefix=/usr/local
                                ^^^^^^^^^^^^^^^^^^^

For what it's worth, /usr/local is the default prefix.


Phil

-- 
If ye love wealth greater than liberty, the tranquility of servitude greater
than the animating contest for freedom, go home and leave us in peace.  We seek
not your counsel, nor your arms.  Crouch down and lick the hand that feeds you;
and may posterity forget that ye were our countrymen.            - Samuel Adams


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