Xref: utzoo comp.unix.microport:3009 comp.unix.questions:12370 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!pacbell!sactoh0!tree!asmodeus From: asmodeus@tree.UUCP (Jonathan Ballard) Newsgroups: comp.unix.microport,comp.unix.questions Subject: Re: C bug causes double fault Message-ID: <246@tree.UUCP> Date: 21 Mar 89 20:32:29 GMT References: <244@tree.UUCP> <9884@smoke.BRL.MIL> Organization: TREE BBS (916)-349-0385 Sacramento, Ca Lines: 25 In article <9884@smoke.BRL.MIL>, gwyn@smoke.BRL.MIL (Doug Gwyn ) writes: > In article <244@tree.UUCP> zarquon@tree.UUCP (Erin Filbert) writes: > >main() > >{ > > float x; > > printf("x = %d", x); > >} > > You'll undoubtedly get a flood of responses correctly pointing out > that conversion of a double (promoted float) argument according to > an int format is incorrect. Use %g or some such format specifier. Okay, of course it is a bug. But the problem is that cc is not detecting it and just compiles it that way. Shouldn't there be something in cc so that a warning could appear. Say like: WARNING! Float not casted in to different declaration. This is actually a serious error because anybody could do this and then totally crash the system! -- ----Asmodeus - Jonathan Ballard ..!csusac!tree!asmodeus ..!pacbell!sactoh0!tree!asmodeus "I'm going to create the best game ever heard of! Might take a few years thou..." -me