Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!haven!aplcen!osiris!consult From: consult@osiris.UUCP (Unix Consultation Mailbox ) Newsgroups: comp.os.os9 Subject: Re: printf bug with C compiler...fatal runtime error! Message-ID: <2820@osiris.UUCP> Date: 31 Jan 89 20:25:23 GMT References: <1223@mmm.UUCP> <1225@mmm.UUCP> Reply-To: consult@osiris.UUCP (Unix Consultation Mailbox (Phil)) Distribution: usa Organization: The Johns Hopkins Hospital, Information Systems Lines: 35 In article <1225@mmm.UUCP> manning@mmm.UUCP (Arthur T. Manning) writes about a "bug" in the Microware C library code for printf. I have a couple of comments. First, why is this "bug" a problem? Is the bit pattern created by poking 0x6666 into the middle of (double) 123.45 a legitimate double? I doubt it; if it were, I think this problem would have been fixed long ago. I've never dealt with Microware, but they seem to be more considerate of their customers than any software company I've ever known. (For one thing, they are willing to ascribe intelligence to their customers - most companies just plain can't do this so it must say something for the quality of Microware's clientele. :-) Do you really need to be able to poke random bit patterns into doubles? If so, I'd hate to ever have to support your software. If it isn't just for fun, are you really worried about it? Common sense would say that doing something unsupported results in indeterminate behavior. I'd say that printf (or _doprnt or whatever) bombing when told to interpret garbage correctly is acceptable behavior. (You can't tell me that it's not doing what it should if you can't tell me what "should" is.) I guess my conclusion is "so what"? It's either a really serious bug that should have been fixed years ago or a meaningless, trivial side- effect of misuse of the C language. In any case, even though I'm dubious that this problem is a genuine one, I *am* curious about why a fault occurs. I'd try to figure it out myself but don't know what endiosity a 68k uses and don't have my Sun anymore to try it and see. (Btw, it works just fine on a Pyramid 9820, though the results are meaningless...) phil