Re: K&R -> ANSI?



Joachim Schmitz <nospam.jojo@xxxxxxxxxxxxxxxxxx> wrote:
"Zach" <netrek@xxxxxxxxx> schrieb im Newsbeitrag
news:1174154640.089921.295000@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I am looking for a program which can automatically convert K&R C code
to ANSI C code.
protoize, comes with gcc

When I first noticed protoize, I found that it would change the
default type promotions. Checking now, I see this is still the
case:

int foobar(a,b)
char a;
short b;
{
return a * b;
}

becomes (with protoize)

int foobar(char a, short int b)
{
return a * b;
}

where cproto will give

int foobar(int a, int b);

--
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net
.