GCC — the GNU Compiler Collection — is the compiler suite that most of the free software world is built with. Started by Richard Stallman in 1987 as a C compiler for the GNU Project, it now compiles C, C++, Objective-C, Fortran, Ada, Go and D (with Modula-2 and COBOL in development) from a single driver, targeting more than 60 processor families from x86 and ARM to RISC-V and POWER. It is free software under the GNU General Public License v3 or later, with a Runtime Library Exception that allows the compiled output to be used in proprietary programs. GCC 16.2 is the current release; distributions ship their own maintained branches (Debian 13 ships 14.2, for example), and the development tree is mirrored at gcc-mirror/gcc.
gcc, g++, gfortran, gnat and gccgo share one optimiser and code generator, and cross-compilation to embedded and exotic architectures is a first-class use case.-O2 and -O3 enable decades of tuning: vectorisation (SIMD), link-time optimisation with -flto, profile-guided optimisation, and per-function target tuning.-Wall -Wextra catch real bugs, and newer releases add static analysis passes: -fanalyzer walks the code for leaks, double frees and null dereferences without an external tool.-fsanitize=address, undefined and thread instrument binaries to catch memory errors and data races at run time.-D_FORTIFY_SOURCE=3, -fstack-protector-strong, -fPIE and -Wl,-z,relro are standard flags for building security-hardened system software.GCC is the default compiler of Linux distributions and the reference implementation for much of the C and C++ ecosystem, so code that builds with GCC builds almost everywhere. It is also the most portable compiler in existence: the same driver produces code for microcontrollers, mainframes and supercomputers, includes the Fortran and Ada compilers that scientific and safety-critical code depends on, and offers diagnostics and static-analysis passes that catch classes of bug a plain syntax check never sees. Because it is GPLv3 software with the Runtime Library Exception, there is no licence obstacle to shipping the binaries it produces, and every distribution has a maintained, security-patched branch available as a package.
gcc-<triple> packages.gfortran and GNAT are the reference compilers.-fanalyzer, sanitizers, fortify flags).Install the toolchain from your distribution — build-essential (Debian/Ubuntu), gcc gcc-c++ (Fedora/RHEL), or gcc via Homebrew or MinGW-w64 elsewhere. Check it with gcc --version, then compile and run a program in two commands: gcc -O2 -Wall hello.c -o hello and ./hello. For C++ use g++, and enable warnings and a debug build early: gcc -g -O0 -Wall -Wextra -fsanitize=address turns a crash into a line number. Use -flto for link-time optimisation in release builds, and -march=native only when the binary stays on the machine that built it.