Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site gitpyr.UUCP Path: utzoo!watmath!clyde!bonnie!akgua!gatech!gitpyr!robert From: robert@gitpyr.UUCP (Robert Viduya) Newsgroups: net.micro.att Subject: Re: What's wrong with this program (3b2)? Message-ID: <476@gitpyr.UUCP> Date: Sun, 16-Jun-85 09:17:10 EDT Article-I.D.: gitpyr.476 Posted: Sun Jun 16 09:17:10 1985 Date-Received: Mon, 17-Jun-85 04:30:38 EDT References: <104@gwsd.UUCP> Organization: Georgia Tech, Atlanta Lines: 32 > > The following program came out of the K&R book, page 8. > When compiled on a 3b2 (SYS-V.2)... > > $ cc -g temperature.c > $ a.out > Illegal instruction - core dumped > $ sdb a.out > main:15: fahr = lower; > *q > The problem isn't in the the program. Basically, the 3B2 (or as I understand it, the old 3B2) doesn't have hardware floating point. If you notice, the program died at the point where the first floating point variable was referenced. The C compiler doesn't know about the missing hardware and gen- erates floating point instructions which the machine promptly pukes on. There's an undocumented flag for the cc command which enables generation of software floating point support. Simply change your cc command line to: $ cc -g -f temperature.c and everything should work fine. robert -- Robert Viduya 01111000 Georgia Institute of Technology ...!{akgua,allegra,amd,hplabs,ihnp4,masscomp,ut-ngp}!gatech!gitpyr!robert ...!{rlgvax,sb1,uf-cgrl,unmvax,ut-sally}!gatech!gitpyr!robert