SUMMARY: ANSI to K&R

From: Joe Hartley (jh@cadre.com)
Date: Mon Jul 06 1992 - 10:12:44 CDT


The original message:
>Well, I have a slightly different problem than some others here. I have some
>code written in ANSI C, but the only compiler available to me is the one
>that's bundled with SunOS 4.1.1. I've tried to compile it, and it fails
>miserably. I've also tried running it through the "ansi2knr" program that
>I got with the JPEG distribution (I think it was originally part of
>Ghostscript), but it still fails to compile.

>Am I hosed here? Have I missed some magic compiler flag that will make cc
>accept ANSI? Or am I doomed to having to find gcc and squeeze it on to our
>already tight system?

A number of people suggested that I get Gnu C and go through the pain of
setting it up - that it will all be worth it in the end. I have no doubts
about that and I promise to do it someday :-)

However, Wietse Venema author of "unproto" pointed me to the source of this
program. As he says:

"I had the same problem and wrote a filter that sits between the
preprocessor and the next compiler stage. Only the compiler sees the
result of the conversion, so the program has to be pretty robust. No
temporary files. Works with lint, too. It's about as fast as the
C preprocessor, so performance is not a problem. Available as:

        ftp.win.tue.nl:/pub/unix/unproto4.shar.Z

The filter has been used for both commercial and non-commercial
applications up to 20k+ lines of code, without a single change
to the application code."

I used it to compile the ANSI code, and it worked very, very well. Thanks, Wietse!

---
===============================================================================
Joe Hartley          | jh@cadre.com  -  Whenever you find that you are on the
Cadre Technologies   | side of the majority, it is time to reform. - M. Twain
222 Richmond St.     | --------------------------------------------------------
Providence, RI 02903 | Overman 1st Class - the Kilgore Trout Memorial Clench
(401) 351-5950 x266  |            of the Church of the SubGenius  
===============================================================================



This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:06:44 CDT