8

I was informed that GCC is not only a compiler for but also for many other languages.

Is it true? If so, then how is it done?

M--
  • 25,431
  • 8
  • 61
  • 93
Jay kishan
  • 369
  • 2
  • 4
  • 9
  • 6
    What is the relation between the title and the body of your question? – sepp2k Jul 07 '16 at 18:07
  • 1
    According to Wikipedia, https://en.wikipedia.org/wiki/GNU_Compiler_Collection, "Originally named the GNU C Compiler, when it only handled the C programming language, GCC 1.0 was released in 1987.[1] It was extended to compile C++ in December of that year. Front ends were later developed for Objective-C, Objective-C++, Fortran, Java, Ada, and Go among others.". Please be more specific regarding "how it is done" - the program simply detects what language you're using and runs a different set of subroutines to compile that language. – Jake Jul 07 '16 at 18:16
  • 1
    The question in your title could be answered by a quick web search. The (completely different) question in the body of your question asks how gcc works; the gcc internals manual ("gccint") is over 2 megabytes of text. – Keith Thompson Jul 07 '16 at 18:31
  • Here's an online book with all you can read about gcc https://www.linuxtopia.org/online_books/an_introduction_to_gcc/index.html it is from 2004 and is still relevant today. – nurettin Dec 16 '20 at 13:48

1 Answers1

29

GNU is not a compiler. It is an Operating System and a collection of free software made to be "Unix like" without using Unix. (GNU stands for "GNU's not Unix!")

GCC stands for "GNU Compiler Collection" and is a piece of GNU software that includes a compiler with frontends for multiple languages:

The standard compiler releases since 4.6 include front ends for C (gcc), C++ (g++), Objective-C, Objective-C++, Fortran (gfortran), Java (gcj), Ada (GNAT), and Go (gccgo).

MinGW stands for "Minimalist GNU for Windows" It is essentially a tool set that includes some GNU software, including a port of GCC.

In summary, MinGW contains GCC which is in the collection of GNU free software.

Further Reading Below:

GNU - https://en.wikipedia.org/wiki/GNU

GCC - https://en.wikipedia.org/wiki/GNU_Compiler_Collection#cite_note-39

MinGW - http://www.mingw.org/

Steve
  • 981
  • 1
  • 8
  • 22