Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!hsi!stpstn!lerman From: lerman@stpstn.UUCP (Ken Lerman) Newsgroups: comp.lang.c Subject: Re: Protoize/Unprotoize (was: ANSI C to K&R syntax converter) Message-ID: <5160@stpstn.UUCP> Date: 5 Jun 90 21:23:31 GMT References: <1990May31.214655.18960@csrd.uiuc.edu> <26699454.10047@paris.ics.uci.edu> <1645@mountn.dec.com> Reply-To: lerman@stpstn.UUCP (Ken Lerman) Organization: The Stepstone Corporation, Sandy Hook, CT 06482 Lines: 41 In article <1645@mountn.dec.com> minow@thundr.enet.dec.com (Martin Minow) writes: >In article <1990May31.214655.18960@csrd.uiuc.edu> pommerel@sp14.csrd.uiuc.edu ... >>I am looking for a portable converter from ANSI C syntax to >>traditional Kernighan&Ritchie syntax. > >I've had good results by writing prototypes using the following process: ...
> /* > * All functions are specified here: > */ > int sample _((int, char *, struct foo)); > >The actual definition of a function uses the old -- but still valid -- syntax: > > int > sample(i, cp, foostruct) > int i; > char *cp; > struct foo foostruct; > ... ... >The above should be portable to all C implementations since around 1978. > >Martin Minow >minow@thundr.enet.dec.com 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. At that time I investigated and found that ANSI leaves that case "undefined". Ken