Date: Fri, 9 Jul 1999 18:16:50 +0100 From: Mark Ovens <markov@globalnet.co.uk> To: "Mikhail V. Evstiounin" <evs@telerama.com> Cc: Rezamys <rezath@tm.net.my>, freebsd-questions@FreeBSD.ORG Subject: Re: newbie: how to compile & run C program in 3.2Release? Message-ID: <19990709181649.A263@marder-1> In-Reply-To: <003601beca04$87ad15e0$6f27abcd@mvehpc.evs.slip.lm.com>; from Mikhail V. Evstiounin on Fri, Jul 09, 1999 at 08:13:58AM -0400 References: <003601beca04$87ad15e0$6f27abcd@mvehpc.evs.slip.lm.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Jul 09, 1999 at 08:13:58AM -0400, Mikhail V. Evstiounin wrote:
> Hi!
>
>
> My company is using gcc on HP-UX 10.20 and 11.0. I installed
> all versions of gcc starting from 2.5 on all our machines - HP
> boxes, IBM RS 6000 boxes, Sequent Boxes. As a result I am trying to
> follow any news in gcc world.
>
> There is a difference between 2.7.1.1 and 2.8.1 in terms of C++
> (I believe, since version 2, gcc and g++ were combined as one
> compiler g++).
Correct, however there are still 2 binaries:
marder-1:/usr/marko{57}% ls -l `which gcc g++`
-r-xr-xr-x 3 root wheel 4720 Feb 15 10:42 /usr/bin/g++
-r-xr-xr-x 2 root wheel 49544 Feb 15 10:42 /usr/bin/gcc
Which one you use determines some compiler defaults. From the
manpage:
The C and C++ compilers are integrated. Both process
input files through one or more of four stages: prepro-
cessing, compilation, assembly, and linking. Source file-
name suffixes identify the source language, but which name
you use for the compiler governs default assumptions:
gcc assumes preprocessed (.i) files are C and assumes C
style linking.
g++ assumes preprocessed (.i) files are C++ and assumes
C++ style linking.
> 2.8.1 works with templates much closer to C++ standard v.3.0, but
> still doesn't have namespaces, correct exceptions and something else.
And egcs works even better with templates.
However, as the original poster is at the "Hello, World" stage I
don't think that they would gain any benefit from using 2.8.1 over
the default.
> According to docs, gcc 2.8.1 does a little better job in terms of
> optimizations.
> It can affect you if you use -O3 parameter.
>
> -----Original Message-----
> From: Mark Ovens <markov@globalnet.co.uk>
> To: Rezamys <rezath@tm.net.my>
> Cc: freebsd-questions@FreeBSD.ORG <freebsd-questions@FreeBSD.ORG>
> Date: Thursday, July 08, 1999 3:09 PM
> Subject: Re: newbie: how to compile & run C program in 3.2Release?
>
>
> >On Thu, Jul 08, 1999 at 11:33:07AM +0800, Rezamys wrote:
> >> Hi Mark,
> >> Okay, tried it last nite. It was fine. Thanks!
> >> I did this (very simple program...):
> >>
> >> #include <stdio.h>
>
>
> [skipped]
>
> >I'm not sure what you're asking here. cc *is* a GNU compiler. If
> >you mean will gcc work, then yes, but you're already using it. The
> >default version with FreeBSD is 2.7.2.1, this is the only one
> >verified to build kernels. You can install gcc-2.8.1 (which you
> >use as gcc -o hello hello.c). This won't overwrite the default so
> >you will have 2 versions.
> >
> >I doubt, however, that you will need anymore than the default.
> >
> >OK, you done "Hello, World". Now get yourself a copy of Kernighan &
> >Ritchie (2nd edition), and carry on ;-).
> >
> >>
>
>
>
>
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-questions" in the body of the message
>
--
FreeBSD - The Power To Serve http://www.freebsd.org
My Webpage http://www.users.globalnet.co.uk/~markov
_______________________________________________________________
Mark Ovens, CNC Apps Engineer, Radan Computational Ltd. Bath UK
CAD/CAM solutions for Sheetmetal Working Industry
mailto:markov@globalnet.co.uk http://www.radan.com
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19990709181649.A263>
