Article View: gnu.gcc.help
Article #52908Re: Converting non-ANSI C programs to ANSI C
From: Paul Kohlmiller
Date: Fri, 01 May 1992 19:39
Date: Fri, 01 May 1992 19:39
22 lines
1856 bytes
1856 bytes
sinai@sono.uucp (Julian &) writes:
>We are in the process of converting our code bases to ANSI C, in
>preparation for converting to g++. Does anyone know of an automatic
>converter that will turn non-ANSI C programs into ANSI C?
Wow. I don't think that can be done in a sincere sense.
I think gcc (and certainly other C compilers) have an option that
automatically add function prototypes. This is pretty easy but ANSI
simply allows prototypes and doesn't require them. Since you are
eventually going to g++ then you will need them and I hope that is
what you meant by this question.
In general, converting any K&R program to ANSI C automatically will
run into some rough spots particularly in the preprocessor. Some
cpp behaviors that were assumed to be in K&R (but never were
really) are different in ANSI C. Maybe someone has a converter that
has fixed some of these kinds of problems but probably not all.
Paul K.
--
// Paul H. Kohlmiller // "Cybers, Macs and Mips" //
// Control Data Corporation // Internet: paul@robin.svl.cdc.com //
// All comments are strictly // America Online: Paul CDC //
// my own. // Compuserve: 71170,2064 //
Technical Details
Message-ID:
<42361@shamash.cdc.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!europa.asd.contel.com!darwin.sura.net!mips!spool.mu.edu!umn.edu!noc.MR.NET!uc.msc.edu!shamash!paulReferences:
<SINAI.92Apr28152036@biltong.sono.uucp>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 11318c,faa300e97e054ff3 X-Google-Attributes: gid11318c,public X-Google-ArrivalTime: 1992-05-01 12:39:42 PST Path: arc1-ca.pugleaf.net!sparky!uunet!europa.asd.contel.com!darwin.sura.net!mips!spool.mu.edu!umn.edu!noc.MR.NET!uc.msc.edu!shamash!paul From: paul@svl.cdc.com (Paul Kohlmiller) Newsgroups: gnu.gcc.help Subject: Re: Converting non-ANSI C programs to ANSI C Message-ID: <42361@shamash.cdc.com> Date: 1 May 92 19:39:42 GMT Article-I.D.: shamash.42361 References: <SINAI.92Apr28152036@biltong.sono.uucp> Sender: usenet@shamash.cdc.com Lines: 22