[Courses] Re : C Programming for Absolute Beginners, text book?
Chao Yang
chyang at redhat.com
Wed Feb 8 07:38:42 UTC 2012
----- Original Message -----
> > I subscribe to the many thanks Carla received. Best first lesson
> > ever!
> > Thanks everybody for all the comments (haven't been able to fully
> > understand all of them...) and questions which helped me think more
> > about
> > the little things.
> >
> > My question is related to what I have encounter so far trying to
> > compile
> > other people codes: which/where is the difference in using gcc or
> > cc while
> > compiling? I can see this example works for both of them, but I
> > know this
> > is not "universal".
> >
> > Thanks!
> > Diana
>
> I love when the brainiacs chime in :)
>
> cc is linked to gcc, which you can see a number of different ways:
>
> $ stat /usr/bin/cc
> File: `/usr/bin/cc' -> `/etc/alternatives/cc'
> Size: 20 Blocks: 0 IO Block: 4096 symbolic link
> Device: 802h/2050d Inode: 1070655 Links: 1
> Access: (0777/lrwxrwxrwx) Uid: ( 0/ root) Gid: ( 0/
> root)
>
>
> $ stat /usr/bin/gcc
> File: `/usr/bin/gcc' -> `gcc-4.6'
> Size: 7 Blocks: 0 IO Block: 4096 symbolic link
> Device: 802h/2050d Inode: 1047149 Links: 1
> Access: (0777/lrwxrwxrwx) Uid: ( 0/ root) Gid: ( 0/
> root)
>
>
> When you look in /etc/alternatives you see another cc > gcc links,
> and how C89
> and C99 standards support are handled:
>
> $ ls -l /etc/alternatives | grep cc
> lrwxrwxrwx 1 root root 12 Jun 2 2011 cc -> /usr/bin/gcc
> lrwxrwxrwx 1 root root 16 Jun 2 2011 c89 -> /usr/bin/c89-gcc
> lrwxrwxrwx 1 root root 16 Jun 2 2011 c99 -> /usr/bin/c99-gcc
>
>
I do not have these files in my system, using of gcc v4.6 and fedora16.
$ ll /etc/alternatives/ | grep cc
$ gcc --version
gcc (GCC) 4.6.2 20111027 (Red Hat 4.6.2-1)
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Is that means my gcc does not have the compatibility with c89 and c99?
> This Stackoverflow discussion goes into some interesting minutiae on
> the finer
> points of cc vs. gcc:
>
> Invoking GCC as “cc” versus “gcc”
> http://stackoverflow.com/questions/939989/invoking-gcc-as-cc-versus-gcc
>
> best,
> Carla
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Carla Schroder, ace Linux guru and howto author
> 541-932-4817 PT
> carla at tuxcomputing.com
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> _______________________________________________
> Courses mailing list
> Courses at linuxchix.org
> http://mailman.linuxchix.org/mailman/listinfo/courses
>
Best,
Chao
More information about the Courses
mailing list