|-D sym = val|
Specify that a macro is defined to a given value.
Specify that a macro is defined to the value 1.
Specify that a macro is undefined.
If the same macro appears in more than one argument, the last occurrence dominates.
|-iD sym [= val]
C strings, comments,
and line continuations
are ignored within
controlled by macros
specified with these options.
which have the same effect as the corresponding
You can have multiple
arguments and mix them with
later options override earlier ones.
Each directive must be on a single line. Object-like macro definitions (without arguments) are set to the given value. Function-like macro definitions (with arguments) are treated as if they are set to 1.
Replace removed lines with blank lines
instead of deleting them.
Mutually exclusive with the
Compress blank lines around a deleted section.
Mutually exclusive with the
i.e., lines that would have been removed or blanked
are retained and vice versa.
Turn on printing of debugging messages.
will report an error if it needs to remove
a preprocessor directive that spans more than one line,
for example, if it has a multi-line
comment hanging off its right hand end.
flag makes it ignore the line instead.
an additional place to look for
This option is ignored by
for compatibility with
and to simplify the implementation of
Always treat the result of
operators as unknown if either operand is unknown,
instead of short-circuiting when unknown operands cant affect the result.
This option is for compatibility with older versions of
lines with constant expressions.
By default, sections controlled by such lines are passed through unchanged
because they typically start
and are used as a kind of comment to sketch out future or past development.
It would be rude to strip them out, just as it would be for normal comments.
Modify one or more input files in place.
Modify input files in place, and keep backups of the original files by
to the input filenames.
directives to the output following any deleted lines,
so that errors produced when compiling the output file correspond to
line numbers in the input file.
Write output to the file
instead of the standard output when processing a single file.
Instead of processing an input file as usual,
this option causes
to produce a list of macros that are used in
preprocessor directive controlling expressions.
option, but the nesting depth of each macro is also printed.
This is useful for working out the number of possible combinations
of interdependent defined/undefined macros.
Disables parsing for C strings, comments,
and line continuations,
which is useful
for plain text.
This is a blanket version of the
Print version details.
|-x -Bro 012 Brc|
|Set exit status mode to zero, one, or two. See the EXIT STATUS section below for details.|
The unifdef utility takes its input from stdin if there are no file arguments. You must use the -m or -M options if there are multiple input files. You can specify inut from stdin or output to stdout with -.
The unifdef utility works nicely with the -D sym option of diff(1).
In normal usage the unifdef utilitys exit status depends on the mode set using the -x option.
If the exit mode is zero (the default) then unifdef exits with status 0 if the output is an exact copy of the input, or with status 1 if the output differs.
If the exit mode is one, unifdef exits with status 1 if the output is unmodified or 0 if it differs.
If the exit mode is two, unifdef exits with status zero in both cases.
In all exit modes, unifdef exits with status 2 if there is an error.
The exit status is 0 if the -h or -V command line options are given.
Too many levels of nesting. Inappropriate #elif, #else or #endif. Obfuscated preprocessor control line. Premature EOF (with the line number of the most recent unterminated #if). EOF in comment.
The unifdef home page is http://dotat.at/prog/unifdef
The unifdef command appeared in BSD 2.9 . ANSI~C support was added in
.Fx 4.7 .
The original implementation was written by
.An Dave Yost Aq Dave@Yost.com .
.An Tony Finch Aq firstname.lastname@example.org rewrote it to support ANSI~C.
Expression evaluation is very limited.
Handling one line at a time means preprocessor directives split across more than one physical line (because of comments or backslash-newline) cannot be handled in every situation.
Trigraphs are not recognized.
There is no support for macros with different definitions at different points in the source file.
The text-mode and ignore functionality does not correspond to modern cpp(1) behaviour.