daveb@ingres.com (When a problem comes along . . . you must whip it) (08/15/90)
This old article suggests "agcpp" might be the de-ansifier that I'm looking for. I need something that is reasonably portable and that inserts casts into function calls. thanks, -dB Newsgroups: comp.sources.misc Subject: v06i068: Lex programme to convert pANS to Classic C Message-ID: <51319@uunet.UU.NET> Date: 21 Mar 89 01:47:57 GMT Sender: allbery@uunet.UU.NET Reply-To: lupton@uhccux.uhcc.Hawaii.Edu (Robert Lupton ) Lines: 246 Approved: allbery@uunet.UU.NET (Brandon S. Allbery - comp.sources.misc) Posting-number: Volume 6, Issue 68 Submitted-by: lupton@uhccux.uhcc.Hawaii.Edu (Robert Lupton ) Archive-name: deansi [Also see "agcpp", as posted to comp.os.minix. ++bsa] My postnews spat this out (`error 11' -- ?), so here it is by mail. [Ummm, sounds like a segmentation violation. Contact your local guru. ++bsa] Here is a simple-minded Lex programme to convert ANSI to Classic C, or at least to try. It will convert prototypes external to functions to extern declarations, convert function declarations from the form "foo(int a,char *b)" to "foo(a,b) int a; char *b;" and remove a couple of keywords (volatile, const). No attempt is made to deal with pre-processor incompatibilities. You are welcome to copy, modify, or (even |-) improve the code, providing that my name remains on it, you don't make money, and these conditions remain on the fruits of your labours. Also, please post any significant improvements. Robert Lupton -- "In my opinion, most C programs should be indented 6 feet under." David Brower: {amdahl, cpsc6a, mtxinu, sun}!rtech!daveb daveb@ingres.com