TRT
Sign in

Foundations · Module 2

Compilation, Types, and Execution Flow

Understand the C compilation pipeline, byte representations of primitive types, and how the CPU manages function calls on the stack.

Start the moduleFree10 lessons · about 171 minutes

Every C construct maps directly to raw CPU instructions and physical memory layouts. This module breaks down how the preprocessor, compiler, assembler, and linker transform code into an executable ELF binary, and how fundamental types occupy byte space. Understanding these mechanics provides the mental model required to predict machine behavior and avoid undefined behavior from the start.

  1. 1The C Compilation PipelineTrace C source code through preprocessing, compilation, assembly, and linking to understand how text transforms into an executable ELF binary.15 min
  2. 2Anatomy of a C Program and Formatted I/OExplore program entry points from crt0 and _start to main, inspect process exit codes, and master buffered standard I/O streams.16 min
  3. 3Primitive Types and Integer EncodingsInspect binary representations of fundamental types, two's complement signed integer mechanics, and sign extension rules in memory.18 min
  4. 4Fixed-Width Types and ConversionsEliminate cross-platform data model ambiguities using stdint.h, format fixed types with inttypes.h, and master casting semantics.18 min
  5. 5Operators, Precedence, and Evaluation OrderDifferentiate operator precedence from evaluation order, master short-circuit evaluation, and eliminate unsequenced modification bugs.18 min
  6. 6Control Flow and Branching MechanicsUnderstand CPU condition flags, predict branch predictor costs, explore compiler jump tables in switch statements, and structure clean goto unwinding.18 min
  7. 7Functions and Call Stack FramesExplore the call stack architecture, function prologues and epilogues, x86-64 calling conventions, and stack frame lifecycles.19 min
  8. 8Storage Classes, Scope, and LinkageMaster variable lifecycles across virtual memory, differentiate internal from external linkage, and organize multi-file C architectures.19 min
  9. 9Portable C, POSIX, and Platform BoundariesLearn which guarantees come from the C language, which come from POSIX, and which depend on Linux or a CPU architecture so you can write code that is portable on purpose.14 min
  10. 10Object Lifetimes, Qualifiers, and Undefined BehaviorBuild a reliable mental model for when C objects exist, what const and volatile promise, and why undefined behavior must be removed rather than debugged around.16 min
  11. 11Project: Text Statistics AnalyzerComing soon
  12. 12Static and Dynamic LibrariesComing soon