By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,261 Members | 1,325 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,261 IT Pros & Developers. It's quick & easy.

K&R -> ANSI?

P: n/a
I am looking for a program which can automatically convert K&R C code
to ANSI C code.

Zach

Mar 17 '07 #1
Share this Question
Share on Google+
6 Replies


P: n/a
"Zach" <ne****@gmail.comschrieb im Newsbeitrag
news:11**********************@d57g2000hsg.googlegr oups.com...
>I am looking for a program which can automatically convert K&R C code
to ANSI C code.
protoize, comes with gcc

Bye, Jojo
Mar 17 '07 #2

P: n/a
Zach wrote:
I am looking for a program which can automatically convert K&R C code
to ANSI C code.
Have a look at cproto or protoize.

<http://cproto.sourceforge.net/>
<http://gcc.gnu.org/onlinedocs/gcc/Running-Protoize.html>

Mar 17 '07 #3

P: n/a
santosh <sa*********@gmail.comwrote:
Have a look at cproto or protoize.
<http://cproto.sourceforge.net/>
http://invisible-island.net/cproto

--
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net
Mar 17 '07 #4

P: n/a
Joachim Schmitz <no*********@schmitz-digital.dewrote:
"Zach" <ne****@gmail.comschrieb im Newsbeitrag
news:11**********************@d57g2000hsg.googlegr oups.com...
>>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
Mar 17 '07 #5

P: n/a
On Mar 17, 2:38 pm, Thomas Dickey <dic...@saltmine.radix.netwrote:
Joachim Schmitz <nospam.j...@schmitz-digital.dewrote:
"Zach" <net...@gmail.comschrieb im Newsbeitrag
news:11**********************@d57g2000hsg.googlegr oups.com...
>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);
Thanks for the heads up. Everyone else who replied I also thanks!

Zach

Mar 18 '07 #6

P: n/a
On Mar 17, 2:38 pm, Thomas Dickey <dic...@saltmine.radix.netwrote:
Joachim Schmitz <nospam.j...@schmitz-digital.dewrote:
"Zach" <net...@gmail.comschrieb im Newsbeitrag
news:11**********************@d57g2000hsg.googlegr oups.com...
>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);
Thanks for the heads up. Everyone else who replied I also thanks!

Zach

Mar 18 '07 #7

This discussion thread is closed

Replies have been disabled for this discussion.