Operating System - HP-UX
1827838 Members
1480 Online
109969 Solutions
New Discussion

How to recognize Ansi C compiler is installed

 
SOLVED
Go to solution
Frank de Vries
Respected Contributor

How to recognize Ansi C compiler is installed

I have two development servers:
(We are migrating stuff from the donkey to the race horse:)
1) The old donkey D270 running hpux-10.00.
When I do a swlist -l subproducts | grep -i Ansi there I get this output:
[root@devor:]/root<>>> swlist -l subproduct | grep -i ansi
# C-ANSI-C B.10.20.00 HP C/ANSI C Compiler
C-ANSI-C.Development C Runtime environment
C-ANSI-C.Help On-line Help
C-ANSI-C.Manuals C and C-TOOLS References Pages

But when I run the what command on it:
[root@devor:]/usr/bin<>>> what cc
cc:
LINT A.10.32.03 CXREF A.10.32.03
HP92453-01 A.10.32.03 HP C Compiler
/usr/lib/libc: $Revision: 76.3 $
[root@devor:]/usr/bin<>>>

It does not realy confirm it is Ansi.
(Although we know it works here)

However, on the newer machine
2) This is a N4000 running hpux 11.00
and when I do a swlist -l subproduct | grep -i ansi I get no output.

Still there is a compilor running:
[root@orasrv2:]/root<>>> what /usr/bin/cc
/usr/bin/cc:
HP92453-01 A.11.00.00 HP C (Bundled) Compiler
CUPROS_IC23B //1
/ux/core/libs/libc/archive_pa1/libc.a_ID
Oct 21 1997 13:07:38
[root@orasrv2:]/root<>>>

When I started here they told me they had
installed an Ansi compiler for c
So how can I be sure there is one or not ?
Any tests I can do ?

Thanks
Look before you leap
5 REPLIES 5
Geoff Wild
Honored Contributor

Re: How to recognize Ansi C compiler is installed

"Bundled" from the "what output" means it is the built in compiler - for making kernels, etc.

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Frank de Vries
Respected Contributor

Re: How to recognize Ansi C compiler is installed

I also found out in the meantime a little test from a another post here:

cc -Aa bogusfile.c
(Bundled) cc: warning 480: The -A option is available only with the C/ANSI C product; ignored.
(Bundled) cc: warning 485: Can't open "bogusfile.c".

apparently if it says that , the Ansi compilor is not there period.


Look before you leap
James R. Ferguson
Acclaimed Contributor
Solution

Re: How to recognize Ansi C compiler is installed

Hi Frank:

The "bundled" compiler is *not* ANSI C.

During installation of ANSI C, a link from '/usr/bin/cc' is created to point to the product. Thus:

# whereis cc
cc: /usr/bin/cc /usr/ccs/bin/cc /opt/ansic/bin/cc /opt/ansic/share/man/man1.Z/cc
.1

# ls -l /usr/bin/cc
lr-xr-xr-t 1 root sys 17 Jan 29 2004 /usr/bin/cc -> /opt/an
sic/bin/cc

As for tests, the bundled C compiler does not support ANSI prototypes.

Regards!

...JRF...
Dennis Handly
Acclaimed Contributor

Re: How to recognize Ansi C compiler is installed

>JRF: As for tests, the bundled C compiler does not support ANSI prototypes.

This isn't true on IPF, that compiler doesn't support K&R.
Frank de Vries
Respected Contributor

Re: How to recognize Ansi C compiler is installed

Apparently management here decided years back to deinstall all Ansi c , except for the old donkey. To save peanuts. Now they have the monkey !!!

Thanks for your input though:)
Look before you leap