Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!csn!ccncsu!purdue!bu.edu!olivea!mintaka!think.com!samsung!uakari.primate.wisc.edu!caen!umich!sharkey!amara!mcdaniel From: mcdaniel@adi.com (Tim McDaniel) Newsgroups: comp.lang.c Subject: Re: new style declarations OK for old style definitions? Message-ID: Date: 8 Apr 91 14:56:31 GMT References: <14590@life.ai.mit.edu> <1991Apr03.141849.26379@convex.com> Sender: news@adi.COM Organization: Applied Dynamics International, Inc.; Ann Arbor, Michigan, USA Lines: 35 The original question was about mixing an old-style, unprototyped function definition in one file with a new-style, prototyped declaration in another. In article <1991Apr03.141849.26379@convex.com> grogers@convex.com (Geoffrey Rogers) writes: In article <14590@life.ai.mit.edu> tmb@ai.mit.edu writes: > Is it sufficient to use only promoted arguments in the new-style > declaration? Yes. If you don't use the default promotion types you will have problems. Exactly. >Is it legal for the compiler to choose >completely incompatible calling sequences for old-style and new-style >declarations? Yes. No. Section 3.5.4.3 of the Standard defines compatability of function types. An old-style function declaration is compatable with a new-style declaration, if the new-style uses promoted arguments and doesn't use ellipses. Thus, with care, you CAN mix new-style with old-style. Because of the care required, I do not recommend such mixing. -- "Of course he has a knife. We all have knives. It's 1183, and we're all barbarians." Tim McDaniel Applied Dynamics Int'l.; Ann Arbor, Michigan, USA Internet: mcdaniel@adi.com UUCP: {uunet,sharkey}!amara!mcdaniel