Introduction to GNU C and C++ Compilers45
•C
•C++
•Fortran
•Objective C
•Java
Front-end preprocessors for many other languages also exist for GCC. For example, you
can use a Pascal language front end with GCC.
C is the primary language and GCC supports ANSI/ISO standards put forward in 1989-90
and 1995-96. These standards are also sometimes called C90 and C95, respectively. Another
revision of the ANSI/ISO C language standard was made in 1999 (known as C99), and GCC
does not yet fully support this revision. You can find out the current status of support for this
revision at http://gcc.gnu.org/gcc-3.0/c99status.html.
Support for these variations in standards can be selected using command line switches
when compiling programs. For example, to compile programs according to original 1989-90
standards, you can use one of the following command line switches:
-ansi
-std=c89
-std=iso9899:1990
The GCC compiler supports Objective C source code. Information on Objective C can be
found in different books and online resources. However there is no standard for Objective C yet.
Later in this chapter you will learn how to compile a simple program written in Objective C.
GCC supports GNU Fortran language and we shall discuss later in this chapter how to
compile programs written in Fortran.
Support for Java is a new addition to GCC and we shall see how GCC handles Java code
with the GCJ compiler. This compiler, which is a part of the GCC family of compilers, can cre-
ate an executable object from Java source code files.
Standard libraries are not part of the GCC compiler. You have to separately install librar-
ies. The most common library used with the compiler is the GNU C library and we shall see how
to get and install this library on Linux systems. The GNU C library (also known as glibc) pro-
vides support for:
•ANSI/ISO C
•POSIX
•BSD
•System V
•X/Open
For more information on languages supported by GCC, please see http://gcc.gnu.org/
onlinedocs/gcc-3.0.2/gcc_2.html.