A compiler translates C source text into executable binary code that a particular machine can understand. C therefore mediates between programmer-readable instructions and platform-specific machine needs. section 1.2 section 1.3
The compiler is a tool rather than a language feature: its command name and options depend on the platform. The bundled translation process may include textual replacement, compilation, and linking. section 1.2 section 1.3
A compiler also helps establish whether a program satisfies C’s requirements:
- Reports warnings and errors for invalid or questionable constructs; diagnostics should be treated as actionable evidence rather than ignored output. section 1.3
- Targets different architectures while allowing one correct C program to remain portable across platforms. section 1.2
- Does not guarantee portability merely because a program runs on one platform; implementations may fail to conform or accept nonportable extensions. section 1.2
Compiling and diagnosing a C program
A POSIX-style command such as `c17 -Wall -o getting-started getting-started.c -lm` translates a source file into an executable. Compiling flawed code with GCC reports an incorrect `main` return type, an undeclared `printf`, and an invalid return value; Clang reports corresponding errors. Correct the first diagnostic, recompile, and continue until the program is flawless. section 1.3








