History log of /freebsd-10.0-release/usr.bin/unifdef/
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
259065 07-Dec-2013 gjb

- Copy stable/10 (r259064) to releng/10.0 as part of the
10.0-RELEASE cycle.
- Update __FreeBSD_version [1]
- Set branch name to -RC1

[1] 10.0-CURRENT __FreeBSD_version value ended at '55', so
start releng/10.0 at '100' so the branch is started with
a value ending in zero.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

256281 10-Oct-2013 gjb

Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


248849 28-Mar-2013 fanf

Update to upstream version 2.7

The most notable new feature is support for processing multiple
files in one invocation. There is also support for more make-friendly
exit statuses.

The most notable bug fix is #line directives now include the input
file name.

Obtained from: http://dotat.at/prog/unifdef


248258 13-Mar-2013 obrien

No need to call an external program.


233456 25-Mar-2012 joel

Remove superfluous paragraph macro.


227243 06-Nov-2011 ed

Mark global functions and/or variables in unifdef(1) static where possible.

This allows compilers and static analyzers to more thorough analysis.


217698 21-Jan-2011 fanf

Update to upstrea version 2.5.6.

Detect IO errors properly.
Write #line directives to the correct output stream.

Obtained from: http://dotat.at/prog/unifdef


217550 18-Jan-2011 fanf

Update to upstream version 2.3

Only significant change is to fix a bu when the output file overwrites
the input when the input is redirected.

Obtained from: http://dotat.at/prog/unifdef


210720 01-Aug-2010 joel

Fix typos.


205089 12-Mar-2010 fanf

Update to upstream version 2.3

Add -V (display version) and -S (list controlling symbols per #if
with nesting information) options, and improve unifdefall debug output.
Done committing 0 revisions to SVN

Obtained from: http://dotat.at/prog/unifdef


204092 19-Feb-2010 fanf

Update to upstream version 1.338

Fix a long-standing cpp compatibility bug: The -DFOO argument
(without an explicit value) should define FOO to 1 not to the empty
string.

Add support for CRLF newlines, based on a suggestion from Mark Rushakoff.

Obtained from: http://dotat.at/prog/unifdef/


202649 19-Jan-2010 fanf

Fix portability to 64 bit platforms.
printf("%.*s",i,s) expects an int not a ptrdiff_t

Thanks to bf1783 (at) googlemail.com for the bug report.


202636 19-Jan-2010 fanf

Sync unifdefall with upstream. It no longer relies entirely on $PATH
to find unifdef, in order to support running the test suite before
installing.


202635 19-Jan-2010 fanf

Add a -o outfile option, which can be used to specify an output file. The
file can safely be the same as the input file. Idea from IRIX unifdef(1).
This version fixes a bug in the NetBSD unifdef which refuses to
write to a -o outfile which does not exist.

Obtained from: NetBSD


201386 02-Jan-2010 ed

Build usr.bin/ with WARNS=6 by default.

Also add some missing $FreeBSD$ to keep svn happy.


199867 27-Nov-2009 fanf

unifdef: fix invalid array access when nesting limit exceeded

If the number of nested #if blocks exceeds 64, nest() increments
the nesting depth and then reports an error. The message includes
the line number for the start of the current #if block, which is
read from past the end of the relevant array.

Avoid the out-of-bounds read by reporting the error and exiting
before the nesting depth has a chance to increase.

Submitted by: Jonathan Nieder <jrnieder@gmail.com>


199842 26-Nov-2009 fanf

unifdefall: optimise the loop that builds the unifdef command.

The old code used a shell loop to convert each controlling macro
definition into a command-line argument, reading the macro definitions
file each time. The new code converts the list of controlling macros
into a sed script which can run through the list of macro definitions
in one go.

Add some explanatory comments, since the code is quite meta.

Use {} instead of () for redirecting a group of commands.

Submitted by: Jonathan Nieder <jrnieder@gmail.com>


199817 26-Nov-2009 fanf

Remove debugging remnants from unifdefall.

Submitted by: Jonathan Nieder <jrnieder@gmail.com>


199813 25-Nov-2009 fanf

Update unifdef to my upstream version 1.188

Main highlights:

(A) The new -B option compresses blank lines around a deleted section
so that blank lines around "paragraphs" of code don't get doubled.

