Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!cbosgd!gatech!seismo!umcp-cs!chris From: chris@umcp-cs.UUCP (Chris Torek) Newsgroups: net.lang.c,net.micro,net.micro.pc Subject: Re: weird C behavior Message-ID: <436@umcp-cs.UUCP> Date: Sat, 22-Mar-86 10:23:21 EST Article-I.D.: umcp-cs.436 Posted: Sat Mar 22 10:23:21 1986 Date-Received: Mon, 24-Mar-86 03:40:35 EST References: <557@utastro.UUCP> Organization: U of Maryland, Computer Science Dept., College Park, MD Lines: 22 Keywords: strange, opaque, odd Xref: watmath net.lang.c:8230 net.micro:14101 net.micro.pc:7509 In article <557@utastro.UUCP> nather@utastro.UUCP (Ed Nather) writes: >Here is a short C program which gives correct output according to K & R. >[...] Try it on *your* 16-bit computer. The code contains the following [paraphrased]: printf("%d\n", 36864); On a 16 bit machine, this should read printf("%ld\n", 36864); One alternative is to change Ed's original program to read #define BIG ((int) 36864) Too bad lint does not catch the printf() type bug. -- In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 1415) UUCP: seismo!umcp-cs!chris CSNet: chris@umcp-cs ARPA: chris@mimsy.umd.edu