2009-04-01 Eric Blake
Release Version 1.4.13.
* NEWS: Mention the release.
2009-03-31 Eric Blake
Tweak submodule instructions.
* HACKING: Improve directions.
* gnulib: Update to latest version.
2009-03-23 Eric Blake
Don't force file overwrites during bootstrap.
* bootstrap: Ensure that rerunning bootstrap doesn't alter tree.
Drop dist-lzma, now that xz replaces lzma.
* configure.ac (AM_INIT_AUTOMAKE): Drop dist-lzma. Until a stable
automake release includes dist-xz, the release process will just
manually create a .xz tarball.
* gnulib: Update to latest gnulib.
2009-03-19 Eric Blake
Exploit git submodule by adding appropriate symlinks.
* bootstrap: No longer copy files from gnulib.
* COPYING: Change to symlink pointing into gnulib.
* INSTALL: Likewise.
* build-aux/compile: Likewise.
* build-aux/config.guess: Likewise.
* build-aux/config.sub: Likewise.
* build-aux/depcomp: Likewise.
* build-aux/install-sh: Likewise.
* build-aux/mdate-sh: Likewise.
* build-aux/missing: Likewise.
* build-aux/texinfo.tex: Likewise.
* .cvsignore: Reflect these changes.
* .gitignore: Likewise.
* build-aux/.cvsignore: New file.
* build-aux/.gitignore: Likewise.
2009-03-18 Eric Blake
Make gnulib a git submodule.
* .gitmodules: New file.
* gnulib: Record which version of gnulib has been tested.
* bootstrap: Aid in submodule usage.
* cfg.mk (gnulib_dir): Alter default location of gnulib.
* HACKING: Mention how to use submodule.
Use latest compile script, even with stable automake.
* bootstrap: Also sync build-aux/compile.
2009-03-12 Eric Blake
Fix awk script portability.
* checks/get-them: In gsub, properly escape {. Close all files
before exiting.
Reported by Gary V. Vaughan.
2009-03-05 Eric Blake
Allow configuration choice in syscmd shell.
* configure.ac (SYSCMD_SHELL): New test.
* src/builtin.c (m4_syscmd, m4_esyscmd): Use it to avoid
hard-coding the shell location.
* doc/m4.texinfo (Syscmd, Esyscmd): Document this.
* README: Document new configure option.
* NEWS: Likewise.
Remove cruft now that gnulib modules do the work.
* configure.ac (M4_cv_func_system_consistent): Delete.
* src/builtin.c (M4SYSVAL_EXITBITS, M4SYSVAL_TERMSIGBITS):
Delete.
Use gnulib pipe module instead of popen(3).
* m4/gnulib-cache.m4: Import pipe and wait-process modules.
* src/builtin.c (m4_esyscmd): Rewrite with pipe module.
Resolves a failure on AIX, reported by Gary V. Vaughan.
Use gnulib execute module instead of system(3).
* m4/gnulib-cache.m4: Import execute module.
* src/builtin.c (m4_sysval): Move computation...
(m4_esyscmd): ...into caller.
(m4_syscmd): Rewrite with execute module.
Resolves a failure on AIX, reported by Gary V. Vaughan.
2009-03-03 Eric Blake
Try to tolerate spaces in directory names in testsuite.
* doc/m4.texinfo (Diversions, Using frozen files): Provide shell
quoting, in case __program__ contains spaces.
Improve web-manual maintainer rule.
* maint.mk (web-manual): Work with VPATH builds. Factor
package-specific detail...
* cfg.mk (manual_title): ...to new variable.
2009-02-26 Eric Blake
Make bootstrap easier on Solaris.
* bootstrap: Add GNULIB_SRCDIR. Useful when a wrapper script
gnulib-tool exists earlier on the path to work around /bin/sh
failure in parsing $GNULIB_SRCDIR/gnulib-tool.
2009-02-19 Eric Blake
Fix regression in translit.
* src/builtin.c (m4_translit): Use correct comparison.
* doc/m4.texinfo (Translit): Enhance test.
Speed up input engine, by searching for quotes by buffer.
* src/input.c (struct input_block): Add end pointer to string.
(push_string_finish, push_wrapup): Populate it.
(next_token): For quotes, attempt a buffer search.
* NEWS: Document this.
2009-02-18 Eric Blake
Speed up translit when from argument is short.
* m4/gnulib-cache.m4: Import memchr2 module.
* src/builtin.c (m4_translit): Use memchr2 when possible.
* doc/m4.texinfo (Translit): Add tests.
* NEWS: Document this.
Update copyright year.
* THANKS: Mention 2009 in copyright year.
Prefer buffer over byte operations.
* src/format.c (expand_format): Use strchr for speed.
* src/builtin.c (substitute, expand_user_macro): Likewise.
Speed up esyscmd with buffer reads.
* src/builtin.c (m4_esyscmd): Read blocks directly into obstack,
rather than repeatedly reading bytes. Detect read errors.
Avoid risk of stack overflow.
* src/output.c (insert_file): Avoid stack allocation of large
buffer.
(freeze_diversions): Avoid spurious semicolon.
2009-02-16 Eric Blake
Avoid test failure due to different errno.
* doc/m4.texinfo (Using frozen files): Ignore stdout, since
hardened systems can prevent attempts to read /.
* THANKS: Update.
Reported by Ronny Peine, in Gentoo bug 259184.
Avoid tests that make no sense, because m4 is single-threaded.
* m4/gnulib-cache.m4: Avoid lock-tests and tls-tests.
2009-02-12 Eric Blake
Avoid quadratic code when walking definition stack.
* examples/stack_sep.m4: Use linear, not quadratic
implementation.
* doc/m4.texinfo (Improved copy): Fix documentation and add test,
based on recent autoconf bug fix.
2009-01-24 Eric Blake
Add URLs to --help output.
* src/m4.c (usage): Use enhanced version-etc features.
2009-01-02 Eric Blake
Use nicer email address in web manual.
* maint.mk (web-manual): Use new option in gendocs.sh.
Nuke xdelta diffs at release time; no one reported using them.
* maint.mk (got-xdelta, delta-xdelta): Delete.
* HACKING: Likewise.
2009-01-01 Eric Blake
Update copyright year.
* NEWS: M4 1.4.13 will occur in 2009.
* doc/m4.texinfo (History): Likewise.
2008-12-24 Eric Blake
Prepare for eventual release.
* doc/m4.texinfo (History): Mention 1.4.13.
2008-12-22 Eric Blake
Make --debugfile argument optional.
* src/builtin.c (m4_debugfile): Make error message consistent.
* src/m4.c (long_options): Make the argument optional, to allow
setting debug file back to stderr.
(main): Make --debugfile order-dependent.
(usage): Document this.
* doc/m4.texinfo (Debugging options): Likewise.
* NEWS: Likewise.
Use @var correctly.
* doc/m4.texinfo (Operation modes, Preprocessor features)
(Limits control, Frozen state, Debugging options): Use lower case
names in @var.
(Improved copy): Use @code, not @var, as appropriate.
2008-12-18 Eric Blake
Document optimized forloop.
* doc/m4.texinfo (Improved forloop): Mention alternate style that
avoids define overhead.
* examples/forloop3.m4: New file.
* examples/Makefile.am (EXTRA_DIST): Distribute it.
Deal with M4 1.4.x limitation on builtin tokens.
* doc/m4.texinfo (Composition): Mention limitation on curry.
(Improved copy): New node.
* examples/stack_sep.m4: New file.
* examples/Makefile.am (EXTRA_DIST): Distribute it.
Document copy composite using stack_foreach and curry.
* doc/m4.texinfo (Stacks): New node, to document pushdef stack
manipulation.
(Ifelse): Move define_blind...
(Composition): ...to this new node. Document currying, then use
it to implement copy and rename.
* examples/curry.m4: New file.
* examples/stack.m4: Likewise.
* examples/Makefile.am (EXTRA_DIST): Distribute them.
2008-12-17 Eric Blake
Don't override signal handlers installed by c-stack.
* src/m4.c (main): Reorder installation of signal handlers, so we
don't trash a SIGBUS handler installed by c-stack. Also provide a
SIGSEGV fallback, for platforms where c-stack combined with
libsigsegv uses something lower level than SIGSEGV.
2008-12-12 Eric Blake
Double size of temp file cache.
* src/output.c (tmp_file, tmp_file_owner): Split...
(tmp_file1, tmp_file2, tmp_file1_owner, tmp_file2_owner): ...into
two variables.
(tmp_file2_recent): New variable.
(m4_tmpopen, m4_tmpclose, m4_tmpremove, m4_tmprename)
(output_exit): Adjust callers.
Use fewer seeks on cached files.
* src/output.c (m4_tmpfile): Use write, not append mode.
(m4_tmpopen): Add parameter to decide when to skip seeks.
(m4_tmprename, make_diversion, insert_diversion_helper)
(freeze_diversions): Adjust callers.
Cache most recently spilled diversion.
* src/output.c (tmp_file, tmp_file_owner): New variables, for
1-deep cache of spilled diversions.
(m4_tmpfile): Open in append mode, since we might revisit
diversion without closing it now.
(m4_tmpopen): Check cache first.
(m4_tmpclose): Update cache, rather than closing. Add parameter.
(m4_tmpremove): Close cache before removing.
(m4_tmprename): Deal with open files when renaming.
(output_exit): Close cache before exiting.
(make_room_for, make_diversion, insert_diversion_helper): Adjust
callers.
* configure.ac (RENAME_OPEN_FILE_WORKS): New configure test.
Correctly track size of in-memory diversions.
* src/output.c (insert_diversion_helper): Correctly track total
in-memory diversion size after undivert.
Avoid quadratic behavior for some cases of divert/undivert.
* src/output.c (struct m4_diversion): Improve comments.
(m4_tmpname, make_diversion): Strengthen preconditions.
(m4_tmprename): New function.
(output_init, output_exit): Move after internal functions.
(make_room_for): Don't bother copying uninitialized bytes.
(insert_diversion_helper): Transfer metadata, rather than copying
contents, when undiverting into a previously unused diversion.
* src/m4.h (includes): Add assert.h.
* doc/m4.texinfo (Diversions): Add test.
(Undivert): Enhance test.
* NEWS: Document the speedup.
2008-12-12 Eric Blake
Upgrade to FDL 1.3, keep COPYING in repository.
* Makefile.am (MAINTAINERCLEANFILES): Don't remove COPYING.
* .cvsignore: Don't ignore it.
* .gitignore: Likewise.
* COPYING: Store in repository, per automake 1.10.2
recommendation.
* m4/gnulib-cache.m4: Replace fdl module with fdl-1.3.
* doc/m4.texinfo (GNU Free Documentation License): Upgrade
license.
* doc/Makefile.am (m4_TEXINFOS): Likewise.
* NEWS: Mention the documentation license change.
2008-10-10 Eric Blake
Release Version 1.4.12.
* NEWS: Mention the release.
2008-10-06 Eric Blake
Work around Solaris' sed inability to process NUL.
* checks/check-them (SED): Allow user to override.
2008-09-25 Eric Blake
Tweak error message on command line failure.
* src/m4.c (process_file): Match wording of include builtin.
* src/freeze.c (produce_frozen_state): Likewise.
* m4/gnulib-cache.m4: Regenerate.
* doc/m4.texinfo (Command line files, Using frozen files): Update
tests accordingly.
2008-09-24 Eric Blake
Unify error handling for reading directories.
* src/path.c (m4_path_search): Factor open attempts...
(m4_fopen): ...into new function, to reject directories.
* doc/m4.texinfo (Include): Document that directories cannot be
input files.
Avoid bugs on platforms that mishandle trailing /.
* m4/gnulib-cache.m4: Import fopen module.
* doc/m4.texinfo (Command line files, Include): Add tests.
(Using frozen files): This test now works on mingw.
* checks/check-them (examples): Expand xerr to allow ignoring
error output because of differences in platform errno values.
2008-09-22 Eric Blake
Support alternate path separator.
* m4/gnulib-cache.m4: Import dirname and filenamecat modules.
* src/m4.h (includes): Add headers.
* src/path.c (m4_path_search): Avoid literal use of '/' as path
separator and when detecting absolute paths.
2008-09-16 Eric Blake
Fix bootstrap for Solaris /bin/sh.
* bootstrap: Avoid shell quoting pitfall.
2008-09-01 Eric Blake
Fix building with -DDEBUG=1.
* src/input.c (lex_debug) [DEBUG_INPUT]: Fix compilation failure.
* src/symtab.c (symtab_debug) [DEBUG_SYM]: Likewise.
* src/m4.c (includes) [DEBUG_STKOVF]: Likewise.
Reported by Tom G. Christensen.
2008-09-01 Ralf Wildenhues
Typos in source code comments.
* src/builtin.c: Fix typos in comments.
* src/input.c: Likewise.
2008-08-29 Eric Blake
Fix manual date information.
* doc/m4.texinfo: UPDATED refers to the day the manual was built,
not the release date of M4.
Based on a bison patch by Akim Demaille.
2008-08-27 Eric Blake
Fix typo.
* doc/m4.texinfo (Invoking m4): 'm4 -d+f' is not supported in this
branch.
2008-08-25 Eric Blake
Update recommendation now that libsigsegv 2.6 is released.
* NEWS: Recommend libsigsegv 2.6+.
* README: Likewise.
2008-08-21 Eric Blake
Fix crash with traced defn(undef), regression from 2007-08-09.
* src/builtin.c (m4_defn): Handle traced but undefined macros.
* doc/m4.texinfo (Trace): Test it.
* NEWS: Document it.
2008-08-18 Eric Blake
Fix crash with 'm4 -N9', regression from 2006-09-14.
* src/m4.c (main): Add missing break.
* NEWS: Document it.
2008-08-15 Eric Blake
Documentation updates.
* doc/m4.texinfo (History): Mention 1.4.12.
(Builtin): Enhance regression tests.
(Debug Levels): Mention effect of -l. Enhance regression tests.
(Incompatibilities): Fix typo, and mention trace output.
(Improved capitalize): Simplify example.
Avoid compiler warning.
* src/builtin.c (m4_ifelse): Avoid unused variable.
* THANKS: Update.
Reported by Tom G. Christensen.
Improve 'git diff' of manual source.
* .gitattributes (*.texi*): Add diff attribute.
* bootstrap: Tell git how to use it.
Inspired by Jim Meyering's similar patch for coreutils.
2008-08-11 Eric Blake
Avoid triggering OS/2 bug in testsuite.
* doc/m4.texinfo (Mkstemp): Don't assume test(1) status is 1.
Reported by Elbert Pol.
2008-08-03 Eric Blake
Increase ulimit stack value to be larger than SIGSTKSZ.
* checks/stackovf.test (tmpfile): Use 300K rather than 50K, since
at least OpenBSD's sh died early from an undersized stack limit.
2008-07-17 Eric Blake
Fix missing copyright notices.
* acinclude.m4: Add copyright license details.
* c-boxes.el: Likewise.
* checks/get-them: Likewise.
* checks/check-them: Likewise.
2008-07-17 Eric Blake
Remove redundant examples/stackovf.sh.
* examples/stackovf.sh: Delete, now that checks has better
version.
* examples/Makefile.am (EXTRA_DIST): Don't distribute it.
2008-07-17 Eric Blake
Adjust to c-stack changes in gnulib.
* src/Makefile.am (m4_LDADD): Use libsigsegv when available and
necessary, via LIBCSTACK.
* src/m4.c (main) [DEBUG_STACKOVF]: Make it easier to test fault
handlers.
* checks/stackovf.test: New file.
* checks/Makefile.in (CHECKS): Add stackovf.test, and factor...
(DOC_CHECKS): ...generated documentation tests into new macro.
(DISTFILES): Distribute stackovf.test.
* checks/check-them: Special-case stackovf.test.
* NEWS: Enhance the NEWS item for -L improvements.
* README: Mention the optional dependency.
* HACKING: Mention maintenance burden added by libsigsegv.
2008-06-21 Eric Blake
Use new sigaction module.
* m4/gnulib-cache.m4: Import sigaction module.
* src/m4.c (main): Drop signal() calls.
2008-06-18 Eric Blake
Also trap SIGILL, SIGFPE, SIGBUS.
* m4/gnulib-cache.m4: Import strsignal module.
* src/m4.c (main): Register more handlers, and prefer sigaction
when available.
(SIGBUS, NSIG): Provide fallback when lacking.
(signal_message): New variable, to keep async-safety.
(fault_handler): Display faulting signal description.
* configure.ac (gl_DISABLE_THREADS): Request gnulib modules to
optimize for single-threaded operation.
2008-06-06 Eric Blake
Inform users what to do in case of programmer error.
* src/m4.h (EXIT_INTERNAL_ERROR): New macro.
* configure.ac (AC_TYPE_SIGNAL): Delete, now that we assume C89.
* src/m4.c (fault_handler): New method.
(program_error_message): New variable, for async-safety.
(main): Print bug reporting address rather than dump core on any
failed assertions or detected non-stack-overflow faults.
2008-06-06 Eric Blake
Replace stackovf with gnulib c-stack.
* m4/gnulib.cache.m4: Import c-stack module.
* configure.ac (AC_CHECK_HEADERS_ONCE): Remove check for
siginfo.h, sys/wait.h.
(AC_CHECK_TYPES): Likewise for siginfo_t.
(AC_CHECK_MEMBERS): Likewise for sa_sigaction, ss_sp.
(AC_CHECK_FUNCS_ONCE): Likewise for sigaction, sigaltstack,
sigstack, sigvec, strerror.
(M4_cv_use_stackovf): Likewise for stack overflow detection.
* src/Makefile.am (m4_SOURCES): Don't build stackovf.c.
* src/stackovf.c: Delete.
* src/m4.h (setup_stackovf_trap): Delete.
* src/m4.c (stackovf_handler): Delete.
(main): Use c_stack_action instead of setup_stackovf_trap. If
stack overflow is detectable, don't limit -L artificially.
(usage): Document unlimited default on supported systems.
* doc/m4.texinfo (Limits control): Document new default nesting
limit.
* NEWS: Document this change.
2008-07-30 Eric Blake
Avoid regressions in trace and comment output.
* doc/m4.texinfo (Trace): Add test.
(Comments): Likewise.
2008-07-28 Eric Blake
Optimize iteration examples.
* examples/forloop2.m4: Avoid excess indir, by passing current
counter value as parameter.
* examples/foreachq3.m4: Avoid unneeded ifelse, by injecting an
ignored argument.
* doc/m4.texinfo (Improved forloop, Improved foreach): Update the
documentation to match.
2008-07-26 Eric Blake
Give example for O(n) foreach on m4 1.4.x.
* examples/foreachq4.m4: New file.
* examples/Makefile.am (EXTRA_DIST): Distribute it.
* doc/m4.texinfo (Improved foreach): Document linear foreach with
m4 1.4.5 and greater.
2008-07-17 Eric Blake
Fix missing copyright notices.
* acinclude.m4: Add copyright license details.
* c-boxes.el: Likewise.
* checks/get-them: Likewise.
* checks/check-them: Likewise.
2008-07-13 Eric Blake
Add -g/--gnu command line argument.
* src/m4.c (usage): Mention the new option.
(long_options, OPTSTRING): Add new option.
(main): Use it.
* NEWS: Document this addition.
* doc/m4.texinfo (Limits control): Likewise.
(Incompatibilities): Mention future use of POSIXLY_CORRECT.
* THANKS: Update.
Reported by Joel E. Denny.
2008-07-11 Eric Blake
Avoid bogus whitespace in @ovar, @dvar.
* doc/m4.texinfo (ovar, dvar): Add @c.
Based on patch by Ralf Wildenhues to Autoconf manual.
2008-06-16 Eric Blake
Add missing const qualifications.
* src/builtin.c (builtin_tab): Declare array elements as const.
2008-06-03 Eric Blake
Use progname module rather than rolling our own program_name.
* m4/gnulib-cache.m4: Import progname module.
* src/m4.c (program_name): Replace...
(main): ...with a call to set_program_name.
2008-06-02 Eric Blake
Allow autobuild usage.
* m4/gnulib.cache: Import autobuild module.
2008-05-23 Eric Blake
Make closing files be consistent.
* src/freeze.c (reload_frozen_state): Use close_stream.
Reported by Jean-Charles Longuet.
2008-05-22 Eric Blake
Don't allow failure to freeze give exit status of 0.
* src/freeze.c (produce_frozen_state): Guarantee non-zero exit on
fopen failure.
* doc/m4.texinfo (Using frozen files): Test the fix.
* THANKS: Update.
Reported by Jean-Charles Longuet.
2008-05-09 Eric Blake
Improve error message when frozen file is invalid.
* src/freeze.c (reload_frozen_state): Track current line.
[GET_STRING]: New helper macro.
2008-05-09 Eric Blake
Detect integer overflow when loading frozen file.
* src/m4.h (includes): Add limits.h.
(_): Define as a no-op placeholder for now.
* src/freeze.c (reload_frozen_state) [GET_NUMBER]: Rewrite to fail
immediately on overflow.
Reported by Jim Meyering.
2008-05-07 Eric Blake
Fix traceon regression introduced 2006-06-06.
* src/builtin.m4 (traceon): Only perform insertion if lookup
fails.
* doc/m4.texinfo (Trace): Test for the bug.
* NEWS: Document it.
2008-05-03 Eric Blake
Document define_blind.
* doc/m4.texinfo (Ifelse): Add a new composite macro.
* THANKS: Update.
Suggested by Mike R.
2008-04-24 Eric Blake
Add debugmode test.
* doc/m4.texinfo (Debug Levels): Test -di behavior.
(Changeword, Location): Correct examples.
* checks/check-them (examples): Update to account for recommended
location for running tests.
* doc/m4.texinfo (Debug Levels): Test this behavior.
2008-04-21 Eric Blake
Fix spelling of attribution to Christopher Strachey.
* doc/m4.texinfo (History, Inhibiting Invocation): Fix typo.
* THANKS: Update.
Reported by Fernando Carrijo.
2008-04-17 Eric Blake
Fix buildbot failure.
* doc/m4.texinfo (Diversions): Consume all of m4's output, in case
SIGPIPE is ignored.
* THANKS: Update.
Detected by Bob Proulx's buildbot.
2008-04-17 Eric Blake
Avoid gcc shadowing warnings.
* src/builtin.c (m4_format): s/format/expand_format, so local
variables can be named format.
* src/format.c (format): Rename...
(expand_format): ...to this, and avoid the name index.
* src/input.c (push_file): Avoid the name close.
* src/m4.h (expand_format): Adjust prototype.
* src/output.c (threshold_diversion_CB): Avoid the name div.
2008-04-15 Eric Blake
Another 'make installcheck' fix.
* doc/m4.texinfo (Diversions): s/m4/__program__/ in case
--program-prefix was active.
2008-04-11 Eric Blake
Ensure --program-prefix doesn't regress.
* Makefile.am (DISTCHECK_CONFIGURE_FLAGS): Enforce change from
2008-03-10 by testing it at 'make distcheck' time.
2008-04-11 Eric Blake
Improve OS/2+emx build.
* src/m4.h [__EMX__]: OS/2 does not have a Unix-compatible
system(3), no matter what other macros it pre-defined.
* doc/m4.texinfo (Mkstemp): Rework test to avoid globbing failure
on OS/2.
* src/builtin.c (predefined_tab): Ensure all possible system
identifiers are defined, not just the first; the testsuite will
catch if multiple identifiers mistakenly made it through.
* THANKS: Update.
Reported by Elbert Pol.
2008-04-09 Eric Blake
Remove redundant configure macros.
* configure.ac (AC_CANONICAL_BUILD, AC_CANONICAL_HOST)
(AC_SYS_LARGEFILE, AC_TYPE_SIZE_T): Delete, since gnulib does
this.
(AC_CHECK_HEADERS_ONCE): Remove limits.h.
2008-08-07 Bruno Haible (tiny change)
Run m4 tests prior to gnulib unit tests.
* Makefile.am (SUBDIRS): Swap order of directories.
2008-04-02 Eric Blake
Release Version 1.4.11.
* NEWS: Mention the release.
Prepare for release.
* maint.mk (alpha): Check for PREV_VERSION setting sooner, and
remove tag operation.
(version-check): Enhance this check.
(prev-tarball): Depend on version-check.
(this-vc-tag): Delete, and mention need to run tag...
* HACKING: ...here, prior to make maintainer-distcheck.
Update the instructions to match this particular release process.
* Makefile.am (.version, announcement): Allow for VPATH build.
* cfg.mk (gnulib_dir): Likewise.
* doc/Makefile.am ($(srcdir)/m4.1): Include release number in man
page.
2008-04-01 Eric Blake
Speed up index builtin.
* m4/gnulib-cache: Import strstr module.
* NEWS: Mention the speedup.
2008-03-29 Eric Blake
Fix testsuite on mingw, OpenBSD.
* src/format.c (ARG_DOUBLE): Use strtod, not atof.
* src/Makefile.am (m4_LDADD): Use POW_LIB when needed.
* doc/m4.texinfo (Format): Add hex-float support.
* NEWS: Document this.
2008-03-27 Eric Blake
Pull other useful doc fixes from branch-1.6.
* doc/m4.texinfo (Arguments): Enable test of
--warn-macro-sequence.
(Defn): Test length of builtin token.
(Builtin, Ifelse, Changequote): Add more regression tests.
2008-03-27 Eric Blake
Add test for divert bug on 2007-05-28, patched 2007-07-21.
* doc/m4.texinfo (Diversions): Add test.
2008-03-24 Eric Blake
Pull GNUmakefile from gnulib.
* m4/gnulib-cache.m4: Import gnumakefile module.
* GNUmakefile: Remove from version control; supplied by gnulib
instead.
* configure.ac (AC_INIT): Track intra-release version with
git-version-gen.
(AC_CONFIG_LINKS): Let gnulib do this now.
* Makefile.am (distclean-local): Likewise.
(EXTRA_DIST): Likewise. Also handle renamed files.
* (.version, dist-hook): Improve version handling.
* Makefile.cfg: Rename...
* cfg.mk: ...to this.
* Makefile.maint: Rename...
* maint.mk: ...to this.
(ME, makefile-check, m4-check): Use new macro instead of
hard-coded name.
* HACKING: Mention that maintainer rules should now work in VPATH
builds.
2008-03-15 Eric Blake
Document join, in order to fix bug in m4wrap example.
* doc/m4.texinfo (Improved m4wrap): New node.
(Defn, Location): Enhance tests.
(Shift): Document the composite macro join.
(Incompatibilities): Move documentation of LIFO vs. FIFO...
(M4wrap): ...here, to match improved example.
2008-03-10 Eric Blake
Allow 'make installcheck' with './configure --program-prefix'.
* checks/Makefile.in (program_transform_name): New macro.
(installcheck): Use it to transform name of m4 before testing.
* checks/check-them (m4): Add -m option, to allow testing m4 by a
different name.
* checks/get-them: Allow xout and xerr notation.
2008-02-25 Eric Blake
Improve release process.
* configure.ac (AM_INIT_AUTOMAKE): Increase requirement, and add
dist-lzma.
* HACKING: Update for git release procedures.
* Makefile.cfg: New file.
* GNUmakefile: Use it.
* Makefile.maint (gzip_rsyncable, GZIP_ENV, GIT, VC, VC-tag)
(VERSION_REGEXP, this-vc-tag, my_distdir, null_AM_MAKEFLAGS)
(TMPDIR, gnulib-version): New macros, borrowed from coreutils.
(makefile-check, news-date-check, changelog-check, m4-check)
(vc-diff-check, maintainer-distcheck, vc-dist, my-distcheck)
(announcement, alpha, beta, major): New rules, borrowed from
coreutils.
(TEXI2HTML, cvs-release, update-timestamps, cvs-news, cvs-commit)
(cvs-dist): Delete.
* Makefile.am (EXTRA_DIST): Distribute new file.
2008-02-19 Eric Blake
Clean up foreach example.
* doc/m4.texinfo (Foreach, Improved foreach): Document another
shortcoming in foreach.m4.
2008-02-16 Eric Blake
Add regression test for multi-character quote recursion.
* examples/foreach2.m4: Use $0 rather than spelling out name.
* examples/foreachq2.m4: Likewise.
* examples/forloop2.m4: Likewise.
* examples/hanoi.m4: Likewise.
* examples/trace.m4: Likewise.
* doc/m4.texinfo (Improved forloop): Document advantage of $0.
(Improved foreach): Adjust dump from file.
2008-02-13 Eric Blake
Fix texinfo grammar.
* doc/m4.texinfo (Incompatibilities): Use @. after capital.
(History): Use @: after abbreviations.
(M4exit): Use correct Latin abbreviation.
2008-02-11 Eric Blake
Document behavior of __gnu__().
* doc/m4.texinfo (Platform macros): Enhance test.
(Macro expansion): New test.
2008-01-31 Ralf Wildenhues
* checks/Makefile.in: Use @SET_MAKE@, and use @SHELL@ rather
than hard-coding /bin/sh.
* THANKS: Update.
Reported by Lawson Chan.
2007-12-13 Paolo Bonzini (tiny change)
* doc/m4.texinfo (Inhibiting Invocation): Fix quoting of a quoting
example.
* THANKS: Update.
Reported by Giovanni Toffetti.
2007-12-07 Eric Blake
Minor security fix: Quote output of mkstemp.
* src/builtin.c (mkstemp_helper): Produce quoted output.
* doc/m4.texinfo (Mkstemp): Update the documentation and tests.
* NEWS: Document this change.
2007-12-04 Eric Blake
Fix builds with OpenBSD make.
* doc/Makefile.am (HELP2MAN): New macro.
(man_MANS, m4.1): Fix rules for building m4.1 into srcdir.
* README: Update copyright.
* HACKING: Mention help2man and makeinfo dependencies.
2007-11-22 Eric Blake
Security fix: avoid arbitrary code execution with 'm4 -F'.
* src/freeze.c (produce_frozen_state): Never pass raw file name as
printf format.
* NEWS: Document this fix.
2007-11-07 Eric Blake
* doc/m4.texinfo (Pseudo Arguments): Test more corner cases.
2007-11-05 Eric Blake
Use build-aux directory.
* configure.ac (PACKAGE, VERSION): Delete, since Automake does
this now.
(AC_CONFIG_AUX_DIR): Add, with auxiliary files in build-aux
instead of the top level.
(AC_INIT_AUTOMAKE): Increase requirement, and add dist-lzma.
* Makefile.am (EXTRA_DIST): Gnulib now manages gendocs.sh.
* bootstrap: Adjust accordingly.
* m4/gnulib-cache.m4: Add --aux-dir option.
* doc/Makefile.am (m4.1): Rewrite rule to use build-aux/missing.
2007-10-31 Eric Blake
Test more corner cases.
* doc/m4.texinfo (Changecom, Pseudo Arguments): Beef up tests.
(Improved foreach): Document alternate foreachq style.
2007-10-28 Eric Blake
More test coverage for autoconf usage patterns.
* doc/m4.texinfo (Inhibiting Invocation, Pseudo Arguments)
(Builtin): Add new undocumented tests.
(Shift): Document cond macro, and add new test.
2007-10-27 Eric Blake
Document one use of changequote(`(',`)').
* doc/m4.texinfo (Changequote): Add new test, based on recent
autoconf addition of m4_expand.
2007-10-22 Eric Blake
Never let printf failures go undetected.
* m4/gnulib-cache.m4: Import announce-gen, git-version-gen,
intprops, strtod, and xprintf modules. Remove deprecated free
module. Replace vasprintf-posix and xvasprintf with
xvasprintf-posix.
* src/m4.h: Include xprintf.h.
* src/builtin.c (ntoa): Export.
(m4_errprint): Adjust all *printf callers.
* src/debug.c (debug_message_prefix, trace_format): Likewise.
* src/freeze.c (produce_frozen_state): Likewise.
* src/input.c [DEBUG_INPUT]: Likewise.
* src/m4.c (usage): Likewise.
* src/m4.h (DEBUG_PRINT1, DEBUG_PRINT3, DEBUG_MESSAGE)
(DEBUG_MESSAGE1, DEBUG_MESSAGE2): Likewise.
* src/output.c (shipout_text, freeze_diversione): Likewise.
* src/path.c [DEBUG_INCL]: Likewise.
* src/stackovf.c (process_sigsegv) [DEBUG_STKOVF]: Likewise.
* src/symtab.c [DEBUG_SYM]: Likewise.
2007-10-17 Eric Blake
Fix 'm4 -F file -t undefined'.
* src/freeze.c (produce_frozen_state): Avoid core dump.
* doc/m4.texinfo (Using frozen files): Test for the bug.
* NEWS: Mention the fix.
2007-10-09 Eric Blake
Avoid regexp regression.
* doc/m4.texinfo (Regexp, Patsubst): Test \ expansion.
2007-10-02 Eric Blake
Add more examples and tests.
* doc/m4.texinfo (Patsubst): Use the examples directory. Also
document shortfall.
(Improved capitalize): New node.
(Index macro, Regexp): Test more code paths.
* examples/capitalize.m4: Update to match manual.
* examples/capitalize2.m4: New file.
* examples/foreachq3.m4: Likewise.
* examples/join.m4: Likewise.
* examples/loop.m4: Likewise.
* examples/wraplifo.m4: Likewise.
* examples/wraplifo2.m4: Likewise.
* examples/Makefile.am (EXTRA_DIST): Distribute new files.
2007-09-24 Eric Blake
Create .gitignore alongside .cvsignore.
* bootstrap (LC_ALL): Set up front.
(version control) Borrow idea from head, to avoid churn in
m4/.*ignore files modified by gnulib-tool.
2007-09-13 Eric Blake
* AUTHORS: Fix typo.
2007-09-07 Eric Blake
* AUTHORS: Simplify, to match libtool and autoconf layout.
* THANKS: Sync with head.
2007-08-10 Eric Blake
* doc/m4.texinfo (Compatibility): Sync with head.
2007-08-10 Konrad Schwarz (tiny change)
and Eric Blake
* doc/m4.texinfo (Defn): Update wording.
2007-08-09 Eric Blake
POSIX requires defn(`a',`b') to concatenate definitions.
* src/builtin.c (m4_defn): Allow multiple arguments, but warn if
trying to mix a builtin with anything else.
* doc/m4.texinfo (Defn): Document a use for this POSIX
requirement.
(Incompatibilities): Update to match current status.
* NEWS: Document this change.
* THANKS: Update.
Reported by Konrad Schwarz.
2007-08-04 Eric Blake
Normalize all GPL license notices.
* GNUmakefile: Update license wording.
* Makefile.am: Likewise.
* Makefile.maint: Likewise.
* bootstrap: Likewise.
* commit: Likewise.
* configure.ac: Likewise.
* checks/Makefile.in: Likewise.
* doc/Makefile.am: Likewise.
* examples/Makefile.am: Likewise.
* src/Makefile.am: Likewise.
* src/builtin.c: Likewise.
* src/debug.c: Likewise.
* src/eval.c: Likewise.
* src/format.c: Likewise.
* src/freeze.c: Likewise.
* src/input.c: Likewise.
* src/m4.c: Likewise.
* src/m4.h: Likewise.
* src/macro.c: Likewise.
* src/output.c: Likewise.
* src/path.c: Likewise.
* src/stackovf.c: Likewise.
* src/symtab.c: Likewise.
2007-07-21 Eric Blake
Fix regression on NetBSD from 2007-05-28.
* src/output.c (m4_tmpopen): Explicitly reset append-mode stream
position to byte 0.
* NEWS: Document this fix.
* THANKS: Update.
Reported by Thomas Klausner.
2007-07-20 Eric Blake
Fix 'make distcheck' issues.
* Makefile.am (EXTRA_DIST): No need to distribute
gpl-3.0.texi.diff anymore.
* m4/gnulib-cache.m4: Update to latest gnulib.
2007-07-14 Eric Blake
Reflect upstream license .texi changes.
* doc/m4.texinfo (Copying): Rename node...
(GNU General Public License): ...to this.
(GNU Free Documentation License): Adjust node location.
* local/doc/gpl-3.0.texi.diff: Remove file.
2007-07-10 Eric Blake
Start 1.4.10a.
* configure.ac (AC_INIT): Bump version number.
* NEWS: Start changes since 1.4.10.
* doc/m4.texinfo (History): Mention 1.4.11.
(Copying This Package, Copying This Manual): Add index entries.
* local/lib/version-etc.c.diff: Delete, now that gnulib has been
updated.
* Makefile.am (EXTRA_DIST): Remove dead file.
2007-07-09 Eric Blake
Release Version 1.4.10.
* doc/Makefile.am (m4_TEXINFOS): Distribute gpl-3.0.texi.
* Makefile.am (EXTRA_DIST): Distribute gnulib diffs.
* configure.ac (AC_INIT): Bump version number.
* NEWS: Describe changes since 1.4.9.
* src/format.c: Missed a GPLv3 conversion.
Avoid undefined behavior of %.*c in printf.
* src/format.c (format): Special case %c.
* TODO: Document that more remains to be done.
* NEWS: Document the fix.
2007-07-05 Eric Blake
Fix up gnulib-tool usage.
* m4/gnulib-cache.m4: Change local-dir to local, not `.'.
* version-etc.c.diff: Move to...
* local/lib/version-etc.c.diff: ...here.
* gpl-3.0.texi.diff: Move to...
* local/doc/gpl-3.0.texi.diff: ...here.
2007-07-04 Eric Blake
Upgrade to GPL version 3 or later.
* bootstrap: Pick up GPLv3.
* m4/gnulib-cache.m4: Augment with 'gnulib-tool
--local-dir=. --import gpl-3.0'.
* doc/m4.texinfo (Copying This Package): New appendix.
* NEWS: Mention this change.
* README: Mention why some files still claim to be version 2.
* version-etc.c.diff: New file, to make sure --version claims
correct GPL version. Temporary until gnulib makes move.
* gpl-3.0.texi.diff: New file, to allow inclusion of GPLv3 as
appendix, rather than section, of the manual.
* GNUmakefile: Update to new license.
* Makefile.am: Likewise.
* Makefile.maint: Likewise.
* commit: Likewise.
* configure.ac: Likewise.
* checks/Makefile.in: Likewise.
* doc/Makefile.am: Likewise.
* examples/Makefile.am: Likewise.
* src/Makefile.am: Likewise.
* src/builtin.c: Likewise.
* src/debug.c: Likewise.
* src/eval.c: Likewise.
* src/freeze.c: Likewise.
* src/input.c: Likewise.
* src/m4.c: Likewise.
* src/m4.h: Likewise.
* src/macro.c: Likewise.
* src/output.c: Likewise.
* src/path.c: Likewise.
* src/stackovf.c: Likewise.
* src/symtab.c: Likewise.
2007-06-26 Eric Blake
* m4/gnulib-cache.m4: Augment with 'gnulib-tool --import assert'.
2007-06-26 Karl Berry (tiny change)
Match Free Software Directory categories.
* doc/m4.texinfo (dircategory): Update.
2007-05-31 Eric Blake
* src/output.c (output_text): Fix regression from 2007-05-28.
* doc/m4.texinfo (History): Mention 1.4.10.
(Format): Make testsuite output easier to debug.
2007-05-29 Eric Blake
Start 1.4.9c.
* configure.ac (AC_INIT): Bump version number.
* NEWS: Start changes since 1.4.9b, and fix typo.
Beta Release Version 1.4.9b.
* configure.ac (AC_INIT): Bump version number.
* NEWS: Describe changes since 1.4.9.
Improve format support.
* m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
vasprintf-posix'.
* src/format.c (format): Parse %'hhd, %a, %A. Avoid calling
printf with too few arguments, as in format(%*.*d,-1,-1,1).
* doc/m4.texinfo (Format): Expand tests, and improve
documentation.
* NEWS: Document this change.
2007-05-28 Eric Blake
Fix large diversion corner cases, including 1.4.8 regression.
* src/output.c (m4_tmpfile, m4_tmpopen): Simplify use of errno.
(make_room_for): Use NULL, not 0, for pointers.
(insert_diversion_helper): Avoid using rewind.
(freeze_diversions): Allow freezing large diversions.
* NEWS: Document this fix.
Also run gnulib unit tests during make check.
* m4/gnulib-cache.m4: Augment with 'gnulib-tool
--tests-base=tests --with-tests'.
* configure.ac (AC_CONFIG_FILES): Build gnulib testdir.
* Makefile.am (SUBDIRS): Run gnulib tests before ours.
2007-05-25 Eric Blake
Backport prompts in examples from head.
* src/macro.c (expand_macro): Shorten message.
* doc/m4.texinfo (Manual, Command line files, Comments)
(Inhibiting Invocation, Macro Arguments, Macro expansion, Indir)
(Builtin, Shift, Forloop, Foreach, Dumpdef, Trace, Debug Levels)
(Debug Output, Include, Format, Syscmd, Mkstemp, Location)
(Using frozen files, Improved forloop, Improved foreach): Add
prompts to examples.
* checks/get-them: Ignore prompts in examples.
Fix sync line interaction with multiline comments.
* doc/m4.texinfo (Other Incompatibilities): Add example, and
document bug in --syncline/divert interaction.
(Preprocessor features): Augment test.
* src/m4.h (output_text): Export.
(shipout_text, next_token): Add parameter.
* src/freeze.c (reload_frozen_state): Don't interfere with
synclines when reloading state.
* src/output.c (output_text): Export.
(shipout_text): Take new parameter for start line of token.
Output at most one syncline per token.
* src/input.c (next_token): Report line where multiline tokens
start.
* src/macro.c (expand_input, expand_token, expand_argument):
Adjust callers so that line is passed from input to output.
* NEWS: Document this fix.
Reported by Sergey Poznyakoff.
Test -s in testsuite.
* doc/m4.texinfo (Preprocessor features): Add a test.
* checks/get-them: Support extra options in testsuite.
* checks/check-them (examples): Use extra options.
* THANKS: Update.
Reported by Sergey Poznyakoff.
2007-05-24 Eric Blake
Support POSIX flush semantics on all platforms.
* m4/gnulib-cache.m4: Remove closeout, and augment with
'gnulib-tool --import closein fflush'.
* src/m4.h (includes): Use closein, not closeout.
* src/m4.c (main): Ensure stdin is flushed when not all input is
consumed.
(process_file): No return needed.
* src/debug.c (debug_flush_files): Rely on gnulib module, rather
than excluding mingw.
* NEWS: Document this change.
Work around cygwin and mingw fseeko bugs.
* m4/gnulib-cache.m4: Augment with 'gnulib-tool --import fseeko'.
* src/debug.c (debug_flush_files): Prefer fseeko over fseek.
2007-04-25 Eric Blake
Fix negative division within eval, regression of 2007-01-06.
* doc/m4.texinfo (Eval): Catch this bug.
* src/eval.c (mult_term): Fix it.
* NEWS: Document this.
* THANKS: Update.
Reported by Cesar Strauss.
2007-04-23 Eric Blake
Start 1.4.9a.
* configure.ac (AC_INIT): Bump version number.
* NEWS: Start changes since 1.4.9.
2007-03-23 Eric Blake
Release 1.4.9:
* configure.ac (AC_INIT): Bump version number.
* NEWS: Describe changes since 1.4.8b.
2007-03-16 Eric Blake
* doc/m4.texinfo (Mkstemp): Tweak wording.
* src/output.c (output_init): Adjust to latest gnulib.
2007-03-15 Eric Blake
Avoid Tandem/NSK's broken long long (without a symmetric unsigned
long long, it confuses gnulib).
* configure.ac (AC_TYPE_LONG_LONG_INT): Declare long long broken
if unsigned long long doesn't work.
* THANKS: Update.
Reported by Matthew Woehlke.
2007-03-07 Eric Blake
* AUTHORS: Update.
* doc/m4.texinfo: Minor tweaks, avoid makeinfo warning.
2007-03-01 Eric Blake
* doc/m4.texinfo: Pick up more index entries from head. Follow
more texinfo recommendations.
(Sysval): Improve tests.
Avoid overfull \vbox warning from texinfo, due to indices that
weren't quite big enough to split across page boundaries.
* doc/m4.texinfo: Add lots of concept index entries.
(Concept Index): Move to be last, as recommended by texinfo
manual.
(Define, Arguments, Pseudo Arguments): Add more function entries.
2007-02-28 Eric Blake
* doc/m4.texinfo (Eval): Clean up wording to reflext POSIX XCU ERN
137.
(Pseudo Arguments): Add useful example.
* doc/m4.texinfo (Pushdef, Incompatibilities): Clean up wording to
reflect POSIX XCU ERN 118.
* src/m4.h (DEFAULT_MACRO_SEQUENCE): Factor out from...
* src/m4.c (usage): ...here,...
* src/builtin.c (set_macro_sequence): ...and here.
(define_user_macro): Fix typo.
* doc/m4.texinfo (Preprocessor features, Arguments): Fix minor
inaccuracies.
(Shift): Document composite macro argn for portably getting at
positional parameters beyond 9.
* configure.ac (AC_INIT): Bump version number.
* NEWS: Start changes of 1.4.8c.
2007-02-24 Eric Blake
Beta Release 1.4.8b:
* configure.ac (AC_INIT): Bump version number.
* NEWS: Describe changes since 1.4.8.
Reserve all uses of raw ${} in macro definitions, not just
${}.
* src/builtin.c (set_macro_sequence): Change default macro
sequence.
* doc/m4.texinfo (Operation modes): Update to match.
* src/m4.c (usage): Likewise.
* NEWS: Likewise.
2007-02-23 Eric Blake
* src/m4.h (includes): Update to latest gnulib.
2007-02-08 Eric Blake
Rename --warn-syntax to --warn-macro-sequence[=regex], to make it
more flexible, and so that autoconf can use it.
* src/m4.h (set_macro_sequence, free_macro_sequence): New
prototypes.
* src/builtin.c (macro_sequence_buf, macro_sequence_regs)
(macro_sequence_inuse, set_macro_sequence, free_macro_sequence):
New variables and functions.
(define_user_macro): Allow flexibility in regular expression used
to trigger warning.
* src/m4.c (warn_syntax): Delete.
(usage, WARN_MACRO_SEQUENCE_OPTION, main): Implement changed
spelling of option, along with optional argument.
* doc/m4.texinfo (Operation modes, Arguments): Document this
change.
* NEWS: Document this change.
2007-02-05 Eric Blake
* m4/gnulib-cache.m4: Module strstr no longer exists.
Avoid bool bitfields, as they don't work on AIX.
* src/m4.h (bool_bitfield): New typedef.
(struct symbol, struct builtin): Use it.
* src/input.c (struct input_block): Likewise.
Reported by Albert Chin.
* doc/m4.texinfo (Sysval): Avoid SIGPIPE in test as unreliable.
Reported by Albert Chin.
* THANKS: Update.
2006-06-18 Bruno Haible (tiny change)
* doc/m4.texinfo (Input processing): Further clarifications.
2007-02-03 Eric Blake
* doc/m4.texinfo (Input processing, Quoting Arguments): Beef up
the examples.
Reported by Bruno Haible.
2007-02-01 Eric Blake
* src/m4.c (fatal_warnings): New variable.
(usage): Document new -E behavior.
(main): Make -E an additive option.
(m4_error, m4_error_at_line): Change exit status when required.
* NEWS: Document this change.
* doc/m4.texinfo (Operation modes): Likewise.
Reported by Ralf Wildenhues.
2007-01-27 Eric Blake
* src/m4.h (warn_syntax): Declare.
(init_pattern_buffer): Export.
* src/m4.c (warn_syntax, usage, WARN_SYNTAX_OPTIONS)
(long_options, main): Implement new option.
* src/builtin.c (init_pattern_buffer): Allow NULL regs argument.
(define_user_macro): Warn on $11 and ${1} if requested.
* src/input.c (init_pattern_buffer): Delete duplicate method.
* doc/m4.texinfo (Operation modes): Document it.
(Arguments): Document future direction of ${11} vs. $11.
(Incompatibilities): Fix wording on POSIX limitations.
* checks/get-them: Parse @{ and @} correctly.
* NEWS: Document this change.
2007-01-26 Eric Blake
* src/builtin.c (includes): Adjust to gnulib changes.
2007-01-15 Eric Blake
* doc/m4.texinfo: Pull in various improvements from head.
* src/builtin.c (include): Alter exit status on failure.
* NEWS: Document this fix.
2007-01-13 Eric Blake
* configure.ac (AC_CHECK_MEMBERS): Check for stack_t.ss_sp, and
assume the fallback of ss_base for BSDI 4.0.1.
* src/stackovf.c (setup_stackovf_trap) [HAVE_SIGALTSTACK &&
! HAVE_STACK_T_SS_SP]: Use this check.
Reported by Chris McGuire.
* THANKS: Update.
* NEWS: Document the improvement.
2007-01-09 Eric Blake
* src/eval.c (ASSIGN): New enumerator.
(eval_lex): Recognize '='.
(equality_term): Treat '=' like '==', but warn that it is
deprecated.
* doc/m4.texinfo (Eval): Document and test this.
(Incompatibilities): Document the POSIX incompatibility.
* NEWS: Document this change.
2007-01-06 Eric Blake
* m4/gnulib-cache.m4: Augment with 'gnulib-tool --import stdint'.
* checks/check-them: Record expected exit status.
* checks/get-them: Check exit status.
* src/m4.h (eval_t, unsigned_eval_t): Delete, use POSIX int32_t
instead.
* src/builtin.c: All users changed.
* src/eval.c: Likewise. Also document where we are triggering
undefined or implementation-defined behavior.
(BADOP, NEGATIVE_EXPONENT, INVALID_OPERATOR, eval_lex, evaluate)
(logical_or_term, logical_and_term, logical_not_term, not_term)
(equality_term, unary_term): Port from head to follow POSIX
semantics.
(exp_term): Reject 0**0 as undefined.
* doc/m4.texinfo (History): Mention 1.4.9.
(Format, Incompatibilities): Update to document POSIX compliance.
* NEWS: Document this change.
2007-01-04 Eric Blake
* NEWS: Document previous fix.
* THANKS: Update.
2007-01-04 Sami Liedes (tiny change)
Fix Debian bug 405594, introduced 2006-11-01 from a bad
copy-n-paste from head.
* src/m4.c (main): Use correct file name after --.
2007-01-04 Eric Blake
Fix regression from 1.4.7 in large file handling on some
platforms, introduced on 2006-10-13.
* configure.ac (AC_LARGE_SYSFILE): Guarantee that large files
will be handled.
* NEWS: Document this fix.
2007-01-03 Eric Blake
* m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
version-etc-fsf'.
* src/m4.c (AUTHORS, main): Use FSF wording for --version (plus
it bumps the copyright year).
2006-12-27 Eric Blake
* doc/m4.texinfo (Patsubst): Fix typo.
2006-12-16 Eric Blake
* src/m4.c (main): Check for errors when closing stdin.
2006-12-09 Ralf Wildenhues
* doc/m4.texinfo: Fix some typos.
2006-12-09 Eric Blake
* configure.ac (AC_INIT): Bump version number.
* NEWS: Start changes of 1.4.8a.
2006-11-20 Eric Blake
Release 1.4.8:
* configure.ac (AC_INIT): Bump version number.
* NEWS: Describe changes since 1.4.7.
2006-11-16 Eric Blake
* doc/m4.texinfo (Include, Search Path, Diversions, Divert):
Minor tweaks noticed while porting to head.
2006-11-14 Eric Blake
* src/output.c (cleanup_tmpfile, freeze_diversions): Clean up
spent iterators.
(m4_tmpname): Avoid memory leak.
2006-11-13 Eric Blake
* src/output.c (cleanup_tmpfile): Avoid double error message when
umask is prohibitive.
(m4_tmpname, m4_tmpopen, m4_tmpclose, m4_tmpremove): New
functions.
(m4_tmpfile): Add parameter, move cloexec action here.
(make_room_for): Adjust caller. Don't keep too many files open.
(insert_diversion_helper): Unlink emptied temp files.
(make_diversion): Don't keep too many files open.
* doc/m4.texinfo (Diversions): Tweak wording, now that open file
descriptors are no longer a limiting factor.
* NEWS: Document this change.
Backport sparse diversion handling from head.
* m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
avltree-oset'.
* src/output.c (struct m4_diversion): Rename from struct
diversion, and update members. All users changed.
(diversion_table): Change to an ordered set, instead of an array.
(div0): New storage for diversion 0.
(diversions): No longer needed.
(free_list): New list to allow recycling diversion storage.
(diversion_storage): New storage to reduce malloc overhead.
(cmp_diversion_CB, threshold_diversion_CB): New callbacks.
(output_init, output_exit, cleanup_tmpfile, make_room_for)
(make_diversion): Handle new diversion storage scheme.
(insert_diversion_helper): New function.
(insert_diversion, undivert_all, freeze_diversions): Use it.
* doc/m4.texinfo (Divert, Diversions): Move hidden test of memory
exhaustion to visible test of large diversion numbers.
* NEWS: Document this fix.
2006-11-11 Eric Blake
* src/builtin.c (m4_translit): Slight optimization.
* src/m4.h (to_uchar): Depend on HAVE_INLINE.
* src/builtin.c: Remove unnecessary casts.
(expand_ranges): Make 8-bit clean.
* doc/m4.texinfo (Translit): Add tests and wording.
* NEWS: Document this fix.
2006-11-07 Eric Blake
* src/m4.h (output_exit): New prototype.
* src/m4.c (main): Use it.
* src/output.c (cleanup_tmpfile): Close files before removing
directory.
(insert_diversion): Check for failure.
(output_exit): Avoid memory leak.
* doc/m4.texinfo (Diversions): Test this bug.
* doc/m4.texinfo (Esyscmd, Errprint): Minor touchups.
2006-11-01 Eric Blake
Allow C++ compilation on Linux, as a safety measure in type
checking.
* m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
stdbool'.
* src/m4.h (hack_symbol, hack_all_symbols): Use full prototype.
(boolean): Kill this, and use stdbool.h instead.
* src/debug.c, src/eval.c, src/input.c, src/macro.c, src/m4.c:
* src/output.c, src/symtab.c: All users changed.
* src/symtab.c (hack_all_symbols): Update prototype.
* src/builtin.c (dump_symbol, set_trace): Update signature.
(m4_dumpdef, m4_traceon, m4_traceoff): Update callers.
(mkstemp_helper, m4_m4wrap, expand_ranges, m4_translit): Allow
C++ compilation.
* src/debug.c (trace_flush): Likewise.
* src/freeze.c (reload_frozen_state): Likewise.
* src/input.c (push_file, push_string_finish, push_wrapup):
(token_bottom, next_token): Likewise.
* src/m4.c (main): Likewise.
* doc/m4.texinfo (Invoking m4): Update according to POSIX 200x
draft wording.
* src/m4.h (m4_path_search): Tweak signature.
* src/path.c (m4_path_search): Likewise.
* src/builtin.c (include): Update caller.
* src/m4.c (main): Allow -D, -U, -t, and -s to be interspersed
with file names. Don't write to **argv.
(process_file): New helper method.
* NEWS: Document this fix.
2006-10-31 Eric Blake
* m4/gnulib-cache.m4: Augment with 'gnulib-tool --import strstr'.
* doc/m4.texinfo (Translit): Improve the documentation.
* src/builtin.c (m4_translit): Optimize to O(n) instead of O(n^2)
algorithm.
(m4_index): Simplify, and speed up slightly.
* NEWS: Document this fix.
2006-10-28 Eric Blake
* src/input.c (set_quotes): Don't allow empty end-quote with
non-empty start-quote.
(set_comment): Likewise for end-comment.
* src/builtin.c (m4_changecom): Adjust caller.
* doc/m4.texinfo (Changequote, Changecom): Update documentation to
match behavior.
(Incompatibilities): Document another POSIX bug.
* NEWS: Mention this change.
2006-10-27 Ralf Wildenhues
* examples/Makefile.am (EXTRA_DIST): Distribute recently-added
files.
2006-10-26 Eric Blake
Silence -Wwrite-strings -Wpointer-arith warnings.
* src/builtin.c (define_user_macro): Allow NULL argument.
(m4_builtin, m4_indir): Cast away const of "".
* src/format.c (format): Likewise.
* src/macro.c (collect_arguments): Likewise.
(expand_macro): Avoid math on void*.
* src/m4.c (main): Adjust caller.
* src/output.c (freeze_diversions): Detect off_t overflow.
* src/input.c (pop_input): Remove unnecessary code.
2006-10-25 Eric Blake
* src/symtab.c (symtab_init): Avoid size_t overflow.
* src/output.c (make_diversion): Avoid size_t overflow.
* doc/m4.texinfo (Diversions): Test this fix.
* src/input.c (input_block): Remove unused member. Reduce size
of struct.
(push_file, pop_input): Avoid useless assignment.
* NEWS: Document the bug fix.
Redo location tracking. Instead of having just files track the
line to return to when popping input, now all input blocks track
their current line.
* src/input.c (INPUT_STRING_WRAP, INPUT_FILE_INIT): No longer
needed.
(input_block): Have line and file storage for all input types, and
rename some members.
(input_change): New global flag.
(push_file, push_macro, push_string_init, push_wrapup): Store
location.
(push_string_finish, pop_input, pop_wrapup): Notice changes in
input blocks.
(peek_input): Adjust to new member names.
(next_char, next_char1): Adjust location if needed.
(skip_line): Simplify restoring location.
* doc/m4.texinfo (Location): Augment the test to catch line
location of expansion of multi-line arguments.
Reported by Stepan Kasal.
2006-10-23 Eric Blake
* doc/m4.texinfo (Macro Arguments): Document that leading space
in argument collection stops at macro expansion.
(Incompatibilities): Document POSIX whitespace wording issue.
2006-10-20 Eric Blake
* doc/m4.texinfo: Trailing '@comment' doesn't format nicely in
TeX, so recognize '@w{ }' instead. Likewise, @code{_name} at the
end of a TeX line splits incorrectly.
(Foreach, Improved foreach): Write these sections, borrowing ideas
from CVS head and from m4sugar.
* checks/get-them: Accomodate new way to show trailing space in
examples.
* examples/foreach.m4: Make usable in documentation.
* examples/foreachq.m4: New file.
* examples/foreachq2.m4: New file.
* examples/foreach2.m4: New file.
* NEWS: Document the documentation updates.
2006-10-19 Eric Blake
* src/builtin.c (mkstemp_helper, m4_mkstemp): New functions.
(m4_maketemp): Provide traditional behavior.
* doc/m4.texinfo (Mkstemp): Rename from Maketemp. Document the
new `mkstemp' macro and the flaws of the old `maketemp'.
(Incompatibilities): Move maketemp discussion to...
(Extensions): ...here, since -G now supresses the GNU extension.
* NEWS: Document this.
* examples/forloop.m4: Simplify.
* examples/forloop2.m4: New file.
* examples/quote.m4: New file.
* doc/m4.texinfo (Loops): Rename to...
(Shift): ...this node.
(Forloop, Foreach, Improved forloop, Improved foreach): New
nodes.
2006-10-17 Eric Blake
* m4/gnulib-cache.m4: Update with 'gnulib-tool --import
config-h'.
* configure.ac (AC_CONFIG_HEADERS): Create config.h alongside
gnulib headers, rather than in top directory.
* src/Makefile.am (AUTOMAKE_OPTIONS): Add nostdinc, to reduce make
output clutter.
2006-10-16 Eric Blake
* doc/m4.texinfo: Backport some minor cleanups from head.
(Cleardivert): Rename from cleardiv.
* doc/m4.texinfo (Invoking m4): Promote to a chapter, instead of
a section of Preliminaries.
(Operation modes, Preprocessor features, Limits control)
(Frozen state, Debugging options, Command line files): Subdivide
into new sections.
(Input processing, Quoting Arguments, Define, Arguments)
(Cleardiv, Format, M4exit): Fix grammar of references.
(Inhibiting Invocation, Macro Arguments, Builtin, Trace)
(Debug Levels, Debug Output, Include, Search Path, Divert)
(Platform macros, Syscmd, Location, Extensions): Point to new
sections.
(Top, Loops, Include, Undivert, Location, Incompatibilities):
Improve file references.
2006-10-14 Eric Blake
* m4/input.c (file_clean): Don't close stdin twice, POSIX says it
is not portable.
Reported by Ralf Wildenhues.
* src/builtin.c (m4_undivert): Check for read error.
2006-10-13 Eric Blake
* src/m4.h (UNIX, W32_NATIVE, OS2): Move platform checks after
header files are included, since can affect the tests.
* THANKS: Updated.
Reported by Martin Koeppe.
Backport head's usage of clean-temp module, as it is cleaner than
using tmpfile-safer.
* m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
clean-temp closeout', and remove tmpfile-safer.
* src/m4.h (includes): Adjust.
(m4_path_search): Rename from path_search, to avoid collision
with gnulib.
* src/m4.c (main): Install closeout handler. Adjust caller.
(usage): Now done by closeout module.
* src/builtin.c (m4_m4exit): Likewise.
(m4_undivert, include): Adjust callers.
* src/freeze.c (reload_frozen_state): Likewise.
* src/path.c (m4_path_search): Rename from path_search.
* src/output.c (output_temp_dir): New variable.
(cleanup_tmpfile, m4_tmpfile): New functions, from head.
(insert_diversion, make_room_for): Use them.
* doc/m4.texinfo (Diversions): Document this, and add a test.
(Improved fatal_error): Fix typo.
(Maketemp): Port test to mingw, and no longer hide from
documentation.
* NEWS: Document the change in TMPDIR behavior.
* configure.ac (m4_pattern_forbid): Narrow the range of forbidden
macros, to work with recent gnulib-tool update.
* src/builtin.c (m4_builtin, m4_indir): Allow transparent
handling of defn results.
* doc/m4.texinfo (Builtin, Indir): Add test cases.
* NEWS: Document this.
2006-10-12 Eric Blake
* doc/m4.texinfo (Location): Fix typo in previous commit.
(Changeword): Catch one more case.
* src/input.c (skip_line): Fix case when outer file used macro to
supply the \n.
2006-10-11 Eric Blake
* src/input.c (enum input_type): Add additional types, to shave
time off the common case.
(push_wrapup): Wrapped strings remember location.
(push_string_finish): Normal strings carry no location.
(push_file): Start new files uninitialized.
(peek_input, next_char_1): Optimize common cases by updating
location only on new input types.
(pop_input): Update to honor new input types.
(skip_line, push_string_finish): Fix regression in previous patch
when dnl is not followed by newline in included file.
(push_string_init): Initialize all fields of INPUT_STRING sooner.
(peek_token): Simplify.
(peek_input): Don't pop input files on peek, so that __file__ and
__line__ as last token of include file work correctly.
* doc/m4.texinfo (History): Mention 1.4.8.
(Answers): Split into sections, one per answer.
(Improved exch, Improved cleardivert, Improved fatal_error): New
nodes.
(Dnl, M4wrap, Location, M4exit, Improved fatal_error): Update to
new m4wrap location semantics.
(Changeword): Add test that caught the regression.
* NEWS: Document this.
* src/macro.c (expand_macro): In macro expansion errors, report
line number at open parenthesis.
* src/input.c (next_token): Fix off-by-one bug in reporting end
of file in unterminated comment and string.
(file_names): New obstack, necessary since expand_macro now hangs
on to file names longer than the files remain open.
(input_init): Initialize new obstack.
(push_file): Use new obstack. Delay updates to current_file
until after expand_macro has restored state.
(peek_input, next_char_1): Update current_file if necessary.
(pop_wrapup): Release memory.
* doc/m4.texinfo (Macro Arguments, Changequote, Changecom): Catch
the off-by-one bug.
(Dnl): Update to the new location reporting rules.
* NEWS: Document these changes.
2006-10-10 Eric Blake
* src/macro.c (argc_stack, argv_stack): New variables for sharing
obstacks across multiple macro calls.
(expand_input): Initialize and tear down stack once per input
file, instead of once per macro.
(expand_macro): Reuse existing stacks when possible.
(collect_arguments): Simplify slightly.
* src/path.c (include_env_init): Fix botched patch application.
Reported by Ralf Wildenhues.
2006-10-09 Eric Blake
* src/m4.c (usage, main): Detect write failures to stderr.
* src/builtin.c (m4_m4exit): Likewise.
* NEWS: Document this.
* src/macro.c (expand_macro): Allow --nesting-limit=0 to remove
the limit.
* NEWS: Document this.
* doc/m4.texinfo (Invoking m4): Likewise.
2006-10-09 Ralf Wildenhues
* src/path.c (include_env_init): Copy the string returned
by getenv before overwriting it; POSIX disallows this.
2006-10-09 Eric Blake
* src/m4.c (main): Defer debugfile until after --help.
* configure.ac (AC_INIT): Bump version number.
* NEWS: Start changes of 1.4.7a.
2006-09-25 Eric Blake
Release 1.4.7:
* configure.ac (AC_INIT): Bump version number.
* NEWS: Describe changes since 1.4.6.
2006-09-21 Eric Blake
* doc/m4.texinfo (Invoking m4): Add clarification on option
processing behavior.
* THANKS: Update.
Reported by Mikhail Teterin.
* bootstrap: Add --force option, based on idea from coreutils.
* README: Document that ./bootstrap and autoreconf are for
developers, and not lightly done in tarballs.
2006-09-20 Eric Blake
* src/m4.c (usage, OPTSTRING, main): Rename -e to -i, and give
deprecation warning on -e.
* doc/m4.texinfo (Invoking m4, Extensions): Document this.
* NEWS: Document this.
2006-09-19 Eric Blake
* src/m4.c (usage, long_options, main, DEBUGFILE_OPTION): Rename
-o/--error-output to --debugfile, and deprecate the former. This
will allow a future release to be more consistent with other GNU
tools, with -o/--output affecting stdout, not debug.
* doc/m4.texinfo (Invoking m4, Debug Output): Document this.
* NEWS: Document this.
2006-09-14 Eric Blake
* src/m4.c (main): Warn on deprecated options -B, -S, -T, -N,
--diversions. `m4 --help --version' now displays help, not
version.
(interactive, frozen_file_to_read, frozen_file_to_write): Move to
smaller scope.
(show_help, show_version): No longer needed.
(long_options, DIVERSIONS_OPTION): Backport patch from head to
distinguish between -N and --diversions in warning.
* doc/m4.texinfo (Invoking m4): Document this.
* NEWS: Likewise.
2006-09-11 Eric Blake
* src/Makefile.am (m4_LDADD): Add any gnulib dependent libraries.
* src/debug.c (debug_flush_files) [UNIX]: Flush stdin if it is
seekable.
(debug_set_file): Use STDOUT_FILENO.
* src/builtin.c (m4_m4exit): Flush stdin before exiting, to comply
with POSIX in regards to unread input.
* NEWS: Document this fix.
* doc/m4.texinfo (Syscmd, Esyscmd, M4exit): Likewise.
2006-09-07 Eric Blake
* m4/gnulib-cache.m4: Update to newer gnulib-tool.
* src/m4.h (push_file): Change prototype.
* src/input.c (push_file, peek_input, next_char_1): Only call getc
once at EOF, to avoid double ^D on terminal stdin; regression from
2006-09-04.
(push_file, pop_file): Allow reading stdin twice.
* src/m4.c (main): Likewise.
* src/builtin.c (include): Update caller.
* NEWS: Document this change.
* doc/m4.texinfo (Invoking m4, Incompatibilities): Likewise.
(Syscmd): Add a test that failed before this patch.
2006-09-07 Ralf Wildenhues
* checks/check-them: Quote $pwd.
2006-09-05 Eric Blake
* src/builtin.c (define_macro): Warn on invalid macro name.
* NEWS: Document this change.
* doc/m4.texinfo: Fix typos.
(Invoking m4, Macro Arguments, Pseudo Arguments, Defn, Indir)
(Ifelse): Backport some improvements from head.
2006-09-04 Eric Blake
* doc/m4.texinfo (Changeword): Skip test on mingw, where the
native echo is braindead.
* checks/check-them (strip_needed): Ignore \r in output. Now the
testsuite will pass when cross-compiling from cygwin to mingw.
* src/input.c (peek_input): Fix regression in handling macro
without arguments as last token in file; debian bug 385720.
(next_token): Always consume an input character.
Reported by Andreas Schultz.
* configure.ac (AC_INIT): Bump version number.
* NEWS: Document this fix.
* doc/m4.texinfo (History): Mention next version.
(Changeword): Add example that exposes this bug.
* THANKS: Update.
2006-08-25 Eric Blake
Release 1.4.6:
* configure.ac (AC_INIT): Bump version number.
* NEWS: Describe changes since 1.4.5.
* Makefile.maint (web-manual): Give up on VPATH build during
distribution. But distributions are made so infrequently that
this is not too much of a hardship.
* Makefile.am (MAINTAINERCLEANFILES): Avoid error if lib/CVS/
exists.
2006-08-24 Eric Blake
* src/builtin.c (m4_index, m4_substr, m4_translit): Similar to
Solaris, produce output on just one argument.
(m4_regexp, m4_patsubst): For consistency, do likewise.
(m4_patsubst): Allow zero-length match at end of string.
* doc/m4.texinfo (Sysval): Fix overfull hbox.
(Bugs, Macro Arguments): Minor fixes.
(Other tokens): Rearrange node order.
(Index macro, Substr, Translit, Regexp, Patsubst): Add tests.
* NEWS: Document these fixes.
2006-08-22 Eric Blake
* src/input.c (pop_input): Avoid empty filename with -di option.
* src/debug.c (debug_message_prefix): Put space before message.
* m4/gnulib-cache.m4: We don't explicitly use alloca module.
* m4/gnulib-cache.m4: Augment with gnulib-tool --import gnupload.
* Makefile.maint (fetch): Simplify, now that we can use gnupload.
* checks/check-them: State why a test is skipped.
* doc/m4.texinfo (Changeword, Sysval, Maketemp): Likewise.
* ChangeLog: Add copyright.
* AUTHORS: Likewise.
* BACKLOG: Likewise.
* README: Likewise.
* THANKS: Likewise.
* TODO: Likewise.
* examples/COPYING: New file, add copyright for all the examples.
* checks/get-them: Put copyright on testsuite files.
2006-08-18 Eric Blake
Don't let unrelated child processes see too many files.
* m4/gnulib-cache.m4: Augment with gnulib-tool --import cloexec.
* src/builtin.c (m4_esyscmd, m4_regexp, m4_patsubst): Fix
spelling in error message.
* src/debug.c [!__STDC__]: Assume C89, and nuke old varargs.h.
(debug_set_output): Close debug file on exec.
* src/m4.h (includes): Add cloexec.h.
* src/output.c (make_room_for): Close diversions on exec.
* src/path.c (path_search): Close include files on exec.
* NEWS: Document this.
Regular expressions were leaking memory.
* src/builtin.c (init_pattern_buffer, free_pattern_buffer): New
helper methods.
(m4_regexp, m4_patsubst): Avoid memory leak.
* src/input.c (init_pattern_buffer) [ENABLE_CHANGEWORD]: Make
static.
(set_word_regexp) [ENABLE_CHANGEWORD]: Avoid memory leak. Change
from O(n^2) to O(n) for calculating word_start.
(next_token, peek_token) [ENABLE_CHANGEWORD]: Treat word_start as
O(1) bitmap, not O(n) search string.
* NEWS: Document this fix.
2006-08-17 Eric Blake
* NEWS: Document previous checkin.
* src/builtin.c (substitute): Avoid core dump when accessing
beyond bound of regular expression.
Reported by Karl Nelson.
* doc/m4.texinfo (Regexp): Add example that causes core dump on
some architectures prior to this patch.
* THANKS: Updated.
2006-08-16 Eric Blake
* doc/m4.texinfo (Invoking m4, Debug Output): Fix wording to be
clear that dumpdef does not always go to stderr.
* src/builtin.c (m4_errprint): Flush buffers before printing to
stderr.
* THANKS: Updated.
2006-08-15 Eric Blake
* src/builtin.c (m4_m4wrap, m4_errprint, m4_shift): Make blind,
per debian bug 96075.
* doc/m4.texinfo (Loops, M4wrap, Errprint): Document this change.
(Changeword): Don't use shift as an example of a swallowed word.
(Divert): Discuss fact that divert is an English word.
Reported by Richard A Nelson.
2006-08-14 Eric Blake
* doc/m4.texinfo (Invoking m4): Minor fixes.
2006-08-12 Eric Blake
* doc/m4.texinfo (Arguments): Hint at better exch macro.
(Answers): Provide a better definition.
2006-08-09 Eric Blake
* doc/m4.texinfo (Incompatibilities): Document that m4 does not
yet understand locales.
* NEWS: Fix wording of a few items.
2006-08-08 Eric Blake
Avoid printing `NONE:0:' in error messages.
* src/m4.h (m4_error_at_line): New function.
* src/m4.c (m4_error_at_line): Implement.
* src/input.c (skip_line, input_init, next_token): Use "", not
"NONE", for no file, since NONE can be a real file name.
* src/macro.c (expand_argument): Likewise.
* src/debug.c (debug_message_prefix, trace_header): Check for
current file.
* doc/m4.texinfo (Dnl, M4wrap): Adjust accordingly.
(Location): Document that synclines and internal message format
are not impacted by redefining these macros.
(M4exit): Hint at bug in fatal_error.
(Answers): Provide workaround to match m4 output.
* m4/gnulib-cache.m4: Augment with gnulib-tool --import verror.
* src/m4.h (m4_error): New function.
(M4ERROR, M4ERROR_AT_LINE): Reimplement without hacking around
error module deficiencies.
(reference_error, suppress_line): No longer needed.
* src/m4.c (m4_error): Implement.
(main): No longer need to install error callback.
2006-08-04 Eric Blake
* src/m4.h (program_name): Declare.
(suppress_line): New variable.
(M4ERROR_AT_LINE): New macro.
* src/m4.c (reference_error, main): Follow GNU Coding Standards
for error message format.
* src/input.c (skip_line, next_token): Use M4ERROR_AT_LINE.
* src/macro.c (expand_argument): Likewise.
* checks/check-them (examples): Adjust to new message format.
* src/builtin.c (m4___program__): New builtin.
* doc/m4.texinfo (Location): Split from Errprint into new node,
and document __program__.
(Builtin, Ifdef, Ifelse, Dumpdef, Trace, Debug Output, Dnl)
(Include, Regexp, Patsubst, Incr, Eval): Adjust error message
format.
(Extensions): Document __program__.
* NEWS: Document this change.
2006-08-03 Eric Blake
Don't confuse leading `(' in comment or quote with start of
argument collection.
* src/m4.h (enum token_type): Add TOKEN_OPEN, TOKEN_COMMA,
TOKEN_CLOSE.
(peek_input): Make private to input.c.
(peek_token): New prototype.
* src/input.c (default_word_regexp): Reduce ifdefs.
(peek_input): Make static.
(next_token): Return new token types.
(match_input, MATCH): Add argument consume, which controls
whether match should be pushed back.
(peek_token): New function.
(token_type_string) [DEBUG_INPUT]: New function.
* src/macro.c (expand_token, expand_argument, collect_arguments):
Handle new token types.
* doc/m4.texinfo (Changequote, Changecom): Document this.
* NEWS: Document this.
* src/stackovf.c (setup_stackovf_trap): Free memory on failure.
* src/stackovf.c (setup_stackovf_trap): Gracefully avoid stack
overflow detection when sigstack exists but is not implemented.
Fixes debian bug 154053.
* THANKS: Updated.
Reported by David Perlin.
2006-08-02 Eric Blake
* src/input.c (MATCH): Fix EOF detection on multi-byte comment
close.
2006-08-01 Eric Blake
* src/input.c (skip_line, next_token): Remember current file in
case input file ends abruptly. Addresses debian bug 175365.
(pop_input): Defer freeing storage that holds previous file
name...
(pop_wrapup): to here, after error message is issued.
* src/macro.c (expand_argument): Remember current file in case
input file ends abruptly.
* doc/m4.texinfo (Macro Arguments, Dnl, Changequote, Changecom)
(M4wrap): Adjust testsuite accordingly.
(Errprint): Document line number limitation of m4wrap.
* NEWS: Document this fix.
* THANKS: Update.
2006-07-31 Eric Blake
* src/input.c (peek_input, next_char, match_input): Be eight-bit
clean; fixes debian bug 311378.
* doc/m4.texinfo (Syntax): Describe eight-bit handling.
(Changequote, Changecom): Add examples to test this.
* NEWS: Document this fix.
* THANKS: Update.
Reported by Steven Augart.
* doc/m4.texinfo: Whitespace fix.
* checks/get-them: Avoid exceeding 14-char file name limit.
* THANKS: Update.
2006-07-30 Eric Blake
* src/path.c (path_search): Detect allocation failure.
Use native free when it is good enough.
* m4/gnulib-cache.m4: Augment with gnulib-tool --import free.
* src/builtin.c (define_user_macro, m4_regexp, m4_patsubst):
Adjust calls.
* src/symtab.c (free_symbol): Likewise.
* src/m4.c (xfree, main): Likewise.
* src/m4.h (obstack_chunk_free): Likewise.
* src/path.c (path_search): Likewise.
* src/input.c (pop_wrapup, set_quotes, set_comment): Likewise.
* doc/m4.texinfo (Errprint): Add example for last patch.
* checks/check-them: Account for VPATH in latest example.
2006-07-29 Eric Blake
* src/path.c (path_search): Add result parameter, so that
-I can be accounted for. Debian bug 53685.
* src/m4.h (path_search): Update prototype.
* src/m4.c (main): Adjust callers.
* src/freeze.c (reload_frozen_state): Likewise.
* src/builtin.c (include, m4_undivert): Likewise.
* NEWS: Document this change.
Reported by Nicolas Lichtmaier.
2006-07-28 Eric Blake
* Makefile.am (MAINTAINERCLEANFILES): Fix typo that tripped up
several non-GNU makes.
* src/stackovf.c (setup_stackovf_trap): Missed _ from yesterday.
* src/m4.h: Likewise.
* src/input.c (push_wrapup): Avoid compiler warning with Solaris
/usr/ccs/bin/ucbcc.
2006-07-27 Eric Blake
* doc/m4.texinfo: Use @acronym{GNU} throughout.
(History): Update for 1.4.6.
* src/m4.h (_): Remove K&R cruft.
* src/builtin.c: Likewise.
* src/debug.c: Likewise.
* src/eval.c: Likewise.
* src/macro.c: Likewise.
* src/stackovf.c: Likewise.
* doc/Makefile.am (m4.1): Improve man page.
* src/m4.c (usage): Improve --help output, including adding the
bug reporting address.
(main): Follow GNU Coding Standards for --version output.
2006-07-26 Eric Blake
* doc/m4.texinfo: Use begin-quote, end-quote, begin-comment, and
end-comment consistently, to match POSIX.
* doc/m4.texinfo (Macro Arguments, Changequote, Changecom)
(Dnl, M4wrap, Include): Document EOF issues, and add examples.
(Incompatibilities): Document incompatibility of changecom
vs. macro names, and of EOF in include.
* src/input.c (next_token): Reject unterminated comments at EOF.
(skip_line): Warn on unterminated dnl at EOF.
* NEWS: Document these changes.
2006-07-25 Eric Blake
* m4/gnulib-cache.m4: Update to reflect gnulib's split of
stdio-safer into fopen-safer and tmpfile-safer.
* src/m4.c: Remove redundant include.
2006-07-24 Eric Blake
Fix bugs related to stream handling.
* m4/gnulib-cache.m4: Augment with gnulib-tool --import
unlocked-io stdio-safer stdlib-safer close-stream.
* configure.ac (AC_CHECK_FUNCS_ONCE): Assume tmpfile; it can be
provided by gnulib if needed.
* src/output.c [! HAVE_TMPFILE]: Likewise.
* src/m4.h (includes): Replace unistd, stdio, and stdlib with
their safer counterparts.
(retcode): New global variable.
* src/input.c (pop_input): Check for read failure.
* src/freeze.c (reload_frozen_state): Likewise.
(produce_frozen_state): Check for write failure.
* src/debug.c (debug_set_file): Likewise.
* src/m4.c (usage, main): Likewise.
(retcode): Make global.
* src/builtin.c (m4_m4exit): Likewise. Ensure that the exit
status is non-zero except when everything succeeds.
* doc/m4.texinfo (M4exit): Document these changes.
(Incompatibilities): Remove documentation of bug now fixed.
* NEWS: Document these fixes.
2006-07-22 Eric Blake
* src/format.c (format): Avoid compiler warning that str may be
used uninitialized.
2006-07-21 Eric Blake
* src/m4.h [UNIX]: Add more platforms that are close enough to
categorize as UNIX, but which don't predefine __unix__.
Reported by Nelson H. F. Beebe.
2006-07-20 Eric Blake
* m4/gnulib-cache.m4: gnulib-tool has changed again. Regenerate
to explicitly ask for --assume-autoconf=2.60.
2006-07-19 Eric Blake
* doc/m4.texinfo (Sysval): Avoid kill -1, since ksh traps SIGHUP
and exits normally with 129.
Reported by Nelson H. F. Beebe.
* THANKS: Update.
* src/m4.h (EXIT_MISMATCH): Define.
* src/freeze.c (reload_frozen_state): Detect version mismatch, by
exiting with status 63.
* src/m4.c (usage): Document this.
* doc/m4.texinfo (Invoking m4, Using frozen files): Likewise.
* NEWS: Likewise.
* doc/m4.texinfo (copying): Relax restriction on front-cover and
back-cover texts.
2006-07-17 Eric Blake
* src/format.c (format): Support F, g, and G specifiers.
* doc/m4.texinfo (Format): Document this.
* NEWS: Document this addition.
* doc/m4.texinfo (Builtin): Delete redundant text.
* configure.ac (AC_INIT): Bump version number.
* src/builtin.c (substitute): Bah. Fix buffer overrun.
* NEWS: Document this fix.
2006-07-15 Eric Blake
Release 1.4.5:
* configure.ac (AC_INIT): Bump version number.
* NEWS: Describe changes since 1.4.4.
* src/m4.c (usage): Document exit status.
* doc/m4.texinfo: Use `exit status', not `exit code'.
(Invoking m4): Document exit status.
* bootstrap: Backport --help, --version from head.
(func_update): New function, for easily grabbing up-to-date files
from gnulib.
* Makefile.maint (web-manual): Fix for VPATH builds.
2006-07-14 Eric Blake
* doc/m4.texinfo: Global cleanup. Avoid @code{...}'d, as it
looks bad in info. Use @deffn rather than @example for
describing prototypes. Fix awkward wording and grammar.
* src/builtin.c (substitute): Warn on bad escape sequences.
Ignore trailing backslash.
* doc/m4.texinfo (Regexp): Add documentation for this.
* NEWS: Document this change.
* src/builtin.c (m4_format, m4_indir): Warn on too few arguments.
* doc/m4.texinfo (Defn, Builtin, Debug Levels, Debug Output): Add
more examples.
(Dnl): Update example to show side effects.
* checks/get-them: Generate three digit test names.
* checks/Makefile.in (CHECKS): Accomodate 100+ tests.
2006-07-13 Eric Blake
* src/input.c (input_init): Simplify.
(set_word_regexp): Treat empty string as default, since empty
regexp would disable word parsing.
* src/m4.c (user_word_regexp): Default to empty string.
* src/builtin.c (builtin_tab): Make changeword blind.
* doc/m4.texinfo (Changeword): Document this.
* NEWS: Document this.
* TODO: Knock off completed items.
* src/builtin.c (m4_undefine, m4_popdef): Visit all arguments, not
just the first.
* doc/m4.texinfo (Undefine, Pushdef): Test this.
* NEWS: Document this change.
* src/builtin.c (numeric_arg): Treat empty string as 0, with a
warning. Detect quoted leading space and overflow as warnings.
(m4_eval): Treat empty radix as 10, and allow output in radix 1.
Treat width as minimum number of digits, as required by POSIX.
(m4_ifdef, m4_divert, m4_m4exit, m4_translit): Ignore extra
arguments.
(m4_substr): Likewise. Silently treat empty start as 0.
(m4_undivert): Treat ` 1a' as file, not diversion 1.
* src/eval.c (eval_lex): Parse radix 1 numbers.
* doc/m4.texinfo (Invoking m4): Fix wording; there is more than
one type of warning.
(Manual): Document behavior of numeric parsing of empty string.
(Divert, Incr): Document error handling.
(Eval): Document radices better.
(Incompatibilities): Document translit incompatibility.
* NEWS: Document these changes.
* Makefile.maint (fetch): Get gendocs from gnulib, not texinfo.
(web-manual): Simplify.
* m4/gnulib-cache.m4: Augment with gnulib-tool --import gendocs.
* Makefile.am (EXTRA_DIST): Distribute gendocs.sh.
(MAINTAINERCLEANFILES): Clean it as well.
* doc/Makefile.am (EXTRA_DIST): Distribute gendocs_template.
(MAINTAINERCLEANFILES): Clean it as well.
2006-07-12 Eric Blake
* doc/m4.texinfo (Extensions): Document how to overcome
implementation difference in > 9 positional parameters.
* src/m4.c (usage): Sort within sections.
(nesting_limit): Raise default from 250 to 1024.
* doc/m4.texinfo: Use file name, not filename, per GNU coding
standard. Use @option where appropriate.
(Invoking m4): Sort to match --help output.
(Debug Levels): Sort.
(Frozen files): Sort and break into two nodes.
* src/m4.c (nesting_limit): Raise default from 250 to 1024.
* NEWS: Document raised -L limit.
2006-07-11 Eric Blake
* Makefile.am (DISTCHECK_CONFIGURE_FLAGS): New macro, to
stress-test changeword before a release.
* doc/m4.texinfo: More doc cleanups.
(Copying This Manual): New node; actually include the FDL in the
documentation.
* doc/Makefile.am (m4_TEXINFOS): Mention dependence on fdl.texi.
* m4/gnulib-cache.m4: Augment with gnulib-tool --import fdl.
* NEWS: Mention documentation improvements.
* src/m4.h (OS2): New platform macro.
* src/builtin.c (predefined_tab) [OS2]: Use it to give OS/2 a
platform macro.
* doc/m4.texinfo (Platform macros): Document it.
(Sysval): Remove non-portable test of system("").
* NEWS: Document this change.
Reported by Andreas Buening.
2006-07-09 Eric Blake
* doc/m4.texinfo (Undivert): Fix typo in last commit.
* src/m4.c (usage): Document M4PATH.
* src/path.c (path_search): Reject empty string.
* src/output.c (insert_diversion): Ignore diversion 0.
* src/builtin.c (m4_undivert): Ignore empty string.
* NEWS: Document this fix.
2006-07-08 Eric Blake
* checks/get-them: Make filtering easier.
* checks/check-them: Filter non-input lines, so line counts are
more realistic in the documentation, and so changeword tests work
even when dnl is disabled.
* doc/m4.texinfo: Adjust example line numbers. Clean up
front-matter, following autoconf's example.
(Changeword): Enable tests, skipping if changeword not supported.
(Define, Defn, Ifelse): Backport more examples from head.
(Input processing, Answers): New nodes, backported from head.
(Include): Expand test to cover empty filename.
(Undivert): Add test of undivert(0).
2006-07-07 Ralf Wildenhues
* doc/m4.texinfo: Fix spelling errors.
2006-07-07 Eric Blake
* THANKS: Update.
* doc/Makefile.am (m4.1): No need to go through a temporary file;
this also ensures timestamps are updated.
* src/m4.h (includes): Require config.h. Assume string.h,
stdlib.h, errno. Include error.h, exit.h, and xalloc.h rather
than prototyping ourselves.
(builtin_func): Add parameter type-checking.
(voidstar): Delete, now that we assume C89.
* src/builtin.c, src/m4.c, src/macro.c, src/symtab.c: All users of
voidstar changed.
* src/m4.c (xfree) [WITH_DMALLOC]: Avoid clash with dmalloc's
xfree.
2006-07-06 Eric Blake
* m4/gnulib-cache.m4: Augment with gnulib-tool --import
binary-io.
* src/m4.h (includes): Add binary-io.h for O_BINARY.
* src/freeze.c (produce_frozen_state): Use O_BINARY to remove
#ifdef. Fixes patch from 2005-02-03 for cygwin.
* NEWS: Mention this fix.
* configure.ac (FUNC_SYSTEM_BROKEN): New check for OS/2 bug.
* src/builtin.c (m4_syscmd): Work around OS/2 bug.
* Makefile.am (SUBDIRS): Build . before src, so that autoheader
runs first when needed.
* doc/Makefile.am (m4.1): Backport rule from CVS head: build m4.1
once in srcdir rather than multiple times in VPATH builds.
2006-07-03 Eric Blake
* checks/check-them: Use portable = in test.
* src/Makefile.am (AM_CPPFLAGS): Omit space between -I and
directory, as required by Solaris cc. Include built headers, as
required by Solaris make in VPATH build.
* checks/Makefile.in: Use $(srcdir) where needed.
(CHECKS): Factor $(srcdir) into macro.
(DISTFILES): Likewise. Automake takes care of distributing
Makefile.in.
(dist): Simplify.
(Makefile): Use modern syntax of config.status.
* doc/m4.texinfo (Loops, Include, Undivert, Incompatibilities):
Avoid overfull and underfull hboxes in dvi.
Fix 'make check' in VPATH build. All files included by testsuite
now live in a single directory. Use forloop.m4 in testsuite.
* checks/incl.m4, checks/foo, checks/wrapfifo.m4: Move from
here...
* examples/incl.m4, examples/foo, examples/wrapfifo.m4: ...to
here.
* checks/Makefile.in (DISTFILES): Don't distribute moved files.
* examples/Makefile.am (EXTRA_DIST): Distribute new files.
* checks/check-them: Avoid s/// when filename is in pattern.
* examples/forloop.m4: Fix to match documentation.
* doc/m4.texinfo (Include, Undivert, Incompatibilities): Reflect
new locations.
(Loops, Format): Actually use forloop.m4 in tests.
2006-07-02 Eric Blake
* checks/Makefile.in (exec_prefix, prefix): New macros, so that
$(bindir) works in installcheck.
(check, installcheck): No longer change directory, so that
distcheck works with a read-only builddir.
* checks/check-them: Work when pwd is no longer builddir.
2006-07-01 Eric Blake
* GNUmakefile: New file, borrowed from coreutils.
* Makefile.am (EXTRA_DIST): Distribute GNUmakefile.
* Makefile.maint (Makefile): Delete this rule, now that
GNUmakefile includes Makefile.
2006-06-30 Eric Blake
For compatibility with other m4 implementations, sysval returns
signal<<8 rather than 0 if syscmd is terminated by a signal.
* configure.ac (AC_CHECK_HEADERS_ONCE): Check for sys/wait.h.
* src/builtin.c (include): Include sys/wait.h when stdlib.h does
not provide wait macros.
(WTERMSIG, WIFSIGNALED, WIFEXITED): More fallback macros.
(M4SYSVAL_EXITBITS, M4SYSVAL_TERMSIGBITS): New helper macros.
(m4_esyscmd): Set sysval to -1 on failure.
(m4_sysval): Print 127 on failure, and accomodate signals if they
are detectable.
* NEWS: Document this change.
* doc/m4.texinfo (Platform macros, Esyscmd, Sysval): Fix typos in
last commit.
* checks/check-them: Likewise.
* src/debug.c (debug_set_file): Work around mingw fstat bug.
* src/m4.h (UNIX, W32_NATIVE): Improve platform detection macros.
* src/freeze.c (produce_frozen_state): Use new spelling of
platform macro.
* src/builtin.c (predefined_tab): Add __windows__ on non-unix
platforms.
(m4_syscmd, m4_esyscmd): The empty command is successful.
* doc/m4.texinfo (Shell commands): Rename from UNIX commands.
Document platform-dependence of system().
(Syscmd): Add example.
(Esyscmd): Make example more robust, and actually demonstrate
rescanning.
(Sysval): Expand test to cover esyscmd code path, and to check
that empty command is successful. Add conditional check for
signal behavior.
(Other Incompatibilities): Move platform macros from here...
(Platform macros): ...to this new node. Add windows macro.
Check that exactly one platform macro is provided.
* checks/check-them: Improve trap cleanup. Tolerate dirname and
.exe in error messages. Allow for skipping checks.
* configure.ac (HAVE_EFGCVT): Kill dead configure check.
* NEWS: Document platform macros.
2006-06-29 Eric Blake
Fix buffer overrun bug.
* m4/gnulib-cache.m4: Augment with gnulib-tool --import
xvasprintf.
* src/format.c [HAVE_EFGCVT]: Delete this code, and use *printf
variant instead, since [efg]cvt are obsolete and our use of them
was buggy (savannah sr #104303).
(format): Fix buffer overflow by using xasprintf.
* doc/m4.texinfo (Format): Expand format test to catch both bugs.
* NEWS: Document this fix.
* configure.ac (AC_CANONICAL_HOST, AC_CANONICAL_BUILD): Allow
cross-compilation.
(AC_CACHE_CHECK): Cache search for ecvt.
2006-06-27 Eric Blake
* doc/m4.texinfo (Eval): Document 32-bit signed limitations
required by POSIX, and add example that exposed core dump on x86
architectures.
(Incompatibilities): Document incompatibility in eval precedence.
* src/eval.c (shift_term): Explicitly mask, to avoid undefined
behavior.
(mult_term): Explicitly check for -1, to avoid SIGFPE on x86.
* NEWS: Document this change.
* doc/m4.texinfo: Use @noindent consistently.
(Quoting Arguments): Document that unquoted parentheses group
arguments.
(Pseudo Arguments): Expand tests to show this.
(Incompatibilities): Contrast traditional behavior of
changequote.
2006-06-24 Eric Blake
* configure.ac (AC_PREREQ): Autoconf 2.60 is now released.
(AC_CHECK_HEADERS_ONCE): Use this new feature.
(AC_CHECK_FUNCS_ONCE): Likewise.
2006-06-23 Eric Blake
* doc/m4.texinfo: Quoting cleanup throughout - follow
autoconf-recommended style of one level of quote per parenthesis
in the normal case. Adjust error messages to match GNU coding
standards (and to allow 'make check' to pass again).
(Quoted strings, Inhibiting Invocation): Turn more examples into
tests.
(Comments): Resolve FIXME by adding example.
(Define): Add example about underquoting.
(Defn): Add example about use of $0.
(Indir, Format): Resolve FIXME done in last commit.
(Ifelse): Add example about creating blind macro.
(Debugging): Fix grammar.
(Dnl): Add example about dnl with arguments.
(M4wrap): Be explicit that LIFO order is non compliant, and will
change in m4 2.0.
(Undivert): Resolve FIXME by adding example.
(Frozen files): Document that m4wrap and sysval will not work
consistently until m4 2.0.
(Incompatibilities): Document another POSIX compliance bug, this
time with changequote. Document a traditional incompatibility
with partial input spanning file boundaries.
Make error messages more consistent with GNU coding standards -
start with lower case, and don't end sentence with punctuation.
* src/debug.c (trace_pre): Update message wording.
* src/eval.c (evaluate, cmp_term, shift_term, mult_term):
Likewise.
* src/freeze.c (produce_frozen_state, issue_expect_message),
(reload_frozen_state): Likewise.
* src/input.c (push_string_init, pop_init, init_macro_token),
(peek_input, next_char_1, set_word_regexp, next_token): Likewise.
* src/m4.c (stackovf_handler, main): Likewise.
* src/macro.c (expand_token, expand_argument, call_macro),
(expand_macro): Likewise.
* src/output.c (make_room_for, output_text, insert_file),
(freeze_diversions): Likewise.
* src/symtab.c (symtab_init, lookup_symbol): Likewise.
* src/builtin.c (builtin_tab): Make format and indir blind.
(substitute): Prefer "Warning:" vs. "ERROR:" in messages.
* NEWS: Mention the change to builtins.
2006-06-22 Eric Blake
Robustify frozen file format.
* src/freeze.c (reload_frozen_state): Add GET_DIRECTIVE helper
macro. Require V first, and only accept it once. For F, use
placeholder if builtin is not found, rather than warning.
* src/m4.h (m4_placeholder): New prototype.
* src/builtin.c: Unify error message style.
(m4_placeholder): New function, warn if invoked.
(builtin_tab): Add m4_placeholder.
(m4_defn): Warn if placeholder is encountered.
(find_builtin_by_addr): Handle placeholder.
(find_builtin_by_name): Return placeholder on failure.
(m4_builtin): Treat placeholder as undefined.
* doc/m4.texinfo (Frozen files): Document changes in V and F.
* NEWS: Document this change.
Reported by Bruno Haible.
* doc/m4.texinfo: Whitespace cleanup. TABs are evil in texinfo.
(tabchar): New macro, so that 'make check' still works.
(Invoking m4): Document that ignored compatibility options -B, -S,
and -T each consume an argument.
* checks/get-them: Honor @tabchar{}.
Avoid compiler warnings during -DDEBUG.
* src/m4.h (M4_GNUC_ATTRIBUTE, M4_GNUC_UNUSED): New macros.
[DEBUG]: Also imply DEBUG_OUTPUT and DEBUG_STKOVF.
* src/input.c (print_token) [DEBUG_INPUT]: Use correct format.
(lex_debug) [DEBUG_INPUT]: Fix to compile. Mark unused.
(next_token) [DEBUG_INPUT]: Print before returning.
* src/path.c (include_dump) [DEBUG_INCL]: Mark unused.
* src/symtab.c (symtab_debug) [DEBUG_SYM]: Mark unused.
Avoid mkstemp bugs on various platforms.
* m4/gnulib-cache.c: Augment with gnulib-tool --import mkstemp.
* src/output.c [! HAVE_MKSTEMP]: Delete.
* configure.ac (AC_CHECK_FUNCS): Don't check for mkstemp.
* src/m4.h (mkstemp) [! HAVE_MKSTEMP]: Prototype, if needed.
* NEWS: Document this.
* Makefile.am (EXTRA_DIST): Distribute gnulib-cache.m4.
Reported by Bruno Haible.
2006-06-21 Eric Blake
Avoid obsolete sigstack when POSIX sigaltstack is available.
* src/m4.c: Blindly assume signal.h, since stackovf.c and gnulib
do likewise.
* configure.ac (AC_CHECK_HEADERS): Likewise.
(AC_CHECK_TYPES): New check for siginfo_t, since siginfo.h is
obsolete and most hosts now have it in signal.h.
(AC_CHECK_MEMBERS): New check for sigaction.sa_sigaction.
(AC_CACHE_CHECK): Cache decision to use stackovf.
(AC_EGREP_HEADER): Switch to AC_CHECK_TYPES.
* src/stackovf.c (DEBUG_STACKOVF): Remove unused define.
(SA_RESETHAND, SA_SIGINFO): Provide fallback definitions, to
simplify later code.
(PARAM_STACKOVF, PARAM_NOSTACKOVF): Move further away from NULL,
in case of dereferencing a member of a NULL pointer.
(sigsegv_handler) [HAVE_STRUCT_SIGACTION_SA_SIGACTION]: Define a
POSIX handler.
(setup_stackovf_trap): Use NULL instead of 0 for pointers, use
EXIT_FAILURE in error, indent preprocessor directives.
[HAVE_SIGALTSTACK && HAVE_SIGINFO_T]: Depend on siginfo_t, not
siginfo.h.
[HAVE_SIGACTION && defined SA_ONSTACK]: Prefer POSIX handler.
Reported by Santiago Vila.
2006-06-19 Eric Blake
* THANKS: Update.
2006-06-18 Andreas Buening (tiny change)
* checks/Makefile.in (PATH_SEPARATOR): New macro.
(check, installcheck): Use it, for OS/2.
2006-06-18 Eric Blake
Consistently use "GNU M4" as package name, "m4" as executable
name.
* NEWS: Document previous fix.
* THANKS: Update.
* README: Fix grammar. Document that --enable-changeword is on
its last leg.
* doc/m4.texinfo (Top, Changeword): Likewise.
(Sysval): Enhance this test.
(History): Backport this section from CVS head, and update.
2006-06-18 Bruno Haible (tiny change)
Eric Blake
* src/builtin.c (WEXITSTATUS): Provide fallback definition.
(m4_esyscmd): Set sysval to 0xffff, to accomodate both
big-endian and little-endian wait status definitions.
(m4_sysval): Use WEXITSTATUS.
Reported by Andreas Buening.
2006-06-18 Eric Blake
* configure.ac (AC_INIT): Bump version number.
* NEWS: Describe changes in 1.4.4c.
2006-06-17 Eric Blake
Beta Release 1.4.4b:
* configure.ac (AC_INIT): Bump version number.
* NEWS: Describe changes since 1.4.4.
* Makefile.maint (cvs-news): Accomodate copyright line wrapping.
* Makefile.am (MAINTAINERCLEANFILES): Clean files added by
bootstrap.
* checks/Makefile.in (maintainer-clean): Add missing target.
* COPYING: Remove generated file from CVS.
2006-06-16 Eric Blake
* checks/Makefile.in (DISTFILES): Distribute wrapfifo.m4.
2006-06-15 Eric Blake
* checks/wrapfifo.m4: New file. Use it...
* doc/m4.texinfo (Incompatibilities): here, in a new test case to
demonstrate how to get POSIX behavior of m4wrap prior to m4 2.0.
* src/m4.h (to_uchar): New function.
* src/eval.c (eval_lex): Use it to avoid passing signed char to
isdigit, isalpha, isupper, islower, isspace, isalnum.
* src/builtin.c (expand_user_macro): Likewise.
* src/format.c (format): Likewise.
* src/macro.c (expand_argument): Likewise.
* NEWS: Document this security fix.
Message cleanup.
* src/symtab.c (lookup_symbol): Use invalid, not illegal.
* src/freeze.c (reload_frozen_state): Fix typo in message.
(produce_frozen_state): Standardize on builtin, not built-in.
* src/builtin.c (numeric_arg, bad_argc): Likewise.
* configure.ac (M4_EARLY, M4_INIT): Use gnulib.
(AC_PROG_RANLIB, AC_AIX, AC_MINIX, AC_CHECK_HEADERS),
(AC_FUNC_ALLOCA, AC_REPLACE_FUNCS): Avoid checks now done by
gnulib.
* Makefile.am (ACLOCAL_AMFLAGS): New entry, for gnulib.
* m4/gnulib-cache.m4: New file, from gnulib.
* bootstrap: Invoke gnulib-tool --update.
* src/m4.c (main): Cast away const.
* NEWS: Document that regex is updated.
* THANKS: Update.
2006-06-08 Eric Blake
* configure.ac (changeword): Work even when changeword is not a
macro.
(AC_PROG_AWK, AC_PROG_INSTALL, AC_PROG_MAKE_SET, AC_HEADER_STDC):
Delete; now done by automake.
(AC_ISC_POSIX, AC_C_CONST): Delete; now obsolete.
2006-06-07 Eric Blake
* lib/regex.c (bcmp_translate): Canonicalize type name.
* doc/Makefile.am (MAINTAINERCLEANFILES): Fix typo.
* configure.ac (changeword): Disable changeword for the creation
of configure, in case of bootstrapping with an m4 configured with
--enable-changeword.
Distribute a rudimentary man page.
* Makefile.am (SUBDIRS): Move doc after src so that 'm4 --help'
can feed help2man.
* doc/Makefile.am (man_MANS, EXTRA_DIST, MAINTAINERDISTCLEAN),
(SUFFIXES, m4.1): New macros and rules to build m4.1.
2006-06-06 Eric Blake
* lib/regex.c (re_match_2_internal, bcmp_translate): Avoid
compiler warnings at -O2.
* lib/getopt.c (_getopt_internal): Likewise.
Cleanup of previous patches.
* src/input.c (struct input_block): Remove traced member.
(push_macro, init_macro_token): Don't pass trace status around.
* src/m4.h (struct token_data): Remove traced member.
(struct symbol, struct builtin): Reduce unused space.
(TOKEN_DATA_FUNC): Simplify.
(TOKEN_DATA_FUNC_TRACED): Remove unused macro.
(push_macro, define_builtin): Remove unused parameter.
* src/builtin.c (define_builtin, builtin_init, define_macro),
(m4_defn): Don't pass trace status around.
* src/macro.c (expand_argument): Likewise.
* src/freeze.c (reload_frozen_state): Likewise.
* src/symtab.c: Whitespace cleanup.
* NEWS: Clean up wording.
* doc/m4.texinfo (Undefine, Dumpdef, Trace): Cleanup wording;
ensure tests actually expose bugs prior to today's patches.
Trace status of builtins is no longer inherited across
define(...,defn(...)). Fixes bug that autom4te had been working
around.
* src/builtin.c (define_builtin): Don't override trace status.
* doc/m4.texinfo (Trace): Add test for this.
* NEWS: Document this.
When changing macro definitions inside the arguments to the macro,
consistently preserve the old definition that was in effect before
argument collection, similar to the C pre-processor.
Reported by John Brzustowski.
* NEWS: Document this change.
* doc/m4.texinfo (Macro Arguments, Undefine, Dumpdef): Document
this policy, and add tests that expose core dumps prior to this
patch.
* src/m4.h (struct symbol): New members to track when a symbol is
still in use after removal from the symbol table.
(SYMBOL_PENDING_EXPANSIONS, SYMBOL_DELETED): Define.
(free_symbol): Prototype.
* src/macro.c (expand_macro): Track pending expansions of a
symbol. On completion, if a symbol is deleted and no longer
pending, free its memory.
* src/symtab.c (free_symbol): Export. Don't free memory if symbol
is still in use.
(lookup_symbol) : Create new entry when old entry
is still in use.
(lookup_symbol) : Mark entries still
in use as deleted and remove from the table without freeing
memory.
(symtab_print_list) [DEBUG_SYM]: More debug output.
* src/symtab.c (hack_all_symbols): Allow certain modifications of
the symbol table during traversal.
* src/builtin.c (set_trace): Replace SYMBOL_DELETE with
SYMBOL_POPDEF, since only the latter is safe with
hack_all_symbols.
Solve crash when passing "indir(`foo')" to "m4 -tfoo".
* src/symtab.c (lookup_symbol) :
Preserve placeholder when macro is being traced.
* src/builtin.c (m4_ifdef, m4_indir): A traced but undefined
symbol is not defined.
(set_trace): Remove placeholder when no longer traced.
(m4_traceon): On named traces, always reserve a slot in the
symbol table.
(m4_traceoff): Don't warn about untracing a nonexistent symbol.
* NEWS: Document new trace behavior.
* doc/m4.texinfo (Trace): Tracing by name now consistently works
no matter whether that macro is currently defined.
(Incompatibilities): Document differences between traditional and
GNU trace.
2006-06-04 Paul Eggert (tiny change)
Eric Blake
* src/m4.h (hash_table_size): Now size_t instead of int.
* src/m4.c (hash_table_size): Likewise.
(main): Adjust to this; use atol rather than atoi.
* src/symtab.c: Include , for CHAR_BIT.
(symtab_init, lookup_symbol, hack_all_symbols):
Use size_t for sizes and indexes, not int.
(symtab_print_list) [DEBUG_SYM]: Likewise.
(hash): Likewise. Don't case-fold in the hash function.
Shift by 7, not 3, for consistency with gnulib/lib/hash.c.
Don't assume hash word is 32 bits.
* NEWS: Document this change.
2006-06-04 Eric Blake
* src/symtab.c (symtab_debug, symtab_print_list) [DEBUG_SYM]: Fix
to allow compilation, for use in debugger.
(profiles, current_mode) [DEBUG_SYM]: New variables.
(show_profile, profile_strcmp) [DEBUG_SYM]: New methods for
determining hash table performance.
2006-05-31 Eric Blake
John Brzustowski
* src/input.c (input_stack): Delete; use current_input instead.
(wrapup_stack): Dynamically allocate, so that recursion is handled
properly.
(push_wrapup): Use current wrapup stack.
(pop_wrapup): Rotate wrapup stack to current, and create new
wrapup stack.
(input_init): Dynamically allocate stacks.
* NEWS: Update, now that recursive m4wrap can no longer cause
core dump.
2006-05-31 Eric Blake