Sun C - is it missing a type specifier?

Joe Garvey garvey at johnny5.uucp
Mon Feb 11 16:07:06 AEST 1991


I was just porting some code from another system (HP), and I ran into
a funny problem. The Sun C compiler complained about my using the 
"signed" type specifier with a char.

The new K&R says (pg 211):

	At most one of signed or unsigned may be specified together with int
	or any of its short or long varieties or with char. Either may appear
	alone, in which case int is understood. The signed specifier is
	useful for forcing char objects to carry a sign; it is permissible
	but redundant with other types.

My solution (since Sun C says char's are signed unless explicitly specified
as unsigned) was to create a "typedef char S_CHAR;". This would then allow
me to substitute "typedef signed char S_CHAR;" in the event I end up
going to a machine that has unsigned chars as a default.

I'm still kinda surprised that the Sun C compiler (unbundled one) doesn't
allow "signed char". Is there a reason for this? Is it an oversite? Did
I screw up?


-- 

Joe Garvey                       uucp: sumax!ole!johnny5!garvey
J5 Research                      registration has been sent in, though we're
Bothell, Wa.                     not in the maps yet.



More information about the Alt.sys.sun mailing list