---
title: "Why Git Has a Variable Named false_but_the_compiler_does_not_know_it"
url: https://daily.dev/posts/why-git-has-a-variable-named-false-but-the-compiler-does-not-know-it-botwobsoq
source_url: https://blog.codingconfessions.com/p/false-but-the-compiler-does-not-know-it
type: article
source: "Confessions of a Code Addict"
published: 2026-06-03T11:03:53.307Z
updated: 2026-06-07T17:51:01.518Z
tags: ["c", "git", "compiler-optimization"]
reading_time: 11
upvotes: 8
comments: 2
language: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Why Git Has a Variable Named false_but_the_compiler_does_not_know_it

**[Confessions of a Code Addict](https://daily.dev/sources/codeconfessions)** · 11 min read · 8 upvotes · 2 comments

## Summary

Git's source code contains a peculiarly named global variable `false_but_the_compiler_does_not_know_it_`, always initialized to 0 but never declared `const` and defined in a separate translation unit. This prevents Clang's `-Wunreachable-code` warning from firing on code that is only unreachable in certain build configurations (e.g., when `NO_SYMLINK_HEAD` is defined and `create_ref_symlink` becomes a constant `-1`). The `NOT_CONSTANT` macro wraps expressions with this variable via logical OR, making the compiler unable to prove the condition is always false at compile time. Alternative approaches like `#ifdef` guards, `#pragma` suppression, `volatile`, or a stub function are discussed and compared. The post also explores whether link-time optimization (LTO) eliminates the dead branch — it does, giving Git both warning suppression during normal builds and dead-code elimination with LTO enabled.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://blog.codingconfessions.com/p/false-but-the-compiler-does-not-know-it>

## Community discussion

Top comments from developers on daily.dev.

**@hanzo** · 1 upvotes

> Great article. I love how modern optimisation boils down to, 'According to the spec, your program invoked forbidden ancient magic, so we replaced your loop with demons'. Compilers are basically hostage negotiators for undefined behaviour.

## Similar posts on daily.dev

- [How the GNU C Compiler became the Clippy of cryptography](https://daily.dev/posts/how-the-gnu-c-compiler-became-the-clippy-of-cryptography-w6spyzuh3) · The Register · 0 upvotes · 0 comments
- [The little bool of doom](https://daily.dev/posts/the-little-bool-of-doom-hyey32wf7) · Hacker News · 2 upvotes · 0 comments

---

Tags: [#c](https://daily.dev/tags/c), [#git](https://daily.dev/tags/git), [#compiler-optimization](https://daily.dev/tags/compiler-optimization)

[View this post on daily.dev](https://daily.dev/posts/why-git-has-a-variable-named-false-but-the-compiler-does-not-know-it-botwobsoq)
