Zach said:
Looking for a program that will convert K&R C source files (including
headers) to C99 (or at least some early ANSI standard) and it must
recognize typedefs and preserve argument promotion; protoize doesn't
and cproto tries but doesn't do a good job
Promotion is the hard part, so hard I don't think it
can be done perfectly. For example, I don't think there
is *any* way to write a prototyped function equivalent to
int f(c)
char c;
{ ... }
.... because char promotes to int on most platforms but
to unsigned int on a few. You'd get similar problems with
int g(x)
int16_t x;
{ ... }
.... but I imagine this would be rarer; K&R-style functions
probably predate the invention of C99 types.
Can you explain your situation a little more? For
example, why do you want to introduce prototypes AND
retain the argument promotions of un-prototyped functions?
Planning on converting only part of the code (ick)?
Or attack it from the other side: Explain just what it
is about the tools you've tried that fails to meet your need.