K&R -> ANSI?

Z

Zach

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

Zach
 
T

Thomas Dickey

Joachim Schmitz said:
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);
 
Z

Zach

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
 
Z

Zach

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top