Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!mcsun!hp4nl!esatst!yc2!neil From: neil@yc.estec.nl (Neil Dixon) Newsgroups: comp.lang.c Subject: Re: Protoize/Unprotoize (was: ANSI C to K&R syntax converter) Message-ID: <1375@esatst.yc.estec.nl> Date: 5 Jun 90 06:58:03 GMT References: <1990May31.214655.18960@csrd.uiuc.edu> <26699454.10047@paris.ics.uci.edu> <1645@mountn.dec.com> Sender: usenet@yc.estec.nl Reply-To: neil@yc.estec.nl Organization: ESTEC/YCV, Noordwijk, The Netherlands Lines: 37 In article <1645@mountn.dec.com>, minow@mountn.dec.com (Martin Minow) writes: |>In article <1990May31.214655.18960@csrd.uiuc.edu> pommerel@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@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 UUCP:...!mcvax!esatst!neil, BITNET: NDIXON@ESTEC Thermal Control & Life Support Division (YC) European Space Research and Technology Centre (ESTEC), Noordwijk, The Netherlands.