Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!uunet!pilchuck!amc-gw!sigma!flash!bryant From: bryant@flash.UUCP (Mike Bryant) Newsgroups: comp.windows.ms Subject: Re: FAR functions and float types Message-ID: <59@flash.UUCP> Date: 12 Sep 89 16:13:20 GMT References: <246400022@uxa.cso.uiuc.edu> Reply-To: bryant@flash.UUCP (Mike Bryant) Organization: Summation Inc, Kirkland WA Lines: 19 In Microsoft C a formal parameter of type float is supposed to always be promoted to double (in the same way that char is pro- moted to int). See the discussion in section 7.2.3, Formal Param- eters, of the Language Reference section of the manual. It ap- pears that this must be broken based on the behavior you are see- ing. Section 5.6.4 states that actual parameters of type float are always promoted to double (which must be working). When using the pascal calling convention the callee pops the parameters from the stack (unlike C where the caller pops the stack). If you call a function with the wrong number of parame- ters or the wrong types then the stack is corrupted. Most of the time this causes a crash of some kind. In your case you are pass- ing two doubles and the function expects two floats. You discovered the solution to the bug on your own! -- Mike Bryant uunet.uu.net!amc!sigma!bryant Summation Inc. 11335 NE 122nd Way Kirkland, WA 98034