Unable to compile ANSI compatible code on HP-UX

Hi!!,
my HP-UX - 10.2 compiler doesnt appear to support ANSI style of coding. On compiling my C code, it flags error messages like

error 1705: Function prototypes are an ANSI Feature

Is it a generic problem with the HP compiler or do I need to use some special switches on the command line for compling my code??

Thanx in advance,

JP

I don't think HP C is ANSI compliant. I'm not sure if they offer it as an add-on package. You could always check out <a href="http://gcc.gnu.org">GCC</a> as a widely-used replacement...

The free compiler that comes bundled with hp-ux is basicly just a k&r c. There is a separate c package that they sell that gives you full ansi c.

I think if you want to compile with Ansi C, then there is a compiler aCC... just type the following in the prompt....
$>type aCC

if you are able to get the path, then
$><PATH> <filename>.C

and it will compile the way u want

also if u could give the program, probably could find the actual reason such an error

I am using an aCC-1.23 compiler for compiling this code. Still is doesnt help much. An the code I am try to compile is the GDB source downloaded from GNU site for HP-UX. So, I dont expect errors in the code either.

If it is a source code by GNU, then there is all the possibility that there is a file called makefile...
if that exists, then all you have to do is...
$>make makefile

and it will compile for you....

In my experience the HP compilers are pretty worthless. Download and install the HP-UX version of gcc from here:

http://hpux.cs.utah.edu/hppd/hpux/Gnu/gcc-3.0.1/

I second the motion of PxT..... whenever I work in UNIX shops, one of the first tasks I accomplish is to create a robust GCC development environment. This is true for HP-UX, Solaris, and all other UNIX environments that do not come with GCC, by default.

After you build binaries in the GCC development environment, you can move them to production and other machines as your local rules and regulations on using this code-base apply.

Thank you all for your suggestions..

HP_UX : ANSI Compile Option....

cc -o object source.c -Aa

option is -Aa

good luck...