gitwtfhub

wtf is nullok?

agl/nullok — explained in plain English

Analysis updated 2026-07-17 · repo last pushed 2016-07-01

11ShellAudience · researcherComplexity · 4/5DormantSetup · hard

TL;DR

Scripts that recompile C programs with and without the "pointers can't be null" compiler assumption, so you can compare the resulting machine code side by side.

Mindmap

mindmap
  root((repo))
    What it does
      Recompiles C packages twice
      Toggles nonnull assumption
      Saves disassembly output
    Tech stack
      Shell scripts
      C compiler
      Modified headers
    Use cases
      Study compiler optimizations
      Compare assembly output
      Learn C11 nonnull rule
    Audience
      Compiler developers
      Performance enthusiasts
      Curious engineers

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Why would anyone build with this?

REASON 1

Compare compiled assembly with and without the nonnull pointer assumption.

REASON 2

Study how C11's nonnull rule changes compiler optimizations.

REASON 3

Rebuild a set of open-source packages under two header configurations to see the difference.

What's in the stack?

ShellC

How it stacks up

agl/nullokac000/libctemplatejssroberto/antigravity-2-fedora-installer
Stars111111
LanguageShellShellShell
Last pushed2016-07-012022-01-19
MaintenanceDormantDormant
Setup difficultyhardmoderateeasy
Complexity4/52/52/5
Audienceresearcherdevelopergeneral

Figures from each repo's GitHub metadata at analysis time.

How do you spin it up?

Difficulty · hard Time to first run · 1h+

Requires manually preparing two modified versions of C standard library headers before running the scripts.

No license information was found in the explanation.

Wtf does this do

This repository contains tools for exploring how C compilers behave when they're told whether function inputs can be null pointers or not. It's built around a specific rule in the C11 standard that says functions in the standard library assume all pointers you pass to them are valid (not null). The author created these scripts to test what actually happens to compiled code when you remove that assumption. The way it works is fairly straightforward: the scripts compile several open-source software packages twice, once with the standard "pointers can't be null" assumption in place, and once with that assumption removed. Then it captures the disassembly (the low-level machine instructions generated by the compiler) for both versions and writes them to files so you can compare them side by side. The difference between these two versions shows what optimizations or code changes the compiler was making based on that null-pointer assumption. To run this yourself, you need to manually set up two modified versions of your C standard library header files: one that keeps the original "nonnull" annotations (the standard assumption) and one that strips them out. The scripts then use these to recompile various packages. The whole process takes a while since it's rebuilding multiple software projects, but it's mostly automated, you just run one main script and let it work through the list. This is useful for compiler developers, performance enthusiasts, or anyone curious about how the C standard's assumptions translate into real performance implications. The blog post linked in the README goes into more depth about why this matters: the compiler can make different optimization choices depending on whether it knows a pointer can never be null. By seeing the actual assembly output, you can understand exactly what those optimizations are and whether they're worth the trade-offs.

Yoink these prompts

Prompt 1
Walk me through how removing nonnull annotations from C standard library headers changes generated assembly.
Prompt 2
Help me set up two versions of my C standard library headers, one with nonnull annotations and one without, so I can use this repo's scripts.
Prompt 3
Explain what optimizations a C compiler skips when it can no longer assume a pointer is never null.
Prompt 4
Show me how to read the disassembly diffs this repo's scripts produce to spot removed optimizations.

Frequently asked questions

wtf is nullok?

Scripts that recompile C programs with and without the "pointers can't be null" compiler assumption, so you can compare the resulting machine code side by side.

What language is nullok written in?

Mainly Shell. The stack also includes Shell, C.

Is nullok actively maintained?

Dormant — no commits in 2+ years (last push 2016-07-01).

What license does nullok use?

No license information was found in the explanation.

How hard is nullok to set up?

Setup difficulty is rated hard, with roughly 1h+ to a first successful run.

Who is nullok for?

Mainly researcher.

View the repo → Decode another repo

This repo across BitVibe Labs

Don't trust strangers blindly. Verify against the repo.