You are browsing as a guest. Sign up (or log in) to start making projects!

1h 33m 16s logged

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.

  1. nullptr: Replaces the macro NULL. It’s a real type, which prevents type-confusion bugs and makes the code’s intent explicit.
  2. 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, cppcheck and GCC’s -fanalyzer.
  • Dependency Tracking: Using -MMD -MP flags 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.

0
10

Comments 1

@Stylt

good job!