Trust No One, Especially Microsoft And Intel

As a developer, I should have full control over the programs I write. There may be a compiler between the text and the executable, but the result is exactly what I expect (excluding the bugs). Even if the compiler may change significantly the structu… (read more)

GCC Is Your Friend

A couple of years ago, I wanted to put some functions to write logs into a C library (shared object). My idea was to have something that was easy to use in every situation. Since, most of the times, variables must be printed, I decided to create a fu… (read more)

How C Compilers Work Part 4: Linker

Now we are at the point where we have produced one or more object files and we want to create an executable. Under GNU/Linux systems, this job is done by ld, the GNU linker. As seen in the previous part, the compiler always works on one file at once,… (read more)

How C Compilers Work Part 3: Compiler

The properly so called compiler is a really complicated piece of software. It performs many different tasks on single files. This means that no matter if your project is made of thousand source files: they will be compiled one by one. Now let's see t… (read more)

How C Compilers Work Part 2 - Preprocessor

As said in the previous post, in modern compilers, preprocessing is not a separate phase but it's made together with compilation. Nevertheless, understanding the role of preprocessor is really helpful. The first thing to say is that it basically unde… (read more)

How C Compilers Work Part 1 - Introduction

I'm writing this series of posts because it seems to me that many young programmers lack a clear idea about what's behind the "Build" button on their IDE. In my opinion, this happens because nowadays the interpreted languages (such as JavaScript, Py… (read more)