It takes human-readable source text and translates it into machine code for a specific CPU, in four phases. The preprocessor expands #include and macros into a single translation unit of pure C. The compiler proper turns that into assembly for the target architecture. The assembler turns assembly into an object file: machine code plus a symbol table, with addresses still unresolved. The linker then combines all object files and libraries, resolves those symbols, lays out the sections, and emits the final image. Two details separate a strong answer here. First, each .c file is compiled independently into its own object file, which is why the compiler can't catch a mismatch between how you call a function in one file and how it's defined in another, only the linker sees both, and only if the symbol names disagree. Second, gcc is not really "the compiler", it's a driver that orchestrates all four stages and quietly links the C runtime for you. On embedded that matters, because you're typically cross-compiling: the compiler runs on your x86 host but emits ARM machine code that can't execute there at all, which is why the toolchain is named arm-none-eabi-gcc rather than gcc.
Programming Fundamentals · Interview question
What does a C compiler actually do?
A strong answer
What a weak answer sounds like
You know the answer. Do you know what gets you dinged?
Pro breaks down the answer most candidates actually give to this question — and the specific reason an interviewer marks it down. It’s the difference between sounding correct and sounding senior, on all 472 questions.
From the lesson
What Is a Program?
A program is text on disk until you compile it. Walk through the source → compile → run loop you'll repeat thousands of times.