From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Greg Rudd Newsgroups: gmane.os.tru64.managers Subject: SUMMARY: GCC and CC questions Date: Wed, 09 Jul 2003 16:04:26 +1000 Organization: Univeristy of Sydney ITS Sender: tru64-unix-managers-owner@ornl.gov Message-ID: <200307091604.26527.g.rudd@isu.usyd.edu.au> References: <200307041611.16261.g.rudd@isu.usyd.edu.au> Reply-To: g.rudd@isu.usyd.edu.au NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: main.gmane.org 1057730652 7810 80.91.224.249 (9 Jul 2003 06:04:12 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 9 Jul 2003 06:04:12 +0000 (UTC) Cc: esu-staff@mail.usyd.edu.au Original-X-From: tru64-unix-managers-owner-gotm-tru64-unix-managers=m.gmane.org@sws1.ctd.ornl.gov Wed Jul 09 08:04:10 2003 Return-path: Original-Received: from sws1.ornl.gov ([160.91.1.101]) by main.gmane.org with smtp (Exim 3.35 #1 (Debian)) id 19a83l-00021h-00 for ; Wed, 09 Jul 2003 08:04:09 +0200 Original-Received: (qmail 32586 invoked by uid 5); 9 Jul 2003 06:04:41 -0000 Original-Followup-To: poster Precedence: bulk Original-Received: (qmail 32577 invoked by uid 49493); 9 Jul 2003 06:04:41 -0000 Original-Received: from g.rudd@isu.usyd.edu.au by sws1 by uid 49491 with qmail-scanner-1.14 (clamscan: 0.54. spamassassin: 2.50-cvs. Clear:SA:0(-2.5/5.0):. Processed in 0.82468 secs); 09 Jul 2003 06:04:41 -0000 Original-Received: from unknown (HELO emroute3.ornl.gov) (160.91.4.110) by 0 with SMTP; 9 Jul 2003 06:04:40 -0000 Original-Received: from emroute3.ornl.gov (localhost [127.0.0.1]) by emroute3.ornl.gov (PMDF V6.2 #30669) with ESMTP id <0HHQ00M1SU7RYU@emroute3.ornl.gov> for tru64-unix-managers@sws1.ctd.ornl.gov (ORCPT tru64-unix-managers@ornl.gov) ; Wed, 09 Jul 2003 02:04:39 -0400 (EDT) Original-Received: from lorica.ucc.usyd.edu.au (lorica.ucc.usyd.edu.au [129.78.64.15]) by emroute3.ornl.gov (PMDF V6.2 #30669) with ESMTP id <0HHQ00AAGU7H5P@emroute3.ornl.gov> for tru64-unix-managers@sws1.ctd.ornl.gov (ORCPT tru64-unix-managers@ornl.gov) ; Wed, 09 Jul 2003 02:04:30 -0400 (EDT) Original-Received: from oberon.ucc.usyd.edu.au (oberon.ucc.usyd.edu.au [129.78.64.20]) by lorica.ucc.usyd.edu.au (8.12.9/8.12.9) with ESMTP id h6964RrS019646; Wed, 09 Jul 2003 16:04:27 +1000 (EST) In-reply-to: <200307041611.16261.g.rudd@isu.usyd.edu.au> Original-To: tru64-unix-managers@ornl.gov User-Agent: KMail/1.4.3 X-RAVMilter-Version: 8.4.3(snapshot 20030401) (lorica) Xref: main.gmane.org gmane.os.tru64.managers:4789 X-Report-Spam: http://spam.gmane.org/gmane.os.tru64.managers:4789 Thanks to both Nikola Milutinovic and Tom Webster for their swift and hel= pfull=20 replies!! :-) The basic consensis is that as a C compiller GCC is far to relaxed in typ= e=20 checking hence a program that will compile with out error or warning on G= CC=20 will most likely bomb out on Compaq CC. =20 To get simmilar behaviour to GCC with the standard Compaq CC compiler the= =20 following flags will have to be given to the C compiler For 4.0x and 5.1x systems the flag would be -std On the other hand Tom pointed me to the Developers Tool Kit version of th= e=20 Compaq C compiler. Which has GCC mode compatibility switched on by defa= ult.=20 To get GNU G++ compatibility with the Compaq C++ compiler you will have t= o=20 issue the following flag to the compiler.=20 "-std gnu" However the is one catch if you want to use the DTK version of the Compaq= C=20 compiler in that it requires the OSF-DEV licence as Tom points out which = you=20 should this licence installed if you are compiling anything other than th= e=20 kernel. Also if you are compiling a lot of open source software it is recomended = that=20 you install GNU make which is avalible from http://www.gnu.org To download the DTK version of the Compaq CC compiler you can go to=20 http://h30097.www3.hp.com/tools.html#application Also worth noting that they three standards of C at the moment with two f= ormal=20 standards ( ANSI and K&R) and one informal ( GNU C) which is widely sprea= d. =20 As Nickola replies to my wish list "An even better wish-list would be to=20 attempt standardising GNU C syntax. If it is coherent, if it brings furth= er=20 abilities, then let's push it as a formal standard. This way we have 3 fo= rmal=20 standards and one informal, but widely spread." Which I tend to agree wit= h. -greg Original Question Friday 04 July 2003 16:11, Greg Rudd wrote: > Hi All > > Sorry if this might have been answered answered before but I am trying = to > get the compaq cc compiler to perfrom the in the same way as gcc. My s= ort > understanding that the default behaviour of gcc is that of relaxed K&R = with > relaxed ansi. Also another thing that I have noticed that gcc is far l= ess > strict with type checking than the compaq cc compiler . What flag shoul= d I > use to get the exact or simmilar behaviour of gcc with cc. > BTW What would be a good wish list would be for cc in a future version = of > tru64 to have a -gnu flag so as you get the benefits of the compaq cc > optimisation when compiling some open source software. > > > Thanks in advance > > -greg --=20 Greg Rudd Computer Systems Officer Information Technology Services University Of Sydney PH: +61 2 9351 5531 Fax +61 2 0351 6004 email: grudd@mail.usyd.edu.au ------------------------------------------------- /"\ ASCII Ribbon Campaign against HTML \ / email=20 X =20 / \ ------------------------------------------------- For more info on why you should not send html in email go to http://www.american.edu/cas/econ/htmlmail.htm