Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!rpi!uupsi!sunic!liuida!prosys!ath From: ath@prosys.se (Anders Thulin) Newsgroups: comp.os.minix Subject: Re: float VS double: The return... Message-ID: <460@helios.prosys.se> Date: 11 Apr 90 06:15:47 GMT References: <16383@nigel.udel.EDU> <29812@amdcad.AMD.COM> Organization: Programsystem AB, Teknikringen 2A, S-583 30 Linkoping, Sweden Lines: 31 In article <29812@amdcad.AMD.COM> tim@amd.com (Tim Olson) writes: > > [ quote ANSI Rationale deleted ] > >This means that in: > >f(c, f) >char c; >float f; >{ > . > . >sizeof c should be 1 and sizeof f should be equal to sizeof(float). No. The ANSI C standard also tries very hard not to introduce backward incompabilities. The example above works just the way K&R says: c becomes an int, and f a double by widening, provided there isn't a new-style definition of f lurking in some corner. In the presence of a new-style definition, like f(char c, float f); c would indeed be a char and f a float. I can't quote the ANSI gospel, but K&R, 2nd ed, Section A7.3.2 Function calls, p.201-202 provides more info. -- Anders Thulin ath@prosys.se {uunet,mcsun}!sunic!prosys!ath Telelogic Programsystem AB, Teknikringen 2B, S-583 30 Linkoping, Sweden