SUMMARY: GCC and CC questions

From: Greg Rudd <g.rudd_at_isu.usyd.edu.au>
Date: Wed, 09 Jul 2003 16:04:26 +1000

Thanks to both Nikola Milutinovic and Tom Webster for their swift and helpfull
replies!! :-)

The basic consensis is that as a C compiller GCC is far to relaxed in type
checking hence a program that will compile with out error or warning on GCC
will most likely bomb out on Compaq CC.

To get simmilar behaviour to GCC with the standard Compaq CC compiler the
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 the
Compaq C compiler. Which has GCC mode compatibility switched on by default.
To get GNU G++ compatibility with the Compaq C++ compiler you will have to
issue the following flag to the compiler.

"-std gnu"

However the is one catch if you want to use the DTK version of the Compaq C
compiler in that it requires the OSF-DEV licence as Tom points out which you
should this licence installed if you are compiling anything other than the
kernel.


Also if you are compiling a lot of open source software it is recomended that
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
http://h30097.www3.hp.com/tools.html#application

Also worth noting that they three standards of C at the moment with two formal
standards ( ANSI and K&R) and one informal ( GNU C) which is widely spread.
As Nickola replies to my wish list "An even better wish-list would be to
attempt standardising GNU C syntax. If it is coherent, if it brings further
abilities, then let's push it as a formal standard. This way we have 3 formal
standards and one informal, but widely spread." Which I tend to agree with.

-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 sort
> 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 less
> strict with type checking than the compaq cc compiler . What flag should 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

-- 
Greg Rudd
Computer Systems Officer
Information Technology Services
University Of Sydney
PH: +61 2 9351 5531
Fax +61 2 0351 6004
email: grudd_at_mail.usyd.edu.au
-------------------------------------------------
/"\  ASCII Ribbon Campaign against HTML
\ /  email 
X   
/ \
-------------------------------------------------
For more info on why you should not send html in email go to
http://www.american.edu/cas/econ/htmlmail.htm
Received on Wed Jul 09 2003 - 06:05:13 NZST

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:44 NZDT