Protoize/Unprotoize (was: ANSI C to K&R syntax converter)

Ken Lerman lerman at stpstn.UUCP
Wed Jun 6 07:23:31 AEST 1990


In article <1645 at mountn.dec.com> minow at thundr.enet.dec.com (Martin Minow) writes:
>In article <1990May31.214655.18960 at csrd.uiuc.edu> pommerel at 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:
... <details of _ macro deleted>
>	/*
>	 * 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;
>	...
...<more stuff deleted>

>The above should be portable to all C implementations since around 1978.
>
>Martin Minow
>minow at 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



More information about the Comp.lang.c mailing list