

Unifdef – remove preprocessor conditionals from code - zdw
http://www.openbsd.org/cgi-bin/man.cgi/OpenBSD-current/man1/unifdef.1

======
brynet
This is an old Unix utility, OpenBSD versions <=5.5 shipped with a much older
version from CSRG times. It was recently updated to the rewrite done by Tony
Finch.

[http://dotat.at/prog/unifdef/](http://dotat.at/prog/unifdef/)

------
__michaelg
Super useful tool once you realize that you need it. I used it extensively
with the QEMU sources where all the supported architectures are essentially
just ifdefs in the code. There is also an improved `sunifdef` flying around in
the interwebs.

~~~
lomnakkus
Yup, I've also used it (the old version, I guess) to great effect to clean up
a legacy code base which had defines for things like Amiga and VMS...

------
jradix
A refactoring tool from the days where "refactoring" didn't exist

~~~
cssmoo
Refactoring always existed. We just didn't have a name for it and it was done
by us meat popsicles.

------
joosters
I wish more manpages would include a brief explanation of _why_ you might want
to use the tool. For someone stumbling across this utility, the documentation
is baffling.

~~~
acveilleux
Trim unused code paths from ancient C code, usually work-arounds and legacy
platform support. Or trim large accumulations of #if 0 that similarly build up
in old C code bases.

