macOS
brew install unifdeflocal Homebrew formula metadata
sudo port install unifdefMacPorts ports tree · devel/unifdef/Portfile · Quelle: api.github.com
brew / Rang 9647
Prüfe Installationswege, Executables, Metadaten und Sicherheitshinweise für unifdef in AI-Agent-Workflows.
Installation
brew install unifdeflocal Homebrew formula metadata
sudo port install unifdefMacPorts ports tree · devel/unifdef/Portfile · Quelle: api.github.com
sudo apk add unifdefAlpine Linux edge package indexes · unifdef · Quelle: dl-cdn.alpinelinux.org
sudo apt install unifdefDebian stable package indexes · unifdef · Quelle: deb.debian.org
sudo dnf install unifdefFedora Rawhide package metadata · unifdef · Quelle: dl.fedoraproject.org
nix profile install nixpkgs#unifdefnixpkgs package indexes · pkgs/by-name/un/unifdef/package.nix · Quelle: api.github.com
sudo pacman -S unifdefArch Linux sync databases · unifdef · Quelle: geo.mirror.pkgbuild.com
sudo zypper install unifdefopenSUSE Tumbleweed package metadata · unifdef · Quelle: download.opensuse.org
Überblick
Selectively process conditional C preprocessor directives
Verlauf
unifdef is a source-filtering utility that selectively removes C preprocessor conditionals. The official manual says it processes `#if`, `#ifdef`, `#ifndef`, `#elif`, `#else`, and `#endif` lines when command-line macro definitions are sufficient to decide whether a block should be kept or removed.
unifdef is much older than its GitHub mirror. The official manual states that the command appeared in 2.9BSD, and that ANSI C support was added in FreeBSD 4.7. It also credits the original implementation to Dave Yost and Tony Finch's rewrite for ANSI C support.
Tony Finch's official project page explains the modern motivation: understanding `xterm`'s heavily conditionalized pty-handling code. That places unifdef in the Unix source-reading and source-cleanup tradition rather than in general-purpose preprocessing.
The current project page publishes release archives, manual documentation, a browsable source repository, and a GitHub collaboration mirror. The GitHub README warns that GitHub release downloads are incomplete and points users back to the official dotat.at release files, which is useful context for packagers.
The official homepage gives a concrete high-profile adoption example: the Linux kernel uses unifdef to strip `#ifdef __KERNEL__` sections from headers exported to userland. It also notes use outside C, including LaTeX workflows.
The supplied package facts show broad distribution packaging across Homebrew, Debian/Ubuntu, Fedora/DNF, Alpine, Arch, MacPorts, Nix, openSUSE, and others. That matches the tool's age and purpose: it is small, portable, and useful in build and source-export pipelines.
unifdef is used by specifying macros with `-D`, `-U`, or a definitions file, then filtering input files so known conditional branches are removed while unknown conditionals are preserved. It can operate on stdin/stdout or modify files in place.
The manual also documents `unifdefall`, a script that uses `unifdef -s` and `cpp -dM` to derive macro information and remove all conditional directives from a file. This shows the tool's role as a controlled partial preprocessor rather than a full C preprocessor replacement.
unifdef is important in the package-nerd niche because it is both tiny and historically deep: a BSD-era tool still used for practical source filtering. It belongs in base-system and package-manager collections because build scripts and source-export tasks can depend on it without pulling in a large toolchain beyond normal C build support.
Its Linux-kernel header-export use case is exactly the kind of quiet infrastructure job package maintainers care about: remove implementation-only conditional sections, preserve line-oriented source structure, and keep generated user-facing source understandable.
Sicherheitslage
Für unifdef wurde kein passendes lokales Secret-Handling-Manifest gefunden. Nucleus-Paketmetadaten bleiben hier veröffentlicht, damit künftige Abdeckung eine stabile Paket-URL hat.
Prüfe vor unbeaufsichtigter Agent-Nutzung, ob das Tool Klartext-Credentials liest, Remote-Zustand schreibt, Artefakte veröffentlicht oder Plugins ausführt.
Executables
| Befehl | Art | Sichtbarkeit | Hinweis |
|---|---|---|---|
unifdef | Executable | indexiertes Executable | Aus dem lokalen Executable-Index erkannt. |
unifdefall | Executable | indexiertes Executable | Aus dem lokalen Executable-Index erkannt. |
Aktualität
Diese Signale trennen das Alter der Seitengenerierung, Aktivität des Paketmanagers und Upstream-Release-Vergleich. Versionsrückstand wird nur gemeldet, wenn eine Evidenz-URL und vergleichbare Versionen vorhanden sind.
Installationsmetadaten
| Paketschlüssel | brew:unifdef |
|---|---|
| Version | 2.12 |
| Paketmanager | Homebrew |
| Homepage | https://dotat.at/prog/unifdef/ |
| Repository | https://github.com/fanf2/unifdef |
| Bottle | nicht erfasst |
| Dienst | keiner deklariert |
Source-Datenbank-Treffer
Treffer stammen aus externen Paketmanager-Indizes und bleiben von lokalen Automic-Vault-Paketlinks getrennt.
unifdef 2.12-1
Remove cpp '#ifdef' lines from files
sudo apt install unifdefunifdef
nix profile install nixpkgs#unifdefunifdef 2.12-1
Remove cpp '#ifdef' lines from files
sudo apt install unifdefunifdef 2.12-r4
Selectively remove C preprocessor conditionals
https://github.com/fanf2/unifdef
sudo apk add unifdefunifdef-doc 2.12-r4
Selectively remove C preprocessor conditionals (documentation)
https://github.com/fanf2/unifdef
sudo apk add unifdef-docunifdef 2.12-9.fc45
Selectively remove C preprocessor conditionals
https://dotat.at/prog/unifdef/
sudo dnf install unifdefunifdef 2.12-4
Remove #ifdef'ed lines
https://dotat.at/prog/unifdef/
sudo pacman -S unifdefunifdef 2.12-3.5
Removes ifdefs from C files
https://dotat.at/prog/unifdef/
sudo zypper install unifdefunifdef
sudo port install unifdefQuellspur
Diese Seite wird von av-web aus dem privaten Paket-SQLite-Artefakt bereitgestellt, das scripts/generate-pkg-sqlite.py erstellt.
View the package source record on GitHub.