[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
use maintainer-makefile for improved 'make syntax-check'
From: |
Eric Blake |
Subject: |
use maintainer-makefile for improved 'make syntax-check' |
Date: |
Sat, 13 Jun 2009 08:48:58 -0600 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.21) Gecko/20090302 Thunderbird/2.0.0.21 Mnenhy/0.7.6.666 |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
I've been sitting on this for a while, because I still need to merge it to
the master branch. But it's worth applying for branch-1.6, even before I
merge (in part because of Ralf's recent report which requires touching
gnulib-cache.m4 again, and rebasing across git submodules is still not the
easiest process).
- --
Don't work too hard, make some time for fun as well!
Eric Blake address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAkozvFoACgkQ84KuGfSFAYB6FQCcCwx7dFzEQaGayALFwYnAzDHl
SYkAn350O4YZ4+yl0PyiPURUYLhWLefj
=tCcg
-----END PGP SIGNATURE-----
From 76b384f1d84225d0412d58999d2becc8936dd645 Mon Sep 17 00:00:00 2001
From: Eric Blake <address@hidden>
Date: Mon, 27 Apr 2009 20:30:46 -0600
Subject: [PATCH 1/3] Drop .cvsignore and redundant .gitignore files.
* .cvsignore: Delete. We are moving further away from CVS.
* build-aux/.cvsignore: Likewise.
* checks/.cvsignore: Likewise.
* doc/.cvsignore: Likewise.
* examples/.cvsignore: Likewise.
* src/.cvsignore: Likewise.
* .gitignore: Consolidate from other files.
* build-aux/.gitignore: Delete, now that it is consolidated.
* checks/.gitignore: Likewise.
* doc/.gitignore: Likewise.
* examples/.gitignore: Likewise.
* src/.gitignore: Likewise.
* bootstrap: Simplify accordingly.
Signed-off-by: Eric Blake <address@hidden>
---
.cvsignore | 30 ----------------------
.gitignore | 66 +++++++++++++++++++++++++++++++++----------------
ChangeLog | 17 +++++++++++++
bootstrap | 22 +----------------
build-aux/.cvsignore | 6 ----
build-aux/.gitignore | 6 ----
checks/.cvsignore | 3 --
checks/.gitignore | 3 --
doc/.cvsignore | 15 -----------
doc/.gitignore | 15 -----------
examples/.cvsignore | 2 -
examples/.gitignore | 2 -
src/.cvsignore | 6 ----
src/.gitignore | 6 ----
14 files changed, 62 insertions(+), 137 deletions(-)
delete mode 100644 .cvsignore
delete mode 100644 build-aux/.cvsignore
delete mode 100644 build-aux/.gitignore
delete mode 100644 checks/.cvsignore
delete mode 100644 checks/.gitignore
delete mode 100644 doc/.cvsignore
delete mode 100644 doc/.gitignore
delete mode 100644 examples/.cvsignore
delete mode 100644 examples/.gitignore
delete mode 100644 src/.cvsignore
delete mode 100644 src/.gitignore
diff --git a/.cvsignore b/.cvsignore
deleted file mode 100644
index 89903ca..0000000
--- a/.cvsignore
+++ /dev/null
@@ -1,30 +0,0 @@
-*.tar.bz2
-*.tar.gz
-.tarball-version
-.version
-aclocal.m4
-autom4te.cache
-config.cache
-config.guess
-config.h
-config.log
-config.status
-config.sub
-config-h.in
-configure
-configure.lineno
-depcomp
-gendocs.sh
-GNUmakefile
-gnupload
-install-sh
-lib
-link-warning.h
-m4-*
-Makefile.in
-Makefile
-missing
-stamp-h
-stamp-h1
-stamp-h.in
-tests
diff --git a/.gitignore b/.gitignore
index b6e029c..1074fda 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,34 +1,56 @@
*~
+*.a
+*.exe
+*.o
*.orig
*.rej
*.tar.bz2
*.tar.gz
-.tarball-version
-.version
-aclocal.m4
-autom4te.cache
-config.cache
+*.tar.lzma
+*.tar.xz
+.deps
+/.tarball-version
+/.version
+/aclocal.m4
+/autom4te.cache
+/build-aux/.gitignore
+/checks/[0-9][0-9].*
+/checks/[0-9][0-9][0-9].*
+/checks/stamp-checks
+/config.cache
/config.guess
-config.h
-config.log
-config.status
+/config.h
+/config.log
+/config.status
/config.sub
-config-h.in
-configure
-configure.lineno
-CVS
+/config-h.in
+/configure
+/configure.lineno
+/CVS
/depcomp
-gendocs.sh
-GNUmakefile
-gnupload
+/doc/.gitignore
+/doc/m4.1
+/doc/m4.??
+/doc/m4.???
+/doc/m4.html
+/doc/m4.info*
+/doc/manual
+/doc/stamp-vti
+/doc/version.texi
+/gendocs.sh
+/GNUmakefile
+/gnupload
/install-sh
-lib
-link-warning.h
-m4-*
+/lib
+/link-warning.h
+/m4-*
+/m4/.gitignore
+/m4/gnulib-comp.m4
Makefile.in
Makefile
/missing
-stamp-h
-stamp-h1
-stamp-h.in
-tests
+/src/m4
+/stamp-h
+/stamp-h1
+/stamp-h.in
+/tests
diff --git a/ChangeLog b/ChangeLog
index 30a84d8..3362dc8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,20 @@
+2009-05-14 Eric Blake <address@hidden>
+
+ Drop .cvsignore and redundant .gitignore files.
+ * .cvsignore: Delete. We are moving further away from CVS.
+ * build-aux/.cvsignore: Likewise.
+ * checks/.cvsignore: Likewise.
+ * doc/.cvsignore: Likewise.
+ * examples/.cvsignore: Likewise.
+ * src/.cvsignore: Likewise.
+ * .gitignore: Consolidate from other files.
+ * build-aux/.gitignore: Delete, now that it is consolidated.
+ * checks/.gitignore: Likewise.
+ * doc/.gitignore: Likewise.
+ * examples/.gitignore: Likewise.
+ * src/.gitignore: Likewise.
+ * bootstrap: Simplify accordingly.
+
2009-04-21 Eric Blake <address@hidden>
Be more explicit about default quoting characters.
diff --git a/bootstrap b/bootstrap
index 697b350..81b87e3 100755
--- a/bootstrap
+++ b/bootstrap
@@ -1,6 +1,6 @@
#! /bin/sh
-# bootstrap (GNU M4) version 2009-03-23
+# bootstrap (GNU M4) version 2009-05-14
# Written by Gary V. Vaughan <address@hidden>
# Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Free Software
@@ -211,26 +211,6 @@ func_update ()
## Version control. ##
## ---------------- ##
-# gnulib-tool updates m4/.{git,cvs}ignore and lib/.{git,cvs}ignore, and
-# keeping generated files under version control does not make sense.
-# Since lib is entirely ignored, we only need to prepopulate the m4 ignore
-# files with generated files not tracked by gnulib-tool.
-if test -f $config_macro_dir/.gitignore ; then
- :
-else
- func_echo "creating initial $config_macro_dir/.cvsignore"
- cat > $config_macro_dir/.cvsignore <<\EOF
-# files created by gnulib, but that gnulib doesn't track
-*~
-.cvsignore
-.gitignore
-gnulib-comp.m4
-# gnulib-tool edits below here
-EOF
- func_echo "creating initial $config_macro_dir/.gitignore"
- cp $config_macro_dir/.cvsignore $config_macro_dir/.gitignore
-fi
-
# See if we can use gnulib's git-merge-changelog merge driver.
if test -d .git && (git --version) >/dev/null 2>/dev/null ; then
if git config merge.merge-changelog.driver >/dev/null ; then
diff --git a/build-aux/.cvsignore b/build-aux/.cvsignore
deleted file mode 100644
index 8196f1a..0000000
--- a/build-aux/.cvsignore
+++ /dev/null
@@ -1,6 +0,0 @@
-announce-gen
-config.rpath
-gendocs.sh
-git-version-gen
-gnupload
-link-warning.h
diff --git a/build-aux/.gitignore b/build-aux/.gitignore
deleted file mode 100644
index b82803d..0000000
--- a/build-aux/.gitignore
+++ /dev/null
@@ -1,6 +0,0 @@
-/announce-gen
-/config.rpath
-/gendocs.sh
-/git-version-gen
-/gnupload
-/link-warning.h
diff --git a/checks/.cvsignore b/checks/.cvsignore
deleted file mode 100644
index cfdeddf..0000000
--- a/checks/.cvsignore
+++ /dev/null
@@ -1,3 +0,0 @@
-[0-9][0-9][0-9].*
-Makefile
-stamp-checks
diff --git a/checks/.gitignore b/checks/.gitignore
deleted file mode 100644
index cfdeddf..0000000
--- a/checks/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-[0-9][0-9][0-9].*
-Makefile
-stamp-checks
diff --git a/doc/.cvsignore b/doc/.cvsignore
deleted file mode 100644
index 81f5a1e..0000000
--- a/doc/.cvsignore
+++ /dev/null
@@ -1,15 +0,0 @@
-fdl-1.3.texi
-gendocs_template
-gpl-3.0.texi
-m4.1
-m4.??
-m4.???
-m4.html
-m4.info*
-Makefile.in
-Makefile
-manual
-mdate-sh
-stamp-vti
-texinfo.tex
-version.texi
diff --git a/doc/.gitignore b/doc/.gitignore
deleted file mode 100644
index 81f5a1e..0000000
--- a/doc/.gitignore
+++ /dev/null
@@ -1,15 +0,0 @@
-fdl-1.3.texi
-gendocs_template
-gpl-3.0.texi
-m4.1
-m4.??
-m4.???
-m4.html
-m4.info*
-Makefile.in
-Makefile
-manual
-mdate-sh
-stamp-vti
-texinfo.tex
-version.texi
diff --git a/examples/.cvsignore b/examples/.cvsignore
deleted file mode 100644
index 3dda729..0000000
--- a/examples/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-Makefile.in
-Makefile
diff --git a/examples/.gitignore b/examples/.gitignore
deleted file mode 100644
index 3dda729..0000000
--- a/examples/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-Makefile.in
-Makefile
diff --git a/src/.cvsignore b/src/.cvsignore
deleted file mode 100644
index 9b593c0..0000000
--- a/src/.cvsignore
+++ /dev/null
@@ -1,6 +0,0 @@
-.deps
-*.o
-Makefile.in
-Makefile
-m4
-m4.exe
diff --git a/src/.gitignore b/src/.gitignore
deleted file mode 100644
index 9b593c0..0000000
--- a/src/.gitignore
+++ /dev/null
@@ -1,6 +0,0 @@
-.deps
-*.o
-Makefile.in
-Makefile
-m4
-m4.exe
--
1.6.3.rc3.2.g4b51
From 260383467b3ae57f2cb3c6821718b99fdf278c4b Mon Sep 17 00:00:00 2001
From: Eric Blake <address@hidden>
Date: Fri, 24 Apr 2009 16:27:36 -0600
Subject: [PATCH 2/3] Use gnulib maintainer-makefile module.
* m4/gnulib-cache.m4: Import maintainer-makefile module.
* cfg.mk (local-checks-to-skip): Drop changelog-check; add
sc_cast_of_x_alloc_return_value.
(gnulib_dir): Delete; provided by maint.mk.
(config_h_header, old_NEWS_hash): New macros.
* .prev-version: New file.
* gnulib: Import latest gnulib.
* maint.mk: Remove from version control; use gnulib instead.
* .gitignore: Update.
Signed-off-by: Eric Blake <address@hidden>
---
.gitignore | 1 +
.prev-version | 1 +
ChangeLog | 13 ++++
cfg.mk | 18 +++---
gnulib | 2 +-
m4/gnulib-cache.m4 | 3 +-
maint.mk | 199 ----------------------------------------------------
7 files changed, 27 insertions(+), 210 deletions(-)
create mode 100644 .prev-version
delete mode 100644 maint.mk
diff --git a/.gitignore b/.gitignore
index 1074fda..2ab1a8b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -46,6 +46,7 @@
/m4-*
/m4/.gitignore
/m4/gnulib-comp.m4
+/maint.mk
Makefile.in
Makefile
/missing
diff --git a/.prev-version b/.prev-version
new file mode 100644
index 0000000..acd81d7
--- /dev/null
+++ b/.prev-version
@@ -0,0 +1 @@
+1.4.13
diff --git a/ChangeLog b/ChangeLog
index 3362dc8..f643747 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2009-05-18 Eric Blake <address@hidden>
+
+ Use gnulib maintainer-makefile module.
+ * m4/gnulib-cache.m4: Import maintainer-makefile module.
+ * cfg.mk (local-checks-to-skip): Drop changelog-check; add
+ sc_cast_of_x_alloc_return_value.
+ (gnulib_dir): Delete; provided by maint.mk.
+ (config_h_header, old_NEWS_hash): New macros.
+ * .prev-version: New file.
+ * gnulib: Import latest gnulib.
+ * maint.mk: Remove from version control; use gnulib instead.
+ * .gitignore: Update.
+
2009-05-14 Eric Blake <address@hidden>
Drop .cvsignore and redundant .gitignore files.
diff --git a/cfg.mk b/cfg.mk
index 2aac5ac..ccdfa39 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -29,12 +29,12 @@ url_dir_list = ftp://$(gnu_rel_host)/gnu/m4
# The GnuPG ID of the key used to sign the tarballs.
gpg_key_ID = F4850180
-# Tests not to run as part of "make distcheck".
-# Exclude changelog-check here so that there's less churn in ChangeLog
-# files -- otherwise, you'd need to have the upcoming version number
-# at the top of the file for each `make distcheck' run.
-local-checks-to-skip = changelog-check
-
-# The local directory containing the checked-out copy of gnulib used in this
-# release. Used solely to get gnulib's SHA1 for the "announcement" target.
-gnulib_dir = $(srcdir)/gnulib
+# Tests not to run as part of "make syntax-check".
+# M4 intentionally uses a coding style that compiles under C++.
+local-checks-to-skip = sc_cast_of_x_alloc_return_value
+
+# Our files include "m4.h", which in turn includes <config.h> first.
+config_h_header = "m4\.h"
+
+# Hash of NEWS contents, to ensure we don't add entries to wrong section.
+old_NEWS_hash = 0330971054cd4fb4e94b85fe367980f2
diff --git a/gnulib b/gnulib
index 8fdb848..2c9ffa2 160000
--- a/gnulib
+++ b/gnulib
@@ -1 +1 @@
-Subproject commit 8fdb8486e14c433b2b277eb11c97e859b282e7d1
+Subproject commit 2c9ffa2717e5fa3d4951b589d7a6d871326fa096
diff --git a/m4/gnulib-cache.m4 b/m4/gnulib-cache.m4
index 1ad5a8d..b3dc67e 100644
--- a/m4/gnulib-cache.m4
+++ b/m4/gnulib-cache.m4
@@ -15,7 +15,7 @@
# Specification in the form of a command-line invocation:
-# gnulib-tool --import --dir=. --local-dir=local --lib=libm4
--source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests
--aux-dir=build-aux --with-tests --no-libtool --macro-prefix=M4 announce-gen
assert autobuild avltree-oset binary-io clean-temp cloexec close-stream closein
config-h dirname error execute fdl-1.3 fflush filenamecat flexmember fopen
fopen-safer freadptr freadseek fseeko gendocs getopt git-version-gen
gnumakefile gnupload gpl-3.0 hash intprops memchr2 memcmp2 memmem mkstemp
obstack obstack-printf-posix pipe progname quote regex rename stdbool stdint
stdlib-safer strtod strtol unlocked-io vasnprintf-posix verror version-etc
version-etc-fsf wait-process xalloc xmemdup0 xprintf xvasprintf-posix
+# gnulib-tool --import --dir=. --local-dir=local --lib=libm4
--source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests
--aux-dir=build-aux --with-tests --no-libtool --macro-prefix=M4 announce-gen
assert autobuild avltree-oset binary-io clean-temp cloexec close-stream closein
config-h dirname error execute fdl-1.3 fflush filenamecat flexmember fopen
fopen-safer freadptr freadseek fseeko gendocs getopt git-version-gen
gnumakefile gnupload gpl-3.0 hash intprops maintainer-makefile memchr2 memcmp2
memmem mkstemp obstack obstack-printf-posix pipe progname quote regex rename
stdbool stdint stdlib-safer strtod strtol unlocked-io vasnprintf-posix verror
version-etc version-etc-fsf wait-process xalloc xmemdup0 xprintf
xvasprintf-posix
# Specification in the form of a few gnulib-tool.m4 macro invocations:
gl_LOCAL_DIR([local])
@@ -50,6 +50,7 @@ gl_MODULES([
gpl-3.0
hash
intprops
+ maintainer-makefile
memchr2
memcmp2
memmem
diff --git a/maint.mk b/maint.mk
deleted file mode 100644
index 5fa32a5..0000000
--- a/maint.mk
+++ /dev/null
@@ -1,199 +0,0 @@
-## maint.mk -- Makefile rules for m4 maintainers -*-Makefile-*-
-##
-## Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation
-##
-## This file is part of GNU M4.
-##
-## GNU M4 is free software: you can redistribute it and/or modify
-## it under the terms of the GNU General Public License as published by
-## the Free Software Foundation, either version 3 of the License, or
-## (at your option) any later version.
-##
-## GNU M4 is distributed in the hope that it will be useful,
-## but WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-## GNU General Public License for more details.
-##
-## You should have received a copy of the GNU General Public License
-## along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-# This is reported not to work with make-3.79.1
-# ME := $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))
-ME := maint.mk
-
-# Do not save the original name or timestamp in the .tar.gz file.
-# Use --rsyncable if available.
-gzip_rsyncable := \
- $(shell gzip --help 2>/dev/null|grep rsyncable >/dev/null && echo
--rsyncable)
-GZIP_ENV = '--no-name --best $(gzip_rsyncable)'
-
-GIT = git
-VC = $(GIT)
-VC-tag = git tag -s -m '$(VERSION)' -u $(gpg_key_ID)
-
-VERSION_REGEXP = $(subst .,\.,$(VERSION))
-my_distdir = $(PACKAGE)-$(VERSION)
-
-# Ensure that we use only the standard $(VAR) notation,
-# not @...@ in Makefile.am, now that we can rely on automake
-# to emit a definition for each substituted variable.
-makefile-check:
- grep -nE '@[A-Z_0-9]+@' `find $(srcdir) -name Makefile.am` \
- && { echo '$(ME): use $$(...), not @...@' 1>&2; exit 1; } || :
-
-news-date-check: NEWS version-check
- today=`date +%Y-%m-%d`; \
- if head $(srcdir)/NEWS | grep '^\*.* $(VERSION_REGEXP) ('$$today')'
\
- >/dev/null; then \
- :; \
- else \
- echo "version or today's date is not in NEWS" 1>&2; \
- exit 1; \
- fi
-
-changelog-check:
- if head $(srcdir)/ChangeLog | grep 'Version $(VERSION_REGEXP)\.$$'
\
- >/dev/null; then \
- :; \
- else \
- echo "$(VERSION) not in ChangeLog" 1>&2; \
- exit 1; \
- fi
-
-m4-check:
- @grep -n 'AC_DEFUN([^[]' $(srcdir)/m4/*.m4 \
- && { echo '$(ME): quote the first arg to AC_DEFUN' 1>&2; \
- exit 1; } || :
-
-vc-diff-check:
- (CDPATH=; cd $(srcdir) && $(VC) diff) > vc-diffs || :
- if test -s vc-diffs; then \
- cat vc-diffs; \
- echo "Some files are locally modified:" 1>&2; \
- exit 1; \
- else \
- rm vc-diffs; \
- fi
-
-maintainer-distcheck:
- $(MAKE) distcheck
- $(MAKE) my-distcheck
-
-# Don't make a distribution if checks fail.
-# Also, make sure the NEWS file is up-to-date.
-vc-dist: $(local-check) vc-diff-check maintainer-distcheck
- $(MAKE) dist
-
-# Use this to make sure we don't run these programs when building
-# from a virgin tgz file, below.
-null_AM_MAKEFLAGS = \
- ACLOCAL=false \
- AUTOCONF=false \
- AUTOMAKE=false \
- AUTOHEADER=false \
- MAKEINFO=false
-
-# Use -Wformat -Werror to detect format-string/arg-list mismatches.
-# Also, check for shadowing problems with -Wshadow, and for pointer
-# arithmetic problems with -Wpointer-arith.
-# These CFLAGS are pretty strict. If you build this target, you probably
-# have to have a recent version of gcc and glibc headers.
-TMPDIR ?= /tmp
-t=$(TMPDIR)/$(PACKAGE)/test
-my-distcheck: $(local-check) check
- -rm -rf $(t)
- mkdir -p $(t)
- GZIP=$(GZIP_ENV) $(AMTAR) -C $(t) -zxf $(distdir).tar.gz
- cd $(t)/$(distdir) \
- && ./configure \
- && $(MAKE) CFLAGS='$(warn_cflags)' \
- AM_MAKEFLAGS='$(null_AM_MAKEFLAGS)' \
- && $(MAKE) dvi \
- && $(MAKE) check \
- && $(MAKE) distclean
- (cd $(t) && mv $(distdir) $(distdir).old \
- && $(AMTAR) -zxf - ) < $(distdir).tar.gz
- diff -ur $(t)/$(distdir).old $(t)/$(distdir)
- -rm -rf $(t)
- @echo "========================"; \
- echo "$(distdir).tar.gz is ready for distribution"; \
- echo "========================"
-
-gnulib-version = $$(cd $(gnulib_dir) && git describe)
-
-announcement: NEWS ChangeLog $(rel-files)
- @$(srcdir)/build-aux/announce-gen \
- --release-type=$(RELEASE_TYPE) \
- --package=$(PACKAGE) \
- --prev=$(PREV_VERSION) \
- --curr=$(VERSION) \
- --gpg-key-id=$(gpg_key_ID) \
- --news=$(srcdir)/NEWS \
- --bootstrap-tools=autoconf,automake,gnulib \
- --gnulib-version=$(gnulib-version) \
- $(addprefix --url-dir=, $(url_dir_list))
-
-.PHONY: alpha beta major
-alpha beta major: $(local-check) version-check
- test $@ = major \
- && { echo $(VERSION) | grep -E '^[0-9]+(\.[0-9]+)+$$' \
- || { echo "invalid version string: $(VERSION)" 1>&2; exit 1;};}\
- || :
- $(MAKE) vc-dist
- $(MAKE) news-date-check changelog-check
- $(MAKE) deltas
- $(MAKE) -s announcement RELEASE_TYPE=$@ > /tmp/announce-$(my_distdir)
-
-.PHONY: version-check
-version-check:
- @case $(VERSION) in \
- *[acegikmoqsuwy]) \
- echo "Version \`$(VERSION)' is not a releasable version, please
read:"; \
- echo " http://www.gnu.org/software/libtool/contribute.html"; \
- exit 1; \
- ;; \
- esac
- @if test -z "$(PREV_VERSION)"; \
- then echo "PREV_VERSION is not set"; exit 1; fi
-
-.PHONY: prev-tarball
-prev-tarball: version-check
-## Make sure we have the previous release tarball in the tree.
- @ofile="$(PACKAGE)-$(PREV_VERSION).tar.gz"; \
- if test -f $$ofile; then :; \
- else echo "Cannot make deltas without $$ofile"; exit 1; fi
-
-.PHONY: new-tarball
-new-tarball:
-## Make sure we have the new release tarball in the tree.
- @ofile="$(PACKAGE)-$(VERSION).tar.gz"; \
- if test -f $$ofile; then :; \
- else echo "Cannot make deltas without $$ofile"; exit 1; fi
-
-.PHONY: deltas
-deltas: delta-diff
-
-DIFF = diff
-DIFF_OPTIONS = -ruNp
-
-.PHONY: delta-diff
-delta-diff: prev-tarball new-tarball
-## Unpack the tarballs somewhere to diff them
- rm -rf delta-diff
- mkdir delta-diff
- ofile="../$(PACKAGE)-$(PREV_VERSION)-$(VERSION).diff.gz"; \
- cd delta-diff \
- && tar xzf "../$(PACKAGE)-$(PREV_VERSION).tar.gz" \
- && tar xzf "../$(PACKAGE)-$(VERSION).tar.gz" \
- && $(DIFF) $(DIFF_OPTIONS) \
- $(PACKAGE)-$(PREV_VERSION) $(PACKAGE)-$(VERSION) \
- | GZIP=$(GZIP_ENV) gzip -c > $$ofile
- rm -rf delta-diff
-
-.PHONY: web-manual
-web-manual:
- @cd '$(srcdir)/doc' ; \
- $(SHELL) ../build-aux/gendocs.sh -o '$(abs_builddir)/doc/manual' \
- --email $(PACKAGE_BUGREPORT) $(PACKAGE) \
- "$(PACKAGE_NAME) - $(manual_title)"
- @echo " *** Upload the doc/manual directory to web-cvs."
--
1.6.3.rc3.2.g4b51
From 2f6096389e2047a01618419af3f4471735444520 Mon Sep 17 00:00:00 2001
From: Eric Blake <address@hidden>
Date: Mon, 27 Apr 2009 13:53:31 -0600
Subject: [PATCH 3/3] Minor cleanups, detected by gnulib's 'make syntax-check'.
* configure.ac (M4_cv_use_stackovf): Avoid redundant parentheses.
* BACKLOG: Delete.
* HACKING: Avoid trailing whitespace.
* TODO: Likewise.
* examples/stackovf.sh: Likewise.
* examples/esyscmd.m4: Likewise.
* examples/file.m4: Avoid space-tab.
* examples/fstab.m4: Likewise.
* examples/patsubst.m4: Likewise.
* src/m4.h (STREQ): New macro.
* src/builtin.c (find_builtin_by_name): Use it.
* src/m4.c (process_file): Likewise.
(main): Mark all strings. Avoid atoi.
(stackovf_handler): Reword string.
(m4_verror_at_line): Use all-lowercase warning.
* src/stackovf.c (includes): Drop unused <assert.h>.
(setup_stackovf_trap): Make it easier to translate errors.
* src/output.c (freeze_diversions): Avoid false positive.
* doc/m4.texinfo: Adjust expected output.
* examples/null.err: Likewise.
Signed-off-by: Eric Blake <address@hidden>
---
BACKLOG | 60 -----------------
ChangeLog | 22 ++++++
HACKING | 2 +-
TODO | 4 +-
configure.ac | 4 +-
doc/m4.texinfo | 176 +++++++++++++++++++++++++-------------------------
examples/esyscmd.m4 | 2 +-
examples/file.m4 | 2 +-
examples/fstab.m4 | 3 +-
examples/null.err | 72 ++++++++++----------
examples/patsubst.m4 | 2 +-
examples/stackovf.sh | 10 ++--
src/builtin.c | 4 +-
src/m4.c | 32 ++++++----
src/m4.h | 5 ++
src/output.c | 2 +-
src/stackovf.c | 17 ++---
17 files changed, 195 insertions(+), 224 deletions(-)
delete mode 100644 BACKLOG
diff --git a/BACKLOG b/BACKLOG
deleted file mode 100644
index 96562a5..0000000
--- a/BACKLOG
+++ /dev/null
@@ -1,60 +0,0 @@
-# Summary of pending email for GNU m4 1.4.
-# Last updated: Saturday, November 05, 1994.
-
-rmail/announce
- 1. 15 Sep 94 <address@hidden> Release: GNU m4 1.3
- 2. 29 Oct 94 <address@hidden> Prerelease: GNU m4 1.3.1
-
-rmail/changeword
- 1. 02 Sep 94 <pinard> Re: Prerelease: GNU m4 1.2.3
- 2. 05 Sep 94 <address@hidden> Re: Prerelease: GNU m4 1.2.3
-
-rmail/configuration
- 1. 03 Nov 94 <address@hidden> Re: m4 1.3 on DEC OSF/1 3.0
- 2. 05 Nov 94 <pinard> Re: m4 1.3 on DEC OSF/1 3.0
-
-rmail/documentation
- 1. 05 Jun 92 <address@hidden> Re: M4
- 2. 10 Nov 92 <address@hidden> Re: Is anyone using m4?
- 3. 25 May 94 <address@hidden> Autoconf 1.11: minor bu
- 4. 27 Jul 94 <address@hidden> Re: 0.95: Spacing details
- 5. 28 Jul 94 <address@hidden> Re: 0.95: Spacing details
- 6. 31 Aug 94 <address@hidden> Re: Frozen file documentation to proofread
-
-rmail/floating-point
- 1. 27 Oct 94 <address@hidden> Re: enhancement to m4 eval()
- 2. 25 Oct 94 <address@hidden> enhancement to m4
- 3. 27 Oct 94 <pinard> Re: enhancement to m4
- 4. 27 Oct 94 <address@hidden> Re: enhancement to m4 eval()
- 5. 27 Oct 94 <pinard> Re: enhancement to m4 eval()
- 6. 27 Oct 94 <address@hidden> Re: enhancement to m4 eval()
- 7. 28 Oct 94 <pinard> Re: enhancement to m4 eval()
- 8. 28 Oct 94 <pinard> Re: enhancement to m4 eval()
- 9. 28 Oct 94 <address@hidden> Re: enhancement to m4 eval()
-10. 28 Oct 94 <pinard> Re: enhancement to m4 eval()
-11. 28 Oct 94 <address@hidden> Re: enhancement to m4 eval()
-12. 28 Oct 94 <address@hidden> Re: enhancement to m4 eval()
-13. 28 Oct 94 <address@hidden> Re: enhancement to m4 eval()
-
-rmail/format-rewrite
- 1. 25 Jun 94 <address@hidden> Re: Prerelease: GNU m4 1.1.3
-
-rmail/named-formals
- 1. 30 Sep 94 <address@hidden> m4 macros with named formal parameters
-
-rmail/purify
- 1. 06 Dec 93 <address@hidden> m4 1.1.1 "make realclean"
-
-rmail/speed
- 1. 29 Aug 94 <pinard> Re: diversions and freezing
- 2. 05 Sep 94 <address@hidden> slowness
- 3. 04 Oct 94 <pinard> Autoconf, m4, and dnl's.
-
-Copyright (C) 2000, 2006 Free Software Foundation, Inc.
-
-Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU Free Documentation License, Version 1.2 or
-any later version published by the Free Software Foundation; with no
-Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
-Texts. A copy of the license is included in the ``GNU Free
-Documentation License'' file as part of this distribution.
diff --git a/ChangeLog b/ChangeLog
index f643747..0a1271a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,27 @@
2009-05-18 Eric Blake <address@hidden>
+ Minor cleanups, detected by gnulib's 'make syntax-check'.
+ * configure.ac (M4_cv_use_stackovf): Avoid redundant parentheses.
+ * BACKLOG: Delete.
+ * HACKING: Avoid trailing whitespace.
+ * TODO: Likewise.
+ * examples/stackovf.sh: Likewise.
+ * examples/esyscmd.m4: Likewise.
+ * examples/file.m4: Avoid space-tab.
+ * examples/fstab.m4: Likewise.
+ * examples/patsubst.m4: Likewise.
+ * src/m4.h (STREQ): New macro.
+ * src/builtin.c (find_builtin_by_name): Use it.
+ * src/m4.c (process_file): Likewise.
+ (main): Mark all strings. Avoid atoi.
+ (stackovf_handler): Reword string.
+ (m4_verror_at_line): Use all-lowercase warning.
+ * src/stackovf.c (includes): Drop unused <assert.h>.
+ (setup_stackovf_trap): Make it easier to translate errors.
+ * src/output.c (freeze_diversions): Avoid false positive.
+ * doc/m4.texinfo: Adjust expected output.
+ * examples/null.err: Likewise.
+
Use gnulib maintainer-makefile module.
* m4/gnulib-cache.m4: Import maintainer-makefile module.
* cfg.mk (local-checks-to-skip): Drop changelog-check; add
diff --git a/HACKING b/HACKING
index 38d2ade..43bc715 100644
--- a/HACKING
+++ b/HACKING
@@ -289,7 +289,7 @@ yyyy-mm-dd Name of Author <address@hidden> (tiny change)
co directory/m4.txt
After making edits, mail the diff to <address@hidden>.
---
+-----------
Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Free Software
Foundation, Inc.
diff --git a/TODO b/TODO
index 4f1ea39..4151f5b 100644
--- a/TODO
+++ b/TODO
@@ -30,14 +30,14 @@ of these ideas, listed more or less in decreasing order of
priority.
GNU m4 is lousy regarding NULs in streams (this would require
maintaining the string lengths, and avoiding strlen, strcpy,
- etc.).
+ etc.).
Local Variables:
mode: outline
outline-regexp: " *[-+*.] \\|"
End:
-Copyright (C) 2000, 2006, 2007 Free Software Foundation, Inc.
+Copyright (C) 2000, 2006, 2007, 2009 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.2 or
diff --git a/configure.ac b/configure.ac
index 5f1664f..f2b42b5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -82,8 +82,8 @@ if test "$ac_cv_func_sigaction" = yes || test
"$ac_cv_func_sigvec" = yes; then
#include <sys/resource.h>
#include <signal.h>
]], [[struct rlimit r; getrlimit (RLIMIT_STACK, &r);
-#if (!defined(HAVE_SIGACTION) || !defined(SA_ONSTACK)) \
- && (!defined(HAVE_SIGVEC) || !defined(SV_ONSTACK))
+#if (!defined HAVE_SIGACTION || !defined SA_ONSTACK) \
+ && (!defined HAVE_SIGVEC || !defined SV_ONSTACK)
choke me /* SA_ONSTACK and/or SV_ONSTACK are not defined */
#endif
]])], [M4_cv_use_stackovf=yes])
diff --git a/doc/m4.texinfo b/doc/m4.texinfo
index c37bc9e..d18d4b0 100644
--- a/doc/m4.texinfo
+++ b/doc/m4.texinfo
@@ -612,7 +612,7 @@ Operation modes
@example
$ @kbd{m4}
defn(`oops')
address@hidden:stdin:1: Warning: defn: undefined macro `oops'
address@hidden:stdin:1: warning: defn: undefined macro `oops'
@result{}
^D
@end example
@@ -642,7 +642,7 @@ Operation modes
@example
$ @kbd{m4 -E -d}
defn(`oops')
address@hidden:stdin:1: Warning: defn: undefined macro `oops'
address@hidden:stdin:1: warning: defn: undefined macro `oops'
@result{}
^D
@end example
@@ -962,7 +962,7 @@ Debugging options
@comment options: -o /dev/null
@example
$ @kbd{m4 -o /dev/null
address@hidden: Warning: `-o' is deprecated, use `--debugfile' instead
address@hidden: warning: `-o' is deprecated, use `--debugfile' instead
dumpdef(`divnum')
@result{}
@end example
@@ -1092,7 +1092,7 @@ Syntax
@example
include(`null.m4')
@result{}# This file tests m4 behavior on NUL bytes.
address@hidden:examples/null.m4:5: Warning: m4exit: non-numeric argument
`2\0002'
address@hidden:examples/null.m4:5: warning: m4exit: non-numeric argument
`2\0002'
@end example
@end ignore
@@ -1650,12 +1650,12 @@ Macro Arguments
@example
$ @kbd{m4}
index(`abc')
address@hidden:stdin:1: Warning: index: too few arguments: 1 < 2
address@hidden:stdin:1: warning: index: too few arguments: 1 < 2
@result{}0
index(`abc',)
@result{}0
index(`abc', `b', `0', `ignored')
address@hidden:stdin:3: Warning: index: extra arguments ignored: 4 > 3
address@hidden:stdin:3: warning: index: extra arguments ignored: 4 > 3
@result{}1
@end example
@@ -2034,8 +2034,8 @@ Arguments
@example
$ @kbd{m4 --warn-macro-sequence}
define(`foo', `$001 address@hidden@} $1')
address@hidden:stdin:1: Warning: definition of `foo' contains sequence `$001'
address@hidden:stdin:1: Warning: definition of `foo' contains sequence
address@hidden@}'
address@hidden:stdin:1: warning: definition of `foo' contains sequence `$001'
address@hidden:stdin:1: warning: definition of `foo' contains sequence
address@hidden@}'
@result{}
foo(`bar')
@result{}bar address@hidden@} bar
@@ -2279,7 +2279,7 @@ Undefine
@example
$ @kbd{m4}
undefine(`a')
address@hidden:stdin:1: Warning: undefine: undefined macro `a'
address@hidden:stdin:1: warning: undefine: undefined macro `a'
@result{}
debugmode(`-d')
@result{}
@@ -2417,7 +2417,7 @@ Defn
defn(`defn')
@result{}
define(defn(`divnum'), `cannot redefine a builtin token')
address@hidden:stdin:2: Warning: define: invalid macro name ignored
address@hidden:stdin:2: warning: define: invalid macro name ignored
@result{}
divnum
@result{}0
@@ -2432,30 +2432,30 @@ Defn
define(`', `empty-$1')
@result{}
defn(defn(`divnum'))
address@hidden:stdin:9: Warning: defn: invalid macro name ignored
address@hidden:stdin:9: warning: defn: invalid macro name ignored
@result{}
pushdef(defn(`divnum'), `oops')
address@hidden:stdin:10: Warning: pushdef: invalid macro name ignored
address@hidden:stdin:10: warning: pushdef: invalid macro name ignored
@result{}
traceon(defn(`divnum'))
address@hidden:stdin:11: Warning: traceon: invalid macro name ignored
address@hidden:stdin:11: warning: traceon: invalid macro name ignored
@result{}
indir(defn(`divnum'), `string')
address@hidden:stdin:12: Warning: indir: invalid macro name ignored
address@hidden:stdin:12: warning: indir: invalid macro name ignored
@result{}
indir(`', `string')
@result{}empty-string
traceoff(defn(`divnum'))
address@hidden:stdin:14: Warning: traceoff: invalid macro name ignored
address@hidden:stdin:14: warning: traceoff: invalid macro name ignored
@result{}
popdef(defn(`divnum'))
address@hidden:stdin:15: Warning: popdef: invalid macro name ignored
address@hidden:stdin:15: warning: popdef: invalid macro name ignored
@result{}
dumpdef(defn(`divnum'))
address@hidden:stdin:16: Warning: dumpdef: invalid macro name ignored
address@hidden:stdin:16: warning: dumpdef: invalid macro name ignored
@result{}
undefine(defn(`divnum'))
address@hidden:stdin:17: Warning: undefine: invalid macro name ignored
address@hidden:stdin:17: warning: undefine: invalid macro name ignored
@result{}
dumpdef(`')
@error{}:@tabchar{}`empty-$1'
@@ -2479,7 +2479,7 @@ Defn
@example
$ @kbd{m4 -d}
defn(`foo')
address@hidden:stdin:1: Warning: defn: undefined macro `foo'
address@hidden:stdin:1: warning: defn: undefined macro `foo'
@result{}
debugmode(`-d')
@result{}
@@ -2494,25 +2494,25 @@ Defn
@result{}AA
define(`mydivnum', defn(`divnum', `divnum'))mydivnum
@error{}m4trace: -2- defn(`divnum', `divnum') -> `<divnum><divnum>'
address@hidden:stdin:7: Warning: define: cannot concatenate builtins
address@hidden:stdin:7: warning: define: cannot concatenate builtins
@error{}m4trace: -1- define(`mydivnum', `<divnum><divnum>') -> `'
@result{}
traceoff(`defn', `define')dumpdef(`mydivnum')
@error{}mydivnum:@tabchar{}`'
@result{}
define(`mydivnum', defn(`divnum')defn(`divnum'))mydivnum
address@hidden:stdin:9: Warning: define: cannot concatenate builtins
address@hidden:stdin:9: warning: define: cannot concatenate builtins
@result{}
define(`mydivnum', defn(`divnum')`a')mydivnum
address@hidden:stdin:10: Warning: define: cannot concatenate builtins
address@hidden:stdin:10: warning: define: cannot concatenate builtins
@result{}A
define(`mydivnum', `a'defn(`divnum'))mydivnum
address@hidden:stdin:11: Warning: define: cannot concatenate builtins
address@hidden:stdin:11: warning: define: cannot concatenate builtins
@result{}A
define(`q', ``$@@'')
@result{}
define(`foo', q(`a', defn(`divnum')))foo
address@hidden:stdin:13: Warning: define: cannot concatenate builtins
address@hidden:stdin:13: warning: define: cannot concatenate builtins
@result{}a,
ifdef(`foo', `yes', `no')
@result{}yes
@@ -2630,7 +2630,7 @@ Pushdef
popdef
@result{}popdef
popdef(`a', `a')
address@hidden:stdin:3: Warning: popdef: undefined macro `a'
address@hidden:stdin:3: warning: popdef: undefined macro `a'
@result{}
debugmode(`-d')
@result{}
@@ -2688,7 +2688,7 @@ Indir
indir(`f', define(`f', `3'))
@result{}3
indir(`f', undefine(`f'))
address@hidden:stdin:4: Warning: indir: undefined macro `f'
address@hidden:stdin:4: warning: indir: undefined macro `f'
@result{}
debugmode(`-d')
@result{}
@@ -2704,17 +2704,17 @@ Indir
@example
$ @kbd{m4 -d}
indir(defn(`defn'), `divnum')
address@hidden:stdin:1: Warning: indir: invalid macro name ignored
address@hidden:stdin:1: warning: indir: invalid macro name ignored
@result{}
indir(`define', defn(`defn'), `divnum')
address@hidden:stdin:2: Warning: define: invalid macro name ignored
address@hidden:stdin:2: warning: define: invalid macro name ignored
@result{}
indir(`define', `foo', defn(`divnum'))
@result{}
foo
@result{}0
indir(`divert', defn(`foo'))
address@hidden:stdin:5: Warning: divert: empty string treated as 0
address@hidden:stdin:5: warning: divert: empty string treated as 0
@result{}
@end example
@@ -2728,7 +2728,7 @@ Indir
@result{}
indir(`%%:\
odd', `extra')
address@hidden:stdin:3: Warning: %%\:\\\nodd: extra arguments ignored: 1 > 0
address@hidden:stdin:3: warning: %%\:\\\nodd: extra arguments ignored: 1 > 0
@result{}0
@end example
@@ -2792,10 +2792,10 @@ Builtin
m4_builtin(`divnum')
@result{}0
m4_builtin(`m4_divnum')
address@hidden:stdin:2: Warning: m4_builtin: undefined builtin `m4_divnum'
address@hidden:stdin:2: warning: m4_builtin: undefined builtin `m4_divnum'
@result{}
m4_indir(`divnum')
address@hidden:stdin:3: Warning: m4_indir: undefined macro `divnum'
address@hidden:stdin:3: warning: m4_indir: undefined macro `divnum'
@result{}
m4_indir(`m4_divnum')
@result{}0
@@ -2813,20 +2813,20 @@ Builtin
builtin
@result{}builtin
builtin()
address@hidden:stdin:2: Warning: builtin: undefined builtin `'
address@hidden:stdin:2: warning: builtin: undefined builtin `'
@result{}
builtin(`builtin')
address@hidden:stdin:3: Warning: builtin: too few arguments: 0 < 1
address@hidden:stdin:3: warning: builtin: too few arguments: 0 < 1
@result{}
builtin(`builtin',)
address@hidden:stdin:4: Warning: builtin: undefined builtin `'
address@hidden:stdin:4: warning: builtin: undefined builtin `'
@result{}
builtin(`builtin', ``'
')
address@hidden:stdin:5: Warning: builtin: undefined builtin ``\'\n'
address@hidden:stdin:5: warning: builtin: undefined builtin ``\'\n'
@result{}
indir(`index')
address@hidden:stdin:7: Warning: index: too few arguments: 0 < 2
address@hidden:stdin:7: warning: index: too few arguments: 0 < 2
@result{}
@end example
@@ -2901,7 +2901,7 @@ Ifdef
ifdef(`foo', ``foo' is defined', ``foo' is not defined')
@result{}foo is defined
ifdef(`no_such_macro', `yes', `no', `extra argument')
address@hidden:stdin:4: Warning: ifdef: extra arguments ignored: 4 > 3
address@hidden:stdin:4: warning: ifdef: extra arguments ignored: 4 > 3
@result{}no
@end example
@@ -2913,7 +2913,7 @@ Ifdef
define(`', `empty')
@result{}
ifdef(defn(`defn'), `yes', `no')
address@hidden:stdin:2: Warning: ifdef: invalid macro name ignored
address@hidden:stdin:2: warning: ifdef: invalid macro name ignored
@result{}no
define(`foo', ifdef(`divnum', defn(`divnum'), `undefined'))
@result{}
@@ -2961,7 +2961,7 @@ Ifelse
ifelse(`some comments')
@result{}
ifelse(`foo', `bar')
address@hidden:stdin:2: Warning: ifelse: too few arguments: 2 < 3
address@hidden:stdin:2: warning: ifelse: too few arguments: 2 < 3
@result{}
@end example
@@ -3013,14 +3013,14 @@ Ifelse
@example
ifelse(`foo', `bar', `third', `gnu', `gnats')
address@hidden:stdin:1: Warning: ifelse: extra arguments ignored: 5 > 4
address@hidden:stdin:1: warning: ifelse: extra arguments ignored: 5 > 4
@result{}gnu
ifelse(`foo', `bar', `third', `gnu', `gnats', `sixth')
@result{}
ifelse(`foo', `bar', `third', `gnu', `gnats', `sixth', `seventh')
@result{}seventh
ifelse(`foo', `bar', `3', `gnu', `gnats', `6', `7', `8')
address@hidden:stdin:4: Warning: ifelse: extra arguments ignored: 8 > 7
address@hidden:stdin:4: warning: ifelse: extra arguments ignored: 8 > 7
@result{}7
@end example
@@ -4045,7 +4045,7 @@ Dumpdef
@error{}f:@tabchar{}``$0'1'
@result{}f2
f(popdef(`f')dumpdef(`f'))
address@hidden:stdin:3: Warning: dumpdef: undefined macro `f'
address@hidden:stdin:3: warning: dumpdef: undefined macro `f'
@result{}f1
debugmode(`-d')
@result{}
@@ -4138,17 +4138,17 @@ Trace
foo
@result{}foo
defn(`foo')
address@hidden:stdin:4: Warning: defn: undefined macro `foo'
address@hidden:stdin:4: warning: defn: undefined macro `foo'
@result{}
undefine(`foo')
address@hidden:stdin:5: Warning: undefine: undefined macro `foo'
address@hidden:stdin:5: warning: undefine: undefined macro `foo'
@result{}
pushdef(`foo')
@result{}
popdef(`foo')
@result{}
popdef(`foo')
address@hidden:stdin:8: Warning: popdef: undefined macro `foo'
address@hidden:stdin:8: warning: popdef: undefined macro `foo'
@result{}
define(`foo', `bar')
@result{}
@@ -4160,7 +4160,7 @@ Trace
ifdef(`foo', `yes', `no')
@result{}no
indir(`foo')
address@hidden:stdin:13: Warning: indir: undefined macro `foo'
address@hidden:stdin:13: warning: indir: undefined macro `foo'
@result{}
define(`foo', `blah')
@result{}
@@ -4487,13 +4487,13 @@ Debugfile
traceon(`divnum')
@result{}
divnum(`extra')
address@hidden:stdin:2: Warning: divnum: extra arguments ignored: 1 > 0
address@hidden:stdin:2: warning: divnum: extra arguments ignored: 1 > 0
@error{}m4trace: -1- divnum(`extra') -> `0'
@result{}0
debugfile()
@result{}
divnum(`extra')
address@hidden:stdin:4: Warning: divnum: extra arguments ignored: 1 > 0
address@hidden:stdin:4: warning: divnum: extra arguments ignored: 1 > 0
@result{}0
debugfile
@result{}
@@ -4588,7 +4588,7 @@ Dnl
@example
dnl(`args are ignored, but side effects occur',
define(`foo', `like this')) while this text is ignored: undefine(`foo')
address@hidden:stdin:1: Warning: dnl: extra arguments ignored: 2 > 0
address@hidden:stdin:1: warning: dnl: extra arguments ignored: 2 > 0
See how `foo' was defined, foo?
@result{}See how foo was defined, like this?
@end example
@@ -4603,7 +4603,7 @@ Dnl
define(`hi', `HI')
@result{}
^D
address@hidden:stdin:1: Warning: dnl: end of file treated as newline
address@hidden:stdin:1: warning: dnl: end of file treated as newline
@result{}0 HI 2 HI
@end example
@@ -6175,7 +6175,7 @@ Index macro
@example
index(`abc')
address@hidden:stdin:1: Warning: index: too few arguments: 1 < 2
address@hidden:stdin:1: warning: index: too few arguments: 1 < 2
@result{}0
index(`abc', `')
@result{}0
@@ -6260,13 +6260,13 @@ Regexp
regexp(`abc', `\(b\)', `\\\10\a')
@result{}\b0a
regexp(`abc', `b', `\1\')
address@hidden:stdin:2: Warning: regexp: sub-expression 1 not present
address@hidden:stdin:2: Warning: regexp: trailing \ ignored in replacement
address@hidden:stdin:2: warning: regexp: sub-expression 1 not present
address@hidden:stdin:2: warning: regexp: trailing \ ignored in replacement
@result{}
regexp(`abc', `\(\(d\)?\)\(c\)', `\1\2\3\4\5\6')
address@hidden:stdin:3: Warning: regexp: sub-expression 4 not present
address@hidden:stdin:3: Warning: regexp: sub-expression 5 not present
address@hidden:stdin:3: Warning: regexp: sub-expression 6 not present
address@hidden:stdin:3: warning: regexp: sub-expression 4 not present
address@hidden:stdin:3: warning: regexp: sub-expression 5 not present
address@hidden:stdin:3: warning: regexp: sub-expression 6 not present
@result{}c
@end example
@@ -6275,7 +6275,7 @@ Regexp
@example
regexp(`abc')
address@hidden:stdin:1: Warning: regexp: too few arguments: 1 < 2
address@hidden:stdin:1: warning: regexp: too few arguments: 1 < 2
@result{}0
regexp(`abc', `')
@result{}0
@@ -6334,7 +6334,7 @@ Substr
@example
substr(`abc')
address@hidden:stdin:1: Warning: substr: too few arguments: 1 < 2
address@hidden:stdin:1: warning: substr: too few arguments: 1 < 2
@result{}abc
substr(`abc', `')
@result{}abc
@@ -6391,10 +6391,10 @@ Substr
substr(`abcde', `-6', `1', `f')
@result{}fabcde
substr(`abcde', `-7', `1', `f')
address@hidden:stdin:5: Warning: substr: substring out of range
address@hidden:stdin:5: warning: substr: substring out of range
@result{}
substr(`abcde', `6', `', `f')
address@hidden:stdin:6: Warning: substr: substring out of range
address@hidden:stdin:6: warning: substr: substring out of range
@result{}
@end example
@@ -6584,7 +6584,7 @@ Translit
@example
translit(`abc')
address@hidden:stdin:1: Warning: translit: too few arguments: 1 < 2
address@hidden:stdin:1: warning: translit: too few arguments: 1 < 2
@result{}abc
@end example
@@ -6638,7 +6638,7 @@ Patsubst
patsubst(`GNUs not Unix', `[A-Z][a-z]+')
@result{}GN address@hidden }
patsubst(`GNUs not Unix', `not', `NOT\')
address@hidden:stdin:6: Warning: patsubst: trailing \ ignored in replacement
address@hidden:stdin:6: warning: patsubst: trailing \ ignored in replacement
@result{}GNUs NOT Unix
@end example
@@ -6717,7 +6717,7 @@ Patsubst
@example
patsubst(`abc')
address@hidden:stdin:1: Warning: patsubst: too few arguments: 1 < 2
address@hidden:stdin:1: warning: patsubst: too few arguments: 1 < 2
@result{}abc
patsubst(`abc', `')
@result{}abc
@@ -6817,14 +6817,14 @@ Format
@example
format(`%p', `0')
address@hidden:stdin:1: Warning: format: unrecognized specifier in `%p'
address@hidden:stdin:1: warning: format: unrecognized specifier in `%p'
@result{}p
format(`%*d', `')
address@hidden:stdin:2: Warning: format: empty string treated as 0
address@hidden:stdin:2: Warning: format: too few arguments: 2 < 3
address@hidden:stdin:2: warning: format: empty string treated as 0
address@hidden:stdin:2: warning: format: too few arguments: 2 < 3
@result{}0
format(`%.1f', `2a')
address@hidden:stdin:3: Warning: format: non-numeric argument `2a'
address@hidden:stdin:3: warning: format: non-numeric argument `2a'
@result{}2.0
@end example
@@ -6866,10 +6866,10 @@ Incr
decr(`7')
@result{}6
incr()
address@hidden:stdin:3: Warning: incr: empty string treated as 0
address@hidden:stdin:3: warning: incr: empty string treated as 0
@result{}1
decr()
address@hidden:stdin:4: Warning: decr: empty string treated as 0
address@hidden:stdin:4: warning: decr: empty string treated as 0
@result{}-1
@end example
@@ -6940,13 +6940,13 @@ Eval
@example
eval(`2 = 2')
address@hidden:stdin:1: Warning: eval: recommend ==, not =, for equality
address@hidden:stdin:1: warning: eval: recommend ==, not =, for equality
@result{}1
eval(`++0')
address@hidden:stdin:2: Warning: eval: invalid operator: `++0'
address@hidden:stdin:2: warning: eval: invalid operator: `++0'
@result{}
eval(`0 |= 1')
address@hidden:stdin:3: Warning: eval: invalid operator: `0 |= 1'
address@hidden:stdin:3: warning: eval: invalid operator: `0 |= 1'
@result{}
@end example
@@ -6989,12 +6989,12 @@ Eval
eval(`2 || 1 / 0')
@result{}1
eval(`0 || 1 / 0')
address@hidden:stdin:9: Warning: eval: divide by zero: `0 || 1 / 0'
address@hidden:stdin:9: warning: eval: divide by zero: `0 || 1 / 0'
@result{}
eval(`0 && 1 % 0')
@result{}0
eval(`2 && 1 % 0')
address@hidden:stdin:11: Warning: eval: modulo by zero: `2 && 1 % 0'
address@hidden:stdin:11: warning: eval: modulo by zero: `2 && 1 % 0'
@result{}
@end example
@@ -7016,9 +7016,9 @@ Eval
@result{}1
eval(`0 ** 0')
@result{}
address@hidden:stdin:5: Warning: eval: divide by zero: `0 ** 0'
address@hidden:stdin:5: warning: eval: divide by zero: `0 ** 0'
eval(`4 ** -2')
address@hidden:stdin:6: Warning: eval: negative exponent: `4 ** -2'
address@hidden:stdin:6: warning: eval: negative exponent: `4 ** -2'
@result{}
eval(`0 ? 2 : 3')
@result{}3
@@ -7069,7 +7069,7 @@ Eval
define(`foo', `666')
@result{}
eval(`foo / 6')
address@hidden:stdin:11: Warning: eval: bad expression: `foo / 6'
address@hidden:stdin:11: warning: eval: bad expression: `foo / 6'
@result{}
eval(foo / 6)
@result{}111
@@ -7139,16 +7139,16 @@ Eval
eval(`10', `16')
@result{}a
eval(`1', `37')
address@hidden:stdin:9: Warning: eval: radix out of range: 37
address@hidden:stdin:9: warning: eval: radix out of range: 37
@result{}
eval(`1', , `-1')
address@hidden:stdin:10: Warning: eval: negative width: -1
address@hidden:stdin:10: warning: eval: negative width: -1
@result{}
eval()
address@hidden:stdin:11: Warning: eval: empty string treated as 0
address@hidden:stdin:11: warning: eval: empty string treated as 0
@result{}0
eval(` ')
address@hidden:stdin:12: Warning: eval: empty string treated as 0
address@hidden:stdin:12: warning: eval: empty string treated as 0
@result{}0
define(`a', `hi')eval(` 10 ', `16')
@result{}hi
@@ -7559,12 +7559,12 @@ Mkstemp
syscmd(`rm -f foo-??????')sysval
@result{}0
define(`file1', maketemp(`foo-XXXXXX'))dnl
address@hidden:stdin:3: Warning: maketemp: recommend using mkstemp instead
address@hidden:stdin:3: warning: maketemp: recommend using mkstemp instead
ifelse(esyscmd(`echo \` foo-?????? \''), ` foo-?????? ',
`no file', `created')
@result{}created
define(`file2', maketemp(`foo-XX'))dnl
address@hidden:stdin:6: Warning: maketemp: recommend using mkstemp instead
address@hidden:stdin:6: warning: maketemp: recommend using mkstemp instead
define(`file3', mkstemp(`foo-XXXXXX'))dnl
ifelse(len(defn(`file1')), len(defn(`file2')),
`same length', `different')
@@ -7604,13 +7604,13 @@ Mkstemp
syscmd(`rm -f foo-*')sysval
@result{}0
len(maketemp(`foo-XXXXX'))
address@hidden:stdin:2: Warning: maketemp: recommend using mkstemp instead
address@hidden:stdin:2: warning: maketemp: recommend using mkstemp instead
@result{}9
define(`abc', `def')
@result{}
maketemp(`foo-abc')
@result{}foo-def
address@hidden:stdin:4: Warning: maketemp: recommend using mkstemp instead
address@hidden:stdin:4: warning: maketemp: recommend using mkstemp instead
syscmd(`test -f foo-*')ifelse(sysval, `0', `0', `1')
@result{}1
@end example
@@ -8552,7 +8552,7 @@ Improved forloop
forloop(`i', `5 + 5', `0xc', ` 0x`'eval(i, `16')')
@result{} 0xa 0xb 0xc
forloop(`i', `a', `b', `non-numeric bounds')
address@hidden:stdin:6: Warning: eval: bad input: `(a) <= (b)'
address@hidden:stdin:6: warning: eval: bad input: `(a) <= (b)'
@result{}
@end example
@@ -9457,7 +9457,7 @@ Improved fatal_error
fatal_error(`inside wrapped text')')
@result{}
^D
address@hidden:stdin:6: Warning: divnum: extra arguments ignored: 1 > 0
address@hidden:stdin:6: warning: divnum: extra arguments ignored: 1 > 0
@result{}0
@error{}m4:stdin:6: fatal error: inside wrapped text
@end example
diff --git a/examples/esyscmd.m4 b/examples/esyscmd.m4
index b839148..0e8634d 100644
--- a/examples/esyscmd.m4
+++ b/examples/esyscmd.m4
@@ -1,5 +1,5 @@
define(`hostname', esyscmd(`hostname'))dnl
`hostname = >>'hostname`<<'
-define(`hostname',
+define(`hostname',
pushdef(`_tmp', `$1')_tmp(translit(esyscmd(`hostname'), `.',
`,'))`'popdef(`_tmp'))dnl
`hostname = >>'hostname`<<'
diff --git a/examples/file.m4 b/examples/file.m4
index e7db5f1..ff56153 100644
--- a/examples/file.m4
+++ b/examples/file.m4
@@ -1,5 +1,5 @@
changequote([[,]])dnl
-define([[quoteall]], [[patsubst([[[[$*]]]], [[,[ ]+]], [[,]])]])dnl
+define([[quoteall]], [[patsubst([[[[$*]]]], [[,[ ]+]], [[,]])]])dnl
define([[group]], quoteall(include([[/etc/group]])))dnl
dnl
group()dnl
diff --git a/examples/fstab.m4 b/examples/fstab.m4
index dbf538a..8d10e17 100644
--- a/examples/fstab.m4
+++ b/examples/fstab.m4
@@ -1,7 +1,6 @@
-define(`concat', `translit(``$*'', ` ')')
+define(`concat', `translit(``$*'', ` ')')
define(`fsent', `format(`%-25s %-16s nfs %-16s 0 0', `$1:$2', `$3',
concat$4)')
fsent(freja, /home/gevn, /home/gevn, (rw, soft, bg, grpid))
fsent(freja, /home/freja, /home/freja, (rw, soft, grpid))
fsent(rimfaxe, /home/rimfaxe, /home/rimfaxe, (rw, soft, bg))
-
diff --git a/examples/null.err b/examples/null.err
index 930d917..dbe52bc 100644
--- a/examples/null.err
+++ b/examples/null.err
@@ -1,23 +1,23 @@
builtin:
-m4:examples/null.m4:21: Warning: builtin: undefined builtin `-\0-'
+m4:examples/null.m4:21: warning: builtin: undefined builtin `-\0-'
changequote:
echo: address@hidden/
m4trace: -1- dumpdef( echo/) -> /
changeword:
-m4:examples/null.m4:43: Warning: changeword: bad regular expression `\\\0\\':
Trailing backslash
+m4:examples/null.m4:43: warning: changeword: bad regular expression `\\\0\\':
Trailing backslash
debugfile:
-m4:examples/null.m4:49: Warning: debugfile: argument `/no/such\0/file'
truncated
-m4:examples/null.m4:49: Warning: debugfile: cannot set debug file `/no/such':
No such file or directory
+m4:examples/null.m4:49: warning: debugfile: argument `/no/such\0/file'
truncated
+m4:examples/null.m4:49: warning: debugfile: cannot set debug file `/no/such':
No such file or directory
debugmode:
-m4:examples/null.m4:52: Warning: debugmode: bad debug flags: `-\0-'
+m4:examples/null.m4:52: warning: debugmode: bad debug flags: `-\0-'
decr:
-m4:examples/null.m4:55: Warning: decr: non-numeric argument `1\0001'
+m4:examples/null.m4:55: warning: decr: non-numeric argument `1\0001'
defn:
-m4:examples/null.m4:60: Warning: defn: undefined macro `\0-\0'
+m4:examples/null.m4:60: warning: defn: undefined macro `\0-\0'
divert:
-m4:examples/null.m4:67: Warning: divert: non-numeric argument `1\0001'
+m4:examples/null.m4:67: warning: divert: non-numeric argument `1\0001'
dumpdef:
-m4:examples/null.m4:75: Warning: dumpdef: undefined macro `\0-\0'
+m4:examples/null.m4:75: warning: dumpdef: undefined macro `\0-\0'
: `empty'
-: `dash'
- -: ``$0': $1'
@@ -26,50 +26,50 @@ m4:examples/null.m4:75: Warning: dumpdef: undefined macro
`\0-\0'
body: `- -'
errprint: - - - -
esyscmd:
-m4:examples/null.m4:85: Warning: esyscmd: argument `echo +\0+' truncated
+m4:examples/null.m4:85: warning: esyscmd: argument `echo +\0+' truncated
eval:
-m4:examples/null.m4:91: Warning: eval: bad input: `1\0+1'
-m4:examples/null.m4:93: Warning: eval: non-numeric argument `2\0002'
-m4:examples/null.m4:95: Warning: eval: non-numeric argument `1\0001'
+m4:examples/null.m4:91: warning: eval: bad input: `1\0+1'
+m4:examples/null.m4:93: warning: eval: non-numeric argument `2\0002'
+m4:examples/null.m4:95: warning: eval: non-numeric argument `1\0001'
format:
-m4:examples/null.m4:100: Warning: format: unrecognized specifier in `%\0%'
-m4:examples/null.m4:100: Warning: format: unrecognized specifier in `%\0%'
-m4:examples/null.m4:102: Warning: format: non-numeric argument `1\0001'
-m4:examples/null.m4:102: Warning: format: argument `-\0-' truncated
+m4:examples/null.m4:100: warning: format: unrecognized specifier in `%\0%'
+m4:examples/null.m4:100: warning: format: unrecognized specifier in `%\0%'
+m4:examples/null.m4:102: warning: format: non-numeric argument `1\0001'
+m4:examples/null.m4:102: warning: format: argument `-\0-' truncated
include:
-m4:examples/null.m4:111: Warning: include: argument `/no/such\0/file' truncated
+m4:examples/null.m4:111: warning: include: argument `/no/such\0/file' truncated
m4:examples/null.m4:111: include: cannot open `/no/such': No such file or
directory
incr:
-m4:examples/null.m4:114: Warning: incr: non-numeric argument `1\0001'
+m4:examples/null.m4:114: warning: incr: non-numeric argument `1\0001'
index:
-m4:examples/null.m4:120: Warning: index: non-numeric argument `1\0001'
+m4:examples/null.m4:120: warning: index: non-numeric argument `1\0001'
indir:
-m4:examples/null.m4:125: Warning: indir: undefined macro `\0-\0'
-m4:examples/null.m4:127: Warning: \0\0%%: extra arguments ignored: 1 > 0
+m4:examples/null.m4:125: warning: indir: undefined macro `\0-\0'
+m4:examples/null.m4:127: warning: \0\0%%: extra arguments ignored: 1 > 0
maketemp:
-m4:examples/null.m4:138: Warning: maketemp: recommend using mkstemp instead
-m4:examples/null.m4:138: Warning: maketemp: argument `/no/such\0/file'
truncated
-m4:examples/null.m4:138: Warning: maketemp: cannot create file from template
`/no/such': No such file or directory
+m4:examples/null.m4:138: warning: maketemp: recommend using mkstemp instead
+m4:examples/null.m4:138: warning: maketemp: argument `/no/such\0/file'
truncated
+m4:examples/null.m4:138: warning: maketemp: cannot create file from template
`/no/such': No such file or directory
mkstemp:
-m4:examples/null.m4:141: Warning: mkstemp: argument `/no/such\0/file' truncated
-m4:examples/null.m4:141: Warning: mkstemp: cannot create file from template
`/no/such': No such file or directory
+m4:examples/null.m4:141: warning: mkstemp: argument `/no/such\0/file' truncated
+m4:examples/null.m4:141: warning: mkstemp: cannot create file from template
`/no/such': No such file or directory
patsubst:
-m4:examples/null.m4:144: Warning: patsubst: bad regular expression `\\\0\\':
Trailing backslash
+m4:examples/null.m4:144: warning: patsubst: bad regular expression `\\\0\\':
Trailing backslash
popdef:
-m4:examples/null.m4:159: Warning: popdef: undefined macro `-\0-'
+m4:examples/null.m4:159: warning: popdef: undefined macro `-\0-'
regexp:
-m4:examples/null.m4:166: Warning: regexp: bad regular expression `\\\0\\':
Trailing backslash
+m4:examples/null.m4:166: warning: regexp: bad regular expression `\\\0\\':
Trailing backslash
sinclude:
-m4:examples/null.m4:181: Warning: sinclude: argument `/no/such\0/file'
truncated
+m4:examples/null.m4:181: warning: sinclude: argument `/no/such\0/file'
truncated
substr:
-m4:examples/null.m4:186: Warning: substr: non-numeric argument `1\0001'
-m4:examples/null.m4:188: Warning: substr: non-numeric argument `1\0001'
+m4:examples/null.m4:186: warning: substr: non-numeric argument `1\0001'
+m4:examples/null.m4:188: warning: substr: non-numeric argument `1\0001'
syscmd:
-m4:examples/null.m4:193: Warning: syscmd: argument `echo +\0+' truncated
+m4:examples/null.m4:193: warning: syscmd: argument `echo +\0+' truncated
traceon:
m4trace: -1- - -(`- -') -> `strange: - -'
m4trace: -1- body -> ` - '
undefine:
-m4:examples/null.m4:212: Warning: undefine: undefined macro `-\0-'
+m4:examples/null.m4:212: warning: undefine: undefined macro `-\0-'
undivert:
-m4:examples/null.m4:215: Warning: undivert: invalid file name `1\0001'
+m4:examples/null.m4:215: warning: undivert: invalid file name `1\0001'
diff --git a/examples/patsubst.m4 b/examples/patsubst.m4
index 3b390ae..8569066 100644
--- a/examples/patsubst.m4
+++ b/examples/patsubst.m4
@@ -5,4 +5,4 @@ patsubst(`GNUs not Unix', `\<\w', `\0=')
patsubst(`GNUs not Unix', `\w*', `(\0)')
patsubst(`GNUs not Unix', `\w+', `(\0)')
patsubst(`GNUs not Unix', `\w+')
-patsubst(`GNUs not Unix', `[ ]+', ` ')
+patsubst(`GNUs not '` Unix', `[ ]+', ` ')
diff --git a/examples/stackovf.sh b/examples/stackovf.sh
index 8916afc..43fd68e 100644
--- a/examples/stackovf.sh
+++ b/examples/stackovf.sh
@@ -7,8 +7,8 @@
# On some systems the ulimit command is available in ksh or bash but not sh
(exec 2>/dev/null; ulimit -HSs 300) || {
for altshell in bash bsh ksh ; do
- if (exec >/dev/null 2>&1; $altshell -c 'ulimit -HSs 300') &&
- test -z "$1"
+ if (exec >/dev/null 2>&1; $altshell -c 'ulimit -HSs 300') &&
+ test -z "$1"
then
echo "Using $altshell because it supports ulimit"
exec $altshell $0 running-with-$altshell
@@ -45,7 +45,7 @@ then
#test -n "$ulimitdashv" && ulimit -HSv 8000
echo "Stack limit is `ulimit -s`K";
echo "Heap limit is `ulimit -d`K";
- test -n "$ulimitdashv" &&
+ test -n "$ulimitdashv" &&
echo "VMem limit is `ulimit -v`K";
else
echo "Can't reset stack limit - this may take a while..."
@@ -61,11 +61,11 @@ else
# See if stack overflow was diagnosed
case "`cat $tmpfile`" in
*overflow*)
- echo "Test succeeded.";
+ echo "Test succeeded.";
exitcode=0
;;
*ut*of*emory*)
- echo "*** Test is INCONCLUSIVE (ran out of heap before stack
overflow)";
+ echo "*** Test is INCONCLUSIVE (ran out of heap before stack overflow)";
;;
*) echo "*** Test FAILED. $M4 aborted unexpectedly. Output:";
;;
diff --git a/src/builtin.c b/src/builtin.c
index a28535b..191e05d 100644
--- a/src/builtin.c
+++ b/src/builtin.c
@@ -196,8 +196,8 @@ find_builtin_by_name (const char *name)
{
const builtin *bp;
- for (bp = &builtin_tab[0]; bp->name != NULL; bp++)
- if (strcmp (bp->name, name) == 0)
+ for (bp = &builtin_tab[0]; bp->name; bp++)
+ if (STREQ (bp->name, name))
return bp;
return bp + 1;
}
diff --git a/src/m4.c b/src/m4.c
index ef244e3..0caf868 100644
--- a/src/m4.c
+++ b/src/m4.c
@@ -84,7 +84,7 @@ typedef struct macro_definition macro_definition;
| behalf of CALLER (if any), otherwise at the global current |
| location. If ERRNUM, decode the errno value that caused the |
| error. If STATUS, exit immediately with that status. If WARN, |
-| prepend 'Warning: '. |
+| prepend 'warning: '. |
`------------------------------------------------------------------*/
static void
@@ -123,9 +123,9 @@ m4_verror_at_line (bool warn, int status, int errnum, const
call_info *caller,
for non-memory reasons (unlikely), then still use the original
format. */
if (warn && macro)
- full = xasprintf (_("Warning: %s: %s"), macro, format);
+ full = xasprintf (_("warning: %s: %s"), macro, format);
else if (warn)
- full = xasprintf (_("Warning: %s"), format);
+ full = xasprintf (_("warning: %s"), format);
else if (macro)
full = xasprintf (_("%s: %s"), macro, format);
verror_at_line (status, errnum, line ? file : NULL, line,
@@ -184,7 +184,7 @@ static void
stackovf_handler (void)
{
m4_error (EXIT_FAILURE, 0, NULL,
- _("ERROR: stack overflow. (Infinite define recursion?)"));
+ _("FATAL: stack overflow. (Infinite define recursion?)"));
}
#endif /* USE_STACKOVF */
@@ -350,7 +350,7 @@ static const struct option long_options[] =
static void
process_file (const char *name)
{
- if (strcmp (name, "-") == 0)
+ if (STREQ (name, "-"))
{
/* If stdin is a terminal, we want to allow 'm4 - file -'
to read input from stdin twice, like GNU cat. Besides,
@@ -366,7 +366,7 @@ process_file (const char *name)
FILE *fp = m4_path_search (name, &full_name);
if (fp == NULL)
{
- error (0, errno, "cannot open %s",
+ error (0, errno, _("cannot open %s"),
quotearg_style (locale_quoting_style, name));
/* Set the status to EXIT_FAILURE, even though we
continue to process files after a missing file. */
@@ -451,7 +451,7 @@ main (int argc, char *const *argv, char *const *envp)
/* Compatibility junk: options that other implementations
support, but which we ignore as no-ops and don't list in
--help. */
- error (0, 0, "Warning: `m4 -%c' may be removed in a future release",
+ error (0, 0, _("warning: `m4 -%c' may be removed in a future release"),
optchar);
break;
@@ -496,7 +496,10 @@ main (int argc, char *const *argv, char *const *envp)
break;
case 'H':
- hash_table_size = atol (optarg);
+ {
+ long tmp = strtol (optarg, NULL, 10);
+ hash_table_size = tmp;
+ }
if (hash_table_size == 0)
hash_table_size = HASHMAX;
break;
@@ -506,7 +509,10 @@ main (int argc, char *const *argv, char *const *envp)
break;
case 'L':
- nesting_limit = atoi (optarg);
+ {
+ long tmp = strtol (optarg, NULL, 10);
+ nesting_limit = tmp;
+ }
break;
case 'P':
@@ -531,12 +537,12 @@ main (int argc, char *const *argv, char *const *envp)
if (seen_file)
goto defer;
if (debug_decode (optarg, SIZE_MAX) < 0)
- error (0, 0, "bad debug flags: %s",
+ error (0, 0, _("bad debug flags: %s"),
quotearg_style (locale_quoting_style, optarg));
break;
case 'e':
- error (0, 0, _("Warning: `%s' is deprecated, use `%s' instead"),
+ error (0, 0, _("warning: `%s' is deprecated, use `%s' instead"),
"-e", "-i");
/* fall through */
case 'i':
@@ -558,7 +564,7 @@ main (int argc, char *const *argv, char *const *envp)
/* -o/--error-output are deprecated synonyms of --debugfile,
so issue a warning. Don't call debug_set_output here, as
it has side effects. */
- error (0, 0, _("Warning: `%s' is deprecated, use `%s' instead"),
+ error (0, 0, _("warning: `%s' is deprecated, use `%s' instead"),
optchar == 'o' ? "-o" : "--error-output", "--debugfile");
debugfile = optarg;
break;
@@ -633,7 +639,7 @@ main (int argc, char *const *argv, char *const *envp)
case 'd':
if (debug_decode (arg, SIZE_MAX) < 0)
- error (0, 0, "bad debug flags: %s",
+ error (0, 0, _("bad debug flags: %s"),
quotearg_style (locale_quoting_style, optarg));
break;
diff --git a/src/m4.h b/src/m4.h
index 5407d10..17184b2 100644
--- a/src/m4.h
+++ b/src/m4.h
@@ -581,6 +581,8 @@ void reload_frozen_state (const char *);
# define DEBUG_SYM 1
#endif
+/* Generic utilties. */
+
/* Convert a possibly-signed character to an unsigned character. This is
a bit safer than casting to unsigned char, since it catches some type
errors that the cast doesn't. */
@@ -589,3 +591,6 @@ static inline unsigned char to_uchar (char ch) { return ch;
}
#else
# define to_uchar(C) ((unsigned char) (C))
#endif
+
+/* Avoid negative logic when comparing two strings. */
+#define STREQ(a, b) (strcmp (a, b) == 0)
diff --git a/src/output.c b/src/output.c
index 99a9f0a..e31f94b 100644
--- a/src/output.c
+++ b/src/output.c
@@ -1018,7 +1018,7 @@ freeze_diversions (FILE *file)
if (file_stat.st_size < 0
|| file_stat.st_size != (unsigned long int) file_stat.st_size)
m4_error (EXIT_FAILURE, 0, NULL, _("diversion too large"));
- xfprintf (file, "D%d,%lu\n", diversion->divnum,
+ xfprintf (file, "%c%d,%lu\n", 'D', diversion->divnum,
(unsigned long int) file_stat.st_size);
}
diff --git a/src/stackovf.c b/src/stackovf.c
index 514e806..47164a8 100644
--- a/src/stackovf.c
+++ b/src/stackovf.c
@@ -1,6 +1,6 @@
/* Detect stack overflow (when getrlimit and sigaction or sigvec are available)
- Copyright (C) 1993, 1994, 2006, 2007, 2008 Free Software
+ Copyright (C) 1993, 1994, 2006, 2007, 2008, 2009 Free Software
Foundation, Inc.
Jim Avera <address@hidden>, October 1993.
@@ -79,7 +79,6 @@
#include "m4.h" /* stdlib.h, xmalloc() */
-#include <assert.h>
#include <sys/time.h>
#include <sys/resource.h>
#include <signal.h>
@@ -156,8 +155,8 @@ process_sigsegv (int signo, const char *p)
char buf[140];
snprintf (buf, sizeof buf,
- "process_sigsegv: p=%#lx stackend=%#lx diff=%ld bot=%#lx\n",
- (long) p, (long) stackend, (long) diff, (long) stackbot);
+ "process_sigsegv: p=%#lx stackend=%#lx diff=%ld bot=%#lx\n",
+ (long) p, (long) stackend, (long) diff, (long) stackbot);
write (2, buf, strlen (buf));
}
#endif
@@ -292,7 +291,7 @@ Error - Do not know how to set up stack-ovf trap handler...
/* Calculate the approximate expected addr for a stack-ovf trap. */
if (getrlimit (RLIMIT_STACK, &rl) < 0)
- error (EXIT_FAILURE, errno, "getrlimit");
+ error (EXIT_FAILURE, errno, _("getrlimit"));
stack_len = (rl.rlim_cur < rl.rlim_max ? rl.rlim_cur : rl.rlim_max);
stackbot = (char *) argv;
grows_upward = ((char *) &stack_len > stackbot);
@@ -363,7 +362,7 @@ Error - Do not know how to set up stack-ovf trap handler...
free (ss.ss_sp);
if (errno == ENOSYS)
return;
- error (EXIT_FAILURE, errno, "sigaltstack");
+ error (EXIT_FAILURE, errno, _("sigaltstack"));
}
}
@@ -385,7 +384,7 @@ Error - Do not know how to set up stack-ovf trap handler...
free (stackbuf);
if (errno == ENOSYS)
return;
- error (EXIT_FAILURE, errno, "sigstack");
+ error (EXIT_FAILURE, errno, _("sigstack"));
}
}
@@ -408,7 +407,7 @@ Error - Do not know how to set up stack-ovf trap handler...
sigemptyset (&act.sa_mask);
act.sa_flags = (SA_ONSTACK | SA_RESETHAND | SA_SIGINFO);
if (sigaction (SIGSEGV, &act, NULL) < 0)
- error (EXIT_FAILURE, errno, "sigaction");
+ error (EXIT_FAILURE, errno, _("sigaction"));
#else /* ! HAVE_SIGACTION */
@@ -416,7 +415,7 @@ Error - Do not know how to set up stack-ovf trap handler...
vec.sv_mask = 0;
vec.sv_flags = (SV_ONSTACK | SV_RESETHAND);
if (sigvec (SIGSEGV, &vec, NULL) < 0)
- error (EXIT_FAILURE, errno, "sigvec");
+ error (EXIT_FAILURE, errno, _("sigvec"));
#endif /* ! HAVE_SIGACTION */
--
1.6.3.rc3.2.g4b51
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- use maintainer-makefile for improved 'make syntax-check',
Eric Blake <=