Path: utzoo!mnetor!uunet!husc6!rutgers!mtune!codas!killer!pollux!bobkat!m5 From: m5@bobkat.UUCP (Mike McNally ) Newsgroups: comp.lang.c Subject: Unsigned considerations Message-ID: <3373@bobkat.UUCP> Date: 2 Feb 88 18:17:32 GMT Reply-To: m5@bobkat.UUCP (Mike McNally (Man from Mars)) Distribution: na Organization: Digital Lynx, Inc; Dallas, TX Lines: 28 Summary: a question Given a compiler with different sized ``int'' and ``long'', what is the result of: int i; unsigned long ul; ul = i; Will the assignment be treated as ul = (unsigned long) (unsigned) i; or as ul = (unsigned long) (long) i; How does the ANSI thing say this conversion should be done? If you think this is completely obvious and that only a fool would get confused, please explain why it's obvious. It's not at all clear to me what should be done (K&R of course doesn't say because ``unsigned long'' doesn't exists there; I don't have any other references). -- Mike McNally, mercifully employed at Digital Lynx --- Where Plano Road the Mighty Flood of Forest Lane doth meet, And Garland fair, whose perfumed air flows soft about my feet... uucp: {texsun,killer,infotel}!pollux!bobkat!m5 (214) 238-7474