Path: utzoo!utgpu!cs.utexas.edu!usc!zaphod.mps.ohio-state.edu!rpi!dali.cs.montana.edu!milton!sumax!amc-gw!quick!johnny5!garvey From: garvey@johnny5.uucp (Joe Garvey) Newsgroups: alt.sys.sun Subject: Sun C - is it missing a type specifier? Message-ID: <1991Feb11.050706.18745@johnny5.uucp> Date: 11 Feb 91 05:07:06 GMT Organization: J5 Research -- Bothell, Wa. Lines: 27 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.