ANSI -> K&R ?

L

llothar

Is there any tool that can do this transformation?

I want to feed my c code to the HP-UX compiler which i think is only
K&R.
 
T

Tim Prince

llothar said:
Is there any tool that can do this transformation?

I want to feed my c code to the HP-UX compiler which i think is only
K&R.
Install gcc on your HPUX machine, if you're unable to buy the standard C
compiler.
 
K

Keith Thompson

llothar said:
Is there any tool that can do this transformation?

I want to feed my c code to the HP-UX compiler which i think is only
K&R.

There's an old tool called "ansi2knr", but you should consider whether
this is really what you want to do. Tim Prince suggested installing
gcc; I second the recommendation.
 
J

Joachim Schmitz

Keith Thompson said:
There's an old tool called "ansi2knr", but you should consider whether
this is really what you want to do. Tim Prince suggested installing
gcc; I second the recommendation.
Also there's unprotoize, part of gcc

Bye, Jojo
 
L

llothar

Which requires installing gcc which solves the OP's original problem!

Sorry i had this discussion before. GCC on PA-RISC is very very bad,
generated code with HP's compile is almost twice as fast which is
important on this slow CPU's.

GCC is only acceptable on Intel/PPC's. Everywhere else it sucks.
 
J

jaysome

Sorry i had this discussion before. GCC on PA-RISC is very very bad,
generated code with HP's compile is almost twice as fast which is
important on this slow CPU's.

GCC is only acceptable on Intel/PPC's. Everywhere else it sucks.

Microchip's MPLAB C30 compiler is gcc-based. So is the avr-gcc
compiler for Atmel devices. Neither suck, IMHO.
 
I

Ian Collins

llothar said:
Sorry i had this discussion before. GCC on PA-RISC is very very bad,
generated code with HP's compile is almost twice as fast which is
important on this slow CPU's.

GCC is only acceptable on Intel/PPC's. Everywhere else it sucks.
Works fine on sparc.
 
C

CBFalconer

llothar said:
.... snip ...

Sorry i had this discussion before. GCC on PA-RISC is very very
bad, generated code with HP's compile is almost twice as fast
which is important on this slow CPU's.

GCC is only acceptable on Intel/PPC's. Everywhere else it sucks.

If you don't like the code generation for some machine, you are
perfectly free to improve it. It doesn't affect the front end.
 
L

llothar

Works fine on sparc.

You are joking aren't you? If not you don't have any clue what you
talking about.

Sparc is on the worse list, look what Sun Studio does.

On Solaris Intel, as i said, it is okay to use GCC but not on Sparc.
 
L

llothar

llothar wrote:

... snip ...



If you don't like the code generation for some machine, you are
perfectly free to improve it. It doesn't affect the front end.

If you pay me for this, i could try to do so.
But your argument is damned stupid.
 
K

Keith Thompson

llothar said:
If you pay me for this, i could try to do so.
But your argument is damned stupid.

If you want to be taken seriously, try showing a little politeness.
 
M

Malcolm McLean

llothar said:
Sorry i had this discussion before. GCC on PA-RISC is very very bad,
generated code with HP's compile is almost twice as fast which is
important on this slow CPU's.

GCC is only acceptable on Intel/PPC's. Everywhere else it sucks.
I tried it on an N64 some years back. Then gcc tended to beat the commerical
compiler, except that it wouldn't do cross-function optimisation.
 
M

Malcolm McLean

llothar said:
If you pay me for this, i could try to do so.
But your argument is damned stupid.
gcc is open source, and is designed so that it can quite quickly be
retargeted. This means that you can get a C compiler of sorts up and running
for minimal outlay. If you want a really top notch optimiser, someone
somewhere has to put extra effort in. Plenty of public-spirited people do
improve freeware tools for free.
 
T

Tim Prince

llothar said:
Sorry i had this discussion before. GCC on PA-RISC is very very bad,
generated code with HP's compile is almost twice as fast which is
important on this slow CPU's.

GCC is only acceptable on Intel/PPC's. Everywhere else it sucks.
The free K&R compiler on HPUX optimized less than gcc, for any use I
made of it. Did you forget to set -O ?
 
C

Clever Monkey

jaysome said:
Microchip's MPLAB C30 compiler is gcc-based. So is the avr-gcc
compiler for Atmel devices. Neither suck, IMHO.
.... and HP and AIX, where it works fine for us.
 
I

Ian Collins

*Please* don't quote signatures.
I know about this but this is Sun Studio and has little to do with
gcc.
No, it's "GCC For SPARC(tm) Systems". A perfect example of how to
improve gcc code generation for a particular machine.
 
R

Randy Howard

Sorry i had this discussion before. GCC on PA-RISC is very very bad,
generated code with HP's compile is almost twice as fast which is
important on this slow CPU's.

GCC is only acceptable on Intel/PPC's. Everywhere else it sucks.

Not true, it works quite well on a number of embedded processors as
well.
 

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

How to build a char[][] in k&r dialect. 7
K&R -> ANSI? 6
Pointer to function in K&R C 16
K&R p.97 8
When did K&R function declarations become obsolete? 55
GCC/K&R Incompatibility 16
Fibonacci 0
Blue J Ciphertext Program 2

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,143
Latest member
SterlingLa
Top