Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!shadooby!ginosko!gem.mps.ohio-state.edu!apple!motcsd!hpda!hpcupt1!swh From: swh@hpcupt1.HP.COM (Steve Harrold) Newsgroups: comp.lang.c Subject: Re: Problem with float in TurboC 1.0? Message-ID: <5940010@hpcupt1.HP.COM> Date: 9 Oct 89 16:51:11 GMT References: <12967@orstcs.CS.ORST.EDU> Organization: Hewlett Packard, Cupertino Lines: 16 Re: floats with Turbo C Be careful when passing "float" types with any ANSI-conformant compiler. When you compile a function that is declared as expecting a "float" parameter, the ANSI compiler will generate code to extract a "float" value from the stack. If, in a separate compilation, you have a program that references the function, AND you neglect to explicitly provide a prototype statement that declares the "float" specification, the compiler will generate code the "old fashioned" way and insert a "double" into the stack. Because this parameter type mismatch is not (generally) detected by the linker you use, the run time execution will be unpredictable (because "double"s are placed into the stack, but are being extracted as "single"s!!). Hope this provides the clue you need.