Operating System - HP-UX
1752782 Members
6162 Online
108789 Solutions
New Discussion юеВ

Trouble compiling c program

 
William Pribble
Frequent Advisor

Trouble compiling c program

We are migrating from a 11.11 PA-RISC system to an 11.23 Itanium system.

We have some custom program written in C that we will need to recompile on the Itanium system.

The method to compile these programs on the 11.11 PA-RISC system was
$ cc -Wall program_name.c -o program_name

This syntax is not working on our Itanium 11.23 system.

Here is the error I get on the 11.23 Itanium system.

cc: error 1914: bad form for `-W' option


The C compiler on the 11.11 PA-RISC system is B.11.11.12 C-ANSI-C Compiler

The C compiler on the 11.23 Itanium system is
C.06.15 C/aC++ Compiler

I believe it has to due with the new options in the C compiler, but I am looking for some help from you excellent folks on finding a slolution.

Thanks
Bill
7 REPLIES 7
James R. Ferguson
Acclaimed Contributor

Re: Trouble compiling c program

Hi Bill:

Have a look at:

http://docs.hp.com/en/14487/options.htm

Regards!

...JRF...
Raj D.
Honored Contributor

Re: Trouble compiling c program

Bill,

Also take a look at the release note if you can fid something for W option:

http://docs.hp.com/en/B3901-90031/B3901-90031.pdf

Hth,
Raj.
" If u think u can , If u think u cannot , - You are always Right . "
Steven Schweda
Honored Contributor

Re: Trouble compiling c program

> $ cc -Wall program_name.c -o program_name

> The C compiler on the 11.11 PA-RISC system
> is B.11.11.12 C-ANSI-C Compiler

Really? "-Wall" sure looks like a GCC
option. I'd try to verify which C compiler
you're actually using. (Unless "B.11.11.12
C-ANSI-C Compiler" is more GCC-compatible
than I'd expect it to be.)

http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Warning-Options.html
Dennis Handly
Acclaimed Contributor

Re: Trouble compiling c program

As Steven said, -Wall is an invalid option for HP-UX compilers and valid for GNU.

For Integrity, the closest option is +wlint.

It appears that the PA C compiler incorrectly parses this as: -Wa,l
Which is ignored unless you are assembling a .s file.

>C.06.15 C/aC++ Compiler

This is obsolete, the latest patch is A.06.23.
dirk dierickx
Honored Contributor

Re: Trouble compiling c program

you can also get gcc for hpux itanium if you must use it. ofcourse, it's possible that when you use the correct flags, your program won't compile because each compiler has his dialects (even between gcc versions, although it will mostly manage these).

so in the end, the easiest solution might be to just go for gcc.
Steven Schweda
Honored Contributor

Re: Trouble compiling c program

> [...] go for gcc.

Certainly, it makes sense to use a command
which is appropriate for your compiler. If
you wish to use the HP compiler, then use a
command which that compiler understands. If
you wish to use a GCC-compatible command,
then use a compiler which can understand that
command. GCC, for example.

The obvious next mystery would be why you're
using that particular command. While it may
have worked better with the older HP
compiler, it never was really appropriate.
Dennis Handly
Acclaimed Contributor

Re: Trouble compiling c program

>Steven: why you're using that particular command. While it may have worked better with the older HP compiler, it never was really appropriate.

Because the driver didn't give an error?
Right. These two are connected.