[Coco] ANSI -> K&R Code Conversion

Mannequin* mannslists at invigorated.org
Thu Mar 17 20:41:56 EST 2005


On Wed, 16 Mar 2005 22:01:15 -0600
Dave <daveekelly at earthlink.net> wrote:

> Mannequin* wrote:
> > Okay, I'm prepared to begin to write or "update" a program that will convert
> > program source from ANSI to K&R C.
...
> > Last, but certainly not least, what are the major dividing points between
> > the two styles? I'm the proud owner of both K&R 1 & 2, so I can look through
> > the books, but I want everyone's opinion here, so I don't miss something
> > rather important. :)
> >
> If you are talking about converting:
> int main ( int argc, char argv[] ) {};
> to
> int main (argc, argv )
>      {
>       int argc;
>       char argv[];
> 
> I wrote that program sometime between the time I bought my AT306 at the 
> last Atlanta Fest and I bought my linux at the first PennFest.
> 
> But alas the code is on a hard drive on a crashed AT306 mother board. 
> Maybe I can get it recovered at the Coco fest.
> 
> Now to answer your question. I found that just about everything could be 
> compiled by making the changes list above.

Would it be prudent to also look through some of the code and check for things
that would require another header under MWC? For example, the need to include
float.h (or whatever) when you try and print floats or doubles (along with the
added command pffinit ().) If I were to do this, I believe it would go beyond
what ANSI.C offers. (I'm not sure about ANSIFRONT, because I can't seem to get
an answer on which version is the latest, and, of course, we can't get our
hands on the source.)

> The use of things like MS findnext() function and other functions not in the
> libraries had to be  worked around.

I'm not too sure as to which language I'm going to use to write this thing in.
I'm going between Python or C.  I would love to write this sucker in C, just for
the sake of it. (I love programming C.) But, Python offers a lot of standard
tools to deal with strings, etc. that I would have to write if I were doing this
in C. Both offer the flexability of running in the big 3 OS's if I write the
program in the standard, so that isn't much of an issue. The only major drawback
to Python is... I'm still learning it. I'm a Python n00b. :)

-M.



More information about the Coco mailing list