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
On Fri, Mar 23, 2001 at 02:48:29PM -0800, Benjamin Kosnik wrote:
> > 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?
>
> 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)
I thought so. I just wanted to know what the Right Thing to do is.
When gcc 3.0 hits the streets in a big way, I anticipate that
many people will start filing bug reports against gcc regarding code
that used to compile with gcc 2.95.2 but not with gcc 3.0, such
as this case with using 'unsigned char' in a streambuf.
I want to make sure that when bug reports on things like GNATS or
Redhat's Bugzilla are posted, that I can respond with a good answer. :)
Is using just plain char for binary data OK? It's been a while
since I've dealt with the arcanities of the C standard, and what
char vs. unsigned char vs. signed char guarantees you.
I've used u_char a lot for writing networking code, and I assume many
other people have as well, so this problem could crop up for other software.
Thanks.
--
Craig Rodrigues
http://www.gis.net/~craigr
rodrigc@mediaone.net