Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Does anyone have a tool for converting old-style C programs to ANSI C, or vice versa, or for automatically generating prototypes?

0
Posted

Does anyone have a tool for converting old-style C programs to ANSI C, or vice versa, or for automatically generating prototypes?

0

Two programs, protoize and unprotoize, convert back and forth between prototyped and “old style” function definitions and declarations. (These programs do not handle full-blown translation between “Classic” C and ANSI C.) These programs are part of the FSF’s GNU C compiler distribution; see question 18.3. The unproto program (/pub/unix/unproto5.shar.Z on ftp.win.tue.nl) is a filter which sits between the preprocessor and the next compiler pass, converting most of ANSI C to traditional C on-the-fly. The GNU GhostScript package comes with a little program called ansi2knr. Before converting ANSI C back to old-style, beware that such a conversion cannot always be made both safely and automatically. ANSI C introduces new features and complexities not found in K&R C. You’ll especially need to be careful of prototyped function calls; you’ll probably need to insert explicit casts. See also questions 11.3 and 11.29a. Several prototype generators exist, many as modifications to lint. A progr

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123