Path: utzoo!utgpu!watserv1!watsci!semicon From: semicon@watsci.uwaterloo.ca (Robert Adsett) Newsgroups: comp.sys.sgi Subject: Re: IRIX 3.2 C compiler bug (Mark Gets Pie in the Face) Message-ID: <971@watserv1.waterloo.edu> Date: 6 Feb 90 00:39:46 GMT References: <90Feb5.000622est.4918@neat.cs.toronto.edu> <13583@phoenix.Princeton.EDU> <12999@cgl.ucsf.EDU> <13600@phoenix.Princeton.EDU> Sender: daemon@watserv1.waterloo.edu Reply-To: semicon@watsci.UUCP (Robert Adsett) Organization: University of Waterloo, Waterloo Ontario, Canada Lines: 19 In article <13600@phoenix.Princeton.EDU> markv@gauss.Princeton.EDU (Mark VandeWettering) writes: >In article <12999@cgl.ucsf.EDU> conrad@cgl.ucsf.edu (Conrad Huang) writes: >> >>In the second place, even if they were equal, it should print 1.000000. > >Actually, if we wanna get really technical about it, this program shouldn't >work at all, because you passed a double to the printf, when in fact it >wants a float argument. This usually works out, but I have had it fail >on various machines (particularly mips based ones) in very odd ways, so >one should be careful. No, floats get expanded to doubles when they are passed. Printf expects to receive a double. If this fails on some machines then either their compiler or library is broken. In ANSI C when a prototype indicates a float parmaeter then there is no implicit conversion. -- Robert Adsett Dept. of Phys, Univ. of Waterloo, Waterloo Ont. Canada