Databases
cancel
Showing results for 
Search instead for 
Did you mean: 

how to verify if ANSI C is installed

ravisurya
Occasional Visitor

how to verify if ANSI C is installed

Hi,

We have a HP UX machine on which ANSI C is installed(i believe!).
How can i confirm if ANSI C is installed?
please let me know if there is any command available to check this.

If i do :
what /usr/ccs/bin/cc
/usr/ccs/bin/cc:
HP92453-01 A.11.01.21 HP C (Bundled) Compiler
$ Sep 8 2000 23:13:51 $

Now if i do :
/usr/ccs/bin ] aCC --version
aCC: HP ANSI C++ B3910B A.03.25

How can i find out about ANSI C,

BR
bravisurya
7 REPLIES
Yogeeraj_1
Honored Contributor

Re: how to verify if ANSI C is installed

hi Bravisurya,

can you try to run the following command:

swlist -l product |grep "ANSI C compiler"


kind regards
yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
Ralph Grothe
Honored Contributor

Re: how to verify if ANSI C is installed

Another indicator would be if your
/usr/bin/cc was a mere symlink to /opt/ansic/bin/cc
But of course the proper verification is via swlist.
Madness, thy name is system administration
H.Merijn Brand (procura
Honored Contributor

Re: how to verify if ANSI C is installed

If you're somehow not allowed to use swlist (yes, I've seen that being shielded from `ordonary users once), you can check the poor-man's way:

x1:/tmp 132 > echo "int main (int argc, char *argv[]) { return (0); }" >xx.c
x1:/tmp 133 > cc -c -Ae xx.c
x1:/tmp 134 > cc_bundled -c -Ae xx.c
(Bundled) cc: warning 922: "-Ae" is unsupported in the bundled compiler, ignored.
x1:/tmp 135 >

So, if -Ae doesn't complain, you have the ANSI version.

Enjoy, Have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
Dennis Handly
Acclaimed Contributor

Re: how to verify if ANSI C is installed

>Ralph: /usr/bin/cc was a mere symlink to /opt/ansic/bin/cc

On 11.31 IPF and the next 11.23 version, that link will be to /opt/aCC/bin/cc. So the correct check is to see that it isn't to /usr/ccs/bin/cc.
Hein van den Heuvel
Honored Contributor

Re: how to verify if ANSI C is installed

Check with --version

You don't even need a temp program.
Both compilers support a --version.

For example:

$ cc --version
cc: HP C/aC++ B3910B A.06.14 [Feb 22 2007]

$ /usr/ccs/bin/cc --version
(Bundled) cc: HP C/aC++ B3910B A.06.12 [Oct 11 2006]


For added info, toss in the -Ae

$ cc -Ae --version
cc: HP C/aC++ B3910B A.06.14 [Feb 22 2007]
$ /usr/ccs/bin/cc -Ae --version
(Bundled) cc: warning 922: "-Ae" is unsupported in the bundled compiler, ignored.
(Bundled) cc: HP C/aC++ B3910B A.06.12 [Oct 11 2006]


Hope this helps some,
Hein van den Heuvel (at gmail dot com)
HvdH Performance Consulting






Dennis Handly
Acclaimed Contributor

Re: how to verify if ANSI C is installed

>Hein: You don't even need a temp program.
Both compilers support a --version.

Unfortunately the PA compiler must have a source file before the -V option works.
But you can use what(1) on them.

(Bundled) cc: warning 922: "-Ae" is unsupported in the bundled compiler, ignored.

Note: K&R is not supported on IPF.
Hein van den Heuvel
Honored Contributor

Re: how to verify if ANSI C is installed

Argh yes. Thanks Dennis. I just work on IPFs, but PA is still the bulk and that's where thiis question is relevant. Sorry all.
Hein.