- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: HP C/ANSI C?
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2005 11:16 AM
06-13-2005 11:16 AM
HP C/ANSI C?
How do I set the path for /opt/ansic/bin/cc?
I have removed /usr/ccs/bin from ect/PATH.
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2005 11:29 AM
06-13-2005 11:29 AM
Re: HP C/ANSI C?
# cat /etc/PATH
/usr/bin:/opt/ansic/bin:/usr/ccs/bin:/usr/contrib/bin:/opt/nettladm/bin:/opt/fc/bin:/opt/fcms/bin:/opt/upgrade/bin:/opt/pd/bin:/usr/bin/X11:/usr/contrib/bin/X11:/opt/resmon/bin:/usr/sbin/diag/contrib:/opt/pred/bin:/opt/hparray/bin:/pro/local/bin:/pro/bin:/opt/perf/bin:/opt/hpnp/bin:/opt/langtools/bin:/opt/imake/bin:/opt/cxperf/bin:/opt/ignite/bin:/opt/openssh2/bin:/opt/sec_mgmt/spc/bin:/usr/local/bin:/usr/local/sbin:/opt/java1.4/jre/bin:/opt/graphics/common/bin:/pro/local/libexec:/pro/local/sbin:/usr/local/mysql/bin:/pro/local/samba/bin:/pro/local/samba/sbin
and for one time use
(t)csh:
% setenv PATH /opt/ansic/bin:/usr/ccs/bin:$PATH
(k)sh:
> export PATH=/opt/ansic/bin:/usr/ccs/bin:$PATH
Enjoy, Have FUN! H.Merijn
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2005 11:30 AM
06-13-2005 11:30 AM
Re: HP C/ANSI C?
I would say add the entry /opt/ansic/bin to ect/PATH file or you could append
/opt/ansic/bin to PATH defnition in /etc/profile file.
regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2005 11:45 AM
06-13-2005 11:45 AM
Re: HP C/ANSI C?
But how can I tell if it is using the ansic compiler?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2005 11:50 AM
06-13-2005 11:50 AM
Re: HP C/ANSI C?
Try the following command..
which cc
this will tell you which cc will be used when you involke the command.
Regards.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2005 11:55 AM
06-13-2005 11:55 AM
Re: HP C/ANSI C?
/usr/ccs/bin/ld: Unsatisfied symbols:
main
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2005 12:00 PM
06-13-2005 12:00 PM
Re: HP C/ANSI C?
Please type..
"which cc"
Without quotes.."Which" is a command.
Regards..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2005 12:04 PM
06-13-2005 12:04 PM
Re: HP C/ANSI C?
/bin/cc
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2005 06:32 PM
06-13-2005 06:32 PM
Re: HP C/ANSI C?
10223 100555 -r-x 1 bin 618496 25 Jan 2005 06:26 /usr/bin/cc -> /opt/ansic/bin/cc
10223 100555 -r-x 1 bin 618496 25 Jan 2005 06:26 /opt/ansic/bin/cc
8405 100555 -r-x 1 bin 225280 7 Nov 1997 09:00 /usr/ccs/bin/cc -> ./cc_bundled
This is the ANSI-C C compiler:
a5:/u/usr/merijn 102 > what `which cc`
/usr/bin/cc:
$Revision: 92453-07 linker linker crt0.o B.11.37 040218 $
LINT B.11.X.32509-32512.GP CXREF B.11.X.32509-32512.GP
HP92453-01 B.11.X.32509-32512.GP HP C Compiler
$ PATCH/11.00:PHCO_27774 Oct 3 2002 09:45:59 $
a5:/u/usr/merijn 103 >
And this is the bundled braindead compiler:
a5:/u/usr/merijn 103 > what `which cc_bundled`
/usr/ccs/bin/cc_bundled:
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
a5:/u/usr/merijn 104 >
You can also pass -v to the compile phase:
a5:/tmp 108 > cat >xx.c
#include
int main (int argc, char *argv[])
{
return (0);
} /* main */
a5:/tmp 109 > cc -v -o xx xx.c
cc: informational note 404: NLSPATH is /opt/ansic/lib/nls/msg/%L/%N.cat:/opt/ansic/lib/nls/msg/C/%N.cat:
cc: informational note 404: INCLUDIR is INCLUDIR=/usr/include
cc: informational note 404: CCOPTS is not set.
/opt/langtools/lbin/cpp.ansi xx.c /tmp/ctmAAAa14252 -$ -D__hp9000s800 -D__hppa -D__hpux -D__unix -D_ILP32 -e -D_PA_RISC2_0 -D_HPUX_SOURCE -D__STDC_EXT__ -D__HP_cc=111108
cc: informational note 411: Entering Preprocessor.
/opt/ansic/lbin/ccom /tmp/ctmAAAa14252 xx.o -Fxx.c -Oq00,al,ag,cn,Lm,sz,Ic,vo,lc,mf,Po,es,rs,sp,in,vc,pi,fa,pe,Rr,Fl,pv,pa,nf,cp,lx,st,ap,Pg,ug,lu,lb,uj,dp,fs,bp,wp,cl,mo,xn,Ex,mp,rp,ap,dn,Sg,pt,kt,Em,pc,np! -ESconstlit -Ae
cc: informational note 404: LPATH is /usr/lib:/opt/langtools/lib:
/usr/ccs/bin/ld /opt/langtools/lib/crt0.o -o xx xx.o -u main -lc
cc: informational note 413: Entering Link editor.
a5:/tmp 110 >
There the difference with the braindead bundled compiler is obvious:
a5:/tmp 110 > cc_bundled -v -o xx xx.c
(Bundled) cc: NLSPATH is /usr/lib/nls/msg/%L/%N.cat:/usr/lib/nls/msg/C/%N.cat:
(Bundled) cc: CCOPTS is not set.
(Bundled) cc: INCLUDIR is INCLUDIR=/usr/include
/usr/ccs/lbin/cpp xx.c /tmp/ctmAAAa14300 -$ -D__hp9000s800 -D__hppa -D__hpux -D__unix -D_PA_RISC1_1 -D__CLASSIC_C__ -j
(Bundled) cc: Entering Preprocessor.
/usr/ccs/lbin/ccom /tmp/ctmAAAa14300 xx.o
(Bundled) cc: "xx.c", line 3: error 1705: Function prototypes are an ANSI feature.
Exit 1
a5:/tmp 111 >
And finally you can check the generated object:
a5:/tmp 112 > odump -compunit xx
Compilation Unit Dictionary from xx:
Index Chunk Language Name
Product_id ; Version_id
Compile time ; Source time
0 0 PA-RISC 2.0 Assembler crt0.o
HP92453-03; UX.11.01.24
Compile Time: Thu Dec 04 2003 22:54:57.000000000 MET
Source Time: Thu Dec 04 2003 22:55:07.000000000 MET
1 0 HPC ../mapdld.c
/CLO/Components/LINKER/Src/csu/CRT_RELEASE
ccom options = -ESlit -DA1.1 -DS1.1 -Oq02,al,ag,cn,Lm,sz,Ic,vo,lc,Mf,Po,es,rs,s
p,in,vc,Pi,fa,pe,Rr,Fl,pv,pa,nf,cp,lx,st,ap,Pg,ug,Lu,lb,uj,dp,Fs,bp,wp,Ex,mp,rp,
ap,dn,Sg,pt,kt,Em,pc,np! +k -Ae
HP92453-01 ; W111107
Compile Time: Thu Dec 04 2003 22:55:35.000000000 MET
Source Time: Thu Jan 23 2003 11:17:33.000000000 MET
2 0 PA-RISC 2.0 Assembler
HP92453-03; UX.11.01.24
Compile Time: Thu Dec 04 2003 22:55:02.000000000 MET
Source Time: None
3 0 HPC ../maptsd.c
/CLO/Components/LINKER/Src/csu/CRT_RELEASE
ccom options = -ESlit -DA1.1 -DS1.1 -Oq02,al,ag,cn,Lm,sz,Ic,vo,lc,Mf,Po,es,rs,s
p,in,vc,Pi,fa,pe,Rr,Fl,pv,pa,nf,cp,lx,st,ap,Pg,ug,Lu,lb,uj,dp,Fs,bp,wp,Ex,mp,rp,
ap,dn,Sg,pt,kt,Em,pc,np! +k -Ae
HP92453-01 ; W111107
Compile Time: Thu Dec 04 2003 22:55:15.000000000 MET
Source Time: Thu Jan 23 2003 11:17:35.000000000 MET
4 0 PA-RISC 2.0 Assembler set_tp
HP92453-03; UX.11.01.24
Compile Time: Thu Dec 04 2003 22:55:07.000000000 MET
Source Time: Sat Oct 04 1997 05:02:46.000000000 METDST
5 0 HPC xx.c
/tmp
ccom options = -Oq00,al,ag,cn,Lm,sz,Ic,vo,lc,mf,Po,es,rs,sp,in,vc,pi,fa,pe,Rr,F
l,pv,pa,nf,cp,lx,st,ap,Pg,ug,lu,lb,uj,dp,fs,bp,wp,cl,mo,xn,Ex,mp,rp,ap,dn,Sg,pt,
kt,Em,pc,np! -ESconstlit -Ae
HP92453-01 ; B11X.25
Compile Time: Tue Jun 14 2005 08:30:19.000000000 METDST
Source Time: Tue Jun 14 2005 08:28:44.000000000 METDST
6 0 PA-RISC 2.0 Assembler dyncallU
HP92453-03; UX.11.01.06 (ROSE)
Compile Time: Fri Jan 08 1999 01:46:03.000000000 MET
Source Time: Fri Jan 08 1999 01:46:03.000000000 MET
a5:/tmp 113 >
Enjoy, Have FUN! H.Merijn
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2005 07:23 PM
06-13-2005 07:23 PM
Re: HP C/ANSI C?
On my system they look like
$ ll /bin/cc
lr-xr-xr-t 1 root sys 17 Oct 14 2004 /bin/cc -> /opt/ansic/bin/cc
$ ll /usr/bin/cc
lr-xr-xr-t 1 root sys 17 Oct 14 2004 /usr/bin/cc -> /opt/ansic/bin/cc