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]

Re: egcs, casting the argument of eg isalpha to an int...


On Sat, 14 Feb 1998, Manfred Hollstein wrote:

> the following cast sequence would be better:
> 
> 	my_isalpha ((int) ((unsigned char) 'A'));
> 	my_isalpha ((int) ((unsigned char) 'ä'));
> 
> This gives:
> 
> 65, 'A'
> 228, 'ä'

But why the explicit cast from unsigned char to int? The following should
be enough:

	my_isalpha ((unsigned char) 'A');
	my_isalpha ((unsigned char) 'ä');

/ Kamil Iskra    AmigaOS  Linux/i386  Linux/m68k               \
| GeekGadgets GCC maintainer   UNIX system administrator       |
| iskra@student.uci.agh.edu.pl  kiskra@ernie.icslab.agh.edu.pl |
\ kamil@dwd.interkom.pl   http://student.uci.agh.edu.pl/~iskra /



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