This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


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

Re: Question about std::basic_ostream and unsigned char in gcc 3.0


> 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


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