develooper Front page | perl.perl5.porters | Postings from February 2003

Re: How about gcc -funsigned-char [Was: Re: one signedness nit fo r Encode]

Thread Previous | Thread Next
From:
Jarkko Hietaniemi
Date:
February 17, 2003 05:50
Subject:
Re: How about gcc -funsigned-char [Was: Re: one signedness nit fo r Encode]
Message ID:
20030217134955.GF16373@kosh.hut.fi
> > The good thing is that very rarely (well, at least in my experience)
> 
> That just proves you have very limited experience :-). In C the
> type "char" is basically just an int - why should it be the only

It depends.  A "char" is distinct from a "signed char" and "unsigned
char": a "char" can be either signed or unsigned, depending.  That is
why mixing them is dangerous: what is unsigned in platform A can be
signed in platform B.  At least based on my limited experience :-)

> kind of int you have to do something special to get signed?
>
> If unsigned char's make more sense, then $#@! declare them that way :-).

Huh, I don't understand?  I was pointing out that code often mixes
chars of different signedness, which is error-prone, and I was moaning
about gcc (being a popular compiler) not warning about such mixing;
to which Dan suggested -funsigned-char; to which I claimed that it
isn't look quite the same.  I agree with you that people such be $#@!
explicit about the signedness of their chars, based on my limited
experience :-)

-- 
Jarkko Hietaniemi <jhi@iki.fi> http://www.iki.fi/jhi/ "There is this special
biologist word we use for 'stable'.  It is 'dead'." -- Jack Cohen

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About