Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!think!ames!aurora!labrea!decwrl!ucbvax!ucbcad!zen!cory.Berkeley.EDU!iverson From: iverson@cory.Berkeley.EDU (Tim Iverson) Newsgroups: comp.sys.ibm.pc Subject: Re: tc bug? Message-ID: <3975@zen.berkeley.edu> Date: Fri, 25-Sep-87 21:44:23 EDT Article-I.D.: zen.3975 Posted: Fri Sep 25 21:44:23 1987 Date-Received: Sun, 27-Sep-87 07:45:17 EDT References: <236@occrsh.ATT.COM> Sender: news@zen.berkeley.edu Reply-To: iverson@cory.Berkeley.EDU.UUCP (Tim Iverson) Organization: University of California, Berkeley Lines: 22 In article <236@occrsh.ATT.COM> writes: >This has no doubt been discussed before, and I wasn't paying attention :-) > >unsigned int xyz = 0x8000 ; > >main() >{ > printf("xyz=%d\n", xyz) ; >} > >...gives me -32768. Really screws things up trying to read files in 32k >chunks. Well, I've never used tc (and never will), but this isn't a bug. It is perfectly K&R kosher - %d implies *signed* int. If you want an unsigned int, you should use %u. Always check the manual before assuming a compiler bug; even with something as buggy as tc, its more likely to be your fault. - Tim Iverson iverson@cory.Berkeley.EDU ucbvax!cory!iverson