Conversions/casts one more time

stuart at bms-at.UUCP stuart at bms-at.UUCP
Thu Dec 11 11:35:16 AEST 1986


In article <176 at unisoft.UUCP>, wendyt at unisoft.UUCP (Wendy Thrash) writes:

> 	printf("\tc = %x, (char)uc = %x, (char)ucf() = %x\n",
> 	  c, (char)uc, (char)ucf());

	results in:

> 	c = ffffffaa, (char)uc = ffffffaa, (char)ucf() = aa

The compiler is broken and left out a cast.  The values printed should
all be the same, either as shown or 'aa' depending on whether 'char's
are signed or unsigned.

As to whether this is required by the X3J11 draft, I couldn't say.
(I hope not.)
-- 
Stuart D. Gathman	<..!seismo!dgis!bms-at!stuart>



More information about the Comp.lang.c mailing list