GCC
$ gcc Foundation Low RiskThe foundational GNU compiler driver supporting C, C++, and multi-target optimization. Modern GCC releases include -fdiagnostics-format=json and -fsyntax-only for non-destructive type and syntax checks, though its massive flag matrix and stderr output require careful agent discipline.
brew install gcc Local native compiler toolchain; agents invoke gcc directly or via build systems like CMake and Make.
Agent-Readiness Checklist
Local Probe EvidenceFCRS-1.0 6-Dimension Breakdown
Modern GCC supports -fdiagnostics-format=json and -fdiagnostics-color=never, but legacy defaults emit dense multi-line stderr text and hundreds of target flags.
- Supports
-fdiagnostics-format=json(GCC 10+) and-fsyntax-only - No built-in
--jqor subcommand discovery
Runs locally with zero network/auth side effects and supports -fsyntax-only, though -o overwrites target paths silently.
- Local filesystem execution with
-fsyntax-onlyread-only mode
Standard on Linux and available via Homebrew (gcc-14) or MinGW-w64 on Windows, though macOS /usr/bin/gcc points to Apple Clang.
- Preinstalled on most Linux distros; Homebrew formula installs versioned binary on macOS
Industry-standard optimizing compiler for C, C++, and Fortran, usually orchestrated via CMake/Make.
- Core system compiler across Linux and embedded toolchains
Maintained by the GNU Project with decades of production stability and annual major releases.
- Official GNU Compiler Collection
Exhaustive official manuals exist, though --help is split across --help=common, --help=warnings, and man pages.
- Comprehensive online docs at gcc.gnu.org/onlinedocs
Security, Auth & Guardrails
No credentials required; operates strictly on local source files and toolchain include/library paths.
GPL-3.0-or-later free software toolchain.
# GCC (gcc) Agent Rules - Prefer `-fsyntax-only -fdiagnostics-color=never` when validating edits before linking. - On macOS, check `gcc --version` first because `/usr/bin/gcc` aliases Apple Clang rather than GNU GCC (`gcc-14`).
Agent-Ready Command Recipes
Safe Read-Only Queries
gcc -fsyntax-only -fdiagnostics-format=json -fdiagnostics-color=never -Wall main.c
Validates syntax and types without writing object files, emitting JSON diagnostics.
gcc -v --version
Prints exact compiler target triple, thread model, and configured build options.
Controlled Writes & Previews
gcc -O2 -Wall -Wextra -Werror -fdiagnostics-color=never main.c -o build/app
Compiles main.c deterministically to build/app while failing on any compiler warning.
Strengths for Agents
- +
-fsyntax-onlyand-fdiagnostics-format=jsonallow fast, structured pre-link checks. - + Zero authentication or network access needed for local builds.
Caveats & Pitfalls
- ! On macOS,
gccis typically an Apple Clang shim unless a versioned Homebrew binary likegcc-14is invoked. - ! Huge flag surface and verbose linker errors can consume context tokens when
-fdiagnostics-format=jsonis omitted or unsupported on older releases.