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

Neil Dixon neil at yc.estec.nl
Tue Jun 5 16:58:03 AEST 1990


In article <1645 at mountn.dec.com>, minow at mountn.dec.com (Martin Minow) writes:
|>In article <1990May31.214655.18960 at csrd.uiuc.edu> pommerel at sp14.csrd.uiuc.edu
|>(Claude Pommerell) writes:
|>>
|>>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:
|>
|>	/*
|>	 * prototype.h
|>	 */
|>	#ifdef _STDC_
|>	#if _STDC_ != 0
|>	#define _(x)	x
|>	#endif
|>	#endif
|>	#ifndef _STDC_
|>	#define _(x)	()
|>	#endif
|>
|>The above should be portable to all C implementations since around 1978.
|>
|>Martin Minow
|>minow at thundr.enet.dec.com

I used this scheme before we got an ANSI C compiler. When it arrived I
found that
there is one failing in using this method, which is the promotion of char and
float arguments to int and double respectively.  In this respect the old
and new
forms of function declaration are incompatible.

Neil Dixon <neil at yc.estec.nl>
UUCP:...!mcvax!esatst!neil, BITNET: NDIXON at ESTEC Thermal Control & Life Support
Division (YC) European Space Research and Technology Centre (ESTEC), Noordwijk,
The Netherlands.  



More information about the Comp.lang.c mailing list