IsUnsigned() function?

Will Crowder will at kfw.COM
Sat Jul 28 02:13:39 AEST 1990


I promised myself I wouldn't get into this....

It sounds like the question has to do with whether or not a given
*type* is signed or unsigned for a given implementation.   That 
could be a useful thing to know, and ideally, the result would
be a compile-time constant.  The specific case I'm thinking of
char, which, according to ANSI, can be signed or unsigned as
the implementation desires.

What's wrong with:

#define IsUnsigned(type)	((type)0 - 1 > 0)

Will



More information about the Comp.lang.c mailing list