This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: Question about std::basic_ostream and unsigned char in gcc 3.0
- To: Craig Rodrigues <rodrigc at mediaone dot net>
- Subject: Re: Question about std::basic_ostream and unsigned char in gcc 3.0
- From: Benjamin Kosnik <bkoz at redhat dot com>
- Date: Fri, 23 Mar 2001 14:48:29 -0800 (PST)
- cc: libstdc++ at gcc dot gnu dot org
> I am trying to compile some code (the SAMPEG mpeg encoder,
> http://rachmaninoff.ti.uni-mannheim.de/sampeg) which
> compiled without error under gcc 2.95.2, but now
> generates an error with gcc 3.0.
Hmm. I got questions about this the other day. Are you going to send your
changes back?
> I have isolated the problem to a section of code like:
>
> #include <iostream.h>
>
> void writeOstream(ostream& ostr){
> unsigned char buf[20];
> ostr.write(buf, 18);
>
> }
yeah.
char != unsigned char != signed char.
the standard streams use char. If you have to use unsigned char, you'll
need to instantiate for that type. (I also suggest just using char)
-benjami