Path: utzoo!attcan!uunet!mailrus!ncar!ico!ism780c!haddock!karl From: karl@haddock.ima.isc.com (Karl Heuer) Newsgroups: comp.lang.c Subject: Re: Protoize/Unprotoize (was: ANSI C to K&R syntax converter) Message-ID: <16805@haddock.ima.isc.com> Date: 6 Jun 90 16:08:35 GMT References: <1990May31.214655.18960@csrd.uiuc.edu> <26699454.10047@paris.ics.uci.edu> <1645@mountn.dec.com> <5160@stpstn.UUCP> Reply-To: karl@haddock.ima.isc.com (Karl Heuer) Organization: Interactive Systems, Cambridge, MA 02138-5302 Lines: 18 In article <5160@stpstn.UUCP> lerman@stpstn.UUCP (Ken Lerman) writes: >In article <1645@mountn.dec.com> minow@thundr.enet.dec.com (Martin Minow) writes: >>[Use a macro to get prototyped declarations conditional on __STDC__, but >>continue to use the obsolescent syntax for function definitions] > >Sorry, Martin, but IMHO that is not correct. I don't have my copy of >the Standard handy, but the last time I tried that (or something like >that) I found that the DG Avvion (Greenhills) C compiler either >complained or generated bad code (I forget which) if a function was >declared with ANSI prototypes and defined without them. This is true in the case of formal parameters (e.g. char, float) that are subject to promotion (see the FAQ list for the reason), but for functions with no promotable arguments (this includes the entire standard library) there should not be any such restriction. As I recall, the Committee intentionally allowed it, to make it easier to upgrade old code with new headers. Karl W. Z. Heuer (karl@ima.ima.isc.com or harvard!ima!karl), The Walking Lint