From: Phred Phungus on
$ gcc -D_GNU_SOURCE -Wall -Wextra e5.c -o out
$
$ cc -D_GNU_SOURCE -Wall -Wextra e5.c -o out
$ ./out
path_max is 4096
name_max is 255
buf_size is 4353
$

Since having started to use gnu development tools on windows, I would
always type the former. I'd see cc, but didn't think it would do me any
good.

Is there an official c compiler in the *nix world?
--
fred
From: Dominic Fandrey on
On 23/02/2010 09:00, Phred Phungus wrote:
> $ gcc -D_GNU_SOURCE -Wall -Wextra e5.c -o out
> $
> $ cc -D_GNU_SOURCE -Wall -Wextra e5.c -o out
> $ ./out
> path_max is 4096
> name_max is 255
> buf_size is 4353
> $
>
> Since having started to use gnu development tools on windows, I would
> always type the former. I'd see cc, but didn't think it would do me any
> good.

gcc always invokes the GNU C compiler.

> Is there an official c compiler in the *nix world?

Different versions of UNIX come with different compilers. cc
normally invokes the default C compiler of the specific UNIX.

This mostly means gcc, nowadays, but it doesn't have to.

--
A: Because it fouls the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
From: David W. Hodgins on
On Tue, 23 Feb 2010 03:00:31 -0500, Phred Phungus <Phred(a)example.invalid> wrote:

> always type the former. I'd see cc, but didn't think it would do me any
> good.
> Is there an official c compiler in the *nix world?

On my Mandriva 2010.0 system, ...

$ ll /usr/bin/cc
lrwxrwxrwx 1 root root 3 2009-11-30 15:31 /usr/bin/cc -> gcc

So cc is gcc.

Regards, Dave Hodgins

--
Change nomail.afraid.org to ody.ca to reply by email.
(nomail.afraid.org has been set up specifically for
use in usenet. Feel free to use it yourself.)
From: OldSchool on
linux installations <generally> have gcc installed. for other *nixes,
the actual installed compiler varies. For example, on HP-UX,
possibilities include cc, c89, aCC, gcc, and probably others,

Base HP would have cc sym-linked to a compiler compatible w/
Kerninghan-Ritchie C to allow building kernals, c89 and aCC are
optional / extra cost, while gcc might be installed separately.

From: Phred Phungus on
David W. Hodgins wrote:
> On Tue, 23 Feb 2010 03:00:31 -0500, Phred Phungus
> <Phred(a)example.invalid> wrote:
>
>> always type the former. I'd see cc, but didn't think it would do me any
>> good.
>> Is there an official c compiler in the *nix world?
>
> On my Mandriva 2010.0 system, ...
>
> $ ll /usr/bin/cc
> lrwxrwxrwx 1 root root 3 2009-11-30 15:31 /usr/bin/cc -> gcc
>
> So cc is gcc.
>
> Regards, Dave Hodgins
>

Alright, thx Dave, any thoughts on why /etc/ is involved in these links?


$ ls -l /usr/bin/cc
lrwxrwxrwx 1 root root 20 2009-12-13 18:00 /usr/bin/cc ->
/etc/alternatives/cc
$ ls -l /etc/alternatives/cc
lrwxrwxrwx 1 root root 12 2009-12-13 17:59 /etc/alternatives/cc ->
/usr/bin/gcc
$ ls -l /usr/bin/gcc
lrwxrwxrwx 1 root root 7 2009-12-13 18:00 /usr/bin/gcc -> gcc-4.3
$ ls -l /usr/bin/gcc-4.3
-rwxr-xr-x 1 root root 208068 2009-03-16 18:30 /usr/bin/gcc-4.3
$ ls -l /usr/bin/gcc*
lrwxrwxrwx 1 root root 7 2009-12-13 18:00 /usr/bin/gcc -> gcc-4.3
-rwxr-xr-x 1 root root 208068 2009-03-16 18:30 /usr/bin/gcc-4.3
$