Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!gem.mps.ohio-state.edu!uakari.primate.wisc.edu!xanth!kremer From: kremer@cs.odu.edu (Lloyd Kremer) Newsgroups: comp.lang.c Subject: Re: HELP!! arg-lists in Turbo-C Keywords: va_args Message-ID: <10213@xanth.cs.odu.edu> Date: 18 Oct 89 15:10:26 GMT References: <19724@ut-emx.UUCP> Organization: Old Dominion University, Norfolk, Va. Lines: 30 In article <19724@ut-emx.UUCP> readdm@walt.cc.utexas.edu (David M. Read) writes: >I noticed that when I use va_arg (va_list, type) with >type = float, the result is useless, but using type = double seems >to resolve the problem. This indicates that floats are pushed onto >the stack as type double, no? Traditionally, yes. In classic C, floats are promoted to doubles at any evaluation, including evaluation for the purpose of passing as an argument. In ANSI C, you can arrange for a passed float to be received as a float rather than as a double by defining the receiving function as void rec_func(float foo) /* new style definition */ { } instead of void rec_func(foo) /* old style definition */ double foo; { } -- Lloyd Kremer ...!uunet!xanth!kremer Have terminal...will hack!