1 2010-02-24 Eric Blake <eblake@redhat.com>
3 Release Version 1.4.14.
4 * gnulib: Update to latest.
5 * README: Increase libsigsegv recommendation.
6 * HACKING: Likewise. Tweak release instructions.
7 * NEWS: Mention the release.
9 Improve parsing example.
10 * doc/m4.texinfo (Input processing): Double-quote argument to
11 translit, for robustness.
13 Reported by Chris Penev.
15 2010-01-29 Eric Blake <ebb9@byu.net>
17 Document upcoming release.
18 * gnulib: Update to latest.
19 * doc/m4.texinfo (History): Mention 1.4.14.
21 2010-01-06 Eric Blake <ebb9@byu.net>
23 Use correct license on auxiliary documentation.
24 * gnulib: Update to latest.
25 * AUTHORS: Use GFDL 1.3, not 1.2.
30 * NEWS: Place under GFDL.
31 * cfg.mk (old_NEWS_hash): Update.
33 2010-01-05 Eric Blake <ebb9@byu.net>
35 Remove more TAB characters.
36 * THANKS: Use space for alignment.
37 * bootstrap: Likewise.
38 * checks/stackovf.test: Likewise.
39 * configure.ac: Likewise.
40 * src/builtin.c: Likewise. Also update some stale comments.
41 * src/debug.c: Likewise.
42 * src/eval.c: Likewise.
43 * src/format.c: Likewise.
44 * src/freeze.c: Likewise.
45 * src/input.c: Likewise.
48 * src/macro.c: Likewise.
49 * src/output.c: Likewise.
50 * src/path.c: Likewise.
51 * src/symtab.c: Likewise.
53 Clarify minimum bootstrap requirements.
54 * bootstrap: Avoid out-of-date duplicated data.
56 Security fix by requiring newer automake features.
57 * configure.ac (AM_INIT_AUTOMAKE): Add dist-xz, color-tests,
58 parallel-tests, and silent-rules.
59 (AC_PREREQ): Bump autoconf requirement to 2.62, per automake.
60 * HACKING: Update minimum requirements.
61 * NEWS: Document the fix.
63 Drop hard-coding of GPG id.
64 * gnulib: Update to latest.
65 * m4/gnulib-cache.m4: Regenerate.
66 * cfg.mk (gpg_key_ID): Delete, now that maint.mk provides a
68 (update-copyright-env): Don't let environment interfere with wrap
71 2010-01-01 Eric Blake <ebb9@byu.net>
73 Update copyright year.
74 All files impacted, via 'make update-copyright'. Additionally:
75 * .gitignore: Ignore backup files.
77 2009-12-29 Eric Blake <ebb9@byu.net>
79 Document new indentation policy.
80 * HACKING: Document indentation policy.
81 * .x-sc_prohibit_tab_based_indentation: New file.
82 * cfg.mk (sc_prohibit_tab_based_indentation): New rule.
83 * Makefile.am (syntax_check_exceptions): New macro.
84 (EXTRA_DIST): Distribute exception files, and .prev-version.
86 Switch to indentation by space, not tab.
87 * .gitmodules: Convert leading tabs to spaces.
89 * bootstrap: Likewise.
90 * c-boxes.el: Likewise.
91 * checks/check-them: Likewise.
92 * checks/get-them: Likewise.
93 * checks/stackovf.test: Likewise.
94 * configure.ac: Likewise.
95 * src/builtin.c: Likewise.
96 * src/debug.c: Likewise.
97 * src/eval.c: Likewise.
98 * src/format.c: Likewise.
99 * src/freeze.c: Likewise.
100 * src/input.c: Likewise.
101 * src/m4.c: Likewise.
102 * src/m4.h: Likewise.
103 * src/macro.c: Likewise.
104 * src/output.c: Likewise.
105 * src/path.c: Likewise.
106 * src/symtab.c: Likewise.
108 Update to latest gnulib.
110 * m4/gnulib-cache.m4: Import xoset.
111 * src/output.c (includes): Ensure that gnulib oset usage will
112 call xalloc_die on memory failure.
113 * build-aux/.cvsignore: Regenerate.
114 * build-aux/.gitignore: Likewise.
116 2009-11-28 Eric Blake <ebb9@byu.net>
118 Work around BSD getopt bug.
120 * doc/m4.texinfo (Command line files): Add test.
122 Use fastmap for better regex performance.
123 * src/input.c (word_start): Delete.
124 (pop_wrapup): Free memory on exit.
125 (set_word_regexp): Compile a fastmap instead.
126 (peek_token, next_token): Use the fastmap.
128 2009-11-26 Eric Blake <ebb9@byu.net>
130 Ignore write failures before stack overflow exit.
131 * m4/gnulib-cache.m4: Import ignore-value module.
132 * src/m4.c (fault_handler): Use it to avoid compiler warning.
134 2009-11-25 Eric Blake <ebb9@byu.net>
136 Allow use of compiler warnings.
137 * m4/gnulib-cache.m4: Import manywarnings module.
138 * configure.ac (WERROR_CFLAGS, WARN_CFLAGS): New variables.
139 * src/Makefile.am (AM_CFLAGS): Use them.
140 * Makefile.am (DISTCHECK_CONFIGURE_FLAGS): Turn on warnings during
142 * src/m4.h (M4_GNUC_NORETURN): New macro.
143 (trace_post): Delete unused parameter.
144 * src/m4.c (usage): Mark as noreturn.
145 (main): Remove unused parameter.
146 * src/debug.c (trace_post): Likewise.
147 (trace_pre): Cover all enum values.
148 * src/symtab.c (lookup_symbol): Likewise.
149 * src/builtin.c (define_macro, m4_dumpdef): Likewise.
150 (m4_define, m4_undefine, m4_pushdef, m4_popdef, m4_sysval)
151 (m4_divert, m4_undivert, m4_dnl, m4_changequote, m4_changecom)
152 (m4_changeword, m4_syscmd, m4_include, m4_sinclude, m4_m4exit)
153 (m4_debugmode, m4_debugfile, m4_placeholder): Mark unused
155 (mkstemp_helper): Use parameter.
156 (substitute): Avoid signed vs. unsigned comparison.
157 * src/format.c (arg_int, arg_long, arg_double): Likewise.
158 * src/input.c (next_token): Likewise.
159 * src/output.c (freeze_diversions): Likewise.
160 (m4_tmpname): Allow C++ compilation.
161 * src/freeze.c (produce_frozen_state, GET_NUMBER): Use correct
163 * src/macro.c (call_macro): Cover all enum values.
164 (expand_macro): Update caller.
165 * src/path.c (m4_fopen): Remove unused parameter.
166 (m4_path_search): Update caller.
168 Silence syntax-check warnings.
169 * src/m4.h (STREQ): New macro.
170 * src/builtin.c (find_builtin_by_name): Use it.
171 * src/input.c (set_word_regexp): Likewise.
172 * src/m4.c (process_file): Likewise.
173 (main): Consistently spell warning, and mark output strings.
174 Avoid unsafe parsing functions.
175 (process_file): Mark output strings.
176 * src/output.c (make_diversion): Likewise.
177 * src/format.c (arg_int, arg_long, arg_double): New helpers.
178 (ARG_INT, ARG_LONG, ARG_DOUBLE): Use them to detect parse errors.
179 * BACKLOG: Avoid whitespace problems.
182 * examples/esyscmd.m4: Likewise.
183 * examples/file.m4: Likewise.
184 * examples/fstab.m4: Likewise.
185 * examples/patsubst.m4: Likewise.
187 Use gnulib maintainer-makefile module.
188 * m4/gnulib-cache.m4: Import maintainer-makefile module.
189 * cfg.mk (local-checks-to-skip): Drop changelog-check; add
190 sc_cast_of_x_alloc_return_value.
191 (gnulib_dir, gnu_rel_host, url_dir_list): Delete; provided by
193 (config_h_header, old_NEWS_hash): New macros.
194 * .prev-version: New file.
195 * maint.mk: Remove from version control; use gnulib instead.
196 * .gitignore: Update.
201 * m4/gnulib-cache.m4: Use --makefile-name.
202 * lib/Makefile.am: Wrap the gnulib-generated file.
203 * tests/Makefile.am: Likewise.
204 * .gitignore: Track our wrappers.
205 * doc/m4.texinfo (Improved capitalize): Fix typo.
207 2009-10-05 Eric Blake <ebb9@byu.net>
211 * m4/gnulib-cache.m4: Import gnu-web-doc-update module.
212 * build-aux/.gitignore: Ignore new file.
213 * build-aux/.cvsignore: Likewise.
215 2009-08-20 Eric Blake <ebb9@byu.net>
219 * AUTHORS: Mention recent copyright assignment.
221 2009-08-17 Eric Blake <ebb9@byu.net>
223 Enhance test with closed descriptors.
224 * doc/m4.texinfo (Command line files): Enhance test from
225 2009-07-20 to actually test the bug being fixed.
227 Update copyright year.
228 * AUTHORS: Run UPDATE_COPYRIGHT_FORCE=1 make update-copyright.
230 * Makefile.am: Likewise.
232 * acinclude.m4: Likewise.
233 * c-boxes.el: Likewise.
235 * checks/Makefile.in: Likewise.
236 * checks/check-them: Likewise.
237 * checks/stackovf.test: Likewise.
238 * doc/Makefile.am: Likewise.
239 * examples/Makefile.am: Likewise.
240 * src/Makefile.am: Likewise.
241 * src/debug.c: Likewise.
242 * src/eval.c: Likewise.
243 * src/freeze.c: Likewise.
244 * src/m4.h: Likewise.
245 * src/macro.c: Likewise.
246 * src/path.c: Likewise.
247 * src/symtab.c: Likewise.
249 Prepare to bulk update copyright year.
251 * m4/gnulib-cache.m4: Import update-copyright and vc-list-files
253 * maint.mk: Fix copyright.
254 (build_aux, VC_LIST, VC_LIST_EXCEPT, update-copyright): New macros
255 and rules borrowed from gnulib.
256 * cfg.mk (update-copyright-env): Enforce longhand behavior.
257 * .cvsignore: Reflect these changes.
258 * .gitignore: Likewise.
259 * .x-update-copyright: New file.
261 2009-08-14 Eric Blake <ebb9@byu.net>
263 Explicitly request GNU getopt extensions.
265 * m4/gnulib-cache.m4: Use getopt-gnu, not obsolete getopt module.
267 2009-07-22 Eric Blake <ebb9@byu.net>
269 Fix testsuite on Solaris.
270 * doc/m4.texinfo (Command line files): Tolerate different spelling
272 * src/builtin.c (m4_esyscmd): Clear errno before reaping.
274 2009-07-21 Eric Blake <ebb9@byu.net>
276 Fix testsuite on mingw.
279 2009-07-20 Eric Blake <ebb9@byu.net>
281 Pick up gnulib fixes for sub-process execution.
283 * doc/m4.texinfo (Command line files): Add test; regression
284 introduced 2009-03-05.
285 * NEWS: Document the change.
287 Avoid cygwin 1.7 crash with closed stdout.
289 * doc/m4.texinfo (Command line files): Add test; regression
290 introduced 2008-07-17.
291 * NEWS: Document the change.
293 A status of 127 does not always imply esyscmd failure.
294 * src/builtin.c (m4_esyscmd): Silence gnulib message; regression
295 introduced 2009-03-05.
296 * doc/m4.texinfo (Sysval): Test this.
297 * NEWS: Document the change.
299 2009-06-25 Eric Blake <ebb9@byu.net>
301 Fix description of limits on diversions.
302 * doc/m4.texinfo (Diversions): Fix grammar. Be less pessimistic
305 Reported by Elias Benali.
307 2009-06-17 Eric Blake <ebb9@byu.net>
309 Update to latest gnulib.
310 * gnulib: Import fixes for Interix compilation.
312 Reported by Jay Krell.
314 2009-05-22 Eric Blake <ebb9@byu.net>
316 Update to latest gnulib.
317 * gnulib: Import fixes for AIX compilation.
319 Reported by Jens Rehsack.
321 2009-04-13 Eric Blake <ebb9@byu.net>
324 * doc/m4.texinfo (copying): Complete transition to GFDL 1.3,
326 Reported by Santiago Vila.
328 2009-04-01 Eric Blake <ebb9@byu.net>
330 Release Version 1.4.13.
331 * NEWS: Mention the release.
333 2009-03-31 Eric Blake <ebb9@byu.net>
335 Tweak submodule instructions.
336 * HACKING: Improve directions.
337 * gnulib: Update to latest version.
339 2009-03-23 Eric Blake <ebb9@byu.net>
341 Don't force file overwrites during bootstrap.
342 * bootstrap: Ensure that rerunning bootstrap doesn't alter tree.
344 Drop dist-lzma, now that xz replaces lzma.
345 * configure.ac (AM_INIT_AUTOMAKE): Drop dist-lzma. Until a stable
346 automake release includes dist-xz, the release process will just
347 manually create a .xz tarball.
348 * gnulib: Update to latest gnulib.
350 2009-03-19 Eric Blake <ebb9@byu.net>
352 Exploit git submodule by adding appropriate symlinks.
353 * bootstrap: No longer copy files from gnulib.
354 * COPYING: Change to symlink pointing into gnulib.
356 * build-aux/compile: Likewise.
357 * build-aux/config.guess: Likewise.
358 * build-aux/config.sub: Likewise.
359 * build-aux/depcomp: Likewise.
360 * build-aux/install-sh: Likewise.
361 * build-aux/mdate-sh: Likewise.
362 * build-aux/missing: Likewise.
363 * build-aux/texinfo.tex: Likewise.
364 * .cvsignore: Reflect these changes.
365 * .gitignore: Likewise.
366 * build-aux/.cvsignore: New file.
367 * build-aux/.gitignore: Likewise.
369 2009-03-18 Eric Blake <ebb9@byu.net>
371 Make gnulib a git submodule.
372 * .gitmodules: New file.
373 * gnulib: Record which version of gnulib has been tested.
374 * bootstrap: Aid in submodule usage.
375 * cfg.mk (gnulib_dir): Alter default location of gnulib.
376 * HACKING: Mention how to use submodule.
378 Use latest compile script, even with stable automake.
379 * bootstrap: Also sync build-aux/compile.
381 2009-03-12 Eric Blake <ebb9@byu.net>
383 Fix awk script portability.
384 * checks/get-them: In gsub, properly escape {. Close all files
386 Reported by Gary V. Vaughan.
388 2009-03-05 Eric Blake <ebb9@byu.net>
390 Allow configuration choice in syscmd shell.
391 * configure.ac (SYSCMD_SHELL): New test.
392 * src/builtin.c (m4_syscmd, m4_esyscmd): Use it to avoid
393 hard-coding the shell location.
394 * doc/m4.texinfo (Syscmd, Esyscmd): Document this.
395 * README: Document new configure option.
398 Remove cruft now that gnulib modules do the work.
399 * configure.ac (M4_cv_func_system_consistent): Delete.
400 * src/builtin.c (M4SYSVAL_EXITBITS, M4SYSVAL_TERMSIGBITS):
403 Use gnulib pipe module instead of popen(3).
404 * m4/gnulib-cache.m4: Import pipe and wait-process modules.
405 * src/builtin.c (m4_esyscmd): Rewrite with pipe module.
406 Resolves a failure on AIX, reported by Gary V. Vaughan.
408 Use gnulib execute module instead of system(3).
409 * m4/gnulib-cache.m4: Import execute module.
410 * src/builtin.c (m4_sysval): Move computation...
411 (m4_esyscmd): ...into caller.
412 (m4_syscmd): Rewrite with execute module.
413 Resolves a failure on AIX, reported by Gary V. Vaughan.
415 2009-03-03 Eric Blake <ebb9@byu.net>
417 Try to tolerate spaces in directory names in testsuite.
418 * doc/m4.texinfo (Diversions, Using frozen files): Provide shell
419 quoting, in case __program__ contains spaces.
421 Improve web-manual maintainer rule.
422 * maint.mk (web-manual): Work with VPATH builds. Factor
423 package-specific detail...
424 * cfg.mk (manual_title): ...to new variable.
426 2009-02-26 Eric Blake <ebb9@byu.net>
428 Make bootstrap easier on Solaris.
429 * bootstrap: Add GNULIB_SRCDIR. Useful when a wrapper script
430 gnulib-tool exists earlier on the path to work around /bin/sh
431 failure in parsing $GNULIB_SRCDIR/gnulib-tool.
433 2009-02-19 Eric Blake <ebb9@byu.net>
435 Fix regression in translit.
436 * src/builtin.c (m4_translit): Use correct comparison.
437 * doc/m4.texinfo (Translit): Enhance test.
439 Speed up input engine, by searching for quotes by buffer.
440 * src/input.c (struct input_block): Add end pointer to string.
441 (push_string_finish, push_wrapup): Populate it.
442 (next_token): For quotes, attempt a buffer search.
443 * NEWS: Document this.
445 2009-02-18 Eric Blake <ebb9@byu.net>
447 Speed up translit when from argument is short.
448 * m4/gnulib-cache.m4: Import memchr2 module.
449 * src/builtin.c (m4_translit): Use memchr2 when possible.
450 * doc/m4.texinfo (Translit): Add tests.
451 * NEWS: Document this.
453 Update copyright year.
454 * THANKS: Mention 2009 in copyright year.
456 Prefer buffer over byte operations.
457 * src/format.c (expand_format): Use strchr for speed.
458 * src/builtin.c (substitute, expand_user_macro): Likewise.
460 Speed up esyscmd with buffer reads.
461 * src/builtin.c (m4_esyscmd): Read blocks directly into obstack,
462 rather than repeatedly reading bytes. Detect read errors.
464 Avoid risk of stack overflow.
465 * src/output.c (insert_file): Avoid stack allocation of large
467 (freeze_diversions): Avoid spurious semicolon.
469 2009-02-16 Eric Blake <ebb9@byu.net>
471 Avoid test failure due to different errno.
472 * doc/m4.texinfo (Using frozen files): Ignore stdout, since
473 hardened systems can prevent attempts to read /.
475 Reported by Ronny Peine, in Gentoo bug 259184.
477 Avoid tests that make no sense, because m4 is single-threaded.
478 * m4/gnulib-cache.m4: Avoid lock-tests and tls-tests.
480 2009-02-12 Eric Blake <ebb9@byu.net>
482 Avoid quadratic code when walking definition stack.
483 * examples/stack_sep.m4: Use linear, not quadratic
485 * doc/m4.texinfo (Improved copy): Fix documentation and add test,
486 based on recent autoconf bug fix.
488 2009-01-24 Eric Blake <ebb9@byu.net>
490 Add URLs to --help output.
491 * src/m4.c (usage): Use enhanced version-etc features.
493 2009-01-02 Eric Blake <ebb9@byu.net>
495 Use nicer email address in web manual.
496 * maint.mk (web-manual): Use new option in gendocs.sh.
498 Nuke xdelta diffs at release time; no one reported using them.
499 * maint.mk (got-xdelta, delta-xdelta): Delete.
502 2009-01-01 Eric Blake <ebb9@byu.net>
504 Update copyright year.
505 * NEWS: M4 1.4.13 will occur in 2009.
506 * doc/m4.texinfo (History): Likewise.
508 2008-12-24 Eric Blake <ebb9@byu.net>
510 Prepare for eventual release.
511 * doc/m4.texinfo (History): Mention 1.4.13.
513 2008-12-22 Eric Blake <ebb9@byu.net>
515 Make --debugfile argument optional.
516 * src/builtin.c (m4_debugfile): Make error message consistent.
517 * src/m4.c (long_options): Make the argument optional, to allow
518 setting debug file back to stderr.
519 (main): Make --debugfile order-dependent.
520 (usage): Document this.
521 * doc/m4.texinfo (Debugging options): Likewise.
525 * doc/m4.texinfo (Operation modes, Preprocessor features)
526 (Limits control, Frozen state, Debugging options): Use lower case
528 (Improved copy): Use @code, not @var, as appropriate.
530 2008-12-18 Eric Blake <ebb9@byu.net>
532 Document optimized forloop.
533 * doc/m4.texinfo (Improved forloop): Mention alternate style that
534 avoids define overhead.
535 * examples/forloop3.m4: New file.
536 * examples/Makefile.am (EXTRA_DIST): Distribute it.
538 Deal with M4 1.4.x limitation on builtin tokens.
539 * doc/m4.texinfo (Composition): Mention limitation on curry.
540 (Improved copy): New node.
541 * examples/stack_sep.m4: New file.
542 * examples/Makefile.am (EXTRA_DIST): Distribute it.
544 Document copy composite using stack_foreach and curry.
545 * doc/m4.texinfo (Stacks): New node, to document pushdef stack
547 (Ifelse): Move define_blind...
548 (Composition): ...to this new node. Document currying, then use
549 it to implement copy and rename.
550 * examples/curry.m4: New file.
551 * examples/stack.m4: Likewise.
552 * examples/Makefile.am (EXTRA_DIST): Distribute them.
554 2008-12-17 Eric Blake <ebb9@byu.net>
556 Don't override signal handlers installed by c-stack.
557 * src/m4.c (main): Reorder installation of signal handlers, so we
558 don't trash a SIGBUS handler installed by c-stack. Also provide a
559 SIGSEGV fallback, for platforms where c-stack combined with
560 libsigsegv uses something lower level than SIGSEGV.
562 2008-12-12 Eric Blake <ebb9@byu.net>
564 Double size of temp file cache.
565 * src/output.c (tmp_file, tmp_file_owner): Split...
566 (tmp_file1, tmp_file2, tmp_file1_owner, tmp_file2_owner): ...into
568 (tmp_file2_recent): New variable.
569 (m4_tmpopen, m4_tmpclose, m4_tmpremove, m4_tmprename)
570 (output_exit): Adjust callers.
572 Use fewer seeks on cached files.
573 * src/output.c (m4_tmpfile): Use write, not append mode.
574 (m4_tmpopen): Add parameter to decide when to skip seeks.
575 (m4_tmprename, make_diversion, insert_diversion_helper)
576 (freeze_diversions): Adjust callers.
578 Cache most recently spilled diversion.
579 * src/output.c (tmp_file, tmp_file_owner): New variables, for
580 1-deep cache of spilled diversions.
581 (m4_tmpfile): Open in append mode, since we might revisit
582 diversion without closing it now.
583 (m4_tmpopen): Check cache first.
584 (m4_tmpclose): Update cache, rather than closing. Add parameter.
585 (m4_tmpremove): Close cache before removing.
586 (m4_tmprename): Deal with open files when renaming.
587 (output_exit): Close cache before exiting.
588 (make_room_for, make_diversion, insert_diversion_helper): Adjust
590 * configure.ac (RENAME_OPEN_FILE_WORKS): New configure test.
592 Correctly track size of in-memory diversions.
593 * src/output.c (insert_diversion_helper): Correctly track total
594 in-memory diversion size after undivert.
596 Avoid quadratic behavior for some cases of divert/undivert.
597 * src/output.c (struct m4_diversion): Improve comments.
598 (m4_tmpname, make_diversion): Strengthen preconditions.
599 (m4_tmprename): New function.
600 (output_init, output_exit): Move after internal functions.
601 (make_room_for): Don't bother copying uninitialized bytes.
602 (insert_diversion_helper): Transfer metadata, rather than copying
603 contents, when undiverting into a previously unused diversion.
604 * src/m4.h (includes): Add assert.h.
605 * doc/m4.texinfo (Diversions): Add test.
606 (Undivert): Enhance test.
607 * NEWS: Document the speedup.
609 2008-12-12 Eric Blake <ebb9@byu.net>
611 Upgrade to FDL 1.3, keep COPYING in repository.
612 * Makefile.am (MAINTAINERCLEANFILES): Don't remove COPYING.
613 * .cvsignore: Don't ignore it.
614 * .gitignore: Likewise.
615 * COPYING: Store in repository, per automake 1.10.2
617 * m4/gnulib-cache.m4: Replace fdl module with fdl-1.3.
618 * doc/m4.texinfo (GNU Free Documentation License): Upgrade
620 * doc/Makefile.am (m4_TEXINFOS): Likewise.
621 * NEWS: Mention the documentation license change.
623 2008-10-10 Eric Blake <ebb9@byu.net>
625 Release Version 1.4.12.
626 * NEWS: Mention the release.
628 2008-10-06 Eric Blake <ebb9@byu.net>
630 Work around Solaris' sed inability to process NUL.
631 * checks/check-them (SED): Allow user to override.
633 2008-09-25 Eric Blake <ebb9@byu.net>
635 Tweak error message on command line failure.
636 * src/m4.c (process_file): Match wording of include builtin.
637 * src/freeze.c (produce_frozen_state): Likewise.
638 * m4/gnulib-cache.m4: Regenerate.
639 * doc/m4.texinfo (Command line files, Using frozen files): Update
642 2008-09-24 Eric Blake <ebb9@byu.net>
644 Unify error handling for reading directories.
645 * src/path.c (m4_path_search): Factor open attempts...
646 (m4_fopen): ...into new function, to reject directories.
647 * doc/m4.texinfo (Include): Document that directories cannot be
650 Avoid bugs on platforms that mishandle trailing /.
651 * m4/gnulib-cache.m4: Import fopen module.
652 * doc/m4.texinfo (Command line files, Include): Add tests.
653 (Using frozen files): This test now works on mingw.
654 * checks/check-them (examples): Expand xerr to allow ignoring
655 error output because of differences in platform errno values.
657 2008-09-22 Eric Blake <ebb9@byu.net>
659 Support alternate path separator.
660 * m4/gnulib-cache.m4: Import dirname and filenamecat modules.
661 * src/m4.h (includes): Add headers.
662 * src/path.c (m4_path_search): Avoid literal use of '/' as path
663 separator and when detecting absolute paths.
665 2008-09-16 Eric Blake <ebb9@byu.net>
667 Fix bootstrap for Solaris /bin/sh.
668 * bootstrap: Avoid shell quoting pitfall.
670 2008-09-01 Eric Blake <ebb9@byu.net>
672 Fix building with -DDEBUG=1.
673 * src/input.c (lex_debug) [DEBUG_INPUT]: Fix compilation failure.
674 * src/symtab.c (symtab_debug) [DEBUG_SYM]: Likewise.
675 * src/m4.c (includes) [DEBUG_STKOVF]: Likewise.
676 Reported by Tom G. Christensen.
678 2008-09-01 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
680 Typos in source code comments.
681 * src/builtin.c: Fix typos in comments.
682 * src/input.c: Likewise.
684 2008-08-29 Eric Blake <ebb9@byu.net>
686 Fix manual date information.
687 * doc/m4.texinfo: UPDATED refers to the day the manual was built,
688 not the release date of M4.
689 Based on a bison patch by Akim Demaille.
691 2008-08-27 Eric Blake <ebb9@byu.net>
694 * doc/m4.texinfo (Invoking m4): 'm4 -d+f' is not supported in this
697 2008-08-25 Eric Blake <ebb9@byu.net>
699 Update recommendation now that libsigsegv 2.6 is released.
700 * NEWS: Recommend libsigsegv 2.6+.
703 2008-08-21 Eric Blake <ebb9@byu.net>
705 Fix crash with traced defn(undef), regression from 2007-08-09.
706 * src/builtin.c (m4_defn): Handle traced but undefined macros.
707 * doc/m4.texinfo (Trace): Test it.
710 2008-08-18 Eric Blake <ebb9@byu.net>
712 Fix crash with 'm4 -N9', regression from 2006-09-14.
713 * src/m4.c (main): Add missing break.
716 2008-08-15 Eric Blake <ebb9@byu.net>
718 Documentation updates.
719 * doc/m4.texinfo (History): Mention 1.4.12.
720 (Builtin): Enhance regression tests.
721 (Debug Levels): Mention effect of -l. Enhance regression tests.
722 (Incompatibilities): Fix typo, and mention trace output.
723 (Improved capitalize): Simplify example.
725 Avoid compiler warning.
726 * src/builtin.c (m4_ifelse): Avoid unused variable.
728 Reported by Tom G. Christensen.
730 Improve 'git diff' of manual source.
731 * .gitattributes (*.texi*): Add diff attribute.
732 * bootstrap: Tell git how to use it.
733 Inspired by Jim Meyering's similar patch for coreutils.
735 2008-08-11 Eric Blake <ebb9@byu.net>
737 Avoid triggering OS/2 bug in testsuite.
738 * doc/m4.texinfo (Mkstemp): Don't assume test(1) status is 1.
739 Reported by Elbert Pol.
741 2008-08-03 Eric Blake <ebb9@byu.net>
743 Increase ulimit stack value to be larger than SIGSTKSZ.
744 * checks/stackovf.test (tmpfile): Use 300K rather than 50K, since
745 at least OpenBSD's sh died early from an undersized stack limit.
747 2008-07-17 Eric Blake <ebb9@byu.net>
749 Remove redundant examples/stackovf.sh.
750 * examples/stackovf.sh: Delete, now that checks has better
752 * examples/Makefile.am (EXTRA_DIST): Don't distribute it.
754 2008-07-17 Eric Blake <ebb9@byu.net>
756 Adjust to c-stack changes in gnulib.
757 * src/Makefile.am (m4_LDADD): Use libsigsegv when available and
758 necessary, via LIBCSTACK.
759 * src/m4.c (main) [DEBUG_STACKOVF]: Make it easier to test fault
761 * checks/stackovf.test: New file.
762 * checks/Makefile.in (CHECKS): Add stackovf.test, and factor...
763 (DOC_CHECKS): ...generated documentation tests into new macro.
764 (DISTFILES): Distribute stackovf.test.
765 * checks/check-them: Special-case stackovf.test.
766 * NEWS: Enhance the NEWS item for -L improvements.
767 * README: Mention the optional dependency.
768 * HACKING: Mention maintenance burden added by libsigsegv.
770 2008-06-21 Eric Blake <ebb9@byu.net>
772 Use new sigaction module.
773 * m4/gnulib-cache.m4: Import sigaction module.
774 * src/m4.c (main): Drop signal() calls.
776 2008-06-18 Eric Blake <ebb9@byu.net>
778 Also trap SIGILL, SIGFPE, SIGBUS.
779 * m4/gnulib-cache.m4: Import strsignal module.
780 * src/m4.c (main): Register more handlers, and prefer sigaction
782 (SIGBUS, NSIG): Provide fallback when lacking.
783 (signal_message): New variable, to keep async-safety.
784 (fault_handler): Display faulting signal description.
785 * configure.ac (gl_DISABLE_THREADS): Request gnulib modules to
786 optimize for single-threaded operation.
788 2008-06-06 Eric Blake <ebb9@byu.net>
790 Inform users what to do in case of programmer error.
791 * src/m4.h (EXIT_INTERNAL_ERROR): New macro.
792 * configure.ac (AC_TYPE_SIGNAL): Delete, now that we assume C89.
793 * src/m4.c (fault_handler): New method.
794 (program_error_message): New variable, for async-safety.
795 (main): Print bug reporting address rather than dump core on any
796 failed assertions or detected non-stack-overflow faults.
798 2008-06-06 Eric Blake <ebb9@byu.net>
800 Replace stackovf with gnulib c-stack.
801 * m4/gnulib.cache.m4: Import c-stack module.
802 * configure.ac (AC_CHECK_HEADERS_ONCE): Remove check for
803 siginfo.h, sys/wait.h.
804 (AC_CHECK_TYPES): Likewise for siginfo_t.
805 (AC_CHECK_MEMBERS): Likewise for sa_sigaction, ss_sp.
806 (AC_CHECK_FUNCS_ONCE): Likewise for sigaction, sigaltstack,
807 sigstack, sigvec, strerror.
808 (M4_cv_use_stackovf): Likewise for stack overflow detection.
809 * src/Makefile.am (m4_SOURCES): Don't build stackovf.c.
810 * src/stackovf.c: Delete.
811 * src/m4.h (setup_stackovf_trap): Delete.
812 * src/m4.c (stackovf_handler): Delete.
813 (main): Use c_stack_action instead of setup_stackovf_trap. If
814 stack overflow is detectable, don't limit -L artificially.
815 (usage): Document unlimited default on supported systems.
816 * doc/m4.texinfo (Limits control): Document new default nesting
818 * NEWS: Document this change.
820 2008-07-30 Eric Blake <ebb9@byu.net>
822 Avoid regressions in trace and comment output.
823 * doc/m4.texinfo (Trace): Add test.
824 (Comments): Likewise.
826 2008-07-28 Eric Blake <ebb9@byu.net>
828 Optimize iteration examples.
829 * examples/forloop2.m4: Avoid excess indir, by passing current
830 counter value as parameter.
831 * examples/foreachq3.m4: Avoid unneeded ifelse, by injecting an
833 * doc/m4.texinfo (Improved forloop, Improved foreach): Update the
834 documentation to match.
836 2008-07-26 Eric Blake <ebb9@byu.net>
838 Give example for O(n) foreach on m4 1.4.x.
839 * examples/foreachq4.m4: New file.
840 * examples/Makefile.am (EXTRA_DIST): Distribute it.
841 * doc/m4.texinfo (Improved foreach): Document linear foreach with
842 m4 1.4.5 and greater.
844 2008-07-17 Eric Blake <ebb9@byu.net>
846 Fix missing copyright notices.
847 * acinclude.m4: Add copyright license details.
848 * c-boxes.el: Likewise.
849 * checks/get-them: Likewise.
850 * checks/check-them: Likewise.
852 2008-07-13 Eric Blake <ebb9@byu.net>
854 Add -g/--gnu command line argument.
855 * src/m4.c (usage): Mention the new option.
856 (long_options, OPTSTRING): Add new option.
858 * NEWS: Document this addition.
859 * doc/m4.texinfo (Limits control): Likewise.
860 (Incompatibilities): Mention future use of POSIXLY_CORRECT.
862 Reported by Joel E. Denny.
864 2008-07-11 Eric Blake <ebb9@byu.net>
866 Avoid bogus whitespace in @ovar, @dvar.
867 * doc/m4.texinfo (ovar, dvar): Add @c.
868 Based on patch by Ralf Wildenhues to Autoconf manual.
870 2008-06-16 Eric Blake <ebb9@byu.net>
872 Add missing const qualifications.
873 * src/builtin.c (builtin_tab): Declare array elements as const.
875 2008-06-03 Eric Blake <ebb9@byu.net>
877 Use progname module rather than rolling our own program_name.
878 * m4/gnulib-cache.m4: Import progname module.
879 * src/m4.c (program_name): Replace...
880 (main): ...with a call to set_program_name.
882 2008-06-02 Eric Blake <ebb9@byu.net>
884 Allow autobuild usage.
885 * m4/gnulib.cache: Import autobuild module.
887 2008-05-23 Eric Blake <ebb9@byu.net>
889 Make closing files be consistent.
890 * src/freeze.c (reload_frozen_state): Use close_stream.
891 Reported by Jean-Charles Longuet.
893 2008-05-22 Eric Blake <ebb9@byu.net>
895 Don't allow failure to freeze give exit status of 0.
896 * src/freeze.c (produce_frozen_state): Guarantee non-zero exit on
898 * doc/m4.texinfo (Using frozen files): Test the fix.
900 Reported by Jean-Charles Longuet.
902 2008-05-09 Eric Blake <ebb9@byu.net>
904 Improve error message when frozen file is invalid.
905 * src/freeze.c (reload_frozen_state): Track current line.
906 [GET_STRING]: New helper macro.
908 2008-05-09 Eric Blake <ebb9@byu.net>
910 Detect integer overflow when loading frozen file.
911 * src/m4.h (includes): Add limits.h.
912 (_): Define as a no-op placeholder for now.
913 * src/freeze.c (reload_frozen_state) [GET_NUMBER]: Rewrite to fail
914 immediately on overflow.
915 Reported by Jim Meyering.
917 2008-05-07 Eric Blake <ebb9@byu.net>
919 Fix traceon regression introduced 2006-06-06.
920 * src/builtin.m4 (traceon): Only perform insertion if lookup
922 * doc/m4.texinfo (Trace): Test for the bug.
925 2008-05-03 Eric Blake <ebb9@byu.net>
927 Document define_blind.
928 * doc/m4.texinfo (Ifelse): Add a new composite macro.
932 2008-04-24 Eric Blake <ebb9@byu.net>
935 * doc/m4.texinfo (Debug Levels): Test -di behavior.
936 (Changeword, Location): Correct examples.
937 * checks/check-them (examples): Update to account for recommended
938 location for running tests.
939 * doc/m4.texinfo (Debug Levels): Test this behavior.
941 2008-04-21 Eric Blake <ebb9@byu.net>
943 Fix spelling of attribution to Christopher Strachey.
944 * doc/m4.texinfo (History, Inhibiting Invocation): Fix typo.
946 Reported by Fernando Carrijo.
948 2008-04-17 Eric Blake <ebb9@byu.net>
950 Fix buildbot failure.
951 * doc/m4.texinfo (Diversions): Consume all of m4's output, in case
954 Detected by Bob Proulx's buildbot.
956 2008-04-17 Eric Blake <ebb9@byu.net>
958 Avoid gcc shadowing warnings.
959 * src/builtin.c (m4_format): s/format/expand_format, so local
960 variables can be named format.
961 * src/format.c (format): Rename...
962 (expand_format): ...to this, and avoid the name index.
963 * src/input.c (push_file): Avoid the name close.
964 * src/m4.h (expand_format): Adjust prototype.
965 * src/output.c (threshold_diversion_CB): Avoid the name div.
967 2008-04-15 Eric Blake <ebb9@byu.net>
969 Another 'make installcheck' fix.
970 * doc/m4.texinfo (Diversions): s/m4/__program__/ in case
971 --program-prefix was active.
973 2008-04-11 Eric Blake <ebb9@byu.net>
975 Ensure --program-prefix doesn't regress.
976 * Makefile.am (DISTCHECK_CONFIGURE_FLAGS): Enforce change from
977 2008-03-10 by testing it at 'make distcheck' time.
979 2008-04-11 Eric Blake <ebb9@byu.net>
981 Improve OS/2+emx build.
982 * src/m4.h [__EMX__]: OS/2 does not have a Unix-compatible
983 system(3), no matter what other macros it pre-defined.
984 * doc/m4.texinfo (Mkstemp): Rework test to avoid globbing failure
986 * src/builtin.c (predefined_tab): Ensure all possible system
987 identifiers are defined, not just the first; the testsuite will
988 catch if multiple identifiers mistakenly made it through.
990 Reported by Elbert Pol.
992 2008-04-09 Eric Blake <ebb9@byu.net>
994 Remove redundant configure macros.
995 * configure.ac (AC_CANONICAL_BUILD, AC_CANONICAL_HOST)
996 (AC_SYS_LARGEFILE, AC_TYPE_SIZE_T): Delete, since gnulib does
998 (AC_CHECK_HEADERS_ONCE): Remove limits.h.
1000 2008-08-07 Bruno Haible <bruno@clisp.org> (tiny change)
1002 Run m4 tests prior to gnulib unit tests.
1003 * Makefile.am (SUBDIRS): Swap order of directories.
1005 2008-04-02 Eric Blake <ebb9@byu.net>
1007 Release Version 1.4.11.
1008 * NEWS: Mention the release.
1010 Prepare for release.
1011 * maint.mk (alpha): Check for PREV_VERSION setting sooner, and
1012 remove tag operation.
1013 (version-check): Enhance this check.
1014 (prev-tarball): Depend on version-check.
1015 (this-vc-tag): Delete, and mention need to run tag...
1016 * HACKING: ...here, prior to make maintainer-distcheck.
1017 Update the instructions to match this particular release process.
1018 * Makefile.am (.version, announcement): Allow for VPATH build.
1019 * cfg.mk (gnulib_dir): Likewise.
1020 * doc/Makefile.am ($(srcdir)/m4.1): Include release number in man
1023 2008-04-01 Eric Blake <ebb9@byu.net>
1025 Speed up index builtin.
1026 * m4/gnulib-cache: Import strstr module.
1027 * NEWS: Mention the speedup.
1029 2008-03-29 Eric Blake <ebb9@byu.net>
1031 Fix testsuite on mingw, OpenBSD.
1032 * src/format.c (ARG_DOUBLE): Use strtod, not atof.
1033 * src/Makefile.am (m4_LDADD): Use POW_LIB when needed.
1034 * doc/m4.texinfo (Format): Add hex-float support.
1035 * NEWS: Document this.
1037 2008-03-27 Eric Blake <ebb9@byu.net>
1039 Pull other useful doc fixes from branch-1.6.
1040 * doc/m4.texinfo (Arguments): Enable test of
1041 --warn-macro-sequence.
1042 (Defn): Test length of builtin token.
1043 (Builtin, Ifelse, Changequote): Add more regression tests.
1045 2008-03-27 Eric Blake <ebb9@byu.net>
1047 Add test for divert bug on 2007-05-28, patched 2007-07-21.
1048 * doc/m4.texinfo (Diversions): Add test.
1050 2008-03-24 Eric Blake <ebb9@byu.net>
1052 Pull GNUmakefile from gnulib.
1053 * m4/gnulib-cache.m4: Import gnumakefile module.
1054 * GNUmakefile: Remove from version control; supplied by gnulib
1056 * configure.ac (AC_INIT): Track intra-release version with
1058 (AC_CONFIG_LINKS): Let gnulib do this now.
1059 * Makefile.am (distclean-local): Likewise.
1060 (EXTRA_DIST): Likewise. Also handle renamed files.
1061 * (.version, dist-hook): Improve version handling.
1062 * Makefile.cfg: Rename...
1063 * cfg.mk: ...to this.
1064 * Makefile.maint: Rename...
1065 * maint.mk: ...to this.
1066 (ME, makefile-check, m4-check): Use new macro instead of
1068 * HACKING: Mention that maintainer rules should now work in VPATH
1071 2008-03-15 Eric Blake <ebb9@byu.net>
1073 Document join, in order to fix bug in m4wrap example.
1074 * doc/m4.texinfo (Improved m4wrap): New node.
1075 (Defn, Location): Enhance tests.
1076 (Shift): Document the composite macro join.
1077 (Incompatibilities): Move documentation of LIFO vs. FIFO...
1078 (M4wrap): ...here, to match improved example.
1080 2008-03-10 Eric Blake <ebb9@byu.net>
1082 Allow 'make installcheck' with './configure --program-prefix'.
1083 * checks/Makefile.in (program_transform_name): New macro.
1084 (installcheck): Use it to transform name of m4 before testing.
1085 * checks/check-them (m4): Add -m option, to allow testing m4 by a
1087 * checks/get-them: Allow xout and xerr notation.
1089 2008-02-25 Eric Blake <ebb9@byu.net>
1091 Improve release process.
1092 * configure.ac (AM_INIT_AUTOMAKE): Increase requirement, and add
1094 * HACKING: Update for git release procedures.
1095 * Makefile.cfg: New file.
1096 * GNUmakefile: Use it.
1097 * Makefile.maint (gzip_rsyncable, GZIP_ENV, GIT, VC, VC-tag)
1098 (VERSION_REGEXP, this-vc-tag, my_distdir, null_AM_MAKEFLAGS)
1099 (TMPDIR, gnulib-version): New macros, borrowed from coreutils.
1100 (makefile-check, news-date-check, changelog-check, m4-check)
1101 (vc-diff-check, maintainer-distcheck, vc-dist, my-distcheck)
1102 (announcement, alpha, beta, major): New rules, borrowed from
1104 (TEXI2HTML, cvs-release, update-timestamps, cvs-news, cvs-commit)
1106 * Makefile.am (EXTRA_DIST): Distribute new file.
1108 2008-02-19 Eric Blake <ebb9@byu.net>
1110 Clean up foreach example.
1111 * doc/m4.texinfo (Foreach, Improved foreach): Document another
1112 shortcoming in foreach.m4.
1114 2008-02-16 Eric Blake <ebb9@byu.net>
1116 Add regression test for multi-character quote recursion.
1117 * examples/foreach2.m4: Use $0 rather than spelling out name.
1118 * examples/foreachq2.m4: Likewise.
1119 * examples/forloop2.m4: Likewise.
1120 * examples/hanoi.m4: Likewise.
1121 * examples/trace.m4: Likewise.
1122 * doc/m4.texinfo (Improved forloop): Document advantage of $0.
1123 (Improved foreach): Adjust dump from file.
1125 2008-02-13 Eric Blake <ebb9@byu.net>
1127 Fix texinfo grammar.
1128 * doc/m4.texinfo (Incompatibilities): Use @. after capital.
1129 (History): Use @: after abbreviations.
1130 (M4exit): Use correct Latin abbreviation.
1132 2008-02-11 Eric Blake <ebb9@byu.net>
1134 Document behavior of __gnu__().
1135 * doc/m4.texinfo (Platform macros): Enhance test.
1136 (Macro expansion): New test.
1138 2008-01-31 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1140 * checks/Makefile.in: Use @SET_MAKE@, and use @SHELL@ rather
1141 than hard-coding /bin/sh.
1143 Reported by Lawson Chan.
1145 2007-12-13 Paolo Bonzini <bonzini@gnu.org> (tiny change)
1147 * doc/m4.texinfo (Inhibiting Invocation): Fix quoting of a quoting
1150 Reported by Giovanni Toffetti.
1152 2007-12-07 Eric Blake <ebb9@byu.net>
1154 Minor security fix: Quote output of mkstemp.
1155 * src/builtin.c (mkstemp_helper): Produce quoted output.
1156 * doc/m4.texinfo (Mkstemp): Update the documentation and tests.
1157 * NEWS: Document this change.
1159 2007-12-04 Eric Blake <ebb9@byu.net>
1161 Fix builds with OpenBSD make.
1162 * doc/Makefile.am (HELP2MAN): New macro.
1163 (man_MANS, m4.1): Fix rules for building m4.1 into srcdir.
1164 * README: Update copyright.
1165 * HACKING: Mention help2man and makeinfo dependencies.
1167 2007-11-22 Eric Blake <ebb9@byu.net>
1169 Security fix: avoid arbitrary code execution with 'm4 -F'.
1170 * src/freeze.c (produce_frozen_state): Never pass raw file name as
1172 * NEWS: Document this fix.
1174 2007-11-07 Eric Blake <ebb9@byu.net>
1176 * doc/m4.texinfo (Pseudo Arguments): Test more corner cases.
1178 2007-11-05 Eric Blake <ebb9@byu.net>
1180 Use build-aux directory.
1181 * configure.ac (PACKAGE, VERSION): Delete, since Automake does
1183 (AC_CONFIG_AUX_DIR): Add, with auxiliary files in build-aux
1184 instead of the top level.
1185 (AC_INIT_AUTOMAKE): Increase requirement, and add dist-lzma.
1186 * Makefile.am (EXTRA_DIST): Gnulib now manages gendocs.sh.
1187 * bootstrap: Adjust accordingly.
1188 * m4/gnulib-cache.m4: Add --aux-dir option.
1189 * doc/Makefile.am (m4.1): Rewrite rule to use build-aux/missing.
1191 2007-10-31 Eric Blake <ebb9@byu.net>
1193 Test more corner cases.
1194 * doc/m4.texinfo (Changecom, Pseudo Arguments): Beef up tests.
1195 (Improved foreach): Document alternate foreachq style.
1197 2007-10-28 Eric Blake <ebb9@byu.net>
1199 More test coverage for autoconf usage patterns.
1200 * doc/m4.texinfo (Inhibiting Invocation, Pseudo Arguments)
1201 (Builtin): Add new undocumented tests.
1202 (Shift): Document cond macro, and add new test.
1204 2007-10-27 Eric Blake <ebb9@byu.net>
1206 Document one use of changequote(`(',`)').
1207 * doc/m4.texinfo (Changequote): Add new test, based on recent
1208 autoconf addition of m4_expand.
1210 2007-10-22 Eric Blake <ebb9@byu.net>
1212 Never let printf failures go undetected.
1213 * m4/gnulib-cache.m4: Import announce-gen, git-version-gen,
1214 intprops, strtod, and xprintf modules. Remove deprecated free
1215 module. Replace vasprintf-posix and xvasprintf with
1217 * src/m4.h: Include xprintf.h.
1218 * src/builtin.c (ntoa): Export.
1219 (m4_errprint): Adjust all *printf callers.
1220 * src/debug.c (debug_message_prefix, trace_format): Likewise.
1221 * src/freeze.c (produce_frozen_state): Likewise.
1222 * src/input.c [DEBUG_INPUT]: Likewise.
1223 * src/m4.c (usage): Likewise.
1224 * src/m4.h (DEBUG_PRINT1, DEBUG_PRINT3, DEBUG_MESSAGE)
1225 (DEBUG_MESSAGE1, DEBUG_MESSAGE2): Likewise.
1226 * src/output.c (shipout_text, freeze_diversione): Likewise.
1227 * src/path.c [DEBUG_INCL]: Likewise.
1228 * src/stackovf.c (process_sigsegv) [DEBUG_STKOVF]: Likewise.
1229 * src/symtab.c [DEBUG_SYM]: Likewise.
1231 2007-10-17 Eric Blake <ebb9@byu.net>
1233 Fix 'm4 -F file -t undefined'.
1234 * src/freeze.c (produce_frozen_state): Avoid core dump.
1235 * doc/m4.texinfo (Using frozen files): Test for the bug.
1236 * NEWS: Mention the fix.
1238 2007-10-09 Eric Blake <ebb9@byu.net>
1240 Avoid regexp regression.
1241 * doc/m4.texinfo (Regexp, Patsubst): Test \ expansion.
1243 2007-10-02 Eric Blake <ebb9@byu.net>
1245 Add more examples and tests.
1246 * doc/m4.texinfo (Patsubst): Use the examples directory. Also
1248 (Improved capitalize): New node.
1249 (Index macro, Regexp): Test more code paths.
1250 * examples/capitalize.m4: Update to match manual.
1251 * examples/capitalize2.m4: New file.
1252 * examples/foreachq3.m4: Likewise.
1253 * examples/join.m4: Likewise.
1254 * examples/loop.m4: Likewise.
1255 * examples/wraplifo.m4: Likewise.
1256 * examples/wraplifo2.m4: Likewise.
1257 * examples/Makefile.am (EXTRA_DIST): Distribute new files.
1259 2007-09-24 Eric Blake <ebb9@byu.net>
1261 Create .gitignore alongside .cvsignore.
1262 * bootstrap (LC_ALL): Set up front.
1263 (version control) Borrow idea from head, to avoid churn in
1264 m4/.*ignore files modified by gnulib-tool.
1266 2007-09-13 Eric Blake <ebb9@byu.net>
1268 * AUTHORS: Fix typo.
1270 2007-09-07 Eric Blake <ebb9@byu.net>
1272 * AUTHORS: Simplify, to match libtool and autoconf layout.
1273 * THANKS: Sync with head.
1275 2007-08-10 Eric Blake <ebb9@byu.net>
1277 * doc/m4.texinfo (Compatibility): Sync with head.
1279 2007-08-10 Konrad Schwarz <konrad.schwarz@siemens.com> (tiny change)
1280 and Eric Blake <ebb9@byu.net>
1282 * doc/m4.texinfo (Defn): Update wording.
1284 2007-08-09 Eric Blake <ebb9@byu.net>
1286 POSIX requires defn(`a',`b') to concatenate definitions.
1287 * src/builtin.c (m4_defn): Allow multiple arguments, but warn if
1288 trying to mix a builtin with anything else.
1289 * doc/m4.texinfo (Defn): Document a use for this POSIX
1291 (Incompatibilities): Update to match current status.
1292 * NEWS: Document this change.
1294 Reported by Konrad Schwarz.
1296 2007-08-04 Eric Blake <ebb9@byu.net>
1298 Normalize all GPL license notices.
1299 * GNUmakefile: Update license wording.
1300 * Makefile.am: Likewise.
1301 * Makefile.maint: Likewise.
1302 * bootstrap: Likewise.
1304 * configure.ac: Likewise.
1305 * checks/Makefile.in: Likewise.
1306 * doc/Makefile.am: Likewise.
1307 * examples/Makefile.am: Likewise.
1308 * src/Makefile.am: Likewise.
1309 * src/builtin.c: Likewise.
1310 * src/debug.c: Likewise.
1311 * src/eval.c: Likewise.
1312 * src/format.c: Likewise.
1313 * src/freeze.c: Likewise.
1314 * src/input.c: Likewise.
1315 * src/m4.c: Likewise.
1316 * src/m4.h: Likewise.
1317 * src/macro.c: Likewise.
1318 * src/output.c: Likewise.
1319 * src/path.c: Likewise.
1320 * src/stackovf.c: Likewise.
1321 * src/symtab.c: Likewise.
1323 2007-07-21 Eric Blake <ebb9@byu.net>
1325 Fix regression on NetBSD from 2007-05-28.
1326 * src/output.c (m4_tmpopen): Explicitly reset append-mode stream
1328 * NEWS: Document this fix.
1330 Reported by Thomas Klausner.
1332 2007-07-20 Eric Blake <ebb9@byu.net>
1334 Fix 'make distcheck' issues.
1335 * Makefile.am (EXTRA_DIST): No need to distribute
1336 gpl-3.0.texi.diff anymore.
1337 * m4/gnulib-cache.m4: Update to latest gnulib.
1339 2007-07-14 Eric Blake <ebb9@byu.net>
1341 Reflect upstream license .texi changes.
1342 * doc/m4.texinfo (Copying): Rename node...
1343 (GNU General Public License): ...to this.
1344 (GNU Free Documentation License): Adjust node location.
1345 * local/doc/gpl-3.0.texi.diff: Remove file.
1347 2007-07-10 Eric Blake <ebb9@byu.net>
1350 * configure.ac (AC_INIT): Bump version number.
1351 * NEWS: Start changes since 1.4.10.
1352 * doc/m4.texinfo (History): Mention 1.4.11.
1353 (Copying This Package, Copying This Manual): Add index entries.
1354 * local/lib/version-etc.c.diff: Delete, now that gnulib has been
1356 * Makefile.am (EXTRA_DIST): Remove dead file.
1358 2007-07-09 Eric Blake <ebb9@byu.net>
1360 Release Version 1.4.10.
1361 * doc/Makefile.am (m4_TEXINFOS): Distribute gpl-3.0.texi.
1362 * Makefile.am (EXTRA_DIST): Distribute gnulib diffs.
1363 * configure.ac (AC_INIT): Bump version number.
1364 * NEWS: Describe changes since 1.4.9.
1366 * src/format.c: Missed a GPLv3 conversion.
1368 Avoid undefined behavior of %.*c in printf.
1369 * src/format.c (format): Special case %c.
1370 * TODO: Document that more remains to be done.
1371 * NEWS: Document the fix.
1373 2007-07-05 Eric Blake <ebb9@byu.net>
1375 Fix up gnulib-tool usage.
1376 * m4/gnulib-cache.m4: Change local-dir to local, not `.'.
1377 * version-etc.c.diff: Move to...
1378 * local/lib/version-etc.c.diff: ...here.
1379 * gpl-3.0.texi.diff: Move to...
1380 * local/doc/gpl-3.0.texi.diff: ...here.
1382 2007-07-04 Eric Blake <ebb9@byu.net>
1384 Upgrade to GPL version 3 or later.
1385 * bootstrap: Pick up GPLv3.
1386 * m4/gnulib-cache.m4: Augment with 'gnulib-tool
1387 --local-dir=. --import gpl-3.0'.
1388 * doc/m4.texinfo (Copying This Package): New appendix.
1389 * NEWS: Mention this change.
1390 * README: Mention why some files still claim to be version 2.
1391 * version-etc.c.diff: New file, to make sure --version claims
1392 correct GPL version. Temporary until gnulib makes move.
1393 * gpl-3.0.texi.diff: New file, to allow inclusion of GPLv3 as
1394 appendix, rather than section, of the manual.
1395 * GNUmakefile: Update to new license.
1396 * Makefile.am: Likewise.
1397 * Makefile.maint: Likewise.
1399 * configure.ac: Likewise.
1400 * checks/Makefile.in: Likewise.
1401 * doc/Makefile.am: Likewise.
1402 * examples/Makefile.am: Likewise.
1403 * src/Makefile.am: Likewise.
1404 * src/builtin.c: Likewise.
1405 * src/debug.c: Likewise.
1406 * src/eval.c: Likewise.
1407 * src/freeze.c: Likewise.
1408 * src/input.c: Likewise.
1409 * src/m4.c: Likewise.
1410 * src/m4.h: Likewise.
1411 * src/macro.c: Likewise.
1412 * src/output.c: Likewise.
1413 * src/path.c: Likewise.
1414 * src/stackovf.c: Likewise.
1415 * src/symtab.c: Likewise.
1417 2007-06-26 Eric Blake <ebb9@byu.net>
1419 * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import assert'.
1421 2007-06-26 Karl Berry <karl@freefriends.org> (tiny change)
1423 Match Free Software Directory categories.
1424 * doc/m4.texinfo (dircategory): Update.
1426 2007-05-31 Eric Blake <ebb9@byu.net>
1428 * src/output.c (output_text): Fix regression from 2007-05-28.
1429 * doc/m4.texinfo (History): Mention 1.4.10.
1430 (Format): Make testsuite output easier to debug.
1432 2007-05-29 Eric Blake <ebb9@byu.net>
1435 * configure.ac (AC_INIT): Bump version number.
1436 * NEWS: Start changes since 1.4.9b, and fix typo.
1438 Beta Release Version 1.4.9b.
1439 * configure.ac (AC_INIT): Bump version number.
1440 * NEWS: Describe changes since 1.4.9.
1442 Improve format support.
1443 * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
1445 * src/format.c (format): Parse %'hhd, %a, %A. Avoid calling
1446 printf with too few arguments, as in format(%*.*d,-1,-1,1).
1447 * doc/m4.texinfo (Format): Expand tests, and improve
1449 * NEWS: Document this change.
1451 2007-05-28 Eric Blake <ebb9@byu.net>
1453 Fix large diversion corner cases, including 1.4.8 regression.
1454 * src/output.c (m4_tmpfile, m4_tmpopen): Simplify use of errno.
1455 (make_room_for): Use NULL, not 0, for pointers.
1456 (insert_diversion_helper): Avoid using rewind.
1457 (freeze_diversions): Allow freezing large diversions.
1458 * NEWS: Document this fix.
1460 Also run gnulib unit tests during make check.
1461 * m4/gnulib-cache.m4: Augment with 'gnulib-tool
1462 --tests-base=tests --with-tests'.
1463 * configure.ac (AC_CONFIG_FILES): Build gnulib testdir.
1464 * Makefile.am (SUBDIRS): Run gnulib tests before ours.
1466 2007-05-25 Eric Blake <ebb9@byu.net>
1468 Backport prompts in examples from head.
1469 * src/macro.c (expand_macro): Shorten message.
1470 * doc/m4.texinfo (Manual, Command line files, Comments)
1471 (Inhibiting Invocation, Macro Arguments, Macro expansion, Indir)
1472 (Builtin, Shift, Forloop, Foreach, Dumpdef, Trace, Debug Levels)
1473 (Debug Output, Include, Format, Syscmd, Mkstemp, Location)
1474 (Using frozen files, Improved forloop, Improved foreach): Add
1475 prompts to examples.
1476 * checks/get-them: Ignore prompts in examples.
1478 Fix sync line interaction with multiline comments.
1479 * doc/m4.texinfo (Other Incompatibilities): Add example, and
1480 document bug in --syncline/divert interaction.
1481 (Preprocessor features): Augment test.
1482 * src/m4.h (output_text): Export.
1483 (shipout_text, next_token): Add parameter.
1484 * src/freeze.c (reload_frozen_state): Don't interfere with
1485 synclines when reloading state.
1486 * src/output.c (output_text): Export.
1487 (shipout_text): Take new parameter for start line of token.
1488 Output at most one syncline per token.
1489 * src/input.c (next_token): Report line where multiline tokens
1491 * src/macro.c (expand_input, expand_token, expand_argument):
1492 Adjust callers so that line is passed from input to output.
1493 * NEWS: Document this fix.
1494 Reported by Sergey Poznyakoff.
1496 Test -s in testsuite.
1497 * doc/m4.texinfo (Preprocessor features): Add a test.
1498 * checks/get-them: Support extra options in testsuite.
1499 * checks/check-them (examples): Use extra options.
1501 Reported by Sergey Poznyakoff.
1503 2007-05-24 Eric Blake <ebb9@byu.net>
1505 Support POSIX flush semantics on all platforms.
1506 * m4/gnulib-cache.m4: Remove closeout, and augment with
1507 'gnulib-tool --import closein fflush'.
1508 * src/m4.h (includes): Use closein, not closeout.
1509 * src/m4.c (main): Ensure stdin is flushed when not all input is
1511 (process_file): No return needed.
1512 * src/debug.c (debug_flush_files): Rely on gnulib module, rather
1513 than excluding mingw.
1514 * NEWS: Document this change.
1516 Work around cygwin and mingw fseeko bugs.
1517 * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import fseeko'.
1518 * src/debug.c (debug_flush_files): Prefer fseeko over fseek.
1520 2007-04-25 Eric Blake <ebb9@byu.net>
1522 Fix negative division within eval, regression of 2007-01-06.
1523 * doc/m4.texinfo (Eval): Catch this bug.
1524 * src/eval.c (mult_term): Fix it.
1525 * NEWS: Document this.
1527 Reported by Cesar Strauss.
1529 2007-04-23 Eric Blake <ebb9@byu.net>
1532 * configure.ac (AC_INIT): Bump version number.
1533 * NEWS: Start changes since 1.4.9.
1535 2007-03-23 Eric Blake <ebb9@byu.net>
1538 * configure.ac (AC_INIT): Bump version number.
1539 * NEWS: Describe changes since 1.4.8b.
1541 2007-03-16 Eric Blake <ebb9@byu.net>
1543 * doc/m4.texinfo (Mkstemp): Tweak wording.
1544 * src/output.c (output_init): Adjust to latest gnulib.
1546 2007-03-15 Eric Blake <ebb9@byu.net>
1548 Avoid Tandem/NSK's broken long long (without a symmetric unsigned
1549 long long, it confuses gnulib).
1550 * configure.ac (AC_TYPE_LONG_LONG_INT): Declare long long broken
1551 if unsigned long long doesn't work.
1553 Reported by Matthew Woehlke.
1555 2007-03-07 Eric Blake <ebb9@byu.net>
1558 * doc/m4.texinfo: Minor tweaks, avoid makeinfo warning.
1560 2007-03-01 Eric Blake <ebb9@byu.net>
1562 * doc/m4.texinfo: Pick up more index entries from head. Follow
1563 more texinfo recommendations.
1564 (Sysval): Improve tests.
1566 Avoid overfull \vbox warning from texinfo, due to indices that
1567 weren't quite big enough to split across page boundaries.
1568 * doc/m4.texinfo: Add lots of concept index entries.
1569 (Concept Index): Move to be last, as recommended by texinfo
1571 (Define, Arguments, Pseudo Arguments): Add more function entries.
1573 2007-02-28 Eric Blake <ebb9@byu.net>
1575 * doc/m4.texinfo (Eval): Clean up wording to reflext POSIX XCU ERN
1577 (Pseudo Arguments): Add useful example.
1579 * doc/m4.texinfo (Pushdef, Incompatibilities): Clean up wording to
1580 reflect POSIX XCU ERN 118.
1582 * src/m4.h (DEFAULT_MACRO_SEQUENCE): Factor out from...
1583 * src/m4.c (usage): ...here,...
1584 * src/builtin.c (set_macro_sequence): ...and here.
1585 (define_user_macro): Fix typo.
1586 * doc/m4.texinfo (Preprocessor features, Arguments): Fix minor
1588 (Shift): Document composite macro argn for portably getting at
1589 positional parameters beyond 9.
1590 * configure.ac (AC_INIT): Bump version number.
1591 * NEWS: Start changes of 1.4.8c.
1593 2007-02-24 Eric Blake <ebb9@byu.net>
1595 Beta Release 1.4.8b:
1596 * configure.ac (AC_INIT): Bump version number.
1597 * NEWS: Describe changes since 1.4.8.
1599 Reserve all uses of raw ${} in macro definitions, not just
1601 * src/builtin.c (set_macro_sequence): Change default macro
1603 * doc/m4.texinfo (Operation modes): Update to match.
1604 * src/m4.c (usage): Likewise.
1607 2007-02-23 Eric Blake <ebb9@byu.net>
1609 * src/m4.h (includes): Update to latest gnulib.
1611 2007-02-08 Eric Blake <ebb9@byu.net>
1613 Rename --warn-syntax to --warn-macro-sequence[=regex], to make it
1614 more flexible, and so that autoconf can use it.
1615 * src/m4.h (set_macro_sequence, free_macro_sequence): New
1617 * src/builtin.c (macro_sequence_buf, macro_sequence_regs)
1618 (macro_sequence_inuse, set_macro_sequence, free_macro_sequence):
1619 New variables and functions.
1620 (define_user_macro): Allow flexibility in regular expression used
1622 * src/m4.c (warn_syntax): Delete.
1623 (usage, WARN_MACRO_SEQUENCE_OPTION, main): Implement changed
1624 spelling of option, along with optional argument.
1625 * doc/m4.texinfo (Operation modes, Arguments): Document this
1627 * NEWS: Document this change.
1629 2007-02-05 Eric Blake <ebb9@byu.net>
1631 * m4/gnulib-cache.m4: Module strstr no longer exists.
1633 Avoid bool bitfields, as they don't work on AIX.
1634 * src/m4.h (bool_bitfield): New typedef.
1635 (struct symbol, struct builtin): Use it.
1636 * src/input.c (struct input_block): Likewise.
1637 Reported by Albert Chin.
1639 * doc/m4.texinfo (Sysval): Avoid SIGPIPE in test as unreliable.
1640 Reported by Albert Chin.
1643 2006-06-18 Bruno Haible <bruno@clisp.org> (tiny change)
1645 * doc/m4.texinfo (Input processing): Further clarifications.
1647 2007-02-03 Eric Blake <ebb9@byu.net>
1649 * doc/m4.texinfo (Input processing, Quoting Arguments): Beef up
1651 Reported by Bruno Haible.
1653 2007-02-01 Eric Blake <ebb9@byu.net>
1655 * src/m4.c (fatal_warnings): New variable.
1656 (usage): Document new -E behavior.
1657 (main): Make -E an additive option.
1658 (m4_error, m4_error_at_line): Change exit status when required.
1659 * NEWS: Document this change.
1660 * doc/m4.texinfo (Operation modes): Likewise.
1661 Reported by Ralf Wildenhues.
1663 2007-01-27 Eric Blake <ebb9@byu.net>
1665 * src/m4.h (warn_syntax): Declare.
1666 (init_pattern_buffer): Export.
1667 * src/m4.c (warn_syntax, usage, WARN_SYNTAX_OPTIONS)
1668 (long_options, main): Implement new option.
1669 * src/builtin.c (init_pattern_buffer): Allow NULL regs argument.
1670 (define_user_macro): Warn on $11 and ${1} if requested.
1671 * src/input.c (init_pattern_buffer): Delete duplicate method.
1672 * doc/m4.texinfo (Operation modes): Document it.
1673 (Arguments): Document future direction of ${11} vs. $11.
1674 (Incompatibilities): Fix wording on POSIX limitations.
1675 * checks/get-them: Parse @{ and @} correctly.
1676 * NEWS: Document this change.
1678 2007-01-26 Eric Blake <ebb9@byu.net>
1680 * src/builtin.c (includes): Adjust to gnulib changes.
1682 2007-01-15 Eric Blake <ebb9@byu.net>
1684 * doc/m4.texinfo: Pull in various improvements from head.
1685 * src/builtin.c (include): Alter exit status on failure.
1686 * NEWS: Document this fix.
1688 2007-01-13 Eric Blake <ebb9@byu.net>
1690 * configure.ac (AC_CHECK_MEMBERS): Check for stack_t.ss_sp, and
1691 assume the fallback of ss_base for BSDI 4.0.1.
1692 * src/stackovf.c (setup_stackovf_trap) [HAVE_SIGALTSTACK &&
1693 ! HAVE_STACK_T_SS_SP]: Use this check.
1694 Reported by Chris McGuire.
1696 * NEWS: Document the improvement.
1698 2007-01-09 Eric Blake <ebb9@byu.net>
1700 * src/eval.c (ASSIGN): New enumerator.
1701 (eval_lex): Recognize '='.
1702 (equality_term): Treat '=' like '==', but warn that it is
1704 * doc/m4.texinfo (Eval): Document and test this.
1705 (Incompatibilities): Document the POSIX incompatibility.
1706 * NEWS: Document this change.
1708 2007-01-06 Eric Blake <ebb9@byu.net>
1710 * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import stdint'.
1711 * checks/check-them: Record expected exit status.
1712 * checks/get-them: Check exit status.
1713 * src/m4.h (eval_t, unsigned_eval_t): Delete, use POSIX int32_t
1715 * src/builtin.c: All users changed.
1716 * src/eval.c: Likewise. Also document where we are triggering
1717 undefined or implementation-defined behavior.
1718 (BADOP, NEGATIVE_EXPONENT, INVALID_OPERATOR, eval_lex, evaluate)
1719 (logical_or_term, logical_and_term, logical_not_term, not_term)
1720 (equality_term, unary_term): Port from head to follow POSIX
1722 (exp_term): Reject 0**0 as undefined.
1723 * doc/m4.texinfo (History): Mention 1.4.9.
1724 (Format, Incompatibilities): Update to document POSIX compliance.
1725 * NEWS: Document this change.
1727 2007-01-04 Eric Blake <ebb9@byu.net>
1729 * NEWS: Document previous fix.
1732 2007-01-04 Sami Liedes <sliedes@cc.hut.fi> (tiny change)
1734 Fix Debian bug 405594, introduced 2006-11-01 from a bad
1735 copy-n-paste from head.
1736 * src/m4.c (main): Use correct file name after --.
1738 2007-01-04 Eric Blake <ebb9@byu.net>
1740 Fix regression from 1.4.7 in large file handling on some
1741 platforms, introduced on 2006-10-13.
1742 * configure.ac (AC_LARGE_SYSFILE): Guarantee that large files
1744 * NEWS: Document this fix.
1746 2007-01-03 Eric Blake <ebb9@byu.net>
1748 * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
1750 * src/m4.c (AUTHORS, main): Use FSF wording for --version (plus
1751 it bumps the copyright year).
1753 2006-12-27 Eric Blake <ebb9@byu.net>
1755 * doc/m4.texinfo (Patsubst): Fix typo.
1757 2006-12-16 Eric Blake <ebb9@byu.net>
1759 * src/m4.c (main): Check for errors when closing stdin.
1761 2006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1763 * doc/m4.texinfo: Fix some typos.
1765 2006-12-09 Eric Blake <ebb9@byu.net>
1767 * configure.ac (AC_INIT): Bump version number.
1768 * NEWS: Start changes of 1.4.8a.
1770 2006-11-20 Eric Blake <ebb9@byu.net>
1773 * configure.ac (AC_INIT): Bump version number.
1774 * NEWS: Describe changes since 1.4.7.
1776 2006-11-16 Eric Blake <ebb9@byu.net>
1778 * doc/m4.texinfo (Include, Search Path, Diversions, Divert):
1779 Minor tweaks noticed while porting to head.
1781 2006-11-14 Eric Blake <ebb9@byu.net>
1783 * src/output.c (cleanup_tmpfile, freeze_diversions): Clean up
1785 (m4_tmpname): Avoid memory leak.
1787 2006-11-13 Eric Blake <ebb9@byu.net>
1789 * src/output.c (cleanup_tmpfile): Avoid double error message when
1790 umask is prohibitive.
1791 (m4_tmpname, m4_tmpopen, m4_tmpclose, m4_tmpremove): New
1793 (m4_tmpfile): Add parameter, move cloexec action here.
1794 (make_room_for): Adjust caller. Don't keep too many files open.
1795 (insert_diversion_helper): Unlink emptied temp files.
1796 (make_diversion): Don't keep too many files open.
1797 * doc/m4.texinfo (Diversions): Tweak wording, now that open file
1798 descriptors are no longer a limiting factor.
1799 * NEWS: Document this change.
1801 Backport sparse diversion handling from head.
1802 * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
1804 * src/output.c (struct m4_diversion): Rename from struct
1805 diversion, and update members. All users changed.
1806 (diversion_table): Change to an ordered set, instead of an array.
1807 (div0): New storage for diversion 0.
1808 (diversions): No longer needed.
1809 (free_list): New list to allow recycling diversion storage.
1810 (diversion_storage): New storage to reduce malloc overhead.
1811 (cmp_diversion_CB, threshold_diversion_CB): New callbacks.
1812 (output_init, output_exit, cleanup_tmpfile, make_room_for)
1813 (make_diversion): Handle new diversion storage scheme.
1814 (insert_diversion_helper): New function.
1815 (insert_diversion, undivert_all, freeze_diversions): Use it.
1816 * doc/m4.texinfo (Divert, Diversions): Move hidden test of memory
1817 exhaustion to visible test of large diversion numbers.
1818 * NEWS: Document this fix.
1820 2006-11-11 Eric Blake <ebb9@byu.net>
1822 * src/builtin.c (m4_translit): Slight optimization.
1824 * src/m4.h (to_uchar): Depend on HAVE_INLINE.
1826 * src/builtin.c: Remove unnecessary casts.
1827 (expand_ranges): Make 8-bit clean.
1828 * doc/m4.texinfo (Translit): Add tests and wording.
1829 * NEWS: Document this fix.
1831 2006-11-07 Eric Blake <ebb9@byu.net>
1833 * src/m4.h (output_exit): New prototype.
1834 * src/m4.c (main): Use it.
1835 * src/output.c (cleanup_tmpfile): Close files before removing
1837 (insert_diversion): Check for failure.
1838 (output_exit): Avoid memory leak.
1839 * doc/m4.texinfo (Diversions): Test this bug.
1841 * doc/m4.texinfo (Esyscmd, Errprint): Minor touchups.
1843 2006-11-01 Eric Blake <ebb9@byu.net>
1845 Allow C++ compilation on Linux, as a safety measure in type
1847 * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
1849 * src/m4.h (hack_symbol, hack_all_symbols): Use full prototype.
1850 (boolean): Kill this, and use stdbool.h instead.
1851 * src/debug.c, src/eval.c, src/input.c, src/macro.c, src/m4.c:
1852 * src/output.c, src/symtab.c: All users changed.
1853 * src/symtab.c (hack_all_symbols): Update prototype.
1854 * src/builtin.c (dump_symbol, set_trace): Update signature.
1855 (m4_dumpdef, m4_traceon, m4_traceoff): Update callers.
1856 (mkstemp_helper, m4_m4wrap, expand_ranges, m4_translit): Allow
1858 * src/debug.c (trace_flush): Likewise.
1859 * src/freeze.c (reload_frozen_state): Likewise.
1860 * src/input.c (push_file, push_string_finish, push_wrapup):
1861 (token_bottom, next_token): Likewise.
1862 * src/m4.c (main): Likewise.
1864 * doc/m4.texinfo (Invoking m4): Update according to POSIX 200x
1866 * src/m4.h (m4_path_search): Tweak signature.
1867 * src/path.c (m4_path_search): Likewise.
1868 * src/builtin.c (include): Update caller.
1869 * src/m4.c (main): Allow -D, -U, -t, and -s to be interspersed
1870 with file names. Don't write to **argv.
1871 (process_file): New helper method.
1872 * NEWS: Document this fix.
1874 2006-10-31 Eric Blake <ebb9@byu.net>
1876 * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import strstr'.
1877 * doc/m4.texinfo (Translit): Improve the documentation.
1878 * src/builtin.c (m4_translit): Optimize to O(n) instead of O(n^2)
1880 (m4_index): Simplify, and speed up slightly.
1881 * NEWS: Document this fix.
1883 2006-10-28 Eric Blake <ebb9@byu.net>
1885 * src/input.c (set_quotes): Don't allow empty end-quote with
1886 non-empty start-quote.
1887 (set_comment): Likewise for end-comment.
1888 * src/builtin.c (m4_changecom): Adjust caller.
1889 * doc/m4.texinfo (Changequote, Changecom): Update documentation to
1891 (Incompatibilities): Document another POSIX bug.
1892 * NEWS: Mention this change.
1894 2006-10-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1896 * examples/Makefile.am (EXTRA_DIST): Distribute recently-added
1899 2006-10-26 Eric Blake <ebb9@byu.net>
1901 Silence -Wwrite-strings -Wpointer-arith warnings.
1902 * src/builtin.c (define_user_macro): Allow NULL argument.
1903 (m4_builtin, m4_indir): Cast away const of "".
1904 * src/format.c (format): Likewise.
1905 * src/macro.c (collect_arguments): Likewise.
1906 (expand_macro): Avoid math on void*.
1907 * src/m4.c (main): Adjust caller.
1908 * src/output.c (freeze_diversions): Detect off_t overflow.
1910 * src/input.c (pop_input): Remove unnecessary code.
1912 2006-10-25 Eric Blake <ebb9@byu.net>
1914 * src/symtab.c (symtab_init): Avoid size_t overflow.
1915 * src/output.c (make_diversion): Avoid size_t overflow.
1916 * doc/m4.texinfo (Diversions): Test this fix.
1917 * src/input.c (input_block): Remove unused member. Reduce size
1919 (push_file, pop_input): Avoid useless assignment.
1920 * NEWS: Document the bug fix.
1922 Redo location tracking. Instead of having just files track the
1923 line to return to when popping input, now all input blocks track
1925 * src/input.c (INPUT_STRING_WRAP, INPUT_FILE_INIT): No longer
1927 (input_block): Have line and file storage for all input types, and
1928 rename some members.
1929 (input_change): New global flag.
1930 (push_file, push_macro, push_string_init, push_wrapup): Store
1932 (push_string_finish, pop_input, pop_wrapup): Notice changes in
1934 (peek_input): Adjust to new member names.
1935 (next_char, next_char1): Adjust location if needed.
1936 (skip_line): Simplify restoring location.
1937 * doc/m4.texinfo (Location): Augment the test to catch line
1938 location of expansion of multi-line arguments.
1939 Reported by Stepan Kasal.
1941 2006-10-23 Eric Blake <ebb9@byu.net>
1943 * doc/m4.texinfo (Macro Arguments): Document that leading space
1944 in argument collection stops at macro expansion.
1945 (Incompatibilities): Document POSIX whitespace wording issue.
1947 2006-10-20 Eric Blake <ebb9@byu.net>
1949 * doc/m4.texinfo: Trailing '@comment' doesn't format nicely in
1950 TeX, so recognize '@w{ }' instead. Likewise, @code{_name} at the
1951 end of a TeX line splits incorrectly.
1952 (Foreach, Improved foreach): Write these sections, borrowing ideas
1953 from CVS head and from m4sugar.
1954 * checks/get-them: Accomodate new way to show trailing space in
1956 * examples/foreach.m4: Make usable in documentation.
1957 * examples/foreachq.m4: New file.
1958 * examples/foreachq2.m4: New file.
1959 * examples/foreach2.m4: New file.
1960 * NEWS: Document the documentation updates.
1962 2006-10-19 Eric Blake <ebb9@byu.net>
1964 * src/builtin.c (mkstemp_helper, m4_mkstemp): New functions.
1965 (m4_maketemp): Provide traditional behavior.
1966 * doc/m4.texinfo (Mkstemp): Rename from Maketemp. Document the
1967 new `mkstemp' macro and the flaws of the old `maketemp'.
1968 (Incompatibilities): Move maketemp discussion to...
1969 (Extensions): ...here, since -G now supresses the GNU extension.
1970 * NEWS: Document this.
1972 * examples/forloop.m4: Simplify.
1973 * examples/forloop2.m4: New file.
1974 * examples/quote.m4: New file.
1975 * doc/m4.texinfo (Loops): Rename to...
1976 (Shift): ...this node.
1977 (Forloop, Foreach, Improved forloop, Improved foreach): New
1980 2006-10-17 Eric Blake <ebb9@byu.net>
1982 * m4/gnulib-cache.m4: Update with 'gnulib-tool --import
1984 * configure.ac (AC_CONFIG_HEADERS): Create config.h alongside
1985 gnulib headers, rather than in top directory.
1986 * src/Makefile.am (AUTOMAKE_OPTIONS): Add nostdinc, to reduce make
1989 2006-10-16 Eric Blake <ebb9@byu.net>
1991 * doc/m4.texinfo: Backport some minor cleanups from head.
1992 (Cleardivert): Rename from cleardiv.
1994 * doc/m4.texinfo (Invoking m4): Promote to a chapter, instead of
1995 a section of Preliminaries.
1996 (Operation modes, Preprocessor features, Limits control)
1997 (Frozen state, Debugging options, Command line files): Subdivide
1999 (Input processing, Quoting Arguments, Define, Arguments)
2000 (Cleardiv, Format, M4exit): Fix grammar of references.
2001 (Inhibiting Invocation, Macro Arguments, Builtin, Trace)
2002 (Debug Levels, Debug Output, Include, Search Path, Divert)
2003 (Platform macros, Syscmd, Location, Extensions): Point to new
2005 (Top, Loops, Include, Undivert, Location, Incompatibilities):
2006 Improve file references.
2008 2006-10-14 Eric Blake <ebb9@byu.net>
2010 * m4/input.c (file_clean): Don't close stdin twice, POSIX says it
2012 Reported by Ralf Wildenhues.
2014 * src/builtin.c (m4_undivert): Check for read error.
2016 2006-10-13 Eric Blake <ebb9@byu.net>
2018 * src/m4.h (UNIX, W32_NATIVE, OS2): Move platform checks after
2019 header files are included, since <unistd.h> can affect the tests.
2021 Reported by Martin Koeppe.
2023 Backport head's usage of clean-temp module, as it is cleaner than
2024 using tmpfile-safer.
2025 * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
2026 clean-temp closeout', and remove tmpfile-safer.
2027 * src/m4.h (includes): Adjust.
2028 (m4_path_search): Rename from path_search, to avoid collision
2030 * src/m4.c (main): Install closeout handler. Adjust caller.
2031 (usage): Now done by closeout module.
2032 * src/builtin.c (m4_m4exit): Likewise.
2033 (m4_undivert, include): Adjust callers.
2034 * src/freeze.c (reload_frozen_state): Likewise.
2035 * src/path.c (m4_path_search): Rename from path_search.
2036 * src/output.c (output_temp_dir): New variable.
2037 (cleanup_tmpfile, m4_tmpfile): New functions, from head.
2038 (insert_diversion, make_room_for): Use them.
2039 * doc/m4.texinfo (Diversions): Document this, and add a test.
2040 (Improved fatal_error): Fix typo.
2041 (Maketemp): Port test to mingw, and no longer hide from
2043 * NEWS: Document the change in TMPDIR behavior.
2045 * configure.ac (m4_pattern_forbid): Narrow the range of forbidden
2046 macros, to work with recent gnulib-tool update.
2048 * src/builtin.c (m4_builtin, m4_indir): Allow transparent
2049 handling of defn results.
2050 * doc/m4.texinfo (Builtin, Indir): Add test cases.
2051 * NEWS: Document this.
2053 2006-10-12 Eric Blake <ebb9@byu.net>
2055 * doc/m4.texinfo (Location): Fix typo in previous commit.
2056 (Changeword): Catch one more case.
2057 * src/input.c (skip_line): Fix case when outer file used macro to
2060 2006-10-11 Eric Blake <ebb9@byu.net>
2062 * src/input.c (enum input_type): Add additional types, to shave
2063 time off the common case.
2064 (push_wrapup): Wrapped strings remember location.
2065 (push_string_finish): Normal strings carry no location.
2066 (push_file): Start new files uninitialized.
2067 (peek_input, next_char_1): Optimize common cases by updating
2068 location only on new input types.
2069 (pop_input): Update to honor new input types.
2070 (skip_line, push_string_finish): Fix regression in previous patch
2071 when dnl is not followed by newline in included file.
2072 (push_string_init): Initialize all fields of INPUT_STRING sooner.
2073 (peek_token): Simplify.
2074 (peek_input): Don't pop input files on peek, so that __file__ and
2075 __line__ as last token of include file work correctly.
2076 * doc/m4.texinfo (History): Mention 1.4.8.
2077 (Answers): Split into sections, one per answer.
2078 (Improved exch, Improved cleardivert, Improved fatal_error): New
2080 (Dnl, M4wrap, Location, M4exit, Improved fatal_error): Update to
2081 new m4wrap location semantics.
2082 (Changeword): Add test that caught the regression.
2083 * NEWS: Document this.
2085 * src/macro.c (expand_macro): In macro expansion errors, report
2086 line number at open parenthesis.
2087 * src/input.c (next_token): Fix off-by-one bug in reporting end
2088 of file in unterminated comment and string.
2089 (file_names): New obstack, necessary since expand_macro now hangs
2090 on to file names longer than the files remain open.
2091 (input_init): Initialize new obstack.
2092 (push_file): Use new obstack. Delay updates to current_file
2093 until after expand_macro has restored state.
2094 (peek_input, next_char_1): Update current_file if necessary.
2095 (pop_wrapup): Release memory.
2096 * doc/m4.texinfo (Macro Arguments, Changequote, Changecom): Catch
2098 (Dnl): Update to the new location reporting rules.
2099 * NEWS: Document these changes.
2101 2006-10-10 Eric Blake <ebb9@byu.net>
2103 * src/macro.c (argc_stack, argv_stack): New variables for sharing
2104 obstacks across multiple macro calls.
2105 (expand_input): Initialize and tear down stack once per input
2106 file, instead of once per macro.
2107 (expand_macro): Reuse existing stacks when possible.
2108 (collect_arguments): Simplify slightly.
2110 * src/path.c (include_env_init): Fix botched patch application.
2111 Reported by Ralf Wildenhues.
2113 2006-10-09 Eric Blake <ebb9@byu.net>
2115 * src/m4.c (usage, main): Detect write failures to stderr.
2116 * src/builtin.c (m4_m4exit): Likewise.
2117 * NEWS: Document this.
2119 * src/macro.c (expand_macro): Allow --nesting-limit=0 to remove
2121 * NEWS: Document this.
2122 * doc/m4.texinfo (Invoking m4): Likewise.
2124 2006-10-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2126 * src/path.c (include_env_init): Copy the string returned
2127 by getenv before overwriting it; POSIX disallows this.
2129 2006-10-09 Eric Blake <ebb9@byu.net>
2131 * src/m4.c (main): Defer debugfile until after --help.
2132 * configure.ac (AC_INIT): Bump version number.
2133 * NEWS: Start changes of 1.4.7a.
2135 2006-09-25 Eric Blake <ebb9@byu.net>
2138 * configure.ac (AC_INIT): Bump version number.
2139 * NEWS: Describe changes since 1.4.6.
2141 2006-09-21 Eric Blake <ebb9@byu.net>
2143 * doc/m4.texinfo (Invoking m4): Add clarification on option
2144 processing behavior.
2146 Reported by Mikhail Teterin.
2148 * bootstrap: Add --force option, based on idea from coreutils.
2149 * README: Document that ./bootstrap and autoreconf are for
2150 developers, and not lightly done in tarballs.
2152 2006-09-20 Eric Blake <ebb9@byu.net>
2154 * src/m4.c (usage, OPTSTRING, main): Rename -e to -i, and give
2155 deprecation warning on -e.
2156 * doc/m4.texinfo (Invoking m4, Extensions): Document this.
2157 * NEWS: Document this.
2159 2006-09-19 Eric Blake <ebb9@byu.net>
2161 * src/m4.c (usage, long_options, main, DEBUGFILE_OPTION): Rename
2162 -o/--error-output to --debugfile, and deprecate the former. This
2163 will allow a future release to be more consistent with other GNU
2164 tools, with -o/--output affecting stdout, not debug.
2165 * doc/m4.texinfo (Invoking m4, Debug Output): Document this.
2166 * NEWS: Document this.
2168 2006-09-14 Eric Blake <ebb9@byu.net>
2170 * src/m4.c (main): Warn on deprecated options -B, -S, -T, -N,
2171 --diversions. `m4 --help --version' now displays help, not
2173 (interactive, frozen_file_to_read, frozen_file_to_write): Move to
2175 (show_help, show_version): No longer needed.
2176 (long_options, DIVERSIONS_OPTION): Backport patch from head to
2177 distinguish between -N and --diversions in warning.
2178 * doc/m4.texinfo (Invoking m4): Document this.
2181 2006-09-11 Eric Blake <ebb9@byu.net>
2183 * src/Makefile.am (m4_LDADD): Add any gnulib dependent libraries.
2184 * src/debug.c (debug_flush_files) [UNIX]: Flush stdin if it is
2186 (debug_set_file): Use STDOUT_FILENO.
2187 * src/builtin.c (m4_m4exit): Flush stdin before exiting, to comply
2188 with POSIX in regards to unread input.
2189 * NEWS: Document this fix.
2190 * doc/m4.texinfo (Syscmd, Esyscmd, M4exit): Likewise.
2192 2006-09-07 Eric Blake <ebb9@byu.net>
2194 * m4/gnulib-cache.m4: Update to newer gnulib-tool.
2195 * src/m4.h (push_file): Change prototype.
2196 * src/input.c (push_file, peek_input, next_char_1): Only call getc
2197 once at EOF, to avoid double ^D on terminal stdin; regression from
2199 (push_file, pop_file): Allow reading stdin twice.
2200 * src/m4.c (main): Likewise.
2201 * src/builtin.c (include): Update caller.
2202 * NEWS: Document this change.
2203 * doc/m4.texinfo (Invoking m4, Incompatibilities): Likewise.
2204 (Syscmd): Add a test that failed before this patch.
2206 2006-09-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2208 * checks/check-them: Quote $pwd.
2210 2006-09-05 Eric Blake <ebb9@byu.net>
2212 * src/builtin.c (define_macro): Warn on invalid macro name.
2213 * NEWS: Document this change.
2214 * doc/m4.texinfo: Fix typos.
2215 (Invoking m4, Macro Arguments, Pseudo Arguments, Defn, Indir)
2216 (Ifelse): Backport some improvements from head.
2218 2006-09-04 Eric Blake <ebb9@byu.net>
2220 * doc/m4.texinfo (Changeword): Skip test on mingw, where the
2221 native echo is braindead.
2222 * checks/check-them (strip_needed): Ignore \r in output. Now the
2223 testsuite will pass when cross-compiling from cygwin to mingw.
2225 * src/input.c (peek_input): Fix regression in handling macro
2226 without arguments as last token in file; debian bug 385720.
2227 (next_token): Always consume an input character.
2228 Reported by Andreas Schultz.
2229 * configure.ac (AC_INIT): Bump version number.
2230 * NEWS: Document this fix.
2231 * doc/m4.texinfo (History): Mention next version.
2232 (Changeword): Add example that exposes this bug.
2235 2006-08-25 Eric Blake <ebb9@byu.net>
2238 * configure.ac (AC_INIT): Bump version number.
2239 * NEWS: Describe changes since 1.4.5.
2241 * Makefile.maint (web-manual): Give up on VPATH build during
2242 distribution. But distributions are made so infrequently that
2243 this is not too much of a hardship.
2244 * Makefile.am (MAINTAINERCLEANFILES): Avoid error if lib/CVS/
2247 2006-08-24 Eric Blake <ebb9@byu.net>
2249 * src/builtin.c (m4_index, m4_substr, m4_translit): Similar to
2250 Solaris, produce output on just one argument.
2251 (m4_regexp, m4_patsubst): For consistency, do likewise.
2252 (m4_patsubst): Allow zero-length match at end of string.
2253 * doc/m4.texinfo (Sysval): Fix overfull hbox.
2254 (Bugs, Macro Arguments): Minor fixes.
2255 (Other tokens): Rearrange node order.
2256 (Index macro, Substr, Translit, Regexp, Patsubst): Add tests.
2257 * NEWS: Document these fixes.
2259 2006-08-22 Eric Blake <ebb9@byu.net>
2261 * src/input.c (pop_input): Avoid empty filename with -di option.
2262 * src/debug.c (debug_message_prefix): Put space before message.
2264 * m4/gnulib-cache.m4: We don't explicitly use alloca module.
2266 * m4/gnulib-cache.m4: Augment with gnulib-tool --import gnupload.
2267 * Makefile.maint (fetch): Simplify, now that we can use gnupload.
2269 * checks/check-them: State why a test is skipped.
2270 * doc/m4.texinfo (Changeword, Sysval, Maketemp): Likewise.
2272 * ChangeLog: Add copyright.
2273 * AUTHORS: Likewise.
2274 * BACKLOG: Likewise.
2278 * examples/COPYING: New file, add copyright for all the examples.
2279 * checks/get-them: Put copyright on testsuite files.
2281 2006-08-18 Eric Blake <ebb9@byu.net>
2283 Don't let unrelated child processes see too many files.
2284 * m4/gnulib-cache.m4: Augment with gnulib-tool --import cloexec.
2285 * src/builtin.c (m4_esyscmd, m4_regexp, m4_patsubst): Fix
2286 spelling in error message.
2287 * src/debug.c [!__STDC__]: Assume C89, and nuke old varargs.h.
2288 (debug_set_output): Close debug file on exec.
2289 * src/m4.h (includes): Add cloexec.h.
2290 * src/output.c (make_room_for): Close diversions on exec.
2291 * src/path.c (path_search): Close include files on exec.
2292 * NEWS: Document this.
2294 Regular expressions were leaking memory.
2295 * src/builtin.c (init_pattern_buffer, free_pattern_buffer): New
2297 (m4_regexp, m4_patsubst): Avoid memory leak.
2298 * src/input.c (init_pattern_buffer) [ENABLE_CHANGEWORD]: Make
2300 (set_word_regexp) [ENABLE_CHANGEWORD]: Avoid memory leak. Change
2301 from O(n^2) to O(n) for calculating word_start.
2302 (next_token, peek_token) [ENABLE_CHANGEWORD]: Treat word_start as
2303 O(1) bitmap, not O(n) search string.
2304 * NEWS: Document this fix.
2306 2006-08-17 Eric Blake <ebb9@byu.net>
2308 * NEWS: Document previous checkin.
2310 * src/builtin.c (substitute): Avoid core dump when accessing
2311 beyond bound of regular expression.
2312 Reported by Karl Nelson.
2313 * doc/m4.texinfo (Regexp): Add example that causes core dump on
2314 some architectures prior to this patch.
2317 2006-08-16 Eric Blake <ebb9@byu.net>
2319 * doc/m4.texinfo (Invoking m4, Debug Output): Fix wording to be
2320 clear that dumpdef does not always go to stderr.
2322 * src/builtin.c (m4_errprint): Flush buffers before printing to
2326 2006-08-15 Eric Blake <ebb9@byu.net>
2328 * src/builtin.c (m4_m4wrap, m4_errprint, m4_shift): Make blind,
2329 per debian bug 96075.
2330 * doc/m4.texinfo (Loops, M4wrap, Errprint): Document this change.
2331 (Changeword): Don't use shift as an example of a swallowed word.
2332 (Divert): Discuss fact that divert is an English word.
2333 Reported by Richard A Nelson.
2335 2006-08-14 Eric Blake <ebb9@byu.net>
2337 * doc/m4.texinfo (Invoking m4): Minor fixes.
2339 2006-08-12 Eric Blake <ebb9@byu.net>
2341 * doc/m4.texinfo (Arguments): Hint at better exch macro.
2342 (Answers): Provide a better definition.
2344 2006-08-09 Eric Blake <ebb9@byu.net>
2346 * doc/m4.texinfo (Incompatibilities): Document that m4 does not
2347 yet understand locales.
2348 * NEWS: Fix wording of a few items.
2350 2006-08-08 Eric Blake <ebb9@byu.net>
2352 Avoid printing `NONE:0:' in error messages.
2353 * src/m4.h (m4_error_at_line): New function.
2354 * src/m4.c (m4_error_at_line): Implement.
2355 * src/input.c (skip_line, input_init, next_token): Use "", not
2356 "NONE", for no file, since NONE can be a real file name.
2357 * src/macro.c (expand_argument): Likewise.
2358 * src/debug.c (debug_message_prefix, trace_header): Check for
2360 * doc/m4.texinfo (Dnl, M4wrap): Adjust accordingly.
2361 (Location): Document that synclines and internal message format
2362 are not impacted by redefining these macros.
2363 (M4exit): Hint at bug in fatal_error.
2364 (Answers): Provide workaround to match m4 output.
2366 * m4/gnulib-cache.m4: Augment with gnulib-tool --import verror.
2367 * src/m4.h (m4_error): New function.
2368 (M4ERROR, M4ERROR_AT_LINE): Reimplement without hacking around
2369 error module deficiencies.
2370 (reference_error, suppress_line): No longer needed.
2371 * src/m4.c (m4_error): Implement.
2372 (main): No longer need to install error callback.
2374 2006-08-04 Eric Blake <ebb9@byu.net>
2376 * src/m4.h (program_name): Declare.
2377 (suppress_line): New variable.
2378 (M4ERROR_AT_LINE): New macro.
2379 * src/m4.c (reference_error, main): Follow GNU Coding Standards
2380 for error message format.
2381 * src/input.c (skip_line, next_token): Use M4ERROR_AT_LINE.
2382 * src/macro.c (expand_argument): Likewise.
2383 * checks/check-them (examples): Adjust to new message format.
2384 * src/builtin.c (m4___program__): New builtin.
2385 * doc/m4.texinfo (Location): Split from Errprint into new node,
2386 and document __program__.
2387 (Builtin, Ifdef, Ifelse, Dumpdef, Trace, Debug Output, Dnl)
2388 (Include, Regexp, Patsubst, Incr, Eval): Adjust error message
2390 (Extensions): Document __program__.
2391 * NEWS: Document this change.
2393 2006-08-03 Eric Blake <ebb9@byu.net>
2395 Don't confuse leading `(' in comment or quote with start of
2396 argument collection.
2397 * src/m4.h (enum token_type): Add TOKEN_OPEN, TOKEN_COMMA,
2399 (peek_input): Make private to input.c.
2400 (peek_token): New prototype.
2401 * src/input.c (default_word_regexp): Reduce ifdefs.
2402 (peek_input): Make static.
2403 (next_token): Return new token types.
2404 (match_input, MATCH): Add argument consume, which controls
2405 whether match should be pushed back.
2406 (peek_token): New function.
2407 (token_type_string) [DEBUG_INPUT]: New function.
2408 * src/macro.c (expand_token, expand_argument, collect_arguments):
2409 Handle new token types.
2410 * doc/m4.texinfo (Changequote, Changecom): Document this.
2411 * NEWS: Document this.
2413 * src/stackovf.c (setup_stackovf_trap): Free memory on failure.
2415 * src/stackovf.c (setup_stackovf_trap): Gracefully avoid stack
2416 overflow detection when sigstack exists but is not implemented.
2417 Fixes debian bug 154053.
2419 Reported by David Perlin.
2421 2006-08-02 Eric Blake <ebb9@byu.net>
2423 * src/input.c (MATCH): Fix EOF detection on multi-byte comment
2426 2006-08-01 Eric Blake <ebb9@byu.net>
2428 * src/input.c (skip_line, next_token): Remember current file in
2429 case input file ends abruptly. Addresses debian bug 175365.
2430 (pop_input): Defer freeing storage that holds previous file
2432 (pop_wrapup): to here, after error message is issued.
2433 * src/macro.c (expand_argument): Remember current file in case
2434 input file ends abruptly.
2435 * doc/m4.texinfo (Macro Arguments, Dnl, Changequote, Changecom)
2436 (M4wrap): Adjust testsuite accordingly.
2437 (Errprint): Document line number limitation of m4wrap.
2438 * NEWS: Document this fix.
2441 2006-07-31 Eric Blake <ebb9@byu.net>
2443 * src/input.c (peek_input, next_char, match_input): Be eight-bit
2444 clean; fixes debian bug 311378.
2445 * doc/m4.texinfo (Syntax): Describe eight-bit handling.
2446 (Changequote, Changecom): Add examples to test this.
2447 * NEWS: Document this fix.
2449 Reported by Steven Augart.
2451 * doc/m4.texinfo: Whitespace fix.
2452 * checks/get-them: Avoid exceeding 14-char file name limit.
2455 2006-07-30 Eric Blake <ebb9@byu.net>
2457 * src/path.c (path_search): Detect allocation failure.
2459 Use native free when it is good enough.
2460 * m4/gnulib-cache.m4: Augment with gnulib-tool --import free.
2461 * src/builtin.c (define_user_macro, m4_regexp, m4_patsubst):
2463 * src/symtab.c (free_symbol): Likewise.
2464 * src/m4.c (xfree, main): Likewise.
2465 * src/m4.h (obstack_chunk_free): Likewise.
2466 * src/path.c (path_search): Likewise.
2467 * src/input.c (pop_wrapup, set_quotes, set_comment): Likewise.
2469 * doc/m4.texinfo (Errprint): Add example for last patch.
2470 * checks/check-them: Account for VPATH in latest example.
2472 2006-07-29 Eric Blake <ebb9@byu.net>
2474 * src/path.c (path_search): Add result parameter, so that
2475 -I can be accounted for. Debian bug 53685.
2476 * src/m4.h (path_search): Update prototype.
2477 * src/m4.c (main): Adjust callers.
2478 * src/freeze.c (reload_frozen_state): Likewise.
2479 * src/builtin.c (include, m4_undivert): Likewise.
2480 * NEWS: Document this change.
2481 Reported by Nicolas Lichtmaier.
2483 2006-07-28 Eric Blake <ebb9@byu.net>
2485 * Makefile.am (MAINTAINERCLEANFILES): Fix typo that tripped up
2486 several non-GNU makes.
2487 * src/stackovf.c (setup_stackovf_trap): Missed _ from yesterday.
2488 * src/m4.h: Likewise.
2489 * src/input.c (push_wrapup): Avoid compiler warning with Solaris
2492 2006-07-27 Eric Blake <ebb9@byu.net>
2494 * doc/m4.texinfo: Use @acronym{GNU} throughout.
2495 (History): Update for 1.4.6.
2497 * src/m4.h (_): Remove K&R cruft.
2498 * src/builtin.c: Likewise.
2499 * src/debug.c: Likewise.
2500 * src/eval.c: Likewise.
2501 * src/macro.c: Likewise.
2502 * src/stackovf.c: Likewise.
2504 * doc/Makefile.am (m4.1): Improve man page.
2505 * src/m4.c (usage): Improve --help output, including adding the
2506 bug reporting address.
2507 (main): Follow GNU Coding Standards for --version output.
2509 2006-07-26 Eric Blake <ebb9@byu.net>
2511 * doc/m4.texinfo: Use begin-quote, end-quote, begin-comment, and
2512 end-comment consistently, to match POSIX.
2514 * doc/m4.texinfo (Macro Arguments, Changequote, Changecom)
2515 (Dnl, M4wrap, Include): Document EOF issues, and add examples.
2516 (Incompatibilities): Document incompatibility of changecom
2517 vs. macro names, and of EOF in include.
2518 * src/input.c (next_token): Reject unterminated comments at EOF.
2519 (skip_line): Warn on unterminated dnl at EOF.
2520 * NEWS: Document these changes.
2522 2006-07-25 Eric Blake <ebb9@byu.net>
2524 * m4/gnulib-cache.m4: Update to reflect gnulib's split of
2525 stdio-safer into fopen-safer and tmpfile-safer.
2526 * src/m4.c: Remove redundant include.
2528 2006-07-24 Eric Blake <ebb9@byu.net>
2530 Fix bugs related to stream handling.
2531 * m4/gnulib-cache.m4: Augment with gnulib-tool --import
2532 unlocked-io stdio-safer stdlib-safer close-stream.
2533 * configure.ac (AC_CHECK_FUNCS_ONCE): Assume tmpfile; it can be
2534 provided by gnulib if needed.
2535 * src/output.c [! HAVE_TMPFILE]: Likewise.
2536 * src/m4.h (includes): Replace unistd, stdio, and stdlib with
2537 their safer counterparts.
2538 (retcode): New global variable.
2539 * src/input.c (pop_input): Check for read failure.
2540 * src/freeze.c (reload_frozen_state): Likewise.
2541 (produce_frozen_state): Check for write failure.
2542 * src/debug.c (debug_set_file): Likewise.
2543 * src/m4.c (usage, main): Likewise.
2544 (retcode): Make global.
2545 * src/builtin.c (m4_m4exit): Likewise. Ensure that the exit
2546 status is non-zero except when everything succeeds.
2547 * doc/m4.texinfo (M4exit): Document these changes.
2548 (Incompatibilities): Remove documentation of bug now fixed.
2549 * NEWS: Document these fixes.
2551 2006-07-22 Eric Blake <ebb9@byu.net>
2553 * src/format.c (format): Avoid compiler warning that str may be
2556 2006-07-21 Eric Blake <ebb9@byu.net>
2558 * src/m4.h [UNIX]: Add more platforms that are close enough to
2559 categorize as UNIX, but which don't predefine __unix__.
2560 Reported by Nelson H. F. Beebe.
2562 2006-07-20 Eric Blake <ebb9@byu.net>
2564 * m4/gnulib-cache.m4: gnulib-tool has changed again. Regenerate
2565 to explicitly ask for --assume-autoconf=2.60.
2567 2006-07-19 Eric Blake <ebb9@byu.net>
2569 * doc/m4.texinfo (Sysval): Avoid kill -1, since ksh traps SIGHUP
2570 and exits normally with 129.
2571 Reported by Nelson H. F. Beebe.
2574 * src/m4.h (EXIT_MISMATCH): Define.
2575 * src/freeze.c (reload_frozen_state): Detect version mismatch, by
2576 exiting with status 63.
2577 * src/m4.c (usage): Document this.
2578 * doc/m4.texinfo (Invoking m4, Using frozen files): Likewise.
2581 * doc/m4.texinfo (copying): Relax restriction on front-cover and
2584 2006-07-17 Eric Blake <ebb9@byu.net>
2586 * src/format.c (format): Support F, g, and G specifiers.
2587 * doc/m4.texinfo (Format): Document this.
2588 * NEWS: Document this addition.
2590 * doc/m4.texinfo (Builtin): Delete redundant text.
2592 * configure.ac (AC_INIT): Bump version number.
2593 * src/builtin.c (substitute): Bah. Fix buffer overrun.
2594 * NEWS: Document this fix.
2596 2006-07-15 Eric Blake <ebb9@byu.net>
2599 * configure.ac (AC_INIT): Bump version number.
2600 * NEWS: Describe changes since 1.4.4.
2602 * src/m4.c (usage): Document exit status.
2603 * doc/m4.texinfo: Use `exit status', not `exit code'.
2604 (Invoking m4): Document exit status.
2606 * bootstrap: Backport --help, --version from head.
2607 (func_update): New function, for easily grabbing up-to-date files
2609 * Makefile.maint (web-manual): Fix for VPATH builds.
2611 2006-07-14 Eric Blake <ebb9@byu.net>
2613 * doc/m4.texinfo: Global cleanup. Avoid @code{...}'d, as it
2614 looks bad in info. Use @deffn rather than @example for
2615 describing prototypes. Fix awkward wording and grammar.
2617 * src/builtin.c (substitute): Warn on bad escape sequences.
2618 Ignore trailing backslash.
2619 * doc/m4.texinfo (Regexp): Add documentation for this.
2620 * NEWS: Document this change.
2622 * src/builtin.c (m4_format, m4_indir): Warn on too few arguments.
2623 * doc/m4.texinfo (Defn, Builtin, Debug Levels, Debug Output): Add
2625 (Dnl): Update example to show side effects.
2626 * checks/get-them: Generate three digit test names.
2627 * checks/Makefile.in (CHECKS): Accomodate 100+ tests.
2629 2006-07-13 Eric Blake <ebb9@byu.net>
2631 * src/input.c (input_init): Simplify.
2632 (set_word_regexp): Treat empty string as default, since empty
2633 regexp would disable word parsing.
2634 * src/m4.c (user_word_regexp): Default to empty string.
2635 * src/builtin.c (builtin_tab): Make changeword blind.
2636 * doc/m4.texinfo (Changeword): Document this.
2637 * NEWS: Document this.
2638 * TODO: Knock off completed items.
2640 * src/builtin.c (m4_undefine, m4_popdef): Visit all arguments, not
2642 * doc/m4.texinfo (Undefine, Pushdef): Test this.
2643 * NEWS: Document this change.
2645 * src/builtin.c (numeric_arg): Treat empty string as 0, with a
2646 warning. Detect quoted leading space and overflow as warnings.
2647 (m4_eval): Treat empty radix as 10, and allow output in radix 1.
2648 Treat width as minimum number of digits, as required by POSIX.
2649 (m4_ifdef, m4_divert, m4_m4exit, m4_translit): Ignore extra
2651 (m4_substr): Likewise. Silently treat empty start as 0.
2652 (m4_undivert): Treat ` 1a' as file, not diversion 1.
2653 * src/eval.c (eval_lex): Parse radix 1 numbers.
2654 * doc/m4.texinfo (Invoking m4): Fix wording; there is more than
2655 one type of warning.
2656 (Manual): Document behavior of numeric parsing of empty string.
2657 (Divert, Incr): Document error handling.
2658 (Eval): Document radices better.
2659 (Incompatibilities): Document translit incompatibility.
2660 * NEWS: Document these changes.
2662 * Makefile.maint (fetch): Get gendocs from gnulib, not texinfo.
2663 (web-manual): Simplify.
2664 * m4/gnulib-cache.m4: Augment with gnulib-tool --import gendocs.
2665 * Makefile.am (EXTRA_DIST): Distribute gendocs.sh.
2666 (MAINTAINERCLEANFILES): Clean it as well.
2667 * doc/Makefile.am (EXTRA_DIST): Distribute gendocs_template.
2668 (MAINTAINERCLEANFILES): Clean it as well.
2670 2006-07-12 Eric Blake <ebb9@byu.net>
2672 * doc/m4.texinfo (Extensions): Document how to overcome
2673 implementation difference in > 9 positional parameters.
2675 * src/m4.c (usage): Sort within sections.
2676 (nesting_limit): Raise default from 250 to 1024.
2677 * doc/m4.texinfo: Use file name, not filename, per GNU coding
2678 standard. Use @option where appropriate.
2679 (Invoking m4): Sort to match --help output.
2680 (Debug Levels): Sort.
2681 (Frozen files): Sort and break into two nodes.
2683 * src/m4.c (nesting_limit): Raise default from 250 to 1024.
2684 * NEWS: Document raised -L limit.
2686 2006-07-11 Eric Blake <ebb9@byu.net>
2688 * Makefile.am (DISTCHECK_CONFIGURE_FLAGS): New macro, to
2689 stress-test changeword before a release.
2690 * doc/m4.texinfo: More doc cleanups.
2691 (Copying This Manual): New node; actually include the FDL in the
2693 * doc/Makefile.am (m4_TEXINFOS): Mention dependence on fdl.texi.
2694 * m4/gnulib-cache.m4: Augment with gnulib-tool --import fdl.
2695 * NEWS: Mention documentation improvements.
2697 * src/m4.h (OS2): New platform macro.
2698 * src/builtin.c (predefined_tab) [OS2]: Use it to give OS/2 a
2700 * doc/m4.texinfo (Platform macros): Document it.
2701 (Sysval): Remove non-portable test of system("").
2702 * NEWS: Document this change.
2703 Reported by Andreas Buening.
2705 2006-07-09 Eric Blake <ebb9@byu.net>
2707 * doc/m4.texinfo (Undivert): Fix typo in last commit.
2708 * src/m4.c (usage): Document M4PATH.
2709 * src/path.c (path_search): Reject empty string.
2710 * src/output.c (insert_diversion): Ignore diversion 0.
2711 * src/builtin.c (m4_undivert): Ignore empty string.
2712 * NEWS: Document this fix.
2714 2006-07-08 Eric Blake <ebb9@byu.net>
2716 * checks/get-them: Make filtering easier.
2717 * checks/check-them: Filter non-input lines, so line counts are
2718 more realistic in the documentation, and so changeword tests work
2719 even when dnl is disabled.
2720 * doc/m4.texinfo: Adjust example line numbers. Clean up
2721 front-matter, following autoconf's example.
2722 (Changeword): Enable tests, skipping if changeword not supported.
2723 (Define, Defn, Ifelse): Backport more examples from head.
2724 (Input processing, Answers): New nodes, backported from head.
2725 (Include): Expand test to cover empty filename.
2726 (Undivert): Add test of undivert(0).
2728 2006-07-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2730 * doc/m4.texinfo: Fix spelling errors.
2732 2006-07-07 Eric Blake <ebb9@byu.net>
2736 * doc/Makefile.am (m4.1): No need to go through a temporary file;
2737 this also ensures timestamps are updated.
2738 * src/m4.h (includes): Require config.h. Assume string.h,
2739 stdlib.h, errno. Include error.h, exit.h, and xalloc.h rather
2740 than prototyping ourselves.
2741 (builtin_func): Add parameter type-checking.
2742 (voidstar): Delete, now that we assume C89.
2743 * src/builtin.c, src/m4.c, src/macro.c, src/symtab.c: All users of
2745 * src/m4.c (xfree) [WITH_DMALLOC]: Avoid clash with dmalloc's
2748 2006-07-06 Eric Blake <ebb9@byu.net>
2750 * m4/gnulib-cache.m4: Augment with gnulib-tool --import
2752 * src/m4.h (includes): Add binary-io.h for O_BINARY.
2753 * src/freeze.c (produce_frozen_state): Use O_BINARY to remove
2754 #ifdef. Fixes patch from 2005-02-03 for cygwin.
2755 * NEWS: Mention this fix.
2757 * configure.ac (FUNC_SYSTEM_BROKEN): New check for OS/2 bug.
2758 * src/builtin.c (m4_syscmd): Work around OS/2 bug.
2760 * Makefile.am (SUBDIRS): Build . before src, so that autoheader
2761 runs first when needed.
2762 * doc/Makefile.am (m4.1): Backport rule from CVS head: build m4.1
2763 once in srcdir rather than multiple times in VPATH builds.
2765 2006-07-03 Eric Blake <ebb9@byu.net>
2767 * checks/check-them: Use portable = in test.
2768 * src/Makefile.am (AM_CPPFLAGS): Omit space between -I and
2769 directory, as required by Solaris cc. Include built headers, as
2770 required by Solaris make in VPATH build.
2771 * checks/Makefile.in: Use $(srcdir) where needed.
2772 (CHECKS): Factor $(srcdir) into macro.
2773 (DISTFILES): Likewise. Automake takes care of distributing
2776 (Makefile): Use modern syntax of config.status.
2777 * doc/m4.texinfo (Loops, Include, Undivert, Incompatibilities):
2778 Avoid overfull and underfull hboxes in dvi.
2780 Fix 'make check' in VPATH build. All files included by testsuite
2781 now live in a single directory. Use forloop.m4 in testsuite.
2782 * checks/incl.m4, checks/foo, checks/wrapfifo.m4: Move from
2784 * examples/incl.m4, examples/foo, examples/wrapfifo.m4: ...to
2786 * checks/Makefile.in (DISTFILES): Don't distribute moved files.
2787 * examples/Makefile.am (EXTRA_DIST): Distribute new files.
2788 * checks/check-them: Avoid s/// when filename is in pattern.
2789 * examples/forloop.m4: Fix to match documentation.
2790 * doc/m4.texinfo (Include, Undivert, Incompatibilities): Reflect
2792 (Loops, Format): Actually use forloop.m4 in tests.
2794 2006-07-02 Eric Blake <ebb9@byu.net>
2796 * checks/Makefile.in (exec_prefix, prefix): New macros, so that
2797 $(bindir) works in installcheck.
2798 (check, installcheck): No longer change directory, so that
2799 distcheck works with a read-only builddir.
2800 * checks/check-them: Work when pwd is no longer builddir.
2802 2006-07-01 Eric Blake <ebb9@byu.net>
2804 * GNUmakefile: New file, borrowed from coreutils.
2805 * Makefile.am (EXTRA_DIST): Distribute GNUmakefile.
2806 * Makefile.maint (Makefile): Delete this rule, now that
2807 GNUmakefile includes Makefile.
2809 2006-06-30 Eric Blake <ebb9@byu.net>
2811 For compatibility with other m4 implementations, sysval returns
2812 signal<<8 rather than 0 if syscmd is terminated by a signal.
2813 * configure.ac (AC_CHECK_HEADERS_ONCE): Check for sys/wait.h.
2814 * src/builtin.c (include): Include sys/wait.h when stdlib.h does
2815 not provide wait macros.
2816 (WTERMSIG, WIFSIGNALED, WIFEXITED): More fallback macros.
2817 (M4SYSVAL_EXITBITS, M4SYSVAL_TERMSIGBITS): New helper macros.
2818 (m4_esyscmd): Set sysval to -1 on failure.
2819 (m4_sysval): Print 127 on failure, and accomodate signals if they
2821 * NEWS: Document this change.
2822 * doc/m4.texinfo (Platform macros, Esyscmd, Sysval): Fix typos in
2824 * checks/check-them: Likewise.
2825 * src/debug.c (debug_set_file): Work around mingw fstat bug.
2827 * src/m4.h (UNIX, W32_NATIVE): Improve platform detection macros.
2828 * src/freeze.c (produce_frozen_state): Use new spelling of
2830 * src/builtin.c (predefined_tab): Add __windows__ on non-unix
2832 (m4_syscmd, m4_esyscmd): The empty command is successful.
2833 * doc/m4.texinfo (Shell commands): Rename from UNIX commands.
2834 Document platform-dependence of system().
2835 (Syscmd): Add example.
2836 (Esyscmd): Make example more robust, and actually demonstrate
2838 (Sysval): Expand test to cover esyscmd code path, and to check
2839 that empty command is successful. Add conditional check for
2841 (Other Incompatibilities): Move platform macros from here...
2842 (Platform macros): ...to this new node. Add windows macro.
2843 Check that exactly one platform macro is provided.
2844 * checks/check-them: Improve trap cleanup. Tolerate dirname and
2845 .exe in error messages. Allow for skipping checks.
2846 * configure.ac (HAVE_EFGCVT): Kill dead configure check.
2847 * NEWS: Document platform macros.
2849 2006-06-29 Eric Blake <ebb9@byu.net>
2851 Fix buffer overrun bug.
2852 * m4/gnulib-cache.m4: Augment with gnulib-tool --import
2854 * src/format.c [HAVE_EFGCVT]: Delete this code, and use *printf
2855 variant instead, since [efg]cvt are obsolete and our use of them
2856 was buggy (savannah sr #104303).
2857 (format): Fix buffer overflow by using xasprintf.
2858 * doc/m4.texinfo (Format): Expand format test to catch both bugs.
2859 * NEWS: Document this fix.
2861 * configure.ac (AC_CANONICAL_HOST, AC_CANONICAL_BUILD): Allow
2863 (AC_CACHE_CHECK): Cache search for ecvt.
2865 2006-06-27 Eric Blake <ebb9@byu.net>
2867 * doc/m4.texinfo (Eval): Document 32-bit signed limitations
2868 required by POSIX, and add example that exposed core dump on x86
2870 (Incompatibilities): Document incompatibility in eval precedence.
2871 * src/eval.c (shift_term): Explicitly mask, to avoid undefined
2873 (mult_term): Explicitly check for -1, to avoid SIGFPE on x86.
2874 * NEWS: Document this change.
2876 * doc/m4.texinfo: Use @noindent consistently.
2877 (Quoting Arguments): Document that unquoted parentheses group
2879 (Pseudo Arguments): Expand tests to show this.
2880 (Incompatibilities): Contrast traditional behavior of
2883 2006-06-24 Eric Blake <ebb9@byu.net>
2885 * configure.ac (AC_PREREQ): Autoconf 2.60 is now released.
2886 (AC_CHECK_HEADERS_ONCE): Use this new feature.
2887 (AC_CHECK_FUNCS_ONCE): Likewise.
2889 2006-06-23 Eric Blake <ebb9@byu.net>
2891 * doc/m4.texinfo: Quoting cleanup throughout - follow
2892 autoconf-recommended style of one level of quote per parenthesis
2893 in the normal case. Adjust error messages to match GNU coding
2894 standards (and to allow 'make check' to pass again).
2895 (Quoted strings, Inhibiting Invocation): Turn more examples into
2897 (Comments): Resolve FIXME by adding example.
2898 (Define): Add example about underquoting.
2899 (Defn): Add example about use of $0.
2900 (Indir, Format): Resolve FIXME done in last commit.
2901 (Ifelse): Add example about creating blind macro.
2902 (Debugging): Fix grammar.
2903 (Dnl): Add example about dnl with arguments.
2904 (M4wrap): Be explicit that LIFO order is non compliant, and will
2906 (Undivert): Resolve FIXME by adding example.
2907 (Frozen files): Document that m4wrap and sysval will not work
2908 consistently until m4 2.0.
2909 (Incompatibilities): Document another POSIX compliance bug, this
2910 time with changequote. Document a traditional incompatibility
2911 with partial input spanning file boundaries.
2913 Make error messages more consistent with GNU coding standards -
2914 start with lower case, and don't end sentence with punctuation.
2915 * src/debug.c (trace_pre): Update message wording.
2916 * src/eval.c (evaluate, cmp_term, shift_term, mult_term):
2918 * src/freeze.c (produce_frozen_state, issue_expect_message),
2919 (reload_frozen_state): Likewise.
2920 * src/input.c (push_string_init, pop_init, init_macro_token),
2921 (peek_input, next_char_1, set_word_regexp, next_token): Likewise.
2922 * src/m4.c (stackovf_handler, main): Likewise.
2923 * src/macro.c (expand_token, expand_argument, call_macro),
2924 (expand_macro): Likewise.
2925 * src/output.c (make_room_for, output_text, insert_file),
2926 (freeze_diversions): Likewise.
2927 * src/symtab.c (symtab_init, lookup_symbol): Likewise.
2929 * src/builtin.c (builtin_tab): Make format and indir blind.
2930 (substitute): Prefer "Warning:" vs. "ERROR:" in messages.
2931 * NEWS: Mention the change to builtins.
2933 2006-06-22 Eric Blake <ebb9@byu.net>
2935 Robustify frozen file format.
2936 * src/freeze.c (reload_frozen_state): Add GET_DIRECTIVE helper
2937 macro. Require V first, and only accept it once. For F, use
2938 placeholder if builtin is not found, rather than warning.
2939 * src/m4.h (m4_placeholder): New prototype.
2940 * src/builtin.c: Unify error message style.
2941 (m4_placeholder): New function, warn if invoked.
2942 (builtin_tab): Add m4_placeholder.
2943 (m4_defn): Warn if placeholder is encountered.
2944 (find_builtin_by_addr): Handle placeholder.
2945 (find_builtin_by_name): Return placeholder on failure.
2946 (m4_builtin): Treat placeholder as undefined.
2947 * doc/m4.texinfo (Frozen files): Document changes in V and F.
2948 * NEWS: Document this change.
2949 Reported by Bruno Haible.
2951 * doc/m4.texinfo: Whitespace cleanup. TABs are evil in texinfo.
2952 (tabchar): New macro, so that 'make check' still works.
2953 (Invoking m4): Document that ignored compatibility options -B, -S,
2954 and -T each consume an argument.
2955 * checks/get-them: Honor @tabchar{}.
2957 Avoid compiler warnings during -DDEBUG.
2958 * src/m4.h (M4_GNUC_ATTRIBUTE, M4_GNUC_UNUSED): New macros.
2959 [DEBUG]: Also imply DEBUG_OUTPUT and DEBUG_STKOVF.
2960 * src/input.c (print_token) [DEBUG_INPUT]: Use correct format.
2961 (lex_debug) [DEBUG_INPUT]: Fix to compile. Mark unused.
2962 (next_token) [DEBUG_INPUT]: Print before returning.
2963 * src/path.c (include_dump) [DEBUG_INCL]: Mark unused.
2964 * src/symtab.c (symtab_debug) [DEBUG_SYM]: Mark unused.
2966 Avoid mkstemp bugs on various platforms.
2967 * m4/gnulib-cache.c: Augment with gnulib-tool --import mkstemp.
2968 * src/output.c [! HAVE_MKSTEMP]: Delete.
2969 * configure.ac (AC_CHECK_FUNCS): Don't check for mkstemp.
2970 * src/m4.h (mkstemp) [! HAVE_MKSTEMP]: Prototype, if needed.
2971 * NEWS: Document this.
2973 * Makefile.am (EXTRA_DIST): Distribute gnulib-cache.m4.
2974 Reported by Bruno Haible.
2976 2006-06-21 Eric Blake <ebb9@byu.net>
2978 Avoid obsolete sigstack when POSIX sigaltstack is available.
2979 * src/m4.c: Blindly assume signal.h, since stackovf.c and gnulib
2981 * configure.ac (AC_CHECK_HEADERS): Likewise.
2982 (AC_CHECK_TYPES): New check for siginfo_t, since siginfo.h is
2983 obsolete and most hosts now have it in signal.h.
2984 (AC_CHECK_MEMBERS): New check for sigaction.sa_sigaction.
2985 (AC_CACHE_CHECK): Cache decision to use stackovf.
2986 (AC_EGREP_HEADER): Switch to AC_CHECK_TYPES.
2987 * src/stackovf.c (DEBUG_STACKOVF): Remove unused define.
2988 (SA_RESETHAND, SA_SIGINFO): Provide fallback definitions, to
2989 simplify later code.
2990 (PARAM_STACKOVF, PARAM_NOSTACKOVF): Move further away from NULL,
2991 in case of dereferencing a member of a NULL pointer.
2992 (sigsegv_handler) [HAVE_STRUCT_SIGACTION_SA_SIGACTION]: Define a
2994 (setup_stackovf_trap): Use NULL instead of 0 for pointers, use
2995 EXIT_FAILURE in error, indent preprocessor directives.
2996 [HAVE_SIGALTSTACK && HAVE_SIGINFO_T]: Depend on siginfo_t, not
2998 [HAVE_SIGACTION && defined SA_ONSTACK]: Prefer POSIX handler.
2999 Reported by Santiago Vila.
3001 2006-06-19 Eric Blake <ebb9@byu.net>
3005 2006-06-18 Andreas Buening <andreas.buening@nexgo.de> (tiny change)
3007 * checks/Makefile.in (PATH_SEPARATOR): New macro.
3008 (check, installcheck): Use it, for OS/2.
3010 2006-06-18 Eric Blake <ebb9@byu.net>
3012 Consistently use "GNU M4" as package name, "m4" as executable
3014 * NEWS: Document previous fix.
3016 * README: Fix grammar. Document that --enable-changeword is on
3018 * doc/m4.texinfo (Top, Changeword): Likewise.
3019 (Sysval): Enhance this test.
3020 (History): Backport this section from CVS head, and update.
3022 2006-06-18 Bruno Haible <bruno@clisp.org> (tiny change)
3023 Eric Blake <ebb9@byu.net>
3025 * src/builtin.c (WEXITSTATUS): Provide fallback definition.
3026 (m4_esyscmd): Set sysval to 0xffff, to accomodate both
3027 big-endian and little-endian wait status definitions.
3028 (m4_sysval): Use WEXITSTATUS.
3029 Reported by Andreas Buening.
3031 2006-06-18 Eric Blake <ebb9@byu.net>
3033 * configure.ac (AC_INIT): Bump version number.
3034 * NEWS: Describe changes in 1.4.4c.
3036 2006-06-17 Eric Blake <ebb9@byu.net>
3038 Beta Release 1.4.4b:
3039 * configure.ac (AC_INIT): Bump version number.
3040 * NEWS: Describe changes since 1.4.4.
3041 * Makefile.maint (cvs-news): Accomodate copyright line wrapping.
3043 * Makefile.am (MAINTAINERCLEANFILES): Clean files added by
3045 * checks/Makefile.in (maintainer-clean): Add missing target.
3046 * COPYING: Remove generated file from CVS.
3048 2006-06-16 Eric Blake <ebb9@byu.net>
3050 * checks/Makefile.in (DISTFILES): Distribute wrapfifo.m4.
3052 2006-06-15 Eric Blake <ebb9@byu.net>
3054 * checks/wrapfifo.m4: New file. Use it...
3055 * doc/m4.texinfo (Incompatibilities): here, in a new test case to
3056 demonstrate how to get POSIX behavior of m4wrap prior to m4 2.0.
3058 * src/m4.h (to_uchar): New function.
3059 * src/eval.c (eval_lex): Use it to avoid passing signed char to
3060 isdigit, isalpha, isupper, islower, isspace, isalnum.
3061 * src/builtin.c (expand_user_macro): Likewise.
3062 * src/format.c (format): Likewise.
3063 * src/macro.c (expand_argument): Likewise.
3064 * NEWS: Document this security fix.
3067 * src/symtab.c (lookup_symbol): Use invalid, not illegal.
3068 * src/freeze.c (reload_frozen_state): Fix typo in message.
3069 (produce_frozen_state): Standardize on builtin, not built-in.
3070 * src/builtin.c (numeric_arg, bad_argc): Likewise.
3072 * configure.ac (M4_EARLY, M4_INIT): Use gnulib.
3073 (AC_PROG_RANLIB, AC_AIX, AC_MINIX, AC_CHECK_HEADERS),
3074 (AC_FUNC_ALLOCA, AC_REPLACE_FUNCS): Avoid checks now done by
3076 * Makefile.am (ACLOCAL_AMFLAGS): New entry, for gnulib.
3077 * m4/gnulib-cache.m4: New file, from gnulib.
3078 * bootstrap: Invoke gnulib-tool --update.
3079 * src/m4.c (main): Cast away const.
3080 * NEWS: Document that regex is updated.
3083 2006-06-08 Eric Blake <ebb9@byu.net>
3085 * configure.ac (changeword): Work even when changeword is not a
3087 (AC_PROG_AWK, AC_PROG_INSTALL, AC_PROG_MAKE_SET, AC_HEADER_STDC):
3088 Delete; now done by automake.
3089 (AC_ISC_POSIX, AC_C_CONST): Delete; now obsolete.
3091 2006-06-07 Eric Blake <ebb9@byu.net>
3093 * lib/regex.c (bcmp_translate): Canonicalize type name.
3094 * doc/Makefile.am (MAINTAINERCLEANFILES): Fix typo.
3095 * configure.ac (changeword): Disable changeword for the creation
3096 of configure, in case of bootstrapping with an m4 configured with
3097 --enable-changeword.
3099 Distribute a rudimentary man page.
3100 * Makefile.am (SUBDIRS): Move doc after src so that 'm4 --help'
3102 * doc/Makefile.am (man_MANS, EXTRA_DIST, MAINTAINERDISTCLEAN),
3103 (SUFFIXES, m4.1): New macros and rules to build m4.1.
3105 2006-06-06 Eric Blake <ebb9@byu.net>
3107 * lib/regex.c (re_match_2_internal, bcmp_translate): Avoid
3108 compiler warnings at -O2.
3109 * lib/getopt.c (_getopt_internal): Likewise.
3111 Cleanup of previous patches.
3112 * src/input.c (struct input_block): Remove traced member.
3113 (push_macro, init_macro_token): Don't pass trace status around.
3114 * src/m4.h (struct token_data): Remove traced member.
3115 (struct symbol, struct builtin): Reduce unused space.
3116 (TOKEN_DATA_FUNC): Simplify.
3117 (TOKEN_DATA_FUNC_TRACED): Remove unused macro.
3118 (push_macro, define_builtin): Remove unused parameter.
3119 * src/builtin.c (define_builtin, builtin_init, define_macro),
3120 (m4_defn): Don't pass trace status around.
3121 * src/macro.c (expand_argument): Likewise.
3122 * src/freeze.c (reload_frozen_state): Likewise.
3123 * src/symtab.c: Whitespace cleanup.
3124 * NEWS: Clean up wording.
3125 * doc/m4.texinfo (Undefine, Dumpdef, Trace): Cleanup wording;
3126 ensure tests actually expose bugs prior to today's patches.
3128 Trace status of builtins is no longer inherited across
3129 define(...,defn(...)). Fixes bug that autom4te had been working
3131 * src/builtin.c (define_builtin): Don't override trace status.
3132 * doc/m4.texinfo (Trace): Add test for this.
3133 * NEWS: Document this.
3135 When changing macro definitions inside the arguments to the macro,
3136 consistently preserve the old definition that was in effect before
3137 argument collection, similar to the C pre-processor.
3138 Reported by John Brzustowski.
3139 * NEWS: Document this change.
3140 * doc/m4.texinfo (Macro Arguments, Undefine, Dumpdef): Document
3141 this policy, and add tests that expose core dumps prior to this
3143 * src/m4.h (struct symbol): New members to track when a symbol is
3144 still in use after removal from the symbol table.
3145 (SYMBOL_PENDING_EXPANSIONS, SYMBOL_DELETED): Define.
3146 (free_symbol): Prototype.
3147 * src/macro.c (expand_macro): Track pending expansions of a
3148 symbol. On completion, if a symbol is deleted and no longer
3149 pending, free its memory.
3150 * src/symtab.c (free_symbol): Export. Don't free memory if symbol
3152 (lookup_symbol) <SYMBOL_INSERT>: Create new entry when old entry
3154 (lookup_symbol) <SYMBOL_DELETE, SYMBOL_POPDEF>: Mark entries still
3155 in use as deleted and remove from the table without freeing
3157 (symtab_print_list) [DEBUG_SYM]: More debug output.
3159 * src/symtab.c (hack_all_symbols): Allow certain modifications of
3160 the symbol table during traversal.
3161 * src/builtin.c (set_trace): Replace SYMBOL_DELETE with
3162 SYMBOL_POPDEF, since only the latter is safe with
3165 Solve crash when passing "indir(`foo')" to "m4 -tfoo".
3166 * src/symtab.c (lookup_symbol) <SYMBOL_DELETE, SYMBOL_POPDEF>:
3167 Preserve placeholder when macro is being traced.
3168 * src/builtin.c (m4_ifdef, m4_indir): A traced but undefined
3169 symbol is not defined.
3170 (set_trace): Remove placeholder when no longer traced.
3171 (m4_traceon): On named traces, always reserve a slot in the
3173 (m4_traceoff): Don't warn about untracing a nonexistent symbol.
3174 * NEWS: Document new trace behavior.
3175 * doc/m4.texinfo (Trace): Tracing by name now consistently works
3176 no matter whether that macro is currently defined.
3177 (Incompatibilities): Document differences between traditional and
3180 2006-06-04 Paul Eggert <eggert@cs.ucla.edu> (tiny change)
3181 Eric Blake <ebb9@byu.net>
3183 * src/m4.h (hash_table_size): Now size_t instead of int.
3184 * src/m4.c (hash_table_size): Likewise.
3185 (main): Adjust to this; use atol rather than atoi.
3186 * src/symtab.c: Include <limits.h>, for CHAR_BIT.
3187 (symtab_init, lookup_symbol, hack_all_symbols):
3188 Use size_t for sizes and indexes, not int.
3189 (symtab_print_list) [DEBUG_SYM]: Likewise.
3190 (hash): Likewise. Don't case-fold in the hash function.
3191 Shift by 7, not 3, for consistency with gnulib/lib/hash.c.
3192 Don't assume hash word is 32 bits.
3193 * NEWS: Document this change.
3195 2006-06-04 Eric Blake <ebb9@byu.net>
3197 * src/symtab.c (symtab_debug, symtab_print_list) [DEBUG_SYM]: Fix
3198 to allow compilation, for use in debugger.
3199 (profiles, current_mode) [DEBUG_SYM]: New variables.
3200 (show_profile, profile_strcmp) [DEBUG_SYM]: New methods for
3201 determining hash table performance.
3203 2006-05-31 Eric Blake <ebb9@byu.net>
3204 John Brzustowski <jbrzusto@fastmail.fm>
3206 * src/input.c (input_stack): Delete; use current_input instead.
3207 (wrapup_stack): Dynamically allocate, so that recursion is handled
3209 (push_wrapup): Use current wrapup stack.
3210 (pop_wrapup): Rotate wrapup stack to current, and create new
3212 (input_init): Dynamically allocate stacks.
3213 * NEWS: Update, now that recursive m4wrap can no longer cause
3216 2006-05-31 Eric Blake <ebb9@byu.net>
3218 * lib/getopt.c: Fix copyright year.
3219 * lib/obstack.c: Ditto.
3220 * src/builtin.c: Ditto.
3222 2006-05-30 Eric Blake <ebb9@byu.net>
3224 * doc/m4.texinfo (M4wrap): Add test to expose m4wrap bug.
3225 Reported by John Brzustowski.
3226 (Incompatibilities): Document known POSIX incompatibilities.
3229 2006-05-29 Eric Blake <ebb9@byu.net>
3231 * doc/m4.texinfo (Maketemp): Work even when running 'make check'
3235 * Makefile.am: New file.
3236 * doc/Makefile.am: Ditto.
3237 * examples/Makefile.am: Ditto.
3238 * lib/Makefile.am: Ditto.
3239 * src/Makefile.am: Ditto.
3240 * acinclude.m4: New file, renamed from aclocal.m4.
3241 * configure.ac (AM_INIT_AUTOMAKE): Invoke new macro.
3242 (AC_ARG_PROGRAM): Now redundant.
3243 (STACKOVF): Turn into automake conditional.
3244 (AC_CONFIG_COMMANDS): stamp-h is a command, not a file.
3245 * checks/Makefile.in: Converting this dir to automake was not
3246 trivial; for now, just add missing targets demanded by top-level.
3247 * INSTALL: Remove files that are now generated from CVS.
3248 * Makefile.in: Ditto.
3249 * aclocal.m4: Ditto.
3250 * install-sh: Ditto.
3251 * mkinstalldirs: Ditto.
3252 * doc/Makefile.in: Ditto.
3253 * doc/texinfo.tex: Ditto.
3254 * examples/Makefile.in: Ditto.
3255 * lib/Makefile.in: Ditto.
3256 * src/Makefile.in: Ditto.
3258 * AUTHORS: Backport from CVS head, and update.
3259 * doc/m4.texinfo (Changeword): Fix examples to match behavior.
3261 2006-05-27 Eric Blake <ebb9@byu.net>
3263 * lib/regex.c (regex_compile): Kill compiler warnings.
3264 * lib/getopt.c: Likewise.
3265 * lib/obstack.c: Likewise.
3266 * src/builtin.c (builtin_init): Likewise.
3267 * src/path.c (path_search): Likewise.
3269 * doc/m4.texinfo: Fix usage of a vs. an.
3270 (Loops, Include, Cleardiv, Patsubst, Format, M4exit): Kill
3271 overfull hbox warnings.
3272 (Inhibiting Invocation, Divert, Maketemp, M4exit): Add new tests.
3274 * configure.ac: Update to autoconf 2.59. Forbid ^M4_. Fix
3276 * aclocal.m4 (fp_PROG_CC_STDC): Delete; now covered by autoconf.
3277 (fp_C_PROTOTYPES): Delete, GNU Coding Standards state we can now
3279 (M4_WITH_DMALLOC): Rename from fp_WITH_DMALLOC. Fix quoting.
3280 * src/m4.h (_): PROTOTYPES is no longer provided, assume C89.
3281 * src/Makefile.in: Delete remains of ansi2knr.
3282 * src/ansi2knr.1: Delete.
3283 * src/ansi2knr.c: Delete.
3285 2006-05-25 Eric Blake <ebb9@byu.net>
3287 * doc/m4.texinfo: Fix spelling errors. Use `invalid' instead of
3290 * doc/m4.texinfo (Francois): No longer needed as a tex variable.
3291 Reported by Karl Berry.
3293 2006-05-24 Eric Blake <ebb9@byu.net>
3295 * Makefile.in (html): New target.
3296 * doc/Makefile.in (html, m4.html): Likewise.
3297 (MAKEINFOHTML): New macro.
3298 * doc/m4.texinfo (Francois) [ifnottex]: Use newer texinfo
3300 (Regexp) [ifhtml]: Make cross-reference to emacs manual an
3302 Reported by Bob Badour.
3304 * THANKS: Update. Move reporter's email addresses here, instead
3307 2006-05-11 Eric Blake <ebb9@byu.net>
3310 * doc/m4.texinfo (Changequote): Give testsuite exposure to bug
3311 patched on 2005-12-04.
3312 Reported by Ilya N. Golubev.
3314 * bootstrap: New file, so that generated files need not be stored
3316 * Makefile.in (DISTFILES): Add bootstrap.
3318 Make testsuite less sensitive to doc changes.
3319 * doc/m4.texinfo: Use m4.input instead of filename.
3320 * checks/check-them (xerr): Turn m4.input into filename.
3321 * checks/Makefile.in (dist): Depend on stamp-checks.
3323 Portability updates for OS/2.
3324 * src/Makefile.in (EXEEXT, OBJEXT): Define.
3327 * lib/Makefile.in (OBJEXT): Define.
3329 * doc/Makefile.in (install, uninstall): Install info files into
3331 Reported by Andreas Buening.
3333 2006-05-09 Eric Blake <ebb9@byu.net>
3335 * install-sh: Update to newer upstream version.
3336 * mkinstalldirs: Likewise.
3337 Reported by Andreas Buening.
3339 * src/m4.c (main): Bump copyright year.
3340 * Makefile.in (datarootdir): Define, for autoconf 2.59c.
3341 * doc/Makefile.in (datarootdir): Likewise.
3343 2006-05-08 Eric Blake <ebb9@byu.net>
3346 * doc/m4.texinfo (Bugs): Backport bug email address from head.
3347 Reported by Stepan Kasal.
3349 2005-12-04 Ilya N. Golubev <gin@mo.msk.ru> (tiny change)
3351 * input.c (match_input): Do not pass expression with side effect
3352 to `obstack_grow'. Fix <INTERNAL ERROR: Recursive push_string!>.
3355 2005-12-04 Gary V. Vaughan <gary@gnu.org> (tiny change)
3357 * doc/m4.texinfo (How to debug macros and input): s/woould/would/
3358 Reported by Damian Menscher.
3360 2005-10-19 Gary V. Vaughan <gary@gnu.org> (tiny change)
3362 * configure.ac (AC_INIT): Bump to 1.4.4a.
3364 2005-10-19 Gary V. Vaughan <gary@gnu.org> (tiny change)
3367 * configure.ac (AC_INIT): Bump to 1.4.4.
3368 * NEWS: Describe 1.4.4's changes.
3369 * INSTALL, install-sh, doc/texinfo.tex: Updated from upstream.
3371 2005-10-17 John Gatewood Ham <zappaman@buraphalinux.org> (tiny change)
3373 * src/m4.c: fix return code when non-existent files are processed
3375 2005-10-17 John Gatewood Ham <zappaman@buraphalinux.org> (tiny change)
3377 * README: update email address for bug reports.
3379 2005-10-17 Gary V. Vaughan <gary@gnu.org>
3381 * doc/m4.info: Generated files are not kept in the repository.
3383 2005-05-01 Gary V. Vaughan <gary@gnu.org>
3385 The FSF are moving offices today. Changed their contact address
3386 in all files from `59 Temple Place, Suite 330, MA 02111-1307' to
3387 `51 Franklin Street, Fifth Floor, MA 02110-1301'.
3389 Also, some of the files here were never updated from the previous
3390 '675 Mass Ave, Cambridge, MA 02139', so changed those to the
3391 '51 Franklin Street, Fifth Floor, MA 02110-1301' address too.
3393 2005-03-31 Mike Frysinger <vapier@gentoo.org>
3395 * Makefile.in (bindir, infodir): Substitute from configure rather
3397 * doc/Makefile.in (infodir): Ditto.
3398 * src/Makefile.in (bindir): Ditto.
3401 2005-03-31 Gary V. Vaughan <gary@gnu.org>
3403 Changes needed to automate the release process for 1.4.3:
3405 * Makefile.in (dist): Make .tar.bz2 tarball too.
3406 * Makefile.maint (TSDEPS_DIST): Remove m4/libtool.m4.
3407 (cvs-news): Look 1 line further down for NEWS release number.
3408 (cvs-dist): We don't use automake, so make dist is fine.
3409 Remove double . before suffixes.
3410 (cvs-release): Don't mention manual.html.
3411 (fetch): Get latest gendocs files.
3412 (web-manual): Rewritten to use gendoc for multiformat manuals.
3413 * doc/gendocs.sh: Don't save an old version in m4 CVS!
3414 * doc/m4.texinfo (Index): HFS+ (the file system on my Mac) is case
3415 preserving, but case insensitive, so generating html docs per node
3416 clashes between Index.html, the node file, and index.html, the
3417 top-level of the document tree...
3418 (Index macro): ...so renamed to this. Changed all references.
3420 2005-03-31 Gary V. Vaughan <gary@gnu.org> (tiny change)
3422 * configure.ac (AC_INIT): Bump to 1.4.3a.
3424 2005-03-31 Gary V. Vaughan <gary@gnu.org> (tiny change)
3427 * configure.in (AC_INIT): Bump to 1.4.3.
3428 * NEWS: Describe 1.4.3's changes.
3430 2005-03-31 Gary V. Vaughan <gary@gnu.org>
3432 * Makefile.maint: New file with release rules, from CVS libtool.
3433 * Makefile.in (DISTFILES): Add Makefile.maint.
3434 * INSTALL, install-sh, doc/texinfo.tex: Updated to latest
3437 2005-03-31 Eric Blake <ebb9@byu.net> (tiny change)
3439 * doc/m4.texinfo (Patsubst): Re-add trailing space required by
3440 checks/47.patsubst, with a redundant @comment to prevent emacs
3441 from removing it accidentally again.
3442 * checks/get-them: Allow for trailing spaces tucked behind
3445 2005-03-31 Eric Blake <ebb9@byu.net> (tiny change)
3447 * doc/Makefile.in (install, uninstall): Accomodate DESTDIR.
3448 * src/Makefile.in (install, uninstall): Likewise.
3450 2005-02-07 Gary V. Vaughan <gary@gnu.org>
3452 * lib/regex.c, lib/regex.h: Reverted gnulib update, which broke
3454 Reported by Eric Blake.
3456 2005-02-04 Gary V. Vaughan <gary@gnu.org>
3458 * lib/regex.c, lib/regex.h: Updated from gnulib.
3459 * src/input.c (set_word_regexp): Don't change the word_regexp
3460 unless it compiles correctly.
3462 Reported by Frank Schwidom.
3464 * Makefile.in (stamp-h): Regenerate config.h properly.
3466 2005-02-03 Gary V. Vaughan <gary@gnu.org>
3468 * configure.ac (AC_DEFINE): Fix overquoting of description
3471 * src/m4.h (__CYGWIN__, WIN32): Canonicalise Windows and Cygwin
3473 * src/freeze.c (produce_frozen_state): Use \n line-endings even
3474 on Windows, so that the frozen file reader will work.
3475 Reported by Josef T. Burger.
3477 * src/m4.c (main): Modernise the --version output.
3479 2005-02-03 Gary V. Vaughan <gary@gnu.org>
3481 Modernise the configury a little to prevent spurious errors from
3482 Autoconf-2.59's autoreconf:
3484 * config.h.in: Renamed to...
3485 * config-h.in: ...this to better support DOS 8.3 file systems.
3486 * acconfig.h: Removed.
3487 * configure.in: Renamed to...
3488 * configure.ac: ...this, and AC_DEFINE used to declare config.h
3489 entry comments. Slight reorganisation and reformatting.
3490 * aclocal.m4: Use third argument to AC_DEFINE to declare config.h
3492 (AC_INIT): Use a modern 3 argument call.
3493 * Makefile.in, checks/Makefile.in, doc/Makefile.in,
3494 examples/Makefile.in, lib/Makefile.in, src/Makefile.in:
3495 s/PRODUCT/PACKAGE/g.
3496 * Makefile.in (DISTFILES): Removed acconfig.h, configure.in,
3497 config.h.in. Added configure.ac, config-h.in.
3498 (stamp-h.in): Removed acconfig.h from dependencies.
3499 (configure): Depends on configure.ac, not configure.in.
3500 * doc/Makefile.in (stamp-vti): Ditto.
3501 * src/freeze.c (produce_frozen_state), src/m4.c (main): Adjust for
3502 difference between PRODUCT="m4" and PACKAGE="GNU M4".
3503 * configure: Regenerated.
3505 2005-02-03 Noah Misch <noah@cs.caltech.edu>
3507 * src/output.c (mkstemp): Make non-static, and build regardless of
3508 HAVE_TMPFILE; src/builtin.c also needs this replacement.
3511 2004-09-09 Vincent Lonngren <Vincent.lonngren.759@student.lu.se>
3513 * configure.in (AC_CHECK_HEADERS): Commit works best when you save
3514 changes from your editor buffer first.
3516 * configure.in (AC_CHECK_HEADERS): Add signal.h, sys/signal.h.
3517 * src/m4.c: And include them as appropriate.
3520 2004-09-09 Andreas Schwab <schwab@suse.de>
3522 Refactoring of the string read case in next_char provides about a
3523 20% speedup of M4 as typically used by autoconf:
3525 * src/input.c (next_char_1): Renamed from next_char.
3526 (next_char): New macro.
3529 2004-08-21 Gary V. Vaughan <gary@gnu.org>
3531 * configure.in (VERSION): Bump to 1.4.2a.
3533 2004-08-19 Paul Eggert <eggert@twinsun.com>
3536 * configure.in (VERSION): Bump to 1.4.2.
3537 * News: Describe 1.4.2's changes.
3539 * src/m4.c (reference_error): Preserve errno, since M4ERROR
3541 * src/builtin.c (m4_esyscmd): Clear errno before calling popen.
3542 (m4_maketemp): Clear errno before calling mkstemp.
3543 * src/path.c (path_search): Don't let "free" trash errno when
3545 * src/output.c (insert_file): Don't assume errno has a valid
3546 value simply because fread returns zero. This fixes a
3547 portability bug reported by Marion Hakanson in
3548 <http://lists.gnu.org/archive/html/bug-m4/2004-07/msg00029.html>.
3550 2004-06-09 Gary V. Vaughan <gary@gnu.org>
3552 * configure.in (VERSION): Bump to 1.4.1a.
3553 * NEWS: Place holder for next stable release.
3555 2004-06-03 Paul Eggert <eggert@cs.ucla.edu>
3558 * configure.in (VERSION): Bump to 1.4.1.
3559 * NEWS: Describe 1.4.1's changes.
3561 * aclocal.m4 (fp_PROG_CC_STDC): Use AC_DEFUN, not define, to
3562 pacify Autoconf 2.59.
3564 * doc/m4.texinfo: Insert commas after @xref's that lack them,
3565 to pacify Texinfo 4.7.
3566 * doc/Makefile.in (info): Remove info-1, info-2, info-3.
3568 * src/m4.h, src/debug.c: Use #ifdef __STDC__, not #if __STDC__, to
3569 pacify Sun C compilers.
3571 2003-09-28 Akim Demaille <akim@epita.fr>
3573 * src/symtab.c (lookup_symbol): Fix an uninitialized-variable
3576 2003-09-03 Santiago Vila <sanvila@debian.org>
3578 * examples/stackovf.sh: Use tempfile if available.
3580 2001-04-02 Robert Bihlmeyer <robbe@orcus.priv.at>
3582 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=92629
3583 * src/output.c (m4_insert_file): Do not mix buffered and
3584 unbuffered I/O, as this breaks on the Hurd. (trivial change)
3586 2001-02-01 Santiago Vila <sanvila@debian.org>
3588 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=84451
3589 * src/m4.c (main): Fix format vulnerabilities. (trivial change)
3591 2001-02-01 Matt Kraai <kraai@debian.org>
3593 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=84416
3594 * doc/m4.texinfo (Maketemp): Change maketemp to refer to a new,
3595 empty file rather than to a nonexistent file. This closes a common
3597 * src/builtin.c (m4_maketemp): Implement the above, by using
3598 mkstemp rather than mktemp. (trivial change)
3600 2000-01-09 Akim Demaille <demaille@inf.enst.fr>
3602 * src/builtin.c (expand_ranges): Added break after trailing dash.
3603 This caused misbehaviors on some systems.
3605 Sat Nov 5 15:52:47 1994 Francois Pinard (pinard@icule)
3608 * doc/Makefile.in (realclean): Also remove stamp-vti.
3609 Reported by Eric Backus.
3611 Wed Nov 2 00:47:53 1994 Francois Pinard (pinard@icule)
3613 * src/freeze.c (produce_frozen_state): If the frozen file cannot
3614 be opened, return immediately after producing the error message.
3615 Reported by Andreas Schwab.
3617 * configure.in: Check for const only after having found possible
3618 ANSIfying compiler flags, this is of no use to check it before.
3619 Reported by Alexander Lehmann.
3621 Tue Nov 1 22:02:37 1994 Francois Pinard (pinard@icule)
3623 * src/macro.c (collect_arguments): Cast obstack arguments to
3624 (voidstar), so avoiding compiler warnings.
3625 Reported by Joseph E. Sacco.
3627 * src/freeze.c (produce_frozen_state): Cast printed lengths to
3628 (int) so they correspond to %d format items.
3629 Reported by Joseph E. Sacco.
3631 * src/m4.c (main): Cast the argument to xfree to (voidstar).
3632 * src/symtab.c (free_symbol): Idem.
3633 Reported by Karl Vogel.
3635 Mon Oct 31 02:11:19 1994 Francois Pinard (pinard@icule)
3637 * Makefile.in (DISTFILES): Distribute BACKLOG.
3639 * configure.in: Define PRODUCT and VERSION.
3640 * acconfig.h: Document PRODUCT and VERSION.
3641 * src/m4.c, src/freeze.c: Use PRODUCT and VERSION instead of the
3642 constant string m4 and variable or parameter named version.
3644 Sun Oct 30 08:13:03 1994 Francois Pinard (pinard@icule)
3646 * src/m4.h, src/debug.c: Replace all #ifdef __STDC__ by #if
3647 __STDC__. Alliant FX/2800 Concentrix 2.2 (i860-BSD4.3) compiler
3648 defines __STDC__ to 0, for indicating it is *not* ANSI!
3649 Reported by Kaveh R. Ghazi.
3651 * configure.in: Added obsolescent tests for AIX and Minix.
3653 * doc/Makefile.in (mostlyclean): Remove texclean in dependencies,
3654 which texclean does not exist anymore.
3655 Reported by Eric Backus, Jim Meyering, John David Anglin and
3658 Sat Oct 29 05:10:03 1994 Francois Pinard (pinard@icule)
3660 * aclocal.m4 (fp_C_PROTOTYPES): Force -D_HPUX_SOURCE with -Aa.
3661 Reported by John David Anglin.
3663 * src/ansi2knr.c: New version, sent by Peter Deutsch.
3664 * aclocal.m4 (fp_C_PROTOTYPES): Substitute empty or ansi2knr for
3665 ANSI2KNR, depending on the fact the compiler is ANSI or not.
3666 * src/Makefile.in: Use -Ovarargs=convert on ansi2knr calls.
3667 Remove the sed filter after ansi2knr for debug.c. Use $O instead
3668 of $U, put underline in extensions rather than in basenames. Use
3669 implicit rules, now that regularity makes this possible.
3670 Have $(OBJECTS) depend on $(ANSI2KNR), so to trigger compilation
3671 of ansi2knr whenever it is needed.
3672 * configure.in: Adjusted for correct STACKOVF substitution.
3673 * src/debug.c (trace_format): When not __STDC__, use (...) as a
3674 parameter list, so ansi2knr will convert it to (va_alist) va_dcl.
3675 Reported by David MacKenzie.
3677 * Makefile.in: Remove binprefix. Use transform_name instead.
3678 Reported by David MacKenzie.
3680 * doc/Makefile.in: Create version.texi, use it, clean it.
3681 Reported by Jim Meyering.
3683 Fri Oct 28 20:33:55 1994 Francois Pinard (pinard@icule)
3685 * Makefile.in (all, install, uninstall): Depend on Makefile.
3687 * Makefile.in: For actions invoking $(MAKE) from within compound
3688 sh statements, exit non-zero if the sub-make fails. Otherwise,
3689 the top-level make may exit successfully when it should fail.
3690 Reported by Jim Kingdon.
3692 * {,/*}Makefile.in: Use && after all cd, in case they fail.
3694 * {,*/}Makefile.in: Declare PRODUCT and VERSION macros.
3695 (dist): Use PRODUCT and VERSION instead of tricks on .fname.
3696 * configure.in: Substitute PRODUCT and VERSION.
3698 * {,*/}Makefile.in (dist): Always try a hard link before a copy.
3700 Thu Oct 27 22:32:58 1994 Francois Pinard (pinard@icule)
3702 * Makefile.in (mostlyclean-local): Do not remove *~.
3703 * */Makefile.in (mostlyclean): Idem.
3704 Reported by Robert E. Brown and Richard Stallman.
3706 Sun Oct 9 08:30:13 1994 Francois Pinard (pinard@icule)
3708 * src/m4.h: Get rid of CONFIG_BROKETS.
3710 Sun Oct 2 16:48:10 1994 Francois Pinard (pinard@icule)
3712 * configure.in: Use AC_ARG_PROGRAM.
3713 * aclocal.m4 (fp_C_PROTOTYPES): Substitute @kr@ by kr or empty.
3714 Reported by David MacKenzie.
3716 Sat Oct 1 11:22:42 1994 Francois Pinard (pinard@icule)
3718 * configure.in: Do not add -O to CFLAGS for GNU C, now that
3719 configure does it automatically.
3720 Reported by Jim Meyering.
3722 Fri Sep 23 08:16:58 1994 Francois Pinard (pinard@icule)
3724 * src/stackovf.c: Declare the handler_t typedef earlier in the
3725 code, use it for stackovf_handler.
3726 (setup_stackovf_trap): Use RETSIGTYPE instead of void while
3727 casting sigsegv_handler.
3728 Reported by Robert Bernstein.
3730 * src/m4.c (main): Initialize program_name to argv[0] without
3732 Reported by Karl Berry.
3734 Sun Sep 18 11:42:50 1994 Francois Pinard (pinard@icule)
3736 * src/Makefile.in (TAGS): Include a ../lib/TAGS reference.
3737 Reported by Karl Berry.
3739 Wed Sep 14 10:00:22 1994 Francois Pinard (pinard@icule)
3741 * lib/Makefile.in (mostlyclean): Added.
3742 (TAGS): Make in $(srcdir).
3744 * configure.in: Use `choke me' in test, like everywhere!
3746 * {doc,examples,lib,src}/Makefile.in (check): Deleted, as
3747 unreacheable and useless.
3749 * doc/Makefile.in (texclean): Deleted, merged in mostlyclean.
3751 * lib/Makefile.in (DISTFILES): Distribute TAGS.
3752 (distclean): Do not remove TAGS.
3753 (realclean): Remove it.
3754 * Makefile.in: Make TAGS in lib also, not just in src.
3755 Reported by Karl Berry.
3757 * Makefile.in (distclean, realclean): Instead of recursively
3758 calling $(MAKE) for the -local part, allow parallel execution of
3759 -recursive and -local, only delay the removal of config.status,
3760 which is repeated in both goals.
3762 Tue Sep 13 19:21:05 1994 Francois Pinard (pinard@icule)
3765 * Makefile.in: Group all *clean-recursive goals in one, using sed
3766 to remove `-recursive' while calling make recursively. Also, use
3767 a subshell for each recursive $(MAKE).
3768 Reported by Jim Meyering.
3770 * src/m4.h (memcpy): Define with bcopy for BSD systems.
3771 Reported by Kaveh R. Ghazi.
3773 * src/Makefile.in (ansi2knr): Use $(LIBS) while linking, for SunOS
3774 4.1.3 requires -ldl to link even ansik2nr, and we need a way to
3777 * configure.in: Use date instead of touch for stamp-h.
3778 * Makefile.in (stamp-h.in): Idem.
3780 * Makefile.in (distclean, realclean): Force serial execution of
3781 both goals, in case parallel makes are being used.
3782 Reported by Jim Meyering.
3784 * src/Makefile.in (DISTFILES): Distribute TAGS.
3785 (distclean): Do not remove TAGS.
3786 (realclean): Remove it.
3787 Reported by Karl Berry.
3789 Sat Sep 10 12:34:04 1994 Francois Pinard (pinard@icule)
3791 * configure.in: Use fp_ to match aclocal.m4. Revert _OS_ macros
3792 to old names, for following Autoconf.
3794 Thu Sep 8 15:07:27 1994 Francois Pinard (pinard@icule)
3796 * Makefile.in (MDEFINES): Remove INSTALL substitutions, for
3797 ./install.sh will not be correctly referred to in sub-Makefiles.
3798 Reported by John David Anglin.
3800 * doc/Makefile.in (texclean): Remove *.cps and *.fns too.
3801 Reported by Eric Backus.
3803 * Makefile.in, checks/Makefile.in, doc/Makefile.in,
3804 examples/Makefile.in, lib/Makefile.in, src/Makefile.in: Limit
3805 config.status into remaking this directory's Makefile only.
3806 * Makefile.in (stamp-h): Do not check nor touch stamp-h.
3807 * configure.in (AC_OUTPUT): Touch stamp-h if CONFIG_HEADERS.
3808 Reported by Jim Meyering.
3810 Tue Sep 6 12:07:33 1994 Francois Pinard (pinard@icule)
3812 * configure.in: Correct stack overflow detection logic, taking
3813 care of systems having only incomplete implementations (like for
3814 Pyramid 9820 OSx 5.0d).
3815 Reported by Kaveh R. Ghazi.
3817 * src/Makefile.in (TAGS): Remote -t from etags call.
3819 Fri Sep 2 10:37:10 1994 Francois Pinard (pinard@icule)
3821 * lib/Makefile.in (install): Depend on all.
3823 Wed Aug 31 11:17:21 1994 Francois Pinard (pinard@icule)
3825 * examples/Makefile.in (mostlyclean): Do not depend on texclean.
3826 Reported by Jim Meyering and John David Anglin.
3828 * Makefile.in (distclean-local): Delete config.log.
3829 Reported by Jim Meyering.
3831 Solidify frozen files with respect to -P:
3832 * src/m4.c: Have -P set prefix_all_buitins variable instead of
3833 calling a function by that name. Declare the variable.
3834 * src/m4.h: Adjust declaration for prefix_all_buitins.
3835 * src/builtin.c (builtin_init): Merge in functionality from
3836 previous prefix_all_buitins function, while making entries in the
3837 symbol table, but not modifying the builtin description itself.
3839 * src/freeze.c (reload_frozen_state): Add a useless `break;',
3840 because *many* compilers do not accept an empty `default:'.
3841 Reported by Akiko Matsushita, Eric Backus, John David Anglin,
3842 Joseph E. Sacco, Kaveh R. Ghazi, Tom McConnell and Ulrich Drepper.
3844 * configure.in: Use AC_TYPE_SIGNAL.
3845 * src/stackovf.c (setup_stackovf_trap): Use RETSIGTYPE.
3846 Reported by Robert Bernstein.
3848 * checks/Makefile.in (check): Modify PATH so check-them will find
3849 m4 in the src directory.
3850 * Makefile.in (check): Don't.
3851 Reported by Akiko Matsushita and Jim Meyering.
3853 * src/output.c (make_room_for, output_character_helper): New
3854 functions, for implementing a global MAXIMUM_TOTAL_SIZE instead of
3855 a per buffer MAXIMUM_BUFFER_SIZE.
3857 * src/output.c (output_text): New function, for optimizing the
3858 output of strings of characters. Use it.
3860 Tue Aug 30 01:44:29 1994 Francois Pinard (pinard@icule)
3862 * doc, src: New directories reorganizing the distribution.
3863 * doc/Makefile.in, src/Makefile.in, examples/Makefile.in: New
3865 * Makefile.in: Adjusted.
3866 * configure.in: Configure new Makefiles.
3868 * m4.h: Declare STRING typedef. Use it for comment and quote
3869 strings, adjusting all references. (This is the rudiments of a
3870 beginning for the eventual withdrawal of NUL terminated strings.)
3871 * output.c (shipout_text): Accept a length parameter, and use it.
3872 All callers adjusted.
3874 Mon Aug 29 12:27:19 1994 Francois Pinard (pinard@icule)
3876 * m4.h: Include <unistd.h> if it exists.
3877 * stackovf.c: Don't.
3879 Clean up for current_diversion variable:
3880 * output.c: Move current_diversion from builtin.c.
3881 * m4.h: Declare current_diversion so builtin.c can access it.
3882 * output.c (output_init, make_diversion): Initialize or update
3884 * builtin.c (builtin_init, m4_divert): Leave current_diversion
3887 Remove limit on number of diversions:
3888 * output.c: Replace ndiversion by diversions, declare it.
3889 (output_init): Allocate only diversion 0.
3890 (make_diversion): Allocate new diversions as needed.
3891 * m4.h, m4.c: Remove NDIVERSIONS and ndiversion related stuff.
3892 * m4.c: Still accept -N, but do nothing with it.
3893 Reported by David MacKenzie.
3896 * output.c (freeze_diversions): New function.
3897 * m4.h: Declare freeze_diversions.
3898 * freeze.c: Document frozen file format, revise it, call
3899 freeze_diversions to add diversions to frozen format, and code to
3900 reload them properly.
3901 * m4.c: Do not undivert automatically at end when status being
3902 frozen. Do not call builtin_init when reloading frozen state.
3904 Speed up diversion processing:
3905 * output.c: Add INITIAL_BUFFER_SIZE, MAXIMUM_BUFFER_SIZE,
3906 COPY_BUFFER_SIZE, in-memory diversion buffers, struct diversion
3907 structure and variables, cached variables out of output_diversion,
3908 reallocate_diversion_for and OUTPUT_CHARACTER.
3909 (shipout_text, make_diversion, insert_diversion): Adapted to new
3911 (insert_file): Use better buffering.
3912 Reported by David MacKenzie.
3914 Sun Aug 28 05:20:02 1994 Francois Pinard (pinard@icule)
3916 * Makefile.in, lib/Makefile.in, checks/Makefile.in: Arrange so
3917 dist works from another build directory.
3919 Sat Aug 27 14:32:45 1994 Francois Pinard (pinard@icule)
3921 * symtab.c (hack_all_symbols): Use hash_table_size instead of
3922 constant HASHMAX, for -H option to work better.
3924 * builtin.c (DECLARE): Simplify by using _ ().
3926 * freeze.c: New file.
3927 * Makefile.in: Compile it, distribute it.
3928 * m4.c: Recognize, document and process --freeze-state (-F) and
3929 --reload-state (-R) options. Pass a true flag to builtin_init
3930 only if no reloading some state.
3931 * builtin.c (define_builtin): Remove static specifier.
3932 (find_builtin_by_name): Remove static specifier.
3933 (builtin_init): Accept and obey a flag argument.
3934 * m4.h: Add declarations for freeze.c, changes for builtin.c.
3936 Wed Aug 24 16:14:19 1994 Francois Pinard (pinard@icule)
3938 * builtin.c (dumpdef_cmp): Rewrite so the cast protect the const
3941 * configure.in: Implement --with-dmalloc.
3942 * acconfig.h: Document WITH_DMALLOC.
3943 * m4.h: Add code for when WITH_DMALLOC.
3945 Mon Aug 15 12:38:05 1994 Francois Pinard (pinard@icule)
3947 * m4.c (long_options): Use "error-output", the dash was missing.
3948 Reported by Akiko Matsushita.
3950 Fri Aug 12 16:38:01 1994 Francois Pinard (pinard@icule)
3952 * m4.h: Include <sys/types.h>.
3953 * builtin.c, debug.c, m4.c, output.c, stackovf.c: Don't.
3954 * m4.h: Declare len_lquote and len_rquote as size_t, not int.
3956 * input.c: Declare len_lquote, len_rquote, len_bcomm and len_ecomm
3958 * builtin.c (dump_args): Declare len as size_t, not int.
3960 * debug.c: Prototype the forward declaration of debug_set_file.
3962 * builtin.c (m4_undivert): Replace div by file, for avoiding the
3963 shadowing of this variable.
3964 * output.c (insert_diversion): Idem.
3966 * input.c: Delete def_rquote, def_lquote, def_bcomm and def_ecomm.
3967 (input_init): Duplicate default quote and comment strings.
3968 (set_quotes): Free previous quote strings in all cases. Duplicate
3969 even default quote strings.
3970 (set_comment): Free previous comment strings in all cases.
3971 Duplicate even default comment strings.
3973 * configure.in: Updated for Autoconf 2.0.
3974 * Makefile.in (distclean-local): Also delete config.cache.
3976 * m4.c (usage): Reorganize the --help output by topic. Include a
3977 description for debugging flags.
3979 Fri Jul 29 10:15:52 1994 Francois Pinard (pinard@icule)
3981 * configure.in: If sigaction is available and SA_ONSTACK defined,
3982 use sigaction. Otherwise, if sigvec is available and SV_ONSTACK
3983 defined, use sigvec. Else don't compile stackovf.c.
3984 * stackovf.c (setup_stackovf_trap): Idem.
3985 Reported by Jim Avera, Karl Berry, Kaveh R. Ghazi, Matthias Rabe
3988 Thu Jul 21 22:43:17 1994 Francois Pinard (pinard@icule)
3990 * m4.c (usage): Replace printf par fputs.
3992 Mon Jul 18 23:48:23 1994 Francois Pinard (pinard@icule)
3996 Sun Jul 17 08:08:25 1994 Francois Pinard (pinard@icule)
3998 * configure.in: Check for sigaction and sigvec. Add a new delayed
3999 check for RLIMIT_STACK, combine in the checking for getrlimit.
4000 All those things are not universally available.
4001 * stackovf.c: Split setting up the trap handler and catching
4002 signals, for better taking care of various configure outcomes.
4003 * examples/stackovf.sh: Correct a typo.
4004 Reported by Eric Backus, Jim Avera and Jim Meyering.
4006 Sat Jul 16 20:36:19 1994 Francois Pinard (pinard@icule)
4008 * ansi2knr.c: New version sent by its author, Peter Deutsch.
4010 Fri Jul 15 14:36:21 1994 Francois Pinard (pinard@icule)
4012 * Makefile.in: Modify so parallel make will not try making
4013 lib/libm4.a twice simultaneously.
4014 Reported by Jim Meyering.
4016 Thu Jul 14 17:23:17 1994 Francois Pinard (pinard@icule)
4018 * stackovf.c (setup_stackovf_trap): Replace "Don't" by "Do not" in
4019 error message, for when no code possibility exists. Even if this
4020 line is completely #ifdef'ed out, it brings a syntax error.
4021 Reported by Andreas Schwab, Jim Meyering and Joseph E. Sacco.
4023 * Makefile.in (install): Have install depend on all too, for lib
4024 to be remade as needed.
4026 * examples/stackovf.sh: Try ksh, bsh and bash for shells
4027 providing ulimit, instead of using only ksh.
4028 Reported by Jim Avera and Joseph E. Sacco.
4030 Tue Jul 12 06:54:31 1994 Francois Pinard (pinard@icule)
4032 * Makefile.in (check): Have it depend on all instead of m4. In
4033 this way, a change in lib will be detected and processed.
4035 * builtin.c (numeric_arg): Use strtol and verify the conversion,
4036 instead of using sscanf which stops as soon as there is a
4037 non-digit in the input. Previously, incr(1xyzzy), eval(1,2xyzzy)
4038 and divert(1xyzzy) were all accepted without any warning or error
4040 * m4.h: Declare strtol as long if not including stdlib.h.
4041 * configure.in: Check for limits.h, and replace strtol if missing.
4042 * lib/Makefile.in: Substitute LIBOBJS. Distribute strtol.c.
4043 * lib/strtol.c: New file, from elsewhere.
4044 Reported by Andreas Schwab.
4046 Thu Jul 7 22:38:10 1994 Francois Pinard (pinard@icule)
4048 * macro.c (expand_macro): Cast value to (boolean) prior to
4049 assigning it to traced.
4050 Reported by Tom McConnell.
4052 * Makefile.in (m4): Always make all in lib first.
4053 Reported by Jim Meyering.
4055 Wed Jul 6 13:16:31 1994 Jim Avera (jima@netcom.com)
4057 * stackovf.c: Isolated OS-dependent sections; Improved portability,
4058 adding support for SunOS/BSD (sigvec, sigstack, and 4-parameter signal
4059 handlers), and a default error message if the fault address is not
4060 available (when neither siginfo.h nor BSD sigcontext are supported).
4061 * configure.in: Changes for stackovf.h: Check for sigcontext,
4062 sigaction, sigstack, and define rlim_t as int if necessary.
4063 * acconfig.h: Added HAVE_SIGCONTEXT and rlim_t.
4064 * examples/stackovf.sh: Run m4 -L99999999 to allow stack overflow.
4065 * ansi2knr.c: Fix for func-ptr args; convert "..." to varargs syntax.
4067 Tue Jul 5 19:13:54 1994 Francois Pinard (pinard@icule)
4069 * configure.in: Use AC_SET_MAKE.
4070 * Makefile.in: Use @SET_MAKE@.
4071 Reported by Jim Meyering.
4073 * checks/check-them: Do not trap on SIGQUIT or SIGALRM.
4074 Reported by Ian Taylor.
4076 Sat Jul 2 00:58:47 1994 Francois Pinard (pinard@icule)
4078 * configure.in: Remove dependency of USE_STACKOVF on STDC_HEADERS,
4079 because siginfo.h is unrelated to standard headers, and siginfo.h
4080 is already checked for.
4081 Reported by Joseph E. Sacco.
4083 * acconfig.h, aclocal.m4, m4.h: Replace HAVE_PROTOTYPES by
4085 * aclocal.m4, configure.in: Replace AC_HAVE_PROTOTYPES by
4088 Wed Jun 29 22:41:53 1994 Francois Pinard (pinard@icule)
4090 * builtin.c (substitute): Use \& to represent this part of the
4091 string which was matched by the whole regexp, instead of
4092 representing the whole string. Any usage of \0 issues a warning
4093 and acts like \&, it will disappear in some subsequent release.
4095 Mon Jun 27 14:24:23 1994 Francois Pinard (pinard@icule)
4097 * m4.c: Complete prototype for forwarded declaration of usage.
4099 * input.c (init_macro_token): Correct own reference in error
4100 message. Previous name get_macro_func was referred to instead.
4101 (next_char): Correct own reference in error message. Previous
4102 name advance_input was referred to instead.
4104 * m4.h: Declare eval_t and unsigned_eval_t typedefs to 32 bits.
4105 * eval.c (logical_or_term, logical_and_term, or_term, xor_term,
4106 and_term, not_term, logical_not_term, cmp_term, shift_term,
4107 add_term, mult_term, exp_term, unary_term, simple_term): Add
4108 prototype to forwarded declarations. Declare parameter v1 as
4109 eval_t * instead of int *. Same for local variable v2 in dyadic
4110 functions. Same for result in exp_term.
4111 * builtin.c (m4_eval): Declare value as eval_t instead of int.
4112 (ntoa): Declare value as eval_t instead of int. Declare uvalue as
4113 unsigned_eval_t instead of unsigned int. Change casts accordingly.
4114 (shipout_int): Cast first argument of ntoa to eval_t.
4115 Reported by Thorsten Ohl.
4117 * macro.c: Complete the prototypes of forwarded expand_macro and
4119 Reported by Thorsten Ohl.
4121 * m4.h: Define voidstar as void * or char * depending on __STDC__.
4122 The Ultrix 3.1 compiler cannot do much with void pointers.
4124 * builtin.c (dumpdef_cmp): Replace void * by voidstar.
4125 * m4.c (xfree): Replace void * by voidstar.
4126 Reported by Tom McConnell.
4128 * ansi2knr.1: New, from elsewhere.
4129 * Makefile.in (DISTFILES): Distribute ansi2knr.1
4131 * Makefile.in (stamp-h.in): Avoid running ./config.status if
4132 stamp-h does not exist yet. This avoids running it a second time
4133 just after the initial ./configure.
4134 Reported by David MacKenzie and Tom McConnell.
4136 * m4.h: Replace the enum debug_info declaration with a series of
4137 #define's. The Ultrix 3.1 compiler would otherwise need casting
4138 (int) to most references, when used in expressions.
4139 Reported by Tom McConnell.
4141 Sat Jun 25 00:10:05 1994 Francois Pinard (pinard@icule)
4143 * aclocal.m4: Replace FP_PROTOTYPES by AC_HAVE_PROTOTYPES,
4144 following an idea from Brook G. Milligan. AC_HAVE_PROTOTYPES
4145 calls the compiler. Previously, FP_PROTOTYPES was only calling
4146 the preprocessor; by not being subject to CFLAGS, this was
4147 discouraging those flags asking for ANSI compilation.
4148 * acconfig.h: Document HAVE_PROTOTYPES.
4149 * configure.in: Use AC_HAVE_PROTOTYPES instead of FP_PROTOTYPES.
4150 * m4.h: Define _() according to HAVE_PROTOTYPES, not __STDC__.
4151 Reported by Eric Backus.
4153 * configure.in: Substitute CFLAGS and LDFLAGS, taking their value
4154 from the environment. Default CFLAGS to -g if not set.
4155 * Makefile.in: Have CFLAGS and LDFLAGS substituted from configure.
4156 * lib/Makefile.in: Have CFLAGS substituted from configure.
4157 Reported by Eric Backus and Tom McConnell.
4159 * configure.in: m4_undefine changeword before using AC_ENABLE.
4161 * m4.h: Declare prototypes for error (for ANSI compilers only),
4162 prefix_all_builtins and reference_error.
4163 Reported by Tom McConnell.
4165 * input.c (set_word_regexp): Do not try to initialize the array
4166 test from a string, this does not work with non-ANSI compilers.
4167 Reported by Eric Backus.
4169 * Makefile.in (dist): Clean examples/ before saving it.
4170 (distclean-local): Also remove stamp-h.
4171 Reported by Eric Backus.
4173 * Makefile.in (_stackovf.c): Goal for compiling stacokovf.c with
4175 Reported by Tom McConnell.
4177 * checks/Makefile.in (clean): Depends on mostlyclean.
4178 (mostlyclean): New goal.
4180 Fri Jun 24 23:30:31 1994 Francois Pinard (pinard@icule)
4182 * Makefile.in (DISTFILES): Distribute install.sh.
4183 * install.sh: New file, copied from elsewhere.
4184 Reported by Assar Westerlund and Kaveh R. Ghazi.
4186 Thu Jun 23 00:00:30 1994 Francois Pinard (pinard@icule)
4188 * configure.in: Define ENABLE_CHANGEWORD if --enable-changeword.
4189 * acconfig.h: Explain ENABLE_CHANGEWORD.
4191 [These modifs all depend upon ENABLE_CHANGEWORD and are adapted
4192 from code provided by Pete Chown]
4193 * m4.h: Add original_text field to u_t variant of union u.
4194 Declare TOKEN_DATA_FUNC macro.
4195 * builtin.c: Declare changeword.
4196 (m4_changeword): New function.
4197 * input.c: Include "regex.h", define variables with word regexps.
4198 (input_init): Initialize the word regexp.
4199 (set_word_regexp): New.
4200 (next_token): Declare local variables, use the previous code if
4201 default_word_regexp is true. Else, match using a new code. Save
4203 * macro.c (expand_token): Ship out original text if not a macro
4205 Reported by Krste Asanovic and Pete Chown.
4207 [These modifs all depend upon ENABLE_CHANGEWORD]
4208 * m4.h: Declare external user_word_regexp.
4209 * m4.c: Declare user_word_regexp, and initialize it from
4210 --word-regexp or -W, or NULL if not specified.
4211 * input.c: Use user_word_regexp if specified, instead of
4212 DEFAULT_WORD_REGEXP.
4214 * Makefile.in (m4): Revert Jan 3 1994 change. I'm unable to
4217 * Makefile.in, lib/Makefile.in: Limit suffixes to .c and .o.
4218 * checks/Makefile.in: Empty the suffix list.
4219 Reported by Geoff Russell, Joel Sherrill and Roland McGrath.
4221 * m4.c: Declare nesting_limit and initialize it to 250.
4222 Implement -LNUMBER or --nesting-limit=NUMBER to change its
4224 * m4.h: Declare nesting_limit as external.
4225 * macro.c (expand_macro): Stop execution whenever nesting limit
4227 Reported by Bengt Mertensson.
4229 * eval.c (evaluate): Diagnose excess characters in eval input.
4230 Things like `eval(08)' used to return 0 with no diagnostic.
4232 * m4.h: Capitalize first letter of all macro arguments in
4235 * m4.c: Declare warning_status, initialize it to 0. Add new
4236 option -E, or --fatal-warnings, which sets warning_status to
4237 EXIT_FAILURE instead.
4238 * m4.h: Declare external warning_status. Define EXIT_SUCCESS and
4239 EXIT_FAILURE if not otherwise done by header files.
4240 * m4.c: Delete declarations for EXIT_SUCCESS and EXIT_FAILURE.
4241 * m4.c, input.c, output.c, symtab.c, builtin.c, macro.c, debug.c,
4242 eval.c: Replace 0 by warning_status and 1 by EXIT_FAILURE in first
4243 argument of all M4ERROR calls.
4244 Reported by Noah Friedman.
4246 * examples/incl-test.m4: Renamed from incl_test.m4.
4247 * examples/include.m4: Include incl-test.m4 instead of
4249 * examples/multiquotes.m4: Renamed from multi-quotes.m.
4251 Wed Jun 22 21:58:54 1994 Francois Pinard (pinard@icule)
4253 * configure.in: Avoid USE_STACKOVF if <siginfo.h> not found. Note
4254 that Jim developped stackovf.c on a 486 running SVR4.0 (ESIX), and
4255 also tested it on a Sun Sparc workstation running SunOS 4.x.
4257 * format.c (format): When not HAVE_EFGCVT, m4 was failing the
4258 49.format check, abusing a `union values' argument with sprintf
4259 without selecting the proper field. Now, save the formatting type
4260 first, delaying the fetch of the corresponding argument.
4261 Reported by Joseph E. Sacco and Tom Quinn.
4263 * format.c (format): Remove const from char *fmt declaration when
4264 not HAVE_EFGCVT, because a NUL may be forced into it.
4266 * m4.h: Declare atof() when not STDC_HEADERS.
4267 Reported by Joseph E. Sacco.
4269 * Regenerate configure using Autoconf 1.11, this corrects a
4270 problem about an incorrect cpp seting on NeXT 3.1.
4271 Reported by Alexander Lehmann.
4273 Sun Jun 5 16:25:19 1994 Francois Pinard (pinard@icule)
4275 * m4.h (_): Change argument from `x' to `Args'.
4277 Wed May 4 23:59:39 1994 Francois Pinard (pinard@icule)
4279 * Makefile.in: Remove all occurrences of $(MFLAGS), which were
4280 bringing more evil than good on a few systems.
4281 Reported by Greg A. Woods.
4283 Fri Apr 22 15:59:35 1994 Francois Pinard (pinard@icule)
4285 * m4.h: Rename Args() to _().
4286 * m4.h: Remove extern specifier from all function declarations.
4288 Fri Apr 22 15:51:21 1994 Jim Avera (jima@netcom.com)
4290 * stackovf.c: New file implementing stack-overflow detection.
4291 * configure.in: Check for getrlimit, sigaction. If all of
4292 standard headers, getrlimit and sigaction, define USE_STACKOVF and
4293 substitute ${U}stackovf.o for STACKOVF.
4294 * acconfig.h: Declare USE_STACKOVF.
4295 * Makefile.in: Distribute stackovf.c, link with $(STACKOVF).
4296 * m4.h: Declare setup_stackovf_trap().
4297 * m4.c: Call setup_stackovf_trap().
4298 * tests/stackovf_test.sh: New file.
4300 Wed Apr 13 14:10:30 1994 Francois Pinard (pinard@icule)
4302 * checks/Makefile.in: Rename .all-stamp to stamp-checks.
4304 * Makefile.in (Makefile, etc.): Adapt for Autoconf 1.8.
4306 Sun Jan 30 14:24:19 1994 (pinard at icule)
4308 * m4.h: Remove definition of volatile, not used anymore.
4309 Reported by Jim Meyering and Joseph E. Sacco.
4311 * m4.h: Consistently use `do { ... } while (0)' in macros, instead
4312 of `if ... else /* nothing */' for if macros.
4313 Reported by Jim Meyering.
4315 * builtin.c (m4_regexp): Reorganize the code for avoiding a
4316 warning from gcc about `repl' possibly used before defined.
4317 Reported by Jim Meyering.
4319 * m4.h: Avoid a pre-ANSI <memory.h> together with <string.h>.
4320 Reported by Jim Meyering.
4322 Tue Jan 25 18:39:37 1994 Francois Pinard (pinard at icule)
4324 * m4.h: Move the conditional definition of volatile after the
4325 inclusion of system files, because they may define it first.
4327 Tue Jan 4 19:46:50 1994 Francois Pinard (pinard@icule)
4329 * checks/Makefile.in (CHECKS): Add a useless `*' before `[', to
4330 get around a problem with Alpha make seeing a syntax error, there.
4331 Reported by Vern Paxson.
4333 Mon Jan 3 00:21:45 1994 Francois Pinard (pinard@icule)
4335 * Makefile.in: Do not define LDFLAGS, use CFLAGS on link calls.
4336 Reported by Richard Stallman.
4338 Sat Dec 25 08:06:05 1993 Francois Pinard (pinard@icule)
4340 * configure.in: Correct test for strerror, AC_FUNC_CHECK was used
4341 instead of AC_HAVE_FUNCS.
4342 Reported by Noah Friedman.
4344 Wed Dec 1 09:37:53 1993 Francois Pinard (pinard@icule)
4346 * m4.c: Initialize show_help and show_version to zero.
4348 * m4.c: Ensure EXIT_SUCCESS and EXIT_FAILURE are defined.
4349 Use them in exit() and usage() calls.
4351 Sat Nov 27 10:43:24 1993 Francois Pinard (pinard@icule)
4353 * m4.h: Delete extern sys_nerr, sys_errlist declarations, and
4354 syserr() macro. Delete errref, add reference_error and M4ERROR.
4355 * m4.c: Replace errref, which was returning an input reference
4356 string, with reference_error, which prints it on standard error.
4357 * builtin.c, output.c: Use errno as second parameter to error,
4358 instead of using syserr() with %s.
4359 * *.c: Use M4ERROR instead of error: no more errref() with %s.
4360 Doing so, the program name appears after the input reference
4361 instead of before, which eases M-x next-error processing.
4363 Wed Nov 24 22:16:15 1993 Francois Pinard (pinard@icule)
4365 * checks/get-them: Escape braces with backslashes in patterns,
4366 because HPUX-9.01 awk needs this.
4367 Reported by Jim Meyering.
4369 Mon Nov 22 10:55:52 1993 Francois Pinard (pinard@icule)
4371 * builtin.c: Declare "FILE *popen ();".
4373 * m4.h: Remove MESSAGE{,1,2}, WARNING1, FATAL{,1}, INTERNAL_ERROR
4374 macros, replace error_message_prefix() declaration by errref()'s.
4375 Declare xrealloc, for use in errref().
4376 * m4.c: Delete error_message_prefix() function, add errref().
4377 * *.c: Use error() systematically in place of all error macros,
4378 now that error() flushes stdout first. Make needed adjustments.
4380 * m4.h: Remove const in sys_errlist[] declaration, it creates
4381 conflicts on SGI and Alpha.
4382 Reported by Kaveh R. Ghazi.
4384 Sat Nov 20 08:26:15 1993 Francois Pinard (pinard@icule)
4386 * m4.c: Include <getopt.h> instead of "getopt.h".
4388 * configure.in: Output to config.h. Use HAVE_FUNCS preferably.
4389 * acconfig.h: New, for documenting HAVE_EFGCVT.
4390 * Makefile.in: Distribute acconfig.h, .stamp-h.in and config.h.in,
4391 use them wherever appropriate. Also use -I. for compilations.
4392 * lib/Makefile.in: Use -I.. for compilations.
4393 * *.c: Include <config.h> or "config.h".
4395 * m4.h: Test for HAVE_MEMORY_H instead of NEED_MEMORY_H.
4396 * configure.in: Use AC_HAVE_HEADERS(memory.h), delete AC_MEMORY_H.
4398 Wed Nov 17 09:34:55 1993 Francois Pinard (pinard@icule)
4400 * builtin.c (m4_eval): Cast strlen to (int) before comparing.
4402 * input.c (input_init): Initialize quote and comment strings
4403 explicitely instead of calling set_quotes and set_comment: by
4404 doing so, we ensure we do not free uninitialized variables.
4406 * checks/check-them: Reverse arguments to both diff, so the
4407 expected is on the left and the obtained on the right.
4409 * m4.h: Add MESSAGE{,1,2}, WARNING1, FATAL{,1} and INTERNAL_ERROR
4410 macros. Delete declarations for m4error, warning, fatal and
4411 internal_error, add declaration for error_message_prefix.
4412 * m4.c: Delete m4error, warning, fatal and internal_error
4413 routines, add error_message_prefix routine.
4414 * *.c: Replace m4error routine calls with MESSAGE* macro calls,
4415 warning with WARNING*, fatal with FATAL* and internal_error with
4417 * Makefile.in (_m4.c): Do not adjust ansi2knr output for va_alist,
4418 this is not needed anymore.
4420 * m4.h: Declare extern FILE *debug. Add DEBUG_PRINT{1,3} and
4421 DEBUG_MESSAGE{,1,2} macros. Delete declarations for debug_print
4422 and debug_message, add declaration for debug_message_prefix.
4423 * debug.c: Remove static specifier for FILE *debug declaration.
4424 Delete debug_print and debug_message routines, add
4425 debug_message_prefix routine.
4426 * builtin.c, debug.c: Replace debug_print routine calls with
4427 DEBUG_PRINT* macro calls.
4428 * input.c, path.c: Replace debug_message routine calls with
4429 DEBUG_MESSAGE* macro calls.
4431 * m4.h: Remove inclusion of <varargs.h>.
4432 * debug.c: Include <stdarg.h> or <varargs.h>.
4433 (trace_format): Use stdarg instead of varargs if __STDC__.
4435 * configure.in: Remove checks for vfprintf and _doprnt. These
4436 implementations use varargs tricks which are not portable enough.
4437 * lib/vfprintf.c: Deleted.
4438 * lib/_doprnt.c: Deleted.
4439 * lib/Makefile.in: Adjusted accordingly. Remove LIBOBJS.
4440 Reported by Joel Sherrill.
4442 * path.c (add_include_directory): Use xstrdup.
4444 * builtin.c (find_builtin_by_name): Declare static.
4446 * *.[ch]: Add const to a few "char *" declarations.
4448 * configure.in: Remove commented tests for fileno() and fstat().
4449 * debug.c: Remove comments about HAVE_FILENO and HAVE_FSTAT.
4451 * debug.c (debug_flush_files): New.
4452 * m4.h: Declares it.
4453 * builtin.c (m4_syscmd, m4_esyscmd): Use it.
4454 Reported by Nicolas Pioch.
4456 Fri Nov 12 10:02:26 1993 Francois Pinard (pinard@icule)
4458 * Makefile.in (m4.dvi): Use m4.texinfo instead of m4.texi.
4459 Reported by Joel Sherrill.
4461 * builtin.c (prefix_all_builtins): Instead of the table size, use
4462 the null entry at end for stopping the loop. It was overwritten.
4463 Reported by Andreas Schwab and Jim Meyering.
4465 * builtin.c (prefix_all_builtins): Cast xmalloc to (char *).
4466 Reported by Kaveh R. Ghazi.
4468 * macro.c (call_macro): Add * in (*SYMBOL_FUNC (sym)) (...).
4469 Reported by Karl Vogel.
4471 Tue Nov 9 09:31:47 1993 Francois Pinard (pinard@icule)
4473 * m4.h: Do not define volatile if already defined.
4474 Reported by Rene' Seindal.
4476 * lib/Makefile.in: Add a forgotten ALLOCA=@ALLOCA@. Grrr!
4478 Reported by Bernhard Daeubler, Eric Backus, Hal Peterson, Hoang
4479 Uong, Ian Taylor, Kaveh R. Ghazi, Tom McConnell and Walter Wong.
4481 Mon Nov 8 21:11:44 1993 Francois Pinard (pinard@icule)
4483 * m4.h: Define strchr and strrchr in terms of index and rindex,
4484 instead of the other way around.
4485 * builtin.c, m4.c, path.c: Use strchr instead of index.
4487 * input.c (next_char): Remove a "break;" after a "return ...;".
4488 Reported by Tom McConnell.
4490 Mon Nov 8 12:45:34 1993 Francois Pinard (pinard@icule)
4494 * configure.in: Do not copy check files in the build hierarchy.
4495 * checks/check-them: Identify the m4 version being checked. For
4496 finding m4, look in $PATH instead of in the parent directory.
4497 * Makefile.in (check): Prepend `pwd` to $PATH before checking.
4498 * checks/Makefile.in (.all-stamp): Always create check files in
4499 the source hierarchy, not anymore in the build hierarchy.
4500 (check): cd to the source hierarchy before performing checks.
4501 Do not copy nor clean COPYING anymore, take it from `..'.
4502 Reported by Tom McConnell.
4504 * Makefile.in (Makefile): Use $(SHELL).
4505 (config.status): Use $(SHELL). Use "config.status --recheck"
4506 instead of "configure --no-create", which is obsolete.
4507 Reported by Tom McConnell.
4509 Fri Nov 5 09:49:30 1993 Francois Pinard (pinard@compy.IRO.UMontreal.CA)
4511 * m4.c (usage): Use "%s" instead of "m4" in format string.
4512 Reported by Jim Meyering.
4514 * Makefile.in: Distribute mkinstalldirs.
4515 Reported by Pierre Gaumond.
4516 Reported by Jim Meyering.
4517 Reported by Tom McConnell.
4518 Reported by Andreas Gustafsson.
4520 * checks/check-them: Renamed from checks/check_them.
4521 * checks/get-them: Renamed from checks/get_them.
4522 * checks/.all-stamp: Renamed from checks/.all_stamp.
4523 * checks/Makefile.in: Changed accordingly.
4524 Reported by Jim Meyering.
4526 Thu Nov 4 13:50:52 1993 Francois Pinard (pinard@lagrande.IRO.UMontreal.CA)
4528 * lib/Makefile.in (dist): Correct permissions on files.
4530 * output.c: Declare tmpfile, some systems don't.
4532 Wed Nov 3 09:09:16 1993 Francois Pinard (pinard@icule)
4534 * checks/Makefile.in (dist): Correct permissions on files.
4536 * Makefile.in (dist): Ensure recursive linking for subdirectory
4537 `examples', also set read/write permissions on all its files.
4539 * mkinstalldirs: New, from elsewhere.
4540 * Makefile.in: Use it.
4542 * debug.c: Synchronize debug messages and regular output when
4543 the debug file and stdout are redirected to the same file.
4544 * configure.in: Add (commented) checks for fileno and fstat.
4545 Reported by Jim Avera.
4547 * builtin.c (m4_ifelse): Diagnose excess arguments if 5, 8, 11,
4548 etc., arguments, then ignore the superfluous one. m4 used to
4549 diagnose missing arguments and return the empty string.
4550 Reported by Nick S. Kanakakorn.
4552 Tue Nov 2 00:55:41 1993 Francois Pinard (pinard@icule)
4554 * m4.c (main): At end of all input, ensure all undiverted text
4555 goes to the main output stream.
4556 Reported by Andreas Gustafsson.
4558 * m4.c (main): exit (0), instead of return 0.
4560 * m4.c: Implement -P and --prefix-builtins.
4561 * builtin.c: Delete const specifier on builtin_tab.
4562 (prefix_all_builtins): New.
4563 Reported by Noah Friedman.
4564 Reported by Scott Bartram.
4566 * c-boxes.el: New, from elsewhere.
4567 * Makefile.in: Distribute it.
4569 * m4.h: Do not define bcopy if <string.h> defines it.
4570 Reported by Stephen Perkins.
4572 * builtin.c (define_macro): Allow a missing second argument, in
4573 which case it is implied empty. Affects define and pushdef.
4574 Reported by Eric Allman.
4576 Mon Nov 1 07:45:24 1993 Francois Pinard (pinard@icule)
4578 * m4.h: Add blind_if_no_args in struct builtin, blind_no_args in
4579 struct symbol adn SYMBOL_BLIND_NO_ARGS macro.
4580 * builtin.c: Initialize all the blindness fields in builtin_tab.
4581 (define_builtin): Copy the blindness of a builtin into its symbol.
4582 * macro.c (expand_token): Avoid processing a blind builtin if the
4583 next character is not an opening parenthesis.
4584 Reported by David MacKenzie.
4585 Reported by Noah Friedman.
4587 * configure.in: Ensure an exit status of 0 on completion.
4588 Reported by Vivek P. Singhal.
4590 * eval.c (eval_lex): Admit both lower and upper case letters for
4591 bases greater than 10. Only lower case letters were accepted.
4593 * eval.c (eval_lex): Recognize 0bDIGITS and 0rRADIX:DIGITS syntax.
4594 Reported by Krste Asanovic.
4596 * eval.c: Rename NOT to LNOT. Add XOR, NOT, LSHIFT and RSHIFT.
4597 * eval.c (logical_not_term): New name for not_term.
4598 * eval.c (xor_term): New, between or_term and and_term.
4599 * eval.c (not_term): New, between and_term and logical_not_term.
4600 * eval.c (shift_term): New, between cmp_term and add_term.
4601 Reported by Krste Asanovic: ~, ^, <<, >>.
4602 Reported by Ben A. Mesander: ** vs ^.
4604 * m4.c: Delete xmalloc.c, xrealloc.c, xstrdup.c.
4605 * m4.h: Delete xrealloc.c.
4606 * lib/xmalloc.c: New, from elsewhere.
4607 * lib/xstrdup.c: New, from elsewhere.
4608 * lib/Makefile.in: Distribute and compile them.
4610 * m4.c: Change progname to program_name.
4611 * builtin.c, eval.c, m4.c, m4.h: Rename error to m4error.
4612 * lib/error.c: New, from elsewhere.
4613 * lib/Makefile.in: Distribute and compile error.c.
4614 * configure.in: Check AC_VPRINTF and for strerror.
4615 * m4.c: Delete cmd_error. Use error instead.
4616 * m4.c: Change label capitalisation to "ERROR", "Warning", etc.
4618 * m4.h: Delete #define const, let Autoconf takes care of this.
4620 * m4.c: Remove all code conditionalized by IMPLEMENT_M4OPTS.
4621 Merge parse_args into main. Declare argv to be `char *const *',
4622 then remove superfluous casts.
4624 * m4.c: Rename --no-gnu-extensions to --traditional.
4625 Reported by Ben A. Mesander.
4627 * m4.c (usage): Add a status parameter. Supply one in various
4628 calls. Add --help processing. Remove -V for --version.
4630 * lib/Makefile.in: Put $(CFLAGS) last in .c.o rule.
4632 * lib/Makefile.in: Have an AR=ar declaration.
4633 Reported by Eric Backus.
4634 Reported by Bjorn R. Bjornsson.
4635 Reported by Tom Tromey.
4636 Reported by Kristine Lund.
4637 Reported by Marion Hakanson.
4639 Sat Oct 30 12:51:47 1993 Francois Pinard (pinard@icule)
4641 * Makefile.in (m4.info): Use -I$(srcdir) on $(MAKEINFO).
4642 Reported by Noah Friedman.
4644 Mon Oct 25 14:58:48 1993 Francois Pinard (pinard@icule)
4646 * Makefile.in: Remove MDEFINES and cleanup.
4648 Wed Jun 9 14:59:46 1993 Francois Pinard (pinard@icule)
4650 * Makefile.in (dist): Replace "echo `pwd`" by a mere "pwd".
4653 Sat Feb 6 14:59:22 1993 Francois Pinard (pinard@icule)
4655 * Makefile.in, lib/Makefile.in, check/Makefile.in: In dist goals,
4656 ensure 777 mode for directories, so older tar's will restore file
4659 Sun Jan 17 15:38:05 1993 Francois Pinard (pinard@icule)
4661 * Makefile.in, lib/Makefile.in: Put $(CFLAGS) after $(CPPFLAGS),
4662 so the installer can override automatically configured choices.
4663 Reported by Karl Berry.
4665 Fri Jan 15 16:07:00 1993 Francois Pinard (pinard@icule)
4667 * lib/vfprintf.c: Stolen from Oleo distribution and adapted. The
4668 previous version was not working properly on m68k-hp-bsd4.3.
4669 Reported by Roland McGrath.
4671 * lib/_doprnt.c: Stolen from Oleo distribution.
4672 * configure.in: Check for _doprnt.c if vfprintf.c selected.
4673 * lib/Makefile.in: Distribute _doprnt.c.
4674 Do not distribute regex.[ch].old anymore.
4676 Fri Jan 1 19:42:23 1993 Francois Pinard (pinard at icule)
4678 * Makefile.in, lib/Makefile.in: Reinstate $(CPPFLAGS), use it.
4679 Richard wants it there.
4681 Sun Dec 27 07:01:54 1992 Francois Pinard (pinard at icule)
4683 * Makefile.in: Add DEFS to MDEFINES.
4684 * lib/Makefile.in (.c.o): Remove $(CPPFLAGS).
4685 (libm4.a): Remove the library before creating it.
4686 (distclean): Remove tags and TAGS too.
4688 Wed Dec 23 12:46:55 1992 Francois Pinard (pinard at icule)
4690 * Makefile.in (dvi, m4.dvi): New goals.
4692 * builtin.c, eval.c, format.c, input.c, m4.[ch], m4.texinfo,
4693 macro.c, output.c, path.c, symtab.c: Change Copyright from
4694 1989-1992 to the explicit enumeration 1989, 1990, 1991, 1992.
4696 * examples/divert.m4: Deleted, this bug has been corrected.
4698 * Makefile.in (texclean, mostlyclean): New goals.
4700 * Makefile.in (clean): Remove clutter from ansi2knr.
4701 Reported by Pierre Gaumond.
4702 Reported by Greg A. Woods.
4704 Sun Dec 20 10:40:20 1992 Francois Pinard (pinard at icule)
4706 * Makefile.in: Remove $(CPPFLAGS) from the .c.o rule. The user
4707 might well use CFLAGS is s/he needs it.
4709 * Makefile.in: Allow installation of info files from a separate
4711 Reported by Jason Merrill.
4712 Reported by David MacKenzie.
4713 Reported by Skip Montanaro.
4714 Reported by Erez Zadok.
4715 Reported by Assar Westerlund.
4717 Sat Dec 19 08:21:34 1992 Francois Pinard (pinard at icule)
4720 This is still a beta release for the future GNU m4 version 1.1.
4722 * lib/alloca.c: New, from elsewhere.
4723 * lib/Makefile.in: Distribute it. Define and use $(ALLOCA).
4725 * m4.h: Do not define index/rindex if already defined. If
4726 FALSE/TRUE are already defined, do not redefine them, but merely
4727 define boolean typedef to int.
4729 * Makefile.in: Use $(DEFS) while compiling ansi2knr.
4730 * ansi2knr.c: Rewrite #ifdef HAVE_STRING_H || STDC_HEADERS,
4731 because some C compilers do not like connectives with #ifdef.
4732 * m4.h: Define `volatile' only if __GNUC__, instead of once for
4733 __GNUC__ and once for __STDC__.
4734 * lib/regex.h: Leave const alone, AC_CONST will take care of it.
4736 * checks/Makefile.in: Use .all_stamp instead of $(CHECKS) for
4737 Makefile dependencies. Without it, make keeps destroying and
4738 remaking $(CHECKS) in a loop (why?). Distribute .all_stamp.
4740 * m4.h, m4.c, builtin.c, output.c: Change all divertion/DIVERTION
4741 to diversion/DIVERSION, this was a spelling error.
4743 * m4.c: Declare version[], remove #include "version.h".
4744 * version.h: Deleted.
4745 * Makefile.in: Remove references to version.h.
4747 * output.c (shipout_text): Centralize all `#line NUM ["FILE"]'
4748 production, by using a simpler and more robust algorithm. This
4749 solves the problem of synclines sometimes written in the middle of
4750 an output line. Delete sync_line() and output_lines variable.
4751 * m4.h: Remove sync_line prototype and output_lines declaration.
4752 * input.c (next_char), output.c (shipout_text): Remove references
4754 * input.c (push_file, pop_file): Merely put the value -1 in
4755 output_current_line instead of calling sync_line, for delaying a
4756 single `#line NUM FILE' before next output line. Do not test
4757 for sync_output, because this is unnecessary clutter.
4758 * output.c (make_divertion, insert_divertion): Idem.
4759 * input.c: Rename must_advance_line to start_of_input_line, for
4762 * debug.c (trace_header): Select a new debug line format, which
4763 better complies with GNU standards for formatting error messages.
4764 With option `-dfl', M-x next-error might be used on the output.
4765 * m4.c (vmesg): Adjust format of error output to GNU standards.
4766 * m4.texinfo: Adjust examples for `make check' to work.
4768 * m4.h, builtin.c, debug.c, input.c, macro.c, path.c: Use upper
4769 case for enum debug_info constants, which were all lower case.
4771 * builtin.c (m4_regexp, m4_patsubst): Use re_search instead of
4773 * lib/regex.[ch]: Use new version from textutils 1.3.6, with some
4774 collected patches. I tried a few times using newer regex.[ch], it
4775 mysteriously stopped aborting with this one. Insecure feeling...
4776 * lib/Makefile.in: Distribute regex.[ch].old, just in case!
4778 Fri Dec 18 11:08:03 1992 Francois Pinard (pinard at icule)
4780 * m4.c: Change `--no-warnings' to `--silent'.
4781 Reported by David MacKenzie.
4783 * m4.c: Put all M4OPTS code upon IMPLEMENT_M4OPTS control, and
4784 leave it off for now. See comment in m4.c for justification.
4785 Reported by David MacKenzie.
4787 * configure.in: Replace AC_USG by AC_HAVE_HEADERS(string.h).
4788 * m4.h, ansi2knr.c, lib/regex.h: Replace USG by HAVE_STRING_H.
4790 * Makefile.in: Add a new `info' goal. Use macro MAKEINFO.
4792 * Makefile.in: Ensure recursive cleaning is done before local
4793 cleaning for all clean goals.
4795 * builtin.c (ntoa): Ensure the value is always interpreted as a
4796 signed quantity, whatever the radix is.
4798 Wed Nov 18 07:57:19 1992 Jim Meyering (meyering@idefix)
4800 * builtin.c, format.c, input.c: Split long lines.
4801 * m4.c: Use typedef macro_definition instead of struct
4803 * symtab.c: Use typedef symbol instead of struct symbol.
4805 Tue Nov 17 01:58:40 1992 Francois Pinard (pinard at icule)
4807 * *.[ch]: Remove all trailing whitespace, in code and comments.
4809 * configure.in: Find some awk.
4810 * Makefile.in: Add $(AWK) to MDEFINES.
4811 * checks/Makefile.in: Transmit $(AWK) to get_them.
4812 * checks/get_them: Use $AWK instead of gawk. Add a close in the
4813 awk script when switching files, because without this, mawk runs
4814 out of file descriptors.
4816 Mon Nov 16 20:42:56 1992 Francois Pinard (pinard at icule)
4818 * Makefile.in (realclean): Delete m4.info*.
4819 Reported by Jim Meyering.
4821 * Makefile.in: Adjust and link with checks/Makefile.
4822 * checks/Makefile.in: New.
4823 * configure.in: Output checks/Makefile.
4825 * checks/get_them: Have the dnl header of each test more
4826 recognizable by next-error, also use a better message.
4828 Mon Nov 16 07:48:52 1992 Jim Meyering (meyering@idefix)
4830 * m4.h [__GNUC__]: Use __volatile__ instead of `volatile.'
4831 And use that only if __GNUC__ since we're using it's GCC-specific
4832 semantics that tell the compiler the associated function doesn't
4835 * builtin.c (substitute): Don't use character as an array index.
4836 (dumpdef_cmp): Make formal arguments `const void *' to avoid
4837 warnings with gcc -W -Wall on systems with qsort prototype.
4838 (m4_errprint): Cast obstack_finish to `char *' to avoid warnings
4841 * eval.c (most functions): Add parentheses to assignments used
4842 as truth values go avoid warnings from gcc -Wall.
4844 * input.c, m4.c, output.c, path.c, symtab.c: Declare static
4845 any functions that don't need external scope.
4847 * builtin.c, debug.c, format.c, m4.c, m4.h, macro.c, symtab.c
4848 (many functions and arrays): Declare `const'.
4850 Sun Nov 15 09:42:09 1992 Francois Pinard (pinard at icule)
4852 * *.[ch]: Rename nil to NULL, using the declaration from <stdio.h>,
4853 removing the declaration from m4.h. Also rename false to FALSE
4856 * lib/Makefile.in (Makefile): New goal.
4858 * Makefile.in, lib/Makefile.in: Add a .c.o rule, so CFLAGS is not
4859 so heavily loaded. It gets more easily overridable, calling make.
4860 Reported by Jim Meyering.
4862 * Makefile.in (dist): Get .fname from the current directory name,
4863 instead of from version.h. I need updating many files manually,
4864 when the version changes, version.h is just one of them.
4866 Sat Nov 14 11:01:20 1992 Francois Pinard (pinard at icule)
4868 * m4.h: Remove the tag `boolean' on the enum introducing typedef
4869 `boolean'. This tag conflicts with <sys/types.h> on SVR4.
4870 Reported by Tom McConnell.
4872 Fri Nov 13 00:12:50 1992 Francois Pinard (pinard at icule)
4874 * m4.texinfo: Correct the examples for 33.divert, 38.divnum,
4875 39.cleardiv, which were describing missing or spurious newlines.
4876 Modify examples 52.eval, 53.esyscmd and 54.sysval so the results
4877 do not depend on machine word size, `/bin/false' implementation,
4878 or `wc' output format. `make check' is more dependable, now.
4880 * checks/check_them: Summarize the failed tests by listing their
4881 name, at end. If none, issue `All checks successful'. Output
4882 `Checking' instead of `Input file:'.
4884 * checks/get_them, checks/check_them: Reindented.
4886 * Makefile.in (dist): chmod a+r before making the tar file.
4888 Thu Nov 12 14:42:57 1992 Francois Pinard (pinard at icule)
4890 * builtin.c (m4_dnl): Diagnose any parameter to `dnl'.
4892 * input.c (next_token): Reinitialize token_buttom just after using
4893 it as a watermark with obstack_free. Or else, a future token, big
4894 enough for triggering reallocation of the obstack chunk, could
4895 void the initialized value of token_buttom, later causing panic in
4896 obstack_free. Rename token_buttom to token_bottom everywhere.
4898 * m4.h: Before declaring errno, first include <errno.h> and
4899 ensure that it does not define errno.
4900 Reported by Richard Stallman.
4902 Wed Nov 11 17:40:35 1992 Francois Pinard (pinard at icule)
4904 * builtin.c: Define and use DECLARE macro for builtins.
4906 * builtin.c (m4_ifelse): Avoid any diagnostic when exactly one
4907 argument, this is a common idiom for introducing long comments.
4909 * builtin.c (m4_ifelse): If 3n + 2 arguments, diagnose missing
4910 arguments. The last argument was silently ignored.
4912 * m4.c (cmd_error): Add a missing semicolon before va_end().
4914 Tue Nov 10 08:57:05 1992 Francois Pinard (pinard at icule)
4916 * Makefile.in: Now handle protoized sources. Define and use U.
4917 Compile and use ansi2knr with old compilers. Update DISTFILES.
4918 Add `aclocal.m4' to `configure' dependencies.
4919 * ansi2knr.c: New, from Ghostscript distribution.
4920 * configure.in: Define U through FP_PROTOTYPES for old compilers.
4921 Add AC_ISC_POSIX, AC_CONST, AC_SIZE_T.
4922 * aclocal.m4: New, provide FP_PROTOTYPES.
4923 * m4.h: Conditionnaly protoized through Args, save for varags.
4924 * builtin.c: Protoized. Then:
4925 Include <sys/types.h> if size_t is not defined, before "regex.h".
4926 (m4_ifelse): Fetch built-in name properly for diagnostic.
4927 (m4_dumpdef): Remove wrong (char *) cast calling dump_symbol.
4928 (m4_regexp): Add const to `msg' declaration.
4929 (m4_patsubst): Add const to `msg' declaration.
4930 * debug.c: Protoized, save for varargs.
4931 * eval.c: Protoized.
4932 * format.c: Protoized.
4933 * input.c: Protoized.
4934 * m4.c: Protoized, save for varargs. Then:
4935 (xfree): Accept void * instead of char *.
4936 (xmalloc): Return void * instead of char *.
4937 (xrealloc): Accept and return void * instead of char *.
4938 * macro.c: Protoized.
4939 * output.c: Protoized.
4940 * path.c: Protoized. Then cast some (char *) over xmalloc's.
4941 * symtab.c: Protoized.
4943 Fri Nov 6 02:05:21 1992 Francois Pinard (pinard at icule)
4945 * m4.texinfo: Remove directory from diagnostics in 30.include,
4946 51.eval, 56.errprint and 57.m4exit tests.
4948 * m4.h: Remove declarations for int or void system functions, they
4949 cause more conflicting trouble than they make good.
4951 * configure.in: Avoid configuration header file. Add some tests.
4952 * m4.h: Remove #include "config.h".
4953 * Makefile.in, lib/Makefile.in: Implement Autoconf interface.
4954 Then, rewritten for better compliance with GNU standards.
4956 Thu Nov 5 12:37:13 1992 Francois Pinard (pinard at icule)
4958 * format.c (format): Avoid syntax error if not HAVE_EFGCVT,
4959 because of a misplaced #endif.
4961 * Many *.[hc] files: Correct intra-line spacing here and there,
4962 according to GNU indent 1.6 advice.
4964 * configure.in: New, using Autoconf 1.2.
4965 * m4.h: Reverse NO_MEMORY_H to NEED_MEMORY_H.
4966 * Delete old configure.in, configure, etc/configure.in,
4967 etc/configure, lib/configure.in, lib/configure and config/*.
4968 Reported by Jason Merrill.
4970 * symtab.c (hash): Change (char) NULL to '\0'.
4971 Reported by Jason Merrill.
4973 * Delete .vers, etc/newdist.sh, etc/newvers.sh and
4974 etc/nextvers.sh. Release numbers will be edited `by hand'.
4975 * version.h: De-automatize, force value in.
4977 * m4.c: Changes in order to use a newer getopt.h.
4978 Reported by David MacKenzie.
4980 * checks/: New name for examples/.
4981 * checks/get_them: New location for etc/get_examples.
4982 * checks/check_them: New location for etc/check_examples.
4983 * Makefile.in, checks/get_them, checks/check_them: Adjust.
4984 * lib/vfprintf.c: New location for etc/vfprintf.c.
4985 * Delete empty etc/.
4986 * examples/: New name for test/.
4988 Tue Mar 10 00:29:46 1992 Francois Pinard (pinard at icule)
4990 * Makefile.in (check): Add m4 as dependency.
4992 * m4.c: Accept --no-warnings instead of --no_warnings, and
4993 --no-gnu-extensions instead of --no_gnu_extensions. Make the
4994 usage message more informative.
4995 Reported by David MacKenzie.
4997 Mon Mar 9 14:53:40 1992 Francois Pinard (pinard at icule)
4999 * etc/check_examples: New name for check_examples.sh.
5000 * etc/get_examples: New name for get_examples.sh.
5001 * Makefile.in, etc/Makefile.in: Use new names.
5003 * Makefile.in: Transmit $(CC) while making in lib.
5005 * Many *.[hc] files: GNU indent'ed, with further fine tuning of
5006 code disposition by hand.
5008 Sun Mar 8 11:01:55 1992 Francois Pinard (pinard at icule)
5010 * m4.h: Delete definitions for abort() and exit().
5011 Reported by Richard Stallman.
5013 * config/hmake-unicos, config/s-unicos.h: New files.
5014 Reported by Hal Peterson.
5016 * eval.c (exp_term): Have N^0 return 1.
5017 Reported by Michael Fetterman.
5019 * eval.c, input.c, m4.h: Remove last comma in enums.
5020 Reported by Mike Lijewski.
5022 * Transfer of maintenance duties from Rene' to Franc,ois.
5024 Thu Oct 24 15:18:46 1991 Rene' Seindal (seindal at diku.dk)
5026 * Release 1.0. Many thanks to those, who provided me with bug
5027 reports and feedback.
5029 * Uses GNU configure, taken from the gdb distribution.
5031 * Uses GNU getopt(), with long option names.
5033 * The -Q/+quiet option is added, which suppresses warnings about
5034 missing or superflous arguments to built-in macros.
5036 * Added default options via the M4OPTS environment variable.
5038 * The built-in format can now be configured to use sprintf as
5039 the formatting engine, for systems without [efg]cvt(3).
5041 * GNU library code is moved to the ./lib subdirectory; other
5042 utility files are now in ./etc.
5044 * Several minor bugs have been fixed.
5046 Fri Jul 26 15:28:42 1991 Rene' Seindal (seindal at diku.dk)
5048 * Fixed various bugs. Release 0.99, manual 0.09. Many thanks to
5049 Francois Pinard and Roland H. Pesch for providing me with reports.
5051 * The builtins incr and decr are now implemented without use of
5054 * The builtin indir is added, to allow for indirect macro calls
5055 (allows use of "illegal" macro names).
5057 * The debugging and tracing facilities has been enhanced
5058 considerably. See the manual for details.
5060 * The -tMACRO option is added, marks MACRO for tracing as soon
5063 * Builtins are traced after renaming iff they were before.
5065 * Named files can now be undiverted.
5067 * The -Nnum option can be used to increase the number of
5068 divertions available.
5070 * Calling changecom without arguments now disables all comment
5073 * The function m4_patsubst() is now consistently declared
5076 * A bug in dnl is fixed.
5078 * A bug in the multi-character quoting code is fixed.
5080 * Several typos in the manual has been corrected. More probably
5083 * The m4.info file is now installed along with the program.
5085 Thu Nov 15 21:51:06 1990 Rene' Seindal (seindal at diku.dk)
5087 * Updated and enhanced version. Release 0.75, manual 0.07.
5089 * Implemented search path for include files (-I option and
5090 M4PATH envronment variable).
5092 * Implemented builtin "format" for printf-like formatting.
5094 * Implemented builtin "regexp" for searching for regular
5097 * Implemented builtin "patsubst" for substitution with regular
5100 * Implemented builtin "esyscmd", which expands to a shell
5103 * Implemented "__file__" and "__line__" for use in error
5106 * Implemented character ranges in "translit".
5108 * Implemented control over debugging output.
5110 * Implemented multi-character quotes.
5112 * Implemented multi-character comment delimiters.
5114 * Changed predefined macro "gnu" to "__gnu__".
5116 * Changed predefined macro "unix" to "__unix__", when the -G
5117 option is not used. With -G, "unix" is still defined.
5119 * Changed "shift", "$@" and "$*" to not insert spaces afters
5122 * Added program name to error messages.
5124 * Fixed two missing null bytes bugs.
5126 Mon Jan 22 21:08:52 1990 Rene' Seindal (seindal at diku.dk)
5128 * Initial beta release. Release 0.50, manual 0.05.
5136 Copyright (C) 1990, 1991, 1992, 1993, 1994, 2000, 2001, 2003,
5137 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
5140 Copying and distribution of this file, with or without
5141 modification, are permitted provided the copyright notice
5142 and this notice are preserved.