Devlog #0: Project setup (Commits: d377087563-7874ad3cc6)
10 changed files with 1056 additions and 0 deletions
For zinn, I decided that the foundation had to be as robust as the final output. Before writing a single line of code, I spent the first hour or so building a thorough foundation from scratch.
C Standard
For this project I have decided to use the latest C23 standard. Why? The answer is simple: modern features.
-
nullptr: Replaces the macroNULL. It’s a real type, which prevents type-confusion bugs and makes the code’s intent explicit. -
constexpr: This allows us to define constants with full type safety. More importantly, its value is known at compile-time, thus the compiler can catch math errors or type mismatches before the code even runs.
And many others…
Code Style
I have outlined the code style that will be followed in this codebase. The whole file can be found here.
Directory Structure
The directory structure is simple:
.
├── bin <-- contains executable binaries
├── build <-- contains intermediate files
├── include <-- contains header files, allows sub-dirs
└── src <-- contains source files, allows sub-dirs
Makefile
I have developed a recursive Makefile that supports multiple build confiruations (Debug, Release, Sanitize, Coverage). It features:
- Zero-Collision Objects: Isolated build directories prevent flag contamination between build configurations.
-
Static Analysis: The Makefile has targets for
clang-tidy,cppcheckand GCC’s-fanalyzer. -
Dependency Tracking: Using
-MMD -MPflags to automatically generate header dependencies. This means the build system is “smart”; it only recompiles what is absolutely necessary. -
Order-Only Directories: Using advanced Makefile logic (the pipe
|) to handle folder creation. This prevents “ghost recompilation” where the binary is rebuilt just because a folder’s timestamp changed.
License
The project is licensed under GPLv3, which ensures it stays as FOSS (Free and Open Source Software) forever.
Future plans
Next, I plan to implement bulletproof core components, such as a logger and CLI argument parser.
Comments 1
good job!
Sign in to join the conversation.