Xref: utzoo comp.unix.microport:3006 comp.unix.questions:12358 comp.unix.wizards:15146 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!iuvax!uxc!tank!shamash!nis!viper!dave From: dave@viper.Lynx.MN.Org (David Messer) Newsgroups: comp.unix.microport,comp.unix.questions,comp.unix.wizards Subject: Re: C bug causes double fault (actually double panic) Message-ID: <2044@viper.Lynx.MN.Org> Date: 22 Mar 89 07:03:31 GMT References: <244@tree.UUCP> <9884@smoke.BRL.MIL> Reply-To: dave@viper.Lynx.MN.Org (David Messer) Organization: Lynx Data Systems, Eagan, MN Lines: 35 In article <9884@smoke.BRL.MIL> gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) writes: >In article <244@tree.UUCP> zarquon@tree.UUCP (Erin Filbert) writes: { Mention that this causes the system to crash deleted by Doug Gwyn } >>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. And you will probably get a flood of responses correctly pointing out that what you say is irrelevent. The original message mentioned that he "crashed the entire system" by running this program (calling it a "double fault" rather than "double panic"; which may have misled you). It doesn't matter that the C program has a bug, it still shouldn't crash the operating system. >The reason I'm posting this is so I can include a plea not to post >questions like this to comp.unix.wizards. A true wizard carefully reads the question so that he might answer the question actually asked, rather than just say the first thing that comes to mind. > Thanks. You are welcome. -- This space | David Messer dave@Lynx.MN.Org -or- for rent. | Lynx Data Systems ...!bungia!viper!dave