]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/doc/gcc/programming-languages-supported-by-gcc.rst
0d4ce6f86f2ec4b0471ee1a65eb6a153af94581a
[thirdparty/gcc.git] / gcc / doc / gcc / programming-languages-supported-by-gcc.rst
1 ..
2 Copyright 1988-2022 Free Software Foundation, Inc.
3 This is part of the GCC manual.
4 For copying conditions, see the copyright.rst file.
5
6 .. index:: GCC, GNU Compiler Collection, GNU C Compiler, Ada, D, Fortran, Go, Objective-C, Objective-C++
7
8 .. _g++-and-gcc:
9
10 Programming Languages Supported by GCC
11 --------------------------------------
12
13 GCC stands for 'GNU Compiler Collection'. GCC is an integrated
14 distribution of compilers for several major programming languages. These
15 languages currently include C, C++, Objective-C, Objective-C++,
16 Fortran, Ada, D, and Go.
17
18 The abbreviation :dfn:`GCC` has multiple meanings in common use. The
19 current official meaning is 'GNU Compiler Collection', which refers
20 generically to the complete suite of tools. The name historically stood
21 for 'GNU C Compiler', and this usage is still common when the emphasis
22 is on compiling C programs. Finally, the name is also used when speaking
23 of the :dfn:`language-independent` component of GCC: code shared among the
24 compilers for all supported languages.
25
26 The language-independent component of GCC includes the majority of the
27 optimizers, as well as the 'back ends' that generate machine code for
28 various processors.
29
30 .. index:: COBOL, Mercury
31
32 The part of a compiler that is specific to a particular language is
33 called the 'front end'. In addition to the front ends that are
34 integrated components of GCC, there are several other front ends that
35 are maintained separately. These support languages such as
36 Mercury, and COBOL. To use these, they must be built together with
37 GCC proper.
38
39 .. index:: C++, G++, Ada, GNAT
40
41 Most of the compilers for languages other than C have their own names.
42 The C++ compiler is G++, the Ada compiler is GNAT, and so on. When we
43 talk about compiling one of those languages, we might refer to that
44 compiler by its own name, or as GCC. Either is correct.
45
46 .. index:: compiler compared to C++ preprocessor, intermediate C version, nonexistent, C intermediate output, nonexistent
47
48 Historically, compilers for many languages, including C++ and Fortran,
49 have been implemented as 'preprocessors' which emit another high
50 level language such as C. None of the compilers included in GCC are
51 implemented this way; they all generate machine code directly. This
52 sort of preprocessor should not be confused with the :dfn:`C
53 preprocessor`, which is an integral feature of the C, C++, Objective-C
54 and Objective-C++ languages.