[geeks] stupid C question

Greg A. Woods woods at weird.com
Thu Feb 28 14:27:17 CST 2002


[ On Wednesday, February 27, 2002 at 21:27:03 (-0500), Joshua D Boyd wrote: ]
> Subject: [geeks] stupid C question
>
> Who had the bright idea to make the char type signed?  I just spend hours
> banging my head over a bug in my tga loader because I didn't remeber to make
> by chars unsigned.

Complain to the designer of your processor, not about C or your compiler.
 
If you don't like signed chars then you need to choose to use processors
which make "unsigned char" the natural byte-sized integer for the
compiler to use.

Only some processors make this a choice that can be left up to the
compiler (or the compiler user) without consequences....

Either that or make your code explicitly portable the hard way....  :-)

(yes this business of signed and unsigned integers of all sizes is messy
stuff in C)

-- 
								Greg A. Woods

+1 416 218-0098;  <gwoods at acm.org>;  <g.a.woods at ieee.org>;  <woods at robohack.ca>
Planix, Inc. <woods at planix.com>; VE3TCP; Secrets of the Weird <woods at weird.com>



More information about the geeks mailing list