1834026 Members
2243 Online
110063 Solutions
New Discussion

HP compiler question ?

 
SOLVED
Go to solution
Charles Harris
Super Advisor

HP compiler question ?

Dear all,

Just a quickie.....

I am trying to write a small function in C to speed up reporting, to chop up selected data rather than using awk (too slow).
I am having problems working out (cc) - how the compiler works - it doesn't seem to accept proto typing or
normal passing of parameters. Does anyone know how the compiler passes parameters or if there is another that does?


Any help, tips, comments warmly received as ever!

Cheers,

-ChaZ-
4 REPLIES 4
Magdi KAMAL
Respected Contributor

Re: HP compiler question ?

Hi ChaZ,

May you please post the sample that you use and which is not working just for speeding the debug process for what you are doing ?

Normaly, cc is working fine.

Magdi
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: HP compiler question ?

Hi Charles:

I suspect that you are using the bundled c compiler; all it speaks is K&R so no prototyping. You will need to buy the ANSI/C compiler of aC++ if you want ANSI features. For such a trivial task, the bundled C compiler should suffice but you will have to convert your function parameters to K&R style.

I would also look into coding your routine in Perl. Perl p-code is very efficient and I suspect it will be almost as fast as doing it
in C unless you are doing some really heavy duty stuff like building a compiler.

Clay
If it ain't broke, I can fix that.
Charles Harris
Super Advisor

Re: HP compiler question ?

Thanks again for the tips, I was trying to use the standard compiler, I'll do it in perl, it's probably easier anyway!
As for the writing of my own compiler...... I'll leave that to the trusty hands of the HP ladies and gentlemen!

Cheers!

-ChaZ-
Bill Hassell
Honored Contributor

Re: HP compiler question ?

Note that the default C compiler is a K&R compiler, not ANSI. SO if you use ANSI structures and protoypes, the compile will flag these as incompatible. You'll need to purchase the ANSI compiler or download the GCC compiler from devresource.hp.com


Bill Hassell, sysadmin