Tony Finch [Fri, 6 Nov 2020 11:22:51 +0000 (11:22 +0000)]
Travis CI is no more
Tony Finch [Wed, 19 Feb 2020 17:15:38 +0000 (17:15 +0000)]
README: note broken GitHub releases
Tony Finch [Fri, 14 Feb 2020 16:59:42 +0000 (16:59 +0000)]
unifdef-2.12
Tony Finch [Fri, 14 Feb 2020 16:49:56 +0000 (16:49 +0000)]
scripts: cleaner Changelog
The Changelog was contaminated by branch name decorations, but I only
want tags. Although there is a --decorate-refs-exclude option, it does
not seem to have any effect on the %d format specifier. Seems easier
to just leave them out altogether.
Tony Finch [Fri, 14 Feb 2020 16:49:31 +0000 (16:49 +0000)]
Bump copyright dates
Tony Finch [Fri, 14 Feb 2020 16:35:26 +0000 (16:35 +0000)]
man: note incomplete C++ raw string literal support
Zenju [Fri, 14 Feb 2020 16:03:59 +0000 (17:03 +0100)]
C++11 raw string literal support
Tony Finch [Mon, 24 Apr 2017 09:45:07 +0000 (10:45 +0100)]
doc: clarify where to send bug reports
Tony Finch [Tue, 21 Mar 2017 13:26:15 +0000 (13:26 +0000)]
unifdef.1: clarify backslash-newline behaviour in DESCRIPTION
Tony Finch [Mon, 6 Feb 2017 18:52:47 +0000 (18:52 +0000)]
web: advertise pre-release version
Tony Finch [Mon, 6 Feb 2017 18:49:50 +0000 (18:49 +0000)]
Bump copyright dates
Tony Finch [Mon, 6 Feb 2017 18:21:55 +0000 (18:21 +0000)]
unifdef: more fixes for weird whitespace
The previous attempt (in commit
802c5cd6) to deal with some whitespace
corner cases had a bug when parsing a dangling C comment; rather than
using the general purpose lexer to scan the dangling line, it assumed
the line state must be dirty - which is not necessarily the case for
dangling C comments as it is for long linear whitespace or C++
comments.
The original example that exposed this problem was from Linux
__BACKPORT_LINUX_REGULATOR_DRIVER_H_; the test case in this
commit is based on analysis of the bug.
Reported-By: Pavel.Aronsky@celeno.com
Reported-By: Aviv.Albagli@celeno.com
Tony Finch [Fri, 26 Feb 2016 09:39:13 +0000 (09:39 +0000)]
portability: fix problems compiling with C++ compiler
Michael McConville suggested removing a "redundant" cast of
the return value from malloc(), based on a change in the
OpenBSD version of unifdef. This is a good suggestion for
a purely C program, but the cast is required in C++.
Carsten Hey contributed some portability improvements in
2012 which included this cast, so that unifdef can be
compiled with a C++ compiler. Unfortunately since then
there have been several regressions in C++ support.
This commit fixes those regressions.
Tony Finch [Tue, 16 Feb 2016 16:58:21 +0000 (16:58 +0000)]
test: need newlines in MinGW printf workaround
Tony Finch [Tue, 16 Feb 2016 16:03:29 +0000 (16:03 +0000)]
test: GNU printf(1) is POSIXly incorrect
Tony Finch [Tue, 16 Feb 2016 14:37:18 +0000 (14:37 +0000)]
test: ugly workaround for lack of chmod() in MinGW
Tony Finch [Tue, 16 Feb 2016 14:31:47 +0000 (14:31 +0000)]
win32: nonexistent new file is not an error in rename(old,new)
Tony Finch [Tue, 16 Feb 2016 14:06:53 +0000 (14:06 +0000)]
win32: revert mktempmode() change - it does not help
Tony Finch [Tue, 16 Feb 2016 14:05:40 +0000 (14:05 +0000)]
test: revert rm change - I was misreading the error message!
Tony Finch [Tue, 16 Feb 2016 13:53:42 +0000 (13:53 +0000)]
win32: more thorough implementation of mktempmde()
Let's see if this makes the permissions tests pass.
Tony Finch [Tue, 16 Feb 2016 13:43:27 +0000 (13:43 +0000)]
test: suppress error output from rm
POSIX says rm -f should not produce any error messages or nonzero
exit status, but MinGW fails to follow the rules.
Tony Finch [Tue, 16 Feb 2016 13:35:00 +0000 (13:35 +0000)]
test: typo in stderr redirection, sigh
Tony Finch [Tue, 16 Feb 2016 13:25:35 +0000 (13:25 +0000)]
test: a hack for MinGW on Travis-CI
The first test that is run for the MinGW build on Travis-CI is
exploding messily when it tries to initialize Wine, but after that
most of the other tests run OK. Let's try adding a fake non-test
to absorb this mess and get closer to a working build.
Tony Finch [Mon, 15 Feb 2016 17:38:42 +0000 (17:38 +0000)]
win32: preen comment
Tony Finch [Mon, 15 Feb 2016 17:33:12 +0000 (17:33 +0000)]
win32: go back to slow snprintf() because MinGW is still troublesome
Tony Finch [Mon, 15 Feb 2016 17:09:33 +0000 (17:09 +0000)]
README: thanks to Ruediger Meier!
Tony Finch [Mon, 15 Feb 2016 17:12:45 +0000 (17:12 +0000)]
win32: better snprintf() portability hack
The code is now much shorter and does not malloc or copy.
There is a #define renaming to avoid a name collision since
Visual Studio 2015 includes a standard snprintf.
Reported-By: Ruediger Meier <ruediger.meier@ga-group.nl>
Tony Finch [Mon, 15 Feb 2016 16:20:07 +0000 (16:20 +0000)]
test: try to work better on MinGW
A lot of the test failures are due to CRLFs in stderr which do not
match the bare LFs in the experr files. So, unilaterally strip CRs
from stderr output.
We don't need to do this for stdout, since unifdef writes that in
binary mode so it can match the newline style of the input file.
We might also need to fix the rc files - let's see how this change
works first.
Ruediger Meier [Thu, 11 Feb 2016 23:47:29 +0000 (00:47 +0100)]
travis: add OSX and Ubuntu Trusty builds
Actually this is a rewrite of .travis.yml:
- speedup build (sudo: false)
- add OSX build
- add Ubuntu 14.04 Trusty build (beta)
- MinGW is allowed to fail silently (no more "Still Failing" emails!)
- add env output for debugging
Note "apt-get install wine failed" for Trusty, that's why we don't
check MinGW there.
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
Tony Finch [Mon, 7 Dec 2015 12:10:30 +0000 (12:10 +0000)]
ifdef-how: what conditionals cause this line to be emitted?
Suggested-by: Anthony Liu <antliu@gmail.com>
Tony Finch [Thu, 3 Dec 2015 14:34:11 +0000 (14:34 +0000)]
Avoid -Wmissing-initializer
Tony Finch [Thu, 3 Dec 2015 14:08:26 +0000 (14:08 +0000)]
man: use .Mt to mark up email addresses
Obtained-from: FreeBSD
Submitted-by: Franco Fichtner <franco@lastsummer.de>
Tony Finch [Thu, 3 Dec 2015 12:15:06 +0000 (12:15 +0000)]
Freecode is read-only
Tony Finch [Thu, 3 Dec 2015 12:10:08 +0000 (12:10 +0000)]
Bump copyright dates
Tony Finch [Thu, 3 Dec 2015 12:06:33 +0000 (12:06 +0000)]
unifdef-2.11
Tony Finch [Thu, 3 Dec 2015 11:50:46 +0000 (11:50 +0000)]
Fix uninitialized variable in evaluator.
Inner expressions typically return LT_IF without setting their
value pointer when they encounter an unknown value. Binary
operators then blindly use these inner values before checking if
they are unknown - before checking for LT_IF. This is undefined
behaviour, but we usually dodge the bullet - except division can
cause things to explode and expose the bug.
Initializing the value to zero avoids undefined behaviour. But this
means that instead of avoiding division when the denominator is
definitely zero (because it might be unknown and zero) we now only
divide if it is definitely non-zero.
Tony Finch [Thu, 3 Dec 2015 11:42:04 +0000 (11:42 +0000)]
test: unexpected /0 exception happening in another part of the test
Tony Finch [Thu, 3 Dec 2015 11:37:56 +0000 (11:37 +0000)]
travis: clone deeply, so version tags are included
Tony Finch [Thu, 3 Dec 2015 11:37:23 +0000 (11:37 +0000)]
test: clearer div test, and try to diagnose unexpected /0 exception
Tony Finch [Thu, 3 Dec 2015 11:17:20 +0000 (11:17 +0000)]
win32: suppress warnings about POSIX functions
Tony Finch [Thu, 3 Dec 2015 11:15:29 +0000 (11:15 +0000)]
travis: clone with a nonzero depth
Tony Finch [Thu, 3 Dec 2015 11:08:24 +0000 (11:08 +0000)]
Document the buggy effect of the dumb lexer on the -f option.
Tony Finch [Thu, 3 Dec 2015 10:59:28 +0000 (10:59 +0000)]
Avoid redundant renames with a -M '' empty backup suffix.
Submitted-by: Michael McConville <mmcco@mykolab.com>
Tony Finch [Thu, 3 Dec 2015 10:50:49 +0000 (10:50 +0000)]
Handle division by zero gracefully.
Reported-by: Michael McConville <mmcco@mykolab.com>
Tony Finch [Fri, 24 Oct 2014 15:43:51 +0000 (16:43 +0100)]
Replace hardcoded operator lexing with table-driven code.
Brian Ginsbach [Fri, 24 Oct 2014 15:02:53 +0000 (15:02 +0000)]
Add support for additional #if/#elif operators
Add support for additional operators in a #if/#elif statement.
- unary bitwise NOT (one's complement): ~
- unary negative: -
- left shift: <<
- right shift: >>
- bitwise AND: &
- bitwise exclusive OR: ^
- bitwise inclusive OR: |
- addition: +
- subtraction: -
- multiplcation: *
- division: /
- modulo: %
Brian Ginsbach [Fri, 24 Oct 2014 15:01:11 +0000 (15:01 +0000)]
Add all comparisons to tests
Add tests for <, <=, >, and >= comparisons.
Tony Finch [Mon, 20 Oct 2014 20:45:20 +0000 (21:45 +0100)]
Ensure that newlines change the linestate when skipping junk.
Sometimes skipline() would skip meaningful characters without
letting skipcomment() look at them.
Reported-By: Christoph Schied <Christoph.Schied@kit.edu>
Tony Finch [Mon, 20 Oct 2014 20:29:13 +0000 (21:29 +0100)]
tests: update for capitalized diagnostics
Tony Finch [Mon, 20 Oct 2014 20:24:35 +0000 (21:24 +0100)]
DIAGNOSTICS do not have full stops.
Tony Finch [Mon, 20 Oct 2014 20:23:50 +0000 (21:23 +0100)]
Add some missing DIAGNOSTICS
Tony Finch [Mon, 20 Oct 2014 20:21:00 +0000 (21:21 +0100)]
Capitalize error messages
Tony Finch [Mon, 20 Oct 2014 20:19:37 +0000 (21:19 +0100)]
Alphabetize DIAGNOSTICS
Tony Finch [Mon, 20 Oct 2014 20:16:34 +0000 (21:16 +0100)]
Check there is a filename argument for inplace editing.
Reported-by: Philip Guenther <guenther@openbsd.org>
Submitted-By: Stuart Henderson <sthen@openbsd.org>
Tony Finch [Wed, 8 Jan 2014 15:03:36 +0000 (15:03 +0000)]
travis: restore missing semicolon
Tony Finch [Wed, 8 Jan 2014 14:59:46 +0000 (14:59 +0000)]
win32: do not use Unix Makefile for testing on MinGW
Tony Finch [Wed, 8 Jan 2014 14:16:13 +0000 (14:16 +0000)]
win32: avoid deprecated -I- compiler option in MinGW build
Tony Finch [Wed, 8 Jan 2014 14:15:39 +0000 (14:15 +0000)]
win32: need prototype for snprintf()
Tony Finch [Wed, 8 Jan 2014 13:51:53 +0000 (13:51 +0000)]
unifdef: typo in comment
Reported-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Tony Finch [Wed, 8 Jan 2014 13:39:10 +0000 (13:39 +0000)]
win32: avoid "secure" string functions - troublesome on MinGW
Tony Finch [Wed, 8 Jan 2014 00:15:18 +0000 (00:15 +0000)]
win32: or maybe stdint.h? MinGW seems to disagree with Windows :-(
Tony Finch [Wed, 8 Jan 2014 00:06:22 +0000 (00:06 +0000)]
win32: need stddef.h
Tony Finch [Tue, 7 Jan 2014 23:57:36 +0000 (23:57 +0000)]
win32: another try at working around lack of _TRUNCATE
Tony Finch [Tue, 7 Jan 2014 23:42:00 +0000 (23:42 +0000)]
win32: need crtdefs.h?
Tony Finch [Tue, 7 Jan 2014 22:45:47 +0000 (22:45 +0000)]
win32: correct variable name in snprintf()
Tony Finch [Tue, 7 Jan 2014 22:32:21 +0000 (22:32 +0000)]
unifdef: cleaner exit status handling
Tony Finch [Tue, 7 Jan 2014 20:41:07 +0000 (20:41 +0000)]
unifdef: do not needlessly modify files when updating in place
If unifdef made no changes, leave the original input file
in place and delete the temporary working copy.
Inspired by http://trac.webkit.org/changeset/156877
Tony Finch [Tue, 7 Jan 2014 20:24:11 +0000 (20:24 +0000)]
unifdef: correct exit status when lines are modified but not deleted
Tony Finch [Tue, 7 Jan 2014 20:02:18 +0000 (20:02 +0000)]
tests: NetBSD pr#47068
Tony Finch [Tue, 7 Jan 2014 19:16:02 +0000 (19:16 +0000)]
web: update for unifdef-2.10 release
Tony Finch [Tue, 7 Jan 2014 19:12:35 +0000 (19:12 +0000)]
bump more copyright dates
Tony Finch [Tue, 7 Jan 2014 19:00:39 +0000 (19:00 +0000)]
unifdef: do not mark the line as dirty when there is no dirt
This caused problems for #undef directives in -f header files:
the following line was ignored because the line state got
incorrectly updated.
Thanks to the uClibc project for reporting the bug and providing a
sample test case and a proposed fix.
Reported-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Tony Finch [Mon, 6 Jan 2014 10:51:56 +0000 (10:51 +0000)]
scripts: make release more verbose
Tony Finch [Mon, 6 Jan 2014 10:51:17 +0000 (10:51 +0000)]
web: link to pre-release
Tony Finch [Mon, 6 Jan 2014 10:42:01 +0000 (10:42 +0000)]
Bump some copyright dates
Tony Finch [Mon, 6 Jan 2014 10:38:00 +0000 (10:38 +0000)]
win32: a more correct snprintf() portability shim
Based on http://stackoverflow.com/questions/
2915672/snprintf-and-visual-studio-2010
Tony Finch [Wed, 12 Jun 2013 14:50:39 +0000 (15:50 +0100)]
INSTALL: use GitHub for Windows to run Unix shell scripts
README: update FreshMeat -> FreeCode and note that GitHub
zip file downloads are broken.
Suggested-by: Lee M. Hamel <lee.m.hamel@intel.com>
Tony Finch [Tue, 11 Jun 2013 21:10:31 +0000 (22:10 +0100)]
unifdef: refactor keyword and symbol matching
The generic strlcmp() is replaced by the more specific matchsym()
and findsym() now includes the effect of skipsym().
This is to prepare for case-insensitive keyword matching, as part
of foreign language support.
Tony Finch [Fri, 7 Jun 2013 22:21:03 +0000 (23:21 +0100)]
unifdef.1: bump date and add link to home page
Tony Finch [Fri, 7 Jun 2013 22:10:14 +0000 (23:10 +0100)]
copycheck: check date in manual
Tony Finch [Fri, 7 Jun 2013 11:09:20 +0000 (12:09 +0100)]
web: update for unifdef-2.9 release
Tony Finch [Fri, 7 Jun 2013 10:53:51 +0000 (11:53 +0100)]
INSTALL: more portability notes.
Tony Finch [Thu, 6 Jun 2013 11:24:30 +0000 (12:24 +0100)]
Makefile: correct dependencies and portability to GNU make.
My aim was previously to rely on make's built-in rules to
build unifdef, on the assumption that this would be the
easiest way to do the right thing on unknown systems.
The right way to specify the dependencies for unifdef is:
unifdef: unifdef.c unifdef.h version.h
However GNU make has an incorrect implicit rule:
.c:
$(LINK.c) $^ $(LOADLIBES) $(LDLIBS) -o $@
This puts all of the prerequisites on the command line, which
causes things to break. POSIX specifies the implicit rule as
.c:
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
And POSIX says "In an inference rule, the $< macro shall evaluate
to the filename whose existence allowed the inference rule to be
chosen for the target". In our case $< expands to just unifdef.c
which is what we want.
Putting .POSIX in the Makefile does not cause GNU make to use the
posixly-correct implicit rule definition.
The previous version of the Makefile had incorrect dependencies
which meant that GNU make (and probably other versions of make)
would not rebuild unifdef if the header files were touched. So
to fix that bug, and to work around the buggy implicit rule in
GNU make, the Makefile now has an expanded version of the
standard POSIX build rule for unifdef.
Tony Finch [Thu, 6 Jun 2013 10:50:19 +0000 (11:50 +0100)]
web: bump pre-release
Tony Finch [Thu, 6 Jun 2013 10:48:43 +0000 (11:48 +0100)]
unifdef: Avoid ssize_t for portability
Ruediger Meier [Thu, 9 May 2013 22:16:01 +0000 (00:16 +0200)]
travis-ci: fix release traget by git cloning with infinite depth
git describe needs at least the last tag available. This is never sure
when using git clone --depth=50 which is done by travis per default.
Ruediger Meier [Thu, 9 May 2013 19:42:31 +0000 (21:42 +0200)]
scripts: avoid gzip option --keep for compatibility
"-k|--keeps" is not available yet in officially released gzip.
Tony Finch [Wed, 15 May 2013 12:22:56 +0000 (13:22 +0100)]
scripts: fetch Github pull requests
Tony Finch [Thu, 9 May 2013 19:44:29 +0000 (20:44 +0100)]
web: bump pre-release
Tony Finch [Thu, 9 May 2013 19:38:24 +0000 (20:38 +0100)]
unifdef: avoid strndup() for non-standard C implementations
Tony Finch [Thu, 9 May 2013 19:08:26 +0000 (20:08 +0100)]
scripts: copycheck fixes
! must go at the start of a pipeline in portable sh
Use a default author if git doesn't know who you are.
Tony Finch [Thu, 9 May 2013 19:00:19 +0000 (20:00 +0100)]
tests: avoid non-portable error message in multimissing
Tony Finch [Thu, 9 May 2013 18:55:37 +0000 (19:55 +0100)]
web: bump pre-release
Tony Finch [Thu, 9 May 2013 18:54:28 +0000 (19:54 +0100)]
tests: shell . command needs path in argument
Tony Finch [Thu, 9 May 2013 18:47:56 +0000 (19:47 +0100)]
web: bump pre-release
Tony Finch [Thu, 9 May 2013 18:44:58 +0000 (19:44 +0100)]
tests: leave the source files alone in the multi-file tests
Tony Finch [Thu, 9 May 2013 13:41:53 +0000 (14:41 +0100)]
Makefile: release fixes
Must include version.h for non-unix builds. Re-jig the version
dependencies to avoid running reversion.sh twice.
Tony Finch [Wed, 8 May 2013 15:51:11 +0000 (16:51 +0100)]
web: bump pre-release
Tony Finch [Wed, 8 May 2013 15:48:49 +0000 (16:48 +0100)]
tests: clean away more xterm gubbins
Tony Finch [Wed, 8 May 2013 15:30:35 +0000 (16:30 +0100)]
tests: do not ship vast chunks of XTerm
By default the xterm test does nothing; if required it will download
and upack xterm in order to run the full test. It is likely to break
when a new version of xterm is released since the download URL is
not versioned.