Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!think.com!sdd.hp.com!elroy.jpl.nasa.gov!usc!nic.csu.net!csun.edu!corona!swalton From: swalton@corona.csun.edu (Stephen Walton) Newsgroups: comp.sys.amiga.programmer Subject: Re: Manx/Lattice ENOUGH IS ENOUGH Message-ID: <1991May29.063111.6969@csun.edu> Date: 29 May 91 06:31:11 GMT References: <1991May27.125456.27018@sugar.hackercorp.com> <1991May28.165437.31104@kuhub.cc.ukans.edu> Sender: usenet@csun.edu Organization: California State Univ., Northridge Lines: 30 In article <1991May28.165437.31104@kuhub.cc.ukans.edu> markv@kuhub.cc.ukans.edu writes: >>>Well, I'm trying to convert a program full of things like: >>> >>> int a(char b, float c); >>> int a(b, c) >>> char b; >>> float c; >>> >>>These are not compatible declarations. > >Correct. ANSI says that promotion only occurs with old style >declarations in the absence of a prototype. Sorry, no. Harbison and Steele, Third Edition, section 9.2.2, pages 242 ff. discusses this at length. The relevant sentence is rule 4 on page 244: "A function type declared in protoype form is compatible with a non-prototype function definition if: ... 4. the type of the i'th parameter in the prototype is compatible with the type resulting from the applying the usual argument conversions to the i'th parameter in the definition." Specifically, H&S state that the only prototype compatible with the definition "int f(x, y) float x; int y; {...}" is "extern int f(double x, int y)". "extern int f(float, int)" is specifically not acceptable. -- Stephen Walton, Dept. of Physics & Astronomy, Cal State Univ. Northridge "Lately it occurs to me/What a long, strange trip it's been"