liveBook · Manning

Compiler

As explained in Modern C

A compiler is a program that translates source code in a programming language into a form suitable for execution on a target platform.

A compiler translates C source text into executable binary code that a target machine can understand. C source is not directly executable; compilation supplies the bridge between programmer intent and platform-specific execution. TAKEAWAY: C is a compiled programming language. section 1.2

0   > c99 -Wall -o getting-started getting-started.c -lm


!@%STYLE%@!
{"css":"{\"css\": \"font-weight: bold;\"}","target":"[[{\"line\":0,\"ch\":0},{\"line\":0,\"ch\":1}]]"}
!@%STYLE%@!

Compile a C file with c99, enable warnings, name the executable, and link the math library. section 1.2

A compiler’s practical role includes:

  • Translating C into binary code suited to a particular platform. section 1.2
  • Bundling several translation steps, including textual replacement, compilation, and linking. section 1.2
  • Warning about questionable code so programmers can correct portability and correctness problems. section 1.3

Warnings expose source flaws

Compiling a flawed program with c99 -Wall produces diagnostics for a non-int main function, an undeclared printf function, and returning a value from void main. Different compilers may warn or reject such code differently, so successful compilation on one platform does not establish portability. section 1.2

How Modern C covers it

How deep it goes
Defines translation, linking, and platform dependence but defers the internal mechanics of compilation.
Examples
Uses c99, clang, gcc, and icc commands plus diagnostics from a flawed C program.
What it assumes
Assumes familiarity with C source text while teaching from zero why execution requires compilation.
What you can do after
Operate/configure a C compiler to build programs, inspect warnings, and avoid treating one platform’s success as portability proof.
How it connects
Connects C with executable code, linking, assembler, platform dependence, and portability.

Also explained in

Compare how 9 books explain compiler →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Modern C. The section links point to the parts of the book it draws on.