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








