Path: utzoo!attcan!uunet!samsung!rex!ames!amdcad!nucleus!tim From: tim@nucleus.amd.com (Tim Olson) Newsgroups: comp.os.minix Subject: Re: float VS double: The return... Message-ID: <29828@amdcad.AMD.COM> Date: 11 Apr 90 14:30:54 GMT References: <16383@nigel.udel.EDU> <29812@amdcad.AMD.COM> <460@helios.prosys.se> Sender: news@amdcad.AMD.COM Reply-To: tim@amd.com (Tim Olson) Organization: Advanced Micro Devices, Inc., Austin, Texas Lines: 30 Summary: Expires: Sender: Followup-To: In article <460@helios.prosys.se> ath@prosys.se (Anders Thulin) writes: | 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. This section really only discusses promotion of arguments by the caller, which should be done. However, I was referring to X3J11/88-159 (December 7 draft, just before ratification), which explicitly states (as a noted QUIET CHANGE) that the received, widened argument must be narrowed upon entry, and that type rewriting is not allowed. I checked it with two ANSI-conforming compiler we have here (MetaWare HighC and gcc with -ansi -pedantic flags), and they both agree with this. -- Tim Olson Advanced Micro Devices (tim@amd.com)