Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!vrdxhq!bms-at!stuart From: stuart@bms-at.UUCP (Stuart D. Gathman) Newsgroups: comp.lang.c Subject: Re: Conversions/casts one more time Message-ID: <320@bms-at.UUCP> Date: Sun, 14-Dec-86 17:15:45 EST Article-I.D.: bms-at.320 Posted: Sun Dec 14 17:15:45 1986 Date-Received: Tue, 16-Dec-86 03:23:24 EST References: <176@unisoft.UUCP> <820@mtund.UUCP> Organization: Business Management Systems, Inc., Fairfax, VA Lines: 16 Summary: automatic conversions In article <820@mtund.UUCP>, adam@mtund.UUCP (Adam V. Reed) writes: > > printf("\tc = %x, (char)uc = %x, (char)ucf() = %x\n", > > c, (char)uc, (char)ucf()); > Ugh. %x expects an int, so the result of feeding it a char is, > *and ought to be*, UNDEFINED. Except that function arguments of short and char are automatically converted to type int except possibly when a function prototype is given and it is not a variable argument. (Whew!) All three arguments are (or should) be implicitly cast to int. In this case, the compiler thought that the last char was unsigned presumably because of the function declaration. -- Stuart D. Gathman <..!seismo!dgis!bms-at!stuart>