(B) Lenient evaluation of && and || so that #if expressions can be
evaluated even when some of their sub-expressions cannot be.

(C) The evaluator can now handle macros with arguments.

(D) Portability fixes, especially for unifdefall.

Contributions from:
Ben Hutchings at Solarflare Communications (A and B)
Anders H Kaseorg <andersk@mit.edu> (A and C)
Jonathan Nieder <jrnieder@gmail.com> (D)

Obtained from: http://dotat.at/prog/unifdef/


178724 02-May-2008 hrs

Add AUTHORS section[*] and fix HISTORY section.

Requested by: Dave Yost (original author)[*]
History checked by: The CSRG Archives
MFC after: 3 days


176751 02-Mar-2008 fanf

Typo in comment spotted by Hasso Tepper.

Obtained from: DragonFlyBSD


176659 29-Feb-2008 fanf

A fix for other ways of triggering joe@'s bug.


176658 29-Feb-2008 fanf

Allow #if defined SYM as well as #if defined(SYM). Fix an abort
caused by files that have #endif and no newline on the last line
(reported by joe@). Also fix a benign uninitialized variable bug.
Update and tidy the copyright.


146466 21-May-2005 ru

Sync program's usage() with manpage's SYNOPSIS.


143285 08-Mar-2005 fanf

Sync with upstream:

Allow the user to run unifdef without defining any symbols. This is
useful in conjunction with the -k flag.
Fix a bug in the -s handling code that would have caused out-of-bounds
array accesses.
Add a -n option to insert #line directives in the output.
Ignore comment markers inside string and character literals
(bug reported by Amos Shapira <amos.shapira@netregistry.com.au>).
More accurate copyright notices.


140420 18-Jan-2005 ru

Sort sections.


140368 17-Jan-2005 ru

Added the EXIT STATUS section where appropriate.


117124 01-Jul-2003 fanf

Improve expression evaluation debugging output, tidy up the handling of
EOF, and improve the commentary about backslash-newline handling.


117076 30-Jun-2003 fanf

Various fixes from upstream, including a bug...

Fix the usage synopsis.

Amend the copyright notice to reflect the fact that there's no Berkeley
code left.

Fix a typo in a comment, improve the descriptions of the way we use
some global variables (relevant to the bug below), and note that
division-by-zero has side effects so the current expression evaluator
can't be trivially extended to arithmetic in its current design.

Avoid hitting an abort(); /* bug */ when in "text mode" (i.e.
ignoring comment state) by updating the line parser state properly.

PR: 53907


115823 04-Jun-2003 fanf

MAINTAINER line moved to MAINTAINERS file.


114594 03-May-2003 obrien

Make GCC 3.3 happy with rcsid[], sccs[], and copyright[].


111447 24-Feb-2003 ru

mdoc(7) police: Scheduled sweep.


109567 20-Jan-2003 fanf

Sync with upstream again:

* Be less strict about multi-line preprocessor directives (e.g. those
with comments hanging off the right-hand end) since they're more
of a problem in practise than I expected. Prompted by phk.

* Fix the handling of "ignore" symbols.

* Style pedantry from OpenBSD and Ted Unangst <tedu@stanford.edu>,
including some whitespace fixes and removal of strcpy()
(and not including excessively strict KNF enforcement).

* Fix some typos and terminological inconsistencies.


109437 17-Jan-2003 fanf

Style fixes: brackets around the argument of return, and removal of
excess space.

Obtained from: OpenBSD


109436 17-Jan-2003 fanf

Add a necessary cast, because ptrdiff_t isn't necessarily the same as int.

Obtained from: OpenBSD


108214 23-Dec-2002 ru

mdoc(7) police: markup nits.


108055 18-Dec-2002 fanf

Sync with up-stream version, including a number of bug-fixes:

* The partial-evaluation of #elif sequences was broken and the
spaghetti logic of its implementation was too hard to understand.
I've re-done it using a straight-forward table-driven push-down
automaton.

* The pre-processor line parser did not allow for all of the weird
places that people might put comments, which could have caused it
to add syntax-errors to the output by removing a #if line containing
the start- or end-marker of a comment.

* The lexer didn't need to special-case the handling of string-literals
or character-constants, but it did need to learn about line-continuations
(backslash-newline).

* The input routine was buggy and bit-rotten and trivially replacable
with fgets(). I've also made the program static- and const-safe and
improved the presentation-order. The formatting of the state-transition
tables remains non-stylish.

This commit-messsage was brought to you by code-point 45.

MFC-after: one-week


107581 04-Dec-2002 ru

mdoc(7) police: s/nul character/null character/.

Approved by: re


103908 24-Sep-2002 fanf

The spec says that unifdefall removes all #ifs, and this now requires
the -k flag to unifdef.


103907 24-Sep-2002 fanf

The readability is improved by reducing the use of the passive voice.
No changes to the meaning are made.


103906 24-Sep-2002 fanf

It is probably a bad idea to unconditionally process directives with
constant controlling expressions: in particular, removing #if 0 sections
is considered "rude". This commit changes the default so that such
things are passed through unchanged, and the old behaviour can be had
with the -k "kill konsts" flag.

Suggested by: markm
MFC after: 3 weeks


102084 19-Aug-2002 jmallett

Remove local prototypes for main().


100453 21-Jul-2002 ru

Fixed improper SCRIPTS assignment that broke `clean'.


97580 30-May-2002 fanf

Character 0 is nul not null.


97576 30-May-2002 ru

mdoc(7) police: tidy up.


97178 23-May-2002 fanf

Sync with upstream version:
* Ensure we work within the array bounds when parsing command-line options;
* Replace h0h0getopt with getopt(3);
* Use consistent whitespace style in the function declarations.

Revieweded by: dwmalone (mentor)


96670 15-May-2002 fanf

Upgrade unifdef:

* It now knows about the existence of #elif which would have
caused it to produce incorrect results in some situations.

* It can now process #if and #elif lines according to the
values of symbols that are specified on the command line.
The expression parser is only a simple subset of what C
allows but it should be sufficient for most real-world
code (it can cope with everything it finds in xterm).

* It has an option for printing all of the symbols that might
control #if processing. The unifdefall script uses this
option along with cpp -dM to strip all #ifs from a file.

* It has much larger static limits.

* It handles nested #ifs much more completely.

There have also been many style improvements: KNF; ANSI function
definitions; all global stuff moved to the top of the file; use
stdbool instead of h0h0bool; const-correctness; err(3) instead
of fprintf(stderr, ...); enum instead of #define; commentary.

I used NetBSD's unifdef as the basis of this since it has received
the most attention over the years.

PR: 37454
Reviewed by: markm, dwmalone
Approved by: dwmalone (mentor)
MFC after: 3 weeks


95124 20-Apr-2002 charnier

Use `The .Nm utility'


92922 22-Mar-2002 imp

remove __P


87698 11-Dec-2001 markm

WARNS=2 fixes, use __FBSDID(), kill register keyword.


79535 10-Jul-2001 ru

mdoc(7) police: removed HISTORY info from the .Os call.


78718 24-Jun-2001 dd

Include missing header files which define functions for which gcc has
builtins (e.g., exit, strcmp).


76040 26-Apr-2001 schweikh

Fix a grammar bogon.


68963 20-Nov-2000 ru

mdoc(7) police: use the new features of the Nm macro.


68575 10-Nov-2000 ru

Avoid use of direct troff requests in mdoc(7) manual pages.


67452 22-Oct-2000 obrien

The last "-iDsym" makes more sense as "-iUsym".


50477 28-Aug-1999 peter

$Id$ -> $FreeBSD$


48792 12-Jul-1999 nik

Add $Id$, to make it simpler for members of the translation teams to
track.

The $Id$ line is normally at the bottom of the main comment block in the
man page, separated from the rest of the manpage by an empty comment,
like so;

.\" $Id$
.\"

If the immediately preceding comment is a @(#) format ID marker than the
the $Id$ will line up underneath it with no intervening blank lines.
Otherwise, an additional blank line is inserted.

Approved by: bde


28789 26-Aug-1997 charnier

Main() returns int.


28457 20-Aug-1997 charnier

Use err(3). Add usage(). Remove progname.


1591 27-May-1994 rgrimes

This commit was generated by cvs2svn to compensate for changes in r1590,
which included commits to RCS files with non-trunk default branches.