Tizen 2.0 Release
[toolchains/m4.git] / ChangeLog
1 2010-02-24  Eric Blake  <eblake@redhat.com>
2
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.
8
9         Improve parsing example.
10         * doc/m4.texinfo (Input processing): Double-quote argument to
11         translit, for robustness.
12         * THANKS: Update.
13         Reported by Chris Penev.
14
15 2010-01-29  Eric Blake  <ebb9@byu.net>
16
17         Document upcoming release.
18         * gnulib: Update to latest.
19         * doc/m4.texinfo (History): Mention 1.4.14.
20
21 2010-01-06  Eric Blake  <ebb9@byu.net>
22
23         Use correct license on auxiliary documentation.
24         * gnulib: Update to latest.
25         * AUTHORS: Use GFDL 1.3, not 1.2.
26         * BACKLOG: Likewise.
27         * README: Likewise.
28         * THANKS: Likewise.
29         * TODO: Likewise.
30         * NEWS: Place under GFDL.
31         * cfg.mk (old_NEWS_hash): Update.
32
33 2010-01-05  Eric Blake  <ebb9@byu.net>
34
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.
46         * src/m4.c: Likewise.
47         * src/m4.h: Likewise.
48         * src/macro.c: Likewise.
49         * src/output.c: Likewise.
50         * src/path.c: Likewise.
51         * src/symtab.c: Likewise.
52
53         Clarify minimum bootstrap requirements.
54         * bootstrap: Avoid out-of-date duplicated data.
55
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.
62
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
67         sensible default.
68         (update-copyright-env): Don't let environment interfere with wrap
69         column.
70
71 2010-01-01  Eric Blake  <ebb9@byu.net>
72
73         Update copyright year.
74         All files impacted, via 'make update-copyright'.  Additionally:
75         * .gitignore: Ignore backup files.
76
77 2009-12-29  Eric Blake  <ebb9@byu.net>
78
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.
85
86         Switch to indentation by space, not tab.
87         * .gitmodules: Convert leading tabs to spaces.
88         * TODO: Likewise.
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.
107
108         Update to latest gnulib.
109         * gnulib: Update.
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.
115
116 2009-11-28  Eric Blake  <ebb9@byu.net>
117
118         Work around BSD getopt bug.
119         * gnulib: Update.
120         * doc/m4.texinfo (Command line files): Add test.
121
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.
127
128 2009-11-26  Eric Blake  <ebb9@byu.net>
129
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.
133
134 2009-11-25  Eric Blake  <ebb9@byu.net>
135
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
141         distcheck.
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
154         parameters.
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
162         type.
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.
167
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.
180         * TODO: Likewise.
181         * HACKING: Likewise.
182         * examples/esyscmd.m4: Likewise.
183         * examples/file.m4: Likewise.
184         * examples/fstab.m4: Likewise.
185         * examples/patsubst.m4: Likewise.
186
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
192         maint.mk.
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.
197         * HACKING: Update.
198
199         Update from gnulib.
200         * gnulib: 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.
206
207 2009-10-05  Eric Blake  <ebb9@byu.net>
208
209         Update from gnulib.
210         * gnulib: Update.
211         * m4/gnulib-cache.m4: Import gnu-web-doc-update module.
212         * build-aux/.gitignore: Ignore new file.
213         * build-aux/.cvsignore: Likewise.
214
215 2009-08-20  Eric Blake  <ebb9@byu.net>
216
217         Update from gnulib.
218         * gnulib: Update.
219         * AUTHORS: Mention recent copyright assignment.
220
221 2009-08-17  Eric Blake  <ebb9@byu.net>
222
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.
226
227         Update copyright year.
228         * AUTHORS: Run UPDATE_COPYRIGHT_FORCE=1 make update-copyright.
229         * BACKLOG: Likewise.
230         * Makefile.am: Likewise.
231         * TODO: Likewise.
232         * acinclude.m4: Likewise.
233         * c-boxes.el: Likewise.
234         * cfg.mk: 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.
248
249         Prepare to bulk update copyright year.
250         * gnulib: Update.
251         * m4/gnulib-cache.m4: Import update-copyright and vc-list-files
252         modules.
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.
260
261 2009-08-14  Eric Blake  <ebb9@byu.net>
262
263         Explicitly request GNU getopt extensions.
264         * gnulib: Update.
265         * m4/gnulib-cache.m4: Use getopt-gnu, not obsolete getopt module.
266
267 2009-07-22  Eric Blake  <ebb9@byu.net>
268
269         Fix testsuite on Solaris.
270         * doc/m4.texinfo (Command line files): Tolerate different spelling
271         of EBADF.
272         * src/builtin.c (m4_esyscmd): Clear errno before reaping.
273
274 2009-07-21  Eric Blake  <ebb9@byu.net>
275
276         Fix testsuite on mingw.
277         * gnulib: Update.
278
279 2009-07-20  Eric Blake  <ebb9@byu.net>
280
281         Pick up gnulib fixes for sub-process execution.
282         * gnulib: Update.
283         * doc/m4.texinfo (Command line files): Add test; regression
284         introduced 2009-03-05.
285         * NEWS: Document the change.
286
287         Avoid cygwin 1.7 crash with closed stdout.
288         * gnulib: Update.
289         * doc/m4.texinfo (Command line files): Add test; regression
290         introduced 2008-07-17.
291         * NEWS: Document the change.
292
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.
298
299 2009-06-25  Eric Blake  <ebb9@byu.net>
300
301         Fix description of limits on diversions.
302         * doc/m4.texinfo (Diversions): Fix grammar.  Be less pessimistic
303         about limitations.
304         * THANKS: Update.
305         Reported by Elias Benali.
306
307 2009-06-17  Eric Blake  <ebb9@byu.net>
308
309         Update to latest gnulib.
310         * gnulib: Import fixes for Interix compilation.
311         * THANKS: Update.
312         Reported by Jay Krell.
313
314 2009-05-22  Eric Blake  <ebb9@byu.net>
315
316         Update to latest gnulib.
317         * gnulib: Import fixes for AIX compilation.
318         * THANKS: Update.
319         Reported by Jens Rehsack.
320
321 2009-04-13  Eric Blake  <ebb9@byu.net>
322
323         Fix GFDL usage.
324         * doc/m4.texinfo (copying): Complete transition to GFDL 1.3,
325         started 2008-12-12.
326         Reported by Santiago Vila.
327
328 2009-04-01  Eric Blake  <ebb9@byu.net>
329
330         Release Version 1.4.13.
331         * NEWS: Mention the release.
332
333 2009-03-31  Eric Blake  <ebb9@byu.net>
334
335         Tweak submodule instructions.
336         * HACKING: Improve directions.
337         * gnulib: Update to latest version.
338
339 2009-03-23  Eric Blake  <ebb9@byu.net>
340
341         Don't force file overwrites during bootstrap.
342         * bootstrap: Ensure that rerunning bootstrap doesn't alter tree.
343
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.
349
350 2009-03-19  Eric Blake  <ebb9@byu.net>
351
352         Exploit git submodule by adding appropriate symlinks.
353         * bootstrap: No longer copy files from gnulib.
354         * COPYING: Change to symlink pointing into gnulib.
355         * INSTALL: Likewise.
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.
368
369 2009-03-18  Eric Blake  <ebb9@byu.net>
370
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.
377
378         Use latest compile script, even with stable automake.
379         * bootstrap: Also sync build-aux/compile.
380
381 2009-03-12  Eric Blake  <ebb9@byu.net>
382
383         Fix awk script portability.
384         * checks/get-them: In gsub, properly escape {.  Close all files
385         before exiting.
386         Reported by Gary V. Vaughan.
387
388 2009-03-05  Eric Blake  <ebb9@byu.net>
389
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.
396         * NEWS: Likewise.
397
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):
401         Delete.
402
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.
407
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.
414
415 2009-03-03  Eric Blake  <ebb9@byu.net>
416
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.
420
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.
425
426 2009-02-26  Eric Blake  <ebb9@byu.net>
427
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.
432
433 2009-02-19  Eric Blake  <ebb9@byu.net>
434
435         Fix regression in translit.
436         * src/builtin.c (m4_translit): Use correct comparison.
437         * doc/m4.texinfo (Translit): Enhance test.
438
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.
444
445 2009-02-18  Eric Blake  <ebb9@byu.net>
446
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.
452
453         Update copyright year.
454         * THANKS: Mention 2009 in copyright year.
455
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.
459
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.
463
464         Avoid risk of stack overflow.
465         * src/output.c (insert_file): Avoid stack allocation of large
466         buffer.
467         (freeze_diversions): Avoid spurious semicolon.
468
469 2009-02-16  Eric Blake  <ebb9@byu.net>
470
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 /.
474         * THANKS: Update.
475         Reported by Ronny Peine, in Gentoo bug 259184.
476
477         Avoid tests that make no sense, because m4 is single-threaded.
478         * m4/gnulib-cache.m4: Avoid lock-tests and tls-tests.
479
480 2009-02-12  Eric Blake  <ebb9@byu.net>
481
482         Avoid quadratic code when walking definition stack.
483         * examples/stack_sep.m4: Use linear, not quadratic
484         implementation.
485         * doc/m4.texinfo (Improved copy): Fix documentation and add test,
486         based on recent autoconf bug fix.
487
488 2009-01-24  Eric Blake  <ebb9@byu.net>
489
490         Add URLs to --help output.
491         * src/m4.c (usage): Use enhanced version-etc features.
492
493 2009-01-02  Eric Blake  <ebb9@byu.net>
494
495         Use nicer email address in web manual.
496         * maint.mk (web-manual): Use new option in gendocs.sh.
497
498         Nuke xdelta diffs at release time; no one reported using them.
499         * maint.mk (got-xdelta, delta-xdelta): Delete.
500         * HACKING: Likewise.
501
502 2009-01-01  Eric Blake  <ebb9@byu.net>
503
504         Update copyright year.
505         * NEWS: M4 1.4.13 will occur in 2009.
506         * doc/m4.texinfo (History): Likewise.
507
508 2008-12-24  Eric Blake  <ebb9@byu.net>
509
510         Prepare for eventual release.
511         * doc/m4.texinfo (History): Mention 1.4.13.
512
513 2008-12-22  Eric Blake  <ebb9@byu.net>
514
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.
522         * NEWS: Likewise.
523
524         Use @var correctly.
525         * doc/m4.texinfo (Operation modes, Preprocessor features)
526         (Limits control, Frozen state, Debugging options): Use lower case
527         names in @var.
528         (Improved copy): Use @code, not @var, as appropriate.
529
530 2008-12-18  Eric Blake  <ebb9@byu.net>
531
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.
537
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.
543
544         Document copy composite using stack_foreach and curry.
545         * doc/m4.texinfo (Stacks): New node, to document pushdef stack
546         manipulation.
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.
553
554 2008-12-17  Eric Blake  <ebb9@byu.net>
555
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.
561
562 2008-12-12  Eric Blake  <ebb9@byu.net>
563
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
567         two variables.
568         (tmp_file2_recent): New variable.
569         (m4_tmpopen, m4_tmpclose, m4_tmpremove, m4_tmprename)
570         (output_exit): Adjust callers.
571
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.
577
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
589         callers.
590         * configure.ac (RENAME_OPEN_FILE_WORKS): New configure test.
591
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.
595
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.
608
609 2008-12-12  Eric Blake  <ebb9@byu.net>
610
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
616         recommendation.
617         * m4/gnulib-cache.m4: Replace fdl module with fdl-1.3.
618         * doc/m4.texinfo (GNU Free Documentation License): Upgrade
619         license.
620         * doc/Makefile.am (m4_TEXINFOS): Likewise.
621         * NEWS: Mention the documentation license change.
622
623 2008-10-10  Eric Blake  <ebb9@byu.net>
624
625         Release Version 1.4.12.
626         * NEWS: Mention the release.
627
628 2008-10-06  Eric Blake  <ebb9@byu.net>
629
630         Work around Solaris' sed inability to process NUL.
631         * checks/check-them (SED): Allow user to override.
632
633 2008-09-25  Eric Blake  <ebb9@byu.net>
634
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
640         tests accordingly.
641
642 2008-09-24  Eric Blake  <ebb9@byu.net>
643
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
648         input files.
649
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.
656
657 2008-09-22  Eric Blake  <ebb9@byu.net>
658
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.
664
665 2008-09-16  Eric Blake  <ebb9@byu.net>
666
667         Fix bootstrap for Solaris /bin/sh.
668         * bootstrap: Avoid shell quoting pitfall.
669
670 2008-09-01  Eric Blake  <ebb9@byu.net>
671
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.
677
678 2008-09-01  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
679
680         Typos in source code comments.
681         * src/builtin.c: Fix typos in comments.
682         * src/input.c: Likewise.
683
684 2008-08-29  Eric Blake  <ebb9@byu.net>
685
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.
690
691 2008-08-27  Eric Blake  <ebb9@byu.net>
692
693         Fix typo.
694         * doc/m4.texinfo (Invoking m4): 'm4 -d+f' is not supported in this
695         branch.
696
697 2008-08-25  Eric Blake  <ebb9@byu.net>
698
699         Update recommendation now that libsigsegv 2.6 is released.
700         * NEWS: Recommend libsigsegv 2.6+.
701         * README: Likewise.
702
703 2008-08-21  Eric Blake  <ebb9@byu.net>
704
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.
708         * NEWS: Document it.
709
710 2008-08-18  Eric Blake  <ebb9@byu.net>
711
712         Fix crash with 'm4 -N9', regression from 2006-09-14.
713         * src/m4.c (main): Add missing break.
714         * NEWS: Document it.
715
716 2008-08-15  Eric Blake  <ebb9@byu.net>
717
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.
724
725         Avoid compiler warning.
726         * src/builtin.c (m4_ifelse): Avoid unused variable.
727         * THANKS: Update.
728         Reported by Tom G. Christensen.
729
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.
734
735 2008-08-11  Eric Blake  <ebb9@byu.net>
736
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.
740
741 2008-08-03  Eric Blake  <ebb9@byu.net>
742
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.
746
747 2008-07-17  Eric Blake  <ebb9@byu.net>
748
749         Remove redundant examples/stackovf.sh.
750         * examples/stackovf.sh: Delete, now that checks has better
751         version.
752         * examples/Makefile.am (EXTRA_DIST): Don't distribute it.
753
754 2008-07-17  Eric Blake  <ebb9@byu.net>
755
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
760         handlers.
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.
769
770 2008-06-21  Eric Blake  <ebb9@byu.net>
771
772         Use new sigaction module.
773         * m4/gnulib-cache.m4: Import sigaction module.
774         * src/m4.c (main): Drop signal() calls.
775
776 2008-06-18  Eric Blake  <ebb9@byu.net>
777
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
781         when available.
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.
787
788 2008-06-06  Eric Blake  <ebb9@byu.net>
789
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.
797
798 2008-06-06  Eric Blake  <ebb9@byu.net>
799
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
817         limit.
818         * NEWS: Document this change.
819
820 2008-07-30  Eric Blake  <ebb9@byu.net>
821
822         Avoid regressions in trace and comment output.
823         * doc/m4.texinfo (Trace): Add test.
824         (Comments): Likewise.
825
826 2008-07-28  Eric Blake  <ebb9@byu.net>
827
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
832         ignored argument.
833         * doc/m4.texinfo (Improved forloop, Improved foreach): Update the
834         documentation to match.
835
836 2008-07-26  Eric Blake  <ebb9@byu.net>
837
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.
843
844 2008-07-17  Eric Blake  <ebb9@byu.net>
845
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.
851
852 2008-07-13  Eric Blake  <ebb9@byu.net>
853
854         Add -g/--gnu command line argument.
855         * src/m4.c (usage): Mention the new option.
856         (long_options, OPTSTRING): Add new option.
857         (main): Use it.
858         * NEWS: Document this addition.
859         * doc/m4.texinfo (Limits control): Likewise.
860         (Incompatibilities): Mention future use of POSIXLY_CORRECT.
861         * THANKS: Update.
862         Reported by Joel E. Denny.
863
864 2008-07-11  Eric Blake  <ebb9@byu.net>
865
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.
869
870 2008-06-16  Eric Blake  <ebb9@byu.net>
871
872         Add missing const qualifications.
873         * src/builtin.c (builtin_tab): Declare array elements as const.
874
875 2008-06-03  Eric Blake  <ebb9@byu.net>
876
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.
881
882 2008-06-02  Eric Blake  <ebb9@byu.net>
883
884         Allow autobuild usage.
885         * m4/gnulib.cache: Import autobuild module.
886
887 2008-05-23  Eric Blake  <ebb9@byu.net>
888
889         Make closing files be consistent.
890         * src/freeze.c (reload_frozen_state): Use close_stream.
891         Reported by Jean-Charles Longuet.
892
893 2008-05-22  Eric Blake  <ebb9@byu.net>
894
895         Don't allow failure to freeze give exit status of 0.
896         * src/freeze.c (produce_frozen_state): Guarantee non-zero exit on
897         fopen failure.
898         * doc/m4.texinfo (Using frozen files): Test the fix.
899         * THANKS: Update.
900         Reported by Jean-Charles Longuet.
901
902 2008-05-09  Eric Blake  <ebb9@byu.net>
903
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.
907
908 2008-05-09  Eric Blake  <ebb9@byu.net>
909
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.
916
917 2008-05-07  Eric Blake  <ebb9@byu.net>
918
919         Fix traceon regression introduced 2006-06-06.
920         * src/builtin.m4 (traceon): Only perform insertion if lookup
921         fails.
922         * doc/m4.texinfo (Trace): Test for the bug.
923         * NEWS: Document it.
924
925 2008-05-03  Eric Blake  <ebb9@byu.net>
926
927         Document define_blind.
928         * doc/m4.texinfo (Ifelse): Add a new composite macro.
929         * THANKS: Update.
930         Suggested by Mike R.
931
932 2008-04-24  Eric Blake  <ebb9@byu.net>
933
934         Add debugmode test.
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.
940
941 2008-04-21  Eric Blake  <ebb9@byu.net>
942
943         Fix spelling of attribution to Christopher Strachey.
944         * doc/m4.texinfo (History, Inhibiting Invocation): Fix typo.
945         * THANKS: Update.
946         Reported by Fernando Carrijo.
947
948 2008-04-17  Eric Blake  <ebb9@byu.net>
949
950         Fix buildbot failure.
951         * doc/m4.texinfo (Diversions): Consume all of m4's output, in case
952         SIGPIPE is ignored.
953         * THANKS: Update.
954         Detected by Bob Proulx's buildbot.
955
956 2008-04-17  Eric Blake  <ebb9@byu.net>
957
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.
966
967 2008-04-15  Eric Blake  <ebb9@byu.net>
968
969         Another 'make installcheck' fix.
970         * doc/m4.texinfo (Diversions): s/m4/__program__/ in case
971         --program-prefix was active.
972
973 2008-04-11  Eric Blake  <ebb9@byu.net>
974
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.
978
979 2008-04-11  Eric Blake  <ebb9@byu.net>
980
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
985         on OS/2.
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.
989         * THANKS: Update.
990         Reported by Elbert Pol.
991
992 2008-04-09  Eric Blake  <ebb9@byu.net>
993
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
997         this.
998         (AC_CHECK_HEADERS_ONCE): Remove limits.h.
999
1000 2008-08-07  Bruno Haible  <bruno@clisp.org>  (tiny change)
1001
1002         Run m4 tests prior to gnulib unit tests.
1003         * Makefile.am (SUBDIRS): Swap order of directories.
1004
1005 2008-04-02  Eric Blake  <ebb9@byu.net>
1006
1007         Release Version 1.4.11.
1008         * NEWS: Mention the release.
1009
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
1021         page.
1022
1023 2008-04-01  Eric Blake  <ebb9@byu.net>
1024
1025         Speed up index builtin.
1026         * m4/gnulib-cache: Import strstr module.
1027         * NEWS: Mention the speedup.
1028
1029 2008-03-29  Eric Blake  <ebb9@byu.net>
1030
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.
1036
1037 2008-03-27  Eric Blake  <ebb9@byu.net>
1038
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.
1044
1045 2008-03-27  Eric Blake  <ebb9@byu.net>
1046
1047         Add test for divert bug on 2007-05-28, patched 2007-07-21.
1048         * doc/m4.texinfo (Diversions): Add test.
1049
1050 2008-03-24  Eric Blake  <ebb9@byu.net>
1051
1052         Pull GNUmakefile from gnulib.
1053         * m4/gnulib-cache.m4: Import gnumakefile module.
1054         * GNUmakefile: Remove from version control; supplied by gnulib
1055         instead.
1056         * configure.ac (AC_INIT): Track intra-release version with
1057         git-version-gen.
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
1067         hard-coded name.
1068         * HACKING: Mention that maintainer rules should now work in VPATH
1069         builds.
1070
1071 2008-03-15  Eric Blake  <ebb9@byu.net>
1072
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.
1079
1080 2008-03-10  Eric Blake  <ebb9@byu.net>
1081
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
1086         different name.
1087         * checks/get-them: Allow xout and xerr notation.
1088
1089 2008-02-25  Eric Blake  <ebb9@byu.net>
1090
1091         Improve release process.
1092         * configure.ac (AM_INIT_AUTOMAKE): Increase requirement, and add
1093         dist-lzma.
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
1103         coreutils.
1104         (TEXI2HTML, cvs-release, update-timestamps, cvs-news, cvs-commit)
1105         (cvs-dist): Delete.
1106         * Makefile.am (EXTRA_DIST): Distribute new file.
1107
1108 2008-02-19  Eric Blake  <ebb9@byu.net>
1109
1110         Clean up foreach example.
1111         * doc/m4.texinfo (Foreach, Improved foreach): Document another
1112         shortcoming in foreach.m4.
1113
1114 2008-02-16  Eric Blake  <ebb9@byu.net>
1115
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.
1124
1125 2008-02-13  Eric Blake  <ebb9@byu.net>
1126
1127         Fix texinfo grammar.
1128         * doc/m4.texinfo (Incompatibilities): Use @. after capital.
1129         (History): Use @: after abbreviations.
1130         (M4exit): Use correct Latin abbreviation.
1131
1132 2008-02-11  Eric Blake  <ebb9@byu.net>
1133
1134         Document behavior of __gnu__().
1135         * doc/m4.texinfo (Platform macros): Enhance test.
1136         (Macro expansion): New test.
1137
1138 2008-01-31  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1139
1140         * checks/Makefile.in: Use @SET_MAKE@, and use @SHELL@ rather
1141         than hard-coding /bin/sh.
1142         * THANKS: Update.
1143         Reported by Lawson Chan.
1144
1145 2007-12-13  Paolo Bonzini  <bonzini@gnu.org>  (tiny change)
1146
1147         * doc/m4.texinfo (Inhibiting Invocation): Fix quoting of a quoting
1148         example.
1149         * THANKS: Update.
1150         Reported by Giovanni Toffetti.
1151
1152 2007-12-07  Eric Blake  <ebb9@byu.net>
1153
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.
1158
1159 2007-12-04  Eric Blake  <ebb9@byu.net>
1160
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.
1166
1167 2007-11-22  Eric Blake  <ebb9@byu.net>
1168
1169         Security fix: avoid arbitrary code execution with 'm4 -F'.
1170         * src/freeze.c (produce_frozen_state): Never pass raw file name as
1171         printf format.
1172         * NEWS: Document this fix.
1173
1174 2007-11-07  Eric Blake  <ebb9@byu.net>
1175
1176         * doc/m4.texinfo (Pseudo Arguments): Test more corner cases.
1177
1178 2007-11-05  Eric Blake  <ebb9@byu.net>
1179
1180         Use build-aux directory.
1181         * configure.ac (PACKAGE, VERSION): Delete, since Automake does
1182         this now.
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.
1190
1191 2007-10-31  Eric Blake  <ebb9@byu.net>
1192
1193         Test more corner cases.
1194         * doc/m4.texinfo (Changecom, Pseudo Arguments): Beef up tests.
1195         (Improved foreach): Document alternate foreachq style.
1196
1197 2007-10-28  Eric Blake  <ebb9@byu.net>
1198
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.
1203
1204 2007-10-27  Eric Blake  <ebb9@byu.net>
1205
1206         Document one use of changequote(`(',`)').
1207         * doc/m4.texinfo (Changequote): Add new test, based on recent
1208         autoconf addition of m4_expand.
1209
1210 2007-10-22  Eric Blake  <ebb9@byu.net>
1211
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
1216         xvasprintf-posix.
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.
1230
1231 2007-10-17  Eric Blake  <ebb9@byu.net>
1232
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.
1237
1238 2007-10-09  Eric Blake  <ebb9@byu.net>
1239
1240         Avoid regexp regression.
1241         * doc/m4.texinfo (Regexp, Patsubst): Test \ expansion.
1242
1243 2007-10-02  Eric Blake  <ebb9@byu.net>
1244
1245         Add more examples and tests.
1246         * doc/m4.texinfo (Patsubst): Use the examples directory.  Also
1247         document shortfall.
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.
1258
1259 2007-09-24  Eric Blake  <ebb9@byu.net>
1260
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.
1265
1266 2007-09-13  Eric Blake  <ebb9@byu.net>
1267
1268         * AUTHORS: Fix typo.
1269
1270 2007-09-07  Eric Blake  <ebb9@byu.net>
1271
1272         * AUTHORS: Simplify, to match libtool and autoconf layout.
1273         * THANKS: Sync with head.
1274
1275 2007-08-10  Eric Blake  <ebb9@byu.net>
1276
1277         * doc/m4.texinfo (Compatibility): Sync with head.
1278
1279 2007-08-10  Konrad Schwarz  <konrad.schwarz@siemens.com>  (tiny change)
1280         and Eric Blake  <ebb9@byu.net>
1281
1282         * doc/m4.texinfo (Defn): Update wording.
1283
1284 2007-08-09  Eric Blake  <ebb9@byu.net>
1285
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
1290         requirement.
1291         (Incompatibilities): Update to match current status.
1292         * NEWS: Document this change.
1293         * THANKS: Update.
1294         Reported by Konrad Schwarz.
1295
1296 2007-08-04  Eric Blake  <ebb9@byu.net>
1297
1298         Normalize all GPL license notices.
1299         * GNUmakefile: Update license wording.
1300         * Makefile.am: Likewise.
1301         * Makefile.maint: Likewise.
1302         * bootstrap: Likewise.
1303         * commit: 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.
1322
1323 2007-07-21  Eric Blake  <ebb9@byu.net>
1324
1325         Fix regression on NetBSD from 2007-05-28.
1326         * src/output.c (m4_tmpopen): Explicitly reset append-mode stream
1327         position to byte 0.
1328         * NEWS: Document this fix.
1329         * THANKS: Update.
1330         Reported by Thomas Klausner.
1331
1332 2007-07-20  Eric Blake  <ebb9@byu.net>
1333
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.
1338
1339 2007-07-14  Eric Blake  <ebb9@byu.net>
1340
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.
1346
1347 2007-07-10  Eric Blake  <ebb9@byu.net>
1348
1349         Start 1.4.10a.
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
1355         updated.
1356         * Makefile.am (EXTRA_DIST): Remove dead file.
1357
1358 2007-07-09  Eric Blake  <ebb9@byu.net>
1359
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.
1365
1366         * src/format.c: Missed a GPLv3 conversion.
1367
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.
1372
1373 2007-07-05  Eric Blake  <ebb9@byu.net>
1374
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.
1381
1382 2007-07-04  Eric Blake  <ebb9@byu.net>
1383
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.
1398         * commit: 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.
1416
1417 2007-06-26  Eric Blake  <ebb9@byu.net>
1418
1419         * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import assert'.
1420
1421 2007-06-26  Karl Berry  <karl@freefriends.org>  (tiny change)
1422
1423         Match Free Software Directory categories.
1424         * doc/m4.texinfo (dircategory): Update.
1425
1426 2007-05-31  Eric Blake  <ebb9@byu.net>
1427
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.
1431
1432 2007-05-29  Eric Blake  <ebb9@byu.net>
1433
1434         Start 1.4.9c.
1435         * configure.ac (AC_INIT): Bump version number.
1436         * NEWS: Start changes since 1.4.9b, and fix typo.
1437
1438         Beta Release Version 1.4.9b.
1439         * configure.ac (AC_INIT): Bump version number.
1440         * NEWS: Describe changes since 1.4.9.
1441
1442         Improve format support.
1443         * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
1444         vasprintf-posix'.
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
1448         documentation.
1449         * NEWS: Document this change.
1450
1451 2007-05-28  Eric Blake  <ebb9@byu.net>
1452
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.
1459
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.
1465
1466 2007-05-25  Eric Blake  <ebb9@byu.net>
1467
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.
1477
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
1490         start.
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.
1495
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.
1500         * THANKS: Update.
1501         Reported by Sergey Poznyakoff.
1502
1503 2007-05-24  Eric Blake  <ebb9@byu.net>
1504
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
1510         consumed.
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.
1515
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.
1519
1520 2007-04-25  Eric Blake  <ebb9@byu.net>
1521
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.
1526         * THANKS: Update.
1527         Reported by Cesar Strauss.
1528
1529 2007-04-23  Eric Blake  <ebb9@byu.net>
1530
1531         Start 1.4.9a.
1532         * configure.ac (AC_INIT): Bump version number.
1533         * NEWS: Start changes since 1.4.9.
1534
1535 2007-03-23  Eric Blake  <ebb9@byu.net>
1536
1537         Release 1.4.9:
1538         * configure.ac (AC_INIT): Bump version number.
1539         * NEWS: Describe changes since 1.4.8b.
1540
1541 2007-03-16  Eric Blake  <ebb9@byu.net>
1542
1543         * doc/m4.texinfo (Mkstemp): Tweak wording.
1544         * src/output.c (output_init): Adjust to latest gnulib.
1545
1546 2007-03-15  Eric Blake  <ebb9@byu.net>
1547
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.
1552         * THANKS: Update.
1553         Reported by Matthew Woehlke.
1554
1555 2007-03-07  Eric Blake  <ebb9@byu.net>
1556
1557         * AUTHORS: Update.
1558         * doc/m4.texinfo: Minor tweaks, avoid makeinfo warning.
1559
1560 2007-03-01  Eric Blake  <ebb9@byu.net>
1561
1562         * doc/m4.texinfo: Pick up more index entries from head.  Follow
1563         more texinfo recommendations.
1564         (Sysval): Improve tests.
1565
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
1570         manual.
1571         (Define, Arguments, Pseudo Arguments): Add more function entries.
1572
1573 2007-02-28  Eric Blake  <ebb9@byu.net>
1574
1575         * doc/m4.texinfo (Eval): Clean up wording to reflext POSIX XCU ERN
1576         137.
1577         (Pseudo Arguments): Add useful example.
1578
1579         * doc/m4.texinfo (Pushdef, Incompatibilities): Clean up wording to
1580         reflect POSIX XCU ERN 118.
1581
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
1587         inaccuracies.
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.
1592
1593 2007-02-24  Eric Blake  <ebb9@byu.net>
1594
1595         Beta Release 1.4.8b:
1596         * configure.ac (AC_INIT): Bump version number.
1597         * NEWS: Describe changes since 1.4.8.
1598
1599         Reserve all uses of raw ${} in macro definitions, not just
1600         ${<digit>}.
1601         * src/builtin.c (set_macro_sequence): Change default macro
1602         sequence.
1603         * doc/m4.texinfo (Operation modes): Update to match.
1604         * src/m4.c (usage): Likewise.
1605         * NEWS: Likewise.
1606
1607 2007-02-23  Eric Blake  <ebb9@byu.net>
1608
1609         * src/m4.h (includes): Update to latest gnulib.
1610
1611 2007-02-08  Eric Blake  <ebb9@byu.net>
1612
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
1616         prototypes.
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
1621         to trigger warning.
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
1626         change.
1627         * NEWS: Document this change.
1628
1629 2007-02-05  Eric Blake  <ebb9@byu.net>
1630
1631         * m4/gnulib-cache.m4: Module strstr no longer exists.
1632
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.
1638
1639         * doc/m4.texinfo (Sysval): Avoid SIGPIPE in test as unreliable.
1640         Reported by Albert Chin.
1641         * THANKS: Update.
1642
1643 2006-06-18  Bruno Haible  <bruno@clisp.org>  (tiny change)
1644
1645         * doc/m4.texinfo (Input processing): Further clarifications.
1646
1647 2007-02-03  Eric Blake  <ebb9@byu.net>
1648
1649         * doc/m4.texinfo (Input processing, Quoting Arguments): Beef up
1650         the examples.
1651         Reported by Bruno Haible.
1652
1653 2007-02-01  Eric Blake  <ebb9@byu.net>
1654
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.
1662
1663 2007-01-27  Eric Blake  <ebb9@byu.net>
1664
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.
1677
1678 2007-01-26  Eric Blake  <ebb9@byu.net>
1679
1680         * src/builtin.c (includes): Adjust to gnulib changes.
1681
1682 2007-01-15  Eric Blake  <ebb9@byu.net>
1683
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.
1687
1688 2007-01-13  Eric Blake  <ebb9@byu.net>
1689
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.
1695         * THANKS: Update.
1696         * NEWS: Document the improvement.
1697
1698 2007-01-09  Eric Blake  <ebb9@byu.net>
1699
1700         * src/eval.c (ASSIGN): New enumerator.
1701         (eval_lex): Recognize '='.
1702         (equality_term): Treat '=' like '==', but warn that it is
1703         deprecated.
1704         * doc/m4.texinfo (Eval): Document and test this.
1705         (Incompatibilities): Document the POSIX incompatibility.
1706         * NEWS: Document this change.
1707
1708 2007-01-06  Eric Blake  <ebb9@byu.net>
1709
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
1714         instead.
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
1721         semantics.
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.
1726
1727 2007-01-04  Eric Blake  <ebb9@byu.net>
1728
1729         * NEWS: Document previous fix.
1730         * THANKS: Update.
1731
1732 2007-01-04  Sami Liedes  <sliedes@cc.hut.fi>  (tiny change)
1733
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 --.
1737
1738 2007-01-04  Eric Blake  <ebb9@byu.net>
1739
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
1743         will be handled.
1744         * NEWS: Document this fix.
1745
1746 2007-01-03  Eric Blake  <ebb9@byu.net>
1747
1748         * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
1749         version-etc-fsf'.
1750         * src/m4.c (AUTHORS, main): Use FSF wording for --version (plus
1751         it bumps the copyright year).
1752
1753 2006-12-27  Eric Blake  <ebb9@byu.net>
1754
1755         * doc/m4.texinfo (Patsubst): Fix typo.
1756
1757 2006-12-16  Eric Blake  <ebb9@byu.net>
1758
1759         * src/m4.c (main): Check for errors when closing stdin.
1760
1761 2006-12-09  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1762
1763         * doc/m4.texinfo: Fix some typos.
1764
1765 2006-12-09  Eric Blake  <ebb9@byu.net>
1766
1767         * configure.ac (AC_INIT): Bump version number.
1768         * NEWS: Start changes of 1.4.8a.
1769
1770 2006-11-20  Eric Blake  <ebb9@byu.net>
1771
1772         Release 1.4.8:
1773         * configure.ac (AC_INIT): Bump version number.
1774         * NEWS: Describe changes since 1.4.7.
1775
1776 2006-11-16  Eric Blake  <ebb9@byu.net>
1777
1778         * doc/m4.texinfo (Include, Search Path, Diversions, Divert):
1779         Minor tweaks noticed while porting to head.
1780
1781 2006-11-14  Eric Blake  <ebb9@byu.net>
1782
1783         * src/output.c (cleanup_tmpfile, freeze_diversions): Clean up
1784         spent iterators.
1785         (m4_tmpname): Avoid memory leak.
1786
1787 2006-11-13  Eric Blake  <ebb9@byu.net>
1788
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
1792         functions.
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.
1800
1801         Backport sparse diversion handling from head.
1802         * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
1803         avltree-oset'.
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.
1819
1820 2006-11-11  Eric Blake  <ebb9@byu.net>
1821
1822         * src/builtin.c (m4_translit): Slight optimization.
1823
1824         * src/m4.h (to_uchar): Depend on HAVE_INLINE.
1825
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.
1830
1831 2006-11-07  Eric Blake  <ebb9@byu.net>
1832
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
1836         directory.
1837         (insert_diversion): Check for failure.
1838         (output_exit): Avoid memory leak.
1839         * doc/m4.texinfo (Diversions): Test this bug.
1840
1841         * doc/m4.texinfo (Esyscmd, Errprint): Minor touchups.
1842
1843 2006-11-01  Eric Blake  <ebb9@byu.net>
1844
1845         Allow C++ compilation on Linux, as a safety measure in type
1846         checking.
1847         * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
1848         stdbool'.
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
1857         C++ compilation.
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.
1863
1864         * doc/m4.texinfo (Invoking m4): Update according to POSIX 200x
1865         draft wording.
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.
1873
1874 2006-10-31  Eric Blake  <ebb9@byu.net>
1875
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)
1879         algorithm.
1880         (m4_index): Simplify, and speed up slightly.
1881         * NEWS: Document this fix.
1882
1883 2006-10-28  Eric Blake  <ebb9@byu.net>
1884
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
1890         match behavior.
1891         (Incompatibilities): Document another POSIX bug.
1892         * NEWS: Mention this change.
1893
1894 2006-10-27  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1895
1896         * examples/Makefile.am (EXTRA_DIST): Distribute recently-added
1897         files.
1898
1899 2006-10-26  Eric Blake  <ebb9@byu.net>
1900
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.
1909
1910         * src/input.c (pop_input): Remove unnecessary code.
1911
1912 2006-10-25  Eric Blake  <ebb9@byu.net>
1913
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
1918         of struct.
1919         (push_file, pop_input): Avoid useless assignment.
1920         * NEWS: Document the bug fix.
1921
1922         Redo location tracking.  Instead of having just files track the
1923         line to return to when popping input, now all input blocks track
1924         their current line.
1925         * src/input.c (INPUT_STRING_WRAP, INPUT_FILE_INIT): No longer
1926         needed.
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
1931         location.
1932         (push_string_finish, pop_input, pop_wrapup): Notice changes in
1933         input blocks.
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.
1940
1941 2006-10-23  Eric Blake  <ebb9@byu.net>
1942
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.
1946
1947 2006-10-20  Eric Blake  <ebb9@byu.net>
1948
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
1955         examples.
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.
1961
1962 2006-10-19  Eric Blake  <ebb9@byu.net>
1963
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.
1971
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
1978         nodes.
1979
1980 2006-10-17  Eric Blake  <ebb9@byu.net>
1981
1982         * m4/gnulib-cache.m4: Update with 'gnulib-tool --import
1983         config-h'.
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
1987         output clutter.
1988
1989 2006-10-16  Eric Blake  <ebb9@byu.net>
1990
1991         * doc/m4.texinfo: Backport some minor cleanups from head.
1992         (Cleardivert): Rename from cleardiv.
1993
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
1998         into new sections.
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
2004         sections.
2005         (Top, Loops, Include, Undivert, Location, Incompatibilities):
2006         Improve file references.
2007
2008 2006-10-14  Eric Blake  <ebb9@byu.net>
2009
2010         * m4/input.c (file_clean): Don't close stdin twice, POSIX says it
2011         is not portable.
2012         Reported by Ralf Wildenhues.
2013
2014         * src/builtin.c (m4_undivert): Check for read error.
2015
2016 2006-10-13  Eric Blake  <ebb9@byu.net>
2017
2018         * src/m4.h (UNIX, W32_NATIVE, OS2): Move platform checks after
2019         header files are included, since <unistd.h> can affect the tests.
2020         * THANKS: Updated.
2021         Reported by Martin Koeppe.
2022
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
2029         with gnulib.
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
2042         documentation.
2043         * NEWS: Document the change in TMPDIR behavior.
2044
2045         * configure.ac (m4_pattern_forbid): Narrow the range of forbidden
2046         macros, to work with recent gnulib-tool update.
2047
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.
2052
2053 2006-10-12  Eric Blake  <ebb9@byu.net>
2054
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
2058         supply the \n.
2059
2060 2006-10-11  Eric Blake  <ebb9@byu.net>
2061
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
2079         nodes.
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.
2084
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
2097         the off-by-one bug.
2098         (Dnl): Update to the new location reporting rules.
2099         * NEWS: Document these changes.
2100
2101 2006-10-10  Eric Blake  <ebb9@byu.net>
2102
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.
2109
2110         * src/path.c (include_env_init): Fix botched patch application.
2111         Reported by Ralf Wildenhues.
2112
2113 2006-10-09  Eric Blake  <ebb9@byu.net>
2114
2115         * src/m4.c (usage, main): Detect write failures to stderr.
2116         * src/builtin.c (m4_m4exit): Likewise.
2117         * NEWS: Document this.
2118
2119         * src/macro.c (expand_macro): Allow --nesting-limit=0 to remove
2120         the limit.
2121         * NEWS: Document this.
2122         * doc/m4.texinfo (Invoking m4): Likewise.
2123
2124 2006-10-09  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
2125
2126         * src/path.c (include_env_init): Copy the string returned
2127         by getenv before overwriting it; POSIX disallows this.
2128
2129 2006-10-09  Eric Blake  <ebb9@byu.net>
2130
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.
2134
2135 2006-09-25  Eric Blake  <ebb9@byu.net>
2136
2137         Release 1.4.7:
2138         * configure.ac (AC_INIT): Bump version number.
2139         * NEWS: Describe changes since 1.4.6.
2140
2141 2006-09-21  Eric Blake  <ebb9@byu.net>
2142
2143         * doc/m4.texinfo (Invoking m4): Add clarification on option
2144         processing behavior.
2145         * THANKS: Update.
2146         Reported by Mikhail Teterin.
2147
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.
2151
2152 2006-09-20  Eric Blake  <ebb9@byu.net>
2153
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.
2158
2159 2006-09-19  Eric Blake  <ebb9@byu.net>
2160
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.
2167
2168 2006-09-14  Eric Blake  <ebb9@byu.net>
2169
2170         * src/m4.c (main): Warn on deprecated options -B, -S, -T, -N,
2171         --diversions. `m4 --help --version' now displays help, not
2172         version.
2173         (interactive, frozen_file_to_read, frozen_file_to_write): Move to
2174         smaller scope.
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.
2179         * NEWS: Likewise.
2180
2181 2006-09-11  Eric Blake  <ebb9@byu.net>
2182
2183         * src/Makefile.am (m4_LDADD): Add any gnulib dependent libraries.
2184         * src/debug.c (debug_flush_files) [UNIX]: Flush stdin if it is
2185         seekable.
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.
2191
2192 2006-09-07  Eric Blake  <ebb9@byu.net>
2193
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
2198         2006-09-04.
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.
2205
2206 2006-09-07  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
2207
2208         * checks/check-them: Quote $pwd.
2209
2210 2006-09-05  Eric Blake  <ebb9@byu.net>
2211
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.
2217
2218 2006-09-04  Eric Blake  <ebb9@byu.net>
2219
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.
2224
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.
2233         * THANKS: Update.
2234
2235 2006-08-25  Eric Blake  <ebb9@byu.net>
2236
2237         Release 1.4.6:
2238         * configure.ac (AC_INIT): Bump version number.
2239         * NEWS: Describe changes since 1.4.5.
2240
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/
2245         exists.
2246
2247 2006-08-24  Eric Blake  <ebb9@byu.net>
2248
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.
2258
2259 2006-08-22  Eric Blake  <ebb9@byu.net>
2260
2261         * src/input.c (pop_input): Avoid empty filename with -di option.
2262         * src/debug.c (debug_message_prefix): Put space before message.
2263
2264         * m4/gnulib-cache.m4: We don't explicitly use alloca module.
2265
2266         * m4/gnulib-cache.m4: Augment with gnulib-tool --import gnupload.
2267         * Makefile.maint (fetch): Simplify, now that we can use gnupload.
2268
2269         * checks/check-them: State why a test is skipped.
2270         * doc/m4.texinfo (Changeword, Sysval, Maketemp): Likewise.
2271
2272         * ChangeLog: Add copyright.
2273         * AUTHORS: Likewise.
2274         * BACKLOG: Likewise.
2275         * README: Likewise.
2276         * THANKS: Likewise.
2277         * TODO: Likewise.
2278         * examples/COPYING: New file, add copyright for all the examples.
2279         * checks/get-them: Put copyright on testsuite files.
2280
2281 2006-08-18  Eric Blake  <ebb9@byu.net>
2282
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.
2293
2294         Regular expressions were leaking memory.
2295         * src/builtin.c (init_pattern_buffer, free_pattern_buffer): New
2296         helper methods.
2297         (m4_regexp, m4_patsubst): Avoid memory leak.
2298         * src/input.c (init_pattern_buffer) [ENABLE_CHANGEWORD]: Make
2299         static.
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.
2305
2306 2006-08-17  Eric Blake  <ebb9@byu.net>
2307
2308         * NEWS: Document previous checkin.
2309
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.
2315         * THANKS: Updated.
2316
2317 2006-08-16  Eric Blake  <ebb9@byu.net>
2318
2319         * doc/m4.texinfo (Invoking m4, Debug Output): Fix wording to be
2320         clear that dumpdef does not always go to stderr.
2321
2322         * src/builtin.c (m4_errprint): Flush buffers before printing to
2323         stderr.
2324         * THANKS: Updated.
2325
2326 2006-08-15  Eric Blake  <ebb9@byu.net>
2327
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.
2334
2335 2006-08-14  Eric Blake  <ebb9@byu.net>
2336
2337         * doc/m4.texinfo (Invoking m4): Minor fixes.
2338
2339 2006-08-12  Eric Blake  <ebb9@byu.net>
2340
2341         * doc/m4.texinfo (Arguments): Hint at better exch macro.
2342         (Answers): Provide a better definition.
2343
2344 2006-08-09  Eric Blake  <ebb9@byu.net>
2345
2346         * doc/m4.texinfo (Incompatibilities): Document that m4 does not
2347         yet understand locales.
2348         * NEWS: Fix wording of a few items.
2349
2350 2006-08-08  Eric Blake  <ebb9@byu.net>
2351
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
2359         current file.
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.
2365
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.
2373
2374 2006-08-04  Eric Blake  <ebb9@byu.net>
2375
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
2389         format.
2390         (Extensions): Document __program__.
2391         * NEWS: Document this change.
2392
2393 2006-08-03  Eric Blake  <ebb9@byu.net>
2394
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,
2398         TOKEN_CLOSE.
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.
2412
2413         * src/stackovf.c (setup_stackovf_trap): Free memory on failure.
2414
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.
2418         * THANKS: Updated.
2419         Reported by David Perlin.
2420
2421 2006-08-02  Eric Blake  <ebb9@byu.net>
2422
2423         * src/input.c (MATCH): Fix EOF detection on multi-byte comment
2424         close.
2425
2426 2006-08-01  Eric Blake  <ebb9@byu.net>
2427
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
2431         name...
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.
2439         * THANKS: Update.
2440
2441 2006-07-31  Eric Blake  <ebb9@byu.net>
2442
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.
2448         * THANKS: Update.
2449         Reported by Steven Augart.
2450
2451         * doc/m4.texinfo: Whitespace fix.
2452         * checks/get-them: Avoid exceeding 14-char file name limit.
2453         * THANKS: Update.
2454
2455 2006-07-30  Eric Blake  <ebb9@byu.net>
2456
2457         * src/path.c (path_search): Detect allocation failure.
2458
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):
2462         Adjust calls.
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.
2468
2469         * doc/m4.texinfo (Errprint): Add example for last patch.
2470         * checks/check-them: Account for VPATH in latest example.
2471
2472 2006-07-29  Eric Blake  <ebb9@byu.net>
2473
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.
2482
2483 2006-07-28  Eric Blake  <ebb9@byu.net>
2484
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
2490         /usr/ccs/bin/ucbcc.
2491
2492 2006-07-27  Eric Blake  <ebb9@byu.net>
2493
2494         * doc/m4.texinfo: Use @acronym{GNU} throughout.
2495         (History): Update for 1.4.6.
2496
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.
2503
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.
2508
2509 2006-07-26  Eric Blake  <ebb9@byu.net>
2510
2511         * doc/m4.texinfo: Use begin-quote, end-quote, begin-comment, and
2512         end-comment consistently, to match POSIX.
2513
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.
2521
2522 2006-07-25  Eric Blake  <ebb9@byu.net>
2523
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.
2527
2528 2006-07-24  Eric Blake  <ebb9@byu.net>
2529
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.
2550
2551 2006-07-22  Eric Blake  <ebb9@byu.net>
2552
2553         * src/format.c (format): Avoid compiler warning that str may be
2554         used uninitialized.
2555
2556 2006-07-21  Eric Blake  <ebb9@byu.net>
2557
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.
2561
2562 2006-07-20  Eric Blake  <ebb9@byu.net>
2563
2564         * m4/gnulib-cache.m4: gnulib-tool has changed again.  Regenerate
2565         to explicitly ask for --assume-autoconf=2.60.
2566
2567 2006-07-19  Eric Blake  <ebb9@byu.net>
2568
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.
2572         * THANKS: Update.
2573
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.
2579         * NEWS: Likewise.
2580
2581         * doc/m4.texinfo (copying): Relax restriction on front-cover and
2582         back-cover texts.
2583
2584 2006-07-17  Eric Blake  <ebb9@byu.net>
2585
2586         * src/format.c (format): Support F, g, and G specifiers.
2587         * doc/m4.texinfo (Format): Document this.
2588         * NEWS: Document this addition.
2589
2590         * doc/m4.texinfo (Builtin): Delete redundant text.
2591
2592         * configure.ac (AC_INIT): Bump version number.
2593         * src/builtin.c (substitute): Bah.  Fix buffer overrun.
2594         * NEWS: Document this fix.
2595
2596 2006-07-15  Eric Blake  <ebb9@byu.net>
2597
2598         Release 1.4.5:
2599         * configure.ac (AC_INIT): Bump version number.
2600         * NEWS: Describe changes since 1.4.4.
2601
2602         * src/m4.c (usage): Document exit status.
2603         * doc/m4.texinfo: Use `exit status', not `exit code'.
2604         (Invoking m4): Document exit status.
2605
2606         * bootstrap: Backport --help, --version from head.
2607         (func_update): New function, for easily grabbing up-to-date files
2608         from gnulib.
2609         * Makefile.maint (web-manual): Fix for VPATH builds.
2610
2611 2006-07-14  Eric Blake  <ebb9@byu.net>
2612
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.
2616
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.
2621
2622         * src/builtin.c (m4_format, m4_indir): Warn on too few arguments.
2623         * doc/m4.texinfo (Defn, Builtin, Debug Levels, Debug Output): Add
2624         more examples.
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.
2628
2629 2006-07-13  Eric Blake  <ebb9@byu.net>
2630
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.
2639
2640         * src/builtin.c (m4_undefine, m4_popdef): Visit all arguments, not
2641         just the first.
2642         * doc/m4.texinfo (Undefine, Pushdef): Test this.
2643         * NEWS: Document this change.
2644
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
2650         arguments.
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.
2661
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.
2669
2670 2006-07-12  Eric Blake  <ebb9@byu.net>
2671
2672         * doc/m4.texinfo (Extensions): Document how to overcome
2673         implementation difference in > 9 positional parameters.
2674
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.
2682
2683         * src/m4.c (nesting_limit): Raise default from 250 to 1024.
2684         * NEWS: Document raised -L limit.
2685
2686 2006-07-11  Eric Blake  <ebb9@byu.net>
2687
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
2692         documentation.
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.
2696
2697         * src/m4.h (OS2): New platform macro.
2698         * src/builtin.c (predefined_tab) [OS2]: Use it to give OS/2 a
2699         platform macro.
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.
2704
2705 2006-07-09  Eric Blake  <ebb9@byu.net>
2706
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.
2713
2714 2006-07-08  Eric Blake  <ebb9@byu.net>
2715
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).
2727
2728 2006-07-07  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
2729
2730         * doc/m4.texinfo: Fix spelling errors.
2731
2732 2006-07-07  Eric Blake  <ebb9@byu.net>
2733
2734         * THANKS: Update.
2735
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
2744         voidstar changed.
2745         * src/m4.c (xfree) [WITH_DMALLOC]: Avoid clash with dmalloc's
2746         xfree.
2747
2748 2006-07-06  Eric Blake  <ebb9@byu.net>
2749
2750         * m4/gnulib-cache.m4: Augment with gnulib-tool --import
2751         binary-io.
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.
2756
2757         * configure.ac (FUNC_SYSTEM_BROKEN): New check for OS/2 bug.
2758         * src/builtin.c (m4_syscmd): Work around OS/2 bug.
2759
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.
2764
2765 2006-07-03  Eric Blake  <ebb9@byu.net>
2766
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
2774         Makefile.in.
2775         (dist): Simplify.
2776         (Makefile): Use modern syntax of config.status.
2777         * doc/m4.texinfo (Loops, Include, Undivert, Incompatibilities):
2778         Avoid overfull and underfull hboxes in dvi.
2779
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
2783         here...
2784         * examples/incl.m4, examples/foo, examples/wrapfifo.m4: ...to
2785         here.
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
2791         new locations.
2792         (Loops, Format): Actually use forloop.m4 in tests.
2793
2794 2006-07-02  Eric Blake  <ebb9@byu.net>
2795
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.
2801
2802 2006-07-01  Eric Blake  <ebb9@byu.net>
2803
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.
2808
2809 2006-06-30  Eric Blake  <ebb9@byu.net>
2810
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
2820         are detectable.
2821         * NEWS: Document this change.
2822         * doc/m4.texinfo (Platform macros, Esyscmd, Sysval): Fix typos in
2823         last commit.
2824         * checks/check-them: Likewise.
2825         * src/debug.c (debug_set_file): Work around mingw fstat bug.
2826
2827         * src/m4.h (UNIX, W32_NATIVE): Improve platform detection macros.
2828         * src/freeze.c (produce_frozen_state): Use new spelling of
2829         platform macro.
2830         * src/builtin.c (predefined_tab): Add __windows__ on non-unix
2831         platforms.
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
2837         rescanning.
2838         (Sysval): Expand test to cover esyscmd code path, and to check
2839         that empty command is successful.  Add conditional check for
2840         signal behavior.
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.
2848
2849 2006-06-29  Eric Blake  <ebb9@byu.net>
2850
2851         Fix buffer overrun bug.
2852         * m4/gnulib-cache.m4: Augment with gnulib-tool --import
2853         xvasprintf.
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.
2860
2861         * configure.ac (AC_CANONICAL_HOST, AC_CANONICAL_BUILD): Allow
2862         cross-compilation.
2863         (AC_CACHE_CHECK): Cache search for ecvt.
2864
2865 2006-06-27  Eric Blake  <ebb9@byu.net>
2866
2867         * doc/m4.texinfo (Eval): Document 32-bit signed limitations
2868         required by POSIX, and add example that exposed core dump on x86
2869         architectures.
2870         (Incompatibilities): Document incompatibility in eval precedence.
2871         * src/eval.c (shift_term): Explicitly mask, to avoid undefined
2872         behavior.
2873         (mult_term): Explicitly check for -1, to avoid SIGFPE on x86.
2874         * NEWS: Document this change.
2875
2876         * doc/m4.texinfo: Use @noindent consistently.
2877         (Quoting Arguments): Document that unquoted parentheses group
2878         arguments.
2879         (Pseudo Arguments): Expand tests to show this.
2880         (Incompatibilities): Contrast traditional behavior of
2881         changequote.
2882
2883 2006-06-24  Eric Blake  <ebb9@byu.net>
2884
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.
2888
2889 2006-06-23  Eric Blake  <ebb9@byu.net>
2890
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
2896         tests.
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
2905         change in m4 2.0.
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.
2912
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):
2917         Likewise.
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.
2928
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.
2932
2933 2006-06-22  Eric Blake  <ebb9@byu.net>
2934
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.
2950
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{}.
2956
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.
2965
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.
2972
2973         * Makefile.am (EXTRA_DIST): Distribute gnulib-cache.m4.
2974         Reported by Bruno Haible.
2975
2976 2006-06-21  Eric Blake  <ebb9@byu.net>
2977
2978         Avoid obsolete sigstack when POSIX sigaltstack is available.
2979         * src/m4.c: Blindly assume signal.h, since stackovf.c and gnulib
2980         do likewise.
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
2993         POSIX handler.
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
2997         siginfo.h.
2998         [HAVE_SIGACTION && defined SA_ONSTACK]: Prefer POSIX handler.
2999         Reported by Santiago Vila.
3000
3001 2006-06-19  Eric Blake  <ebb9@byu.net>
3002
3003         * THANKS: Update.
3004
3005 2006-06-18  Andreas Buening  <andreas.buening@nexgo.de>  (tiny change)
3006
3007         * checks/Makefile.in (PATH_SEPARATOR): New macro.
3008         (check, installcheck): Use it, for OS/2.
3009
3010 2006-06-18  Eric Blake  <ebb9@byu.net>
3011
3012         Consistently use "GNU M4" as package name, "m4" as executable
3013         name.
3014         * NEWS: Document previous fix.
3015         * THANKS: Update.
3016         * README: Fix grammar.  Document that --enable-changeword is on
3017         its last leg.
3018         * doc/m4.texinfo (Top, Changeword): Likewise.
3019         (Sysval): Enhance this test.
3020         (History): Backport this section from CVS head, and update.
3021
3022 2006-06-18  Bruno Haible  <bruno@clisp.org>  (tiny change)
3023             Eric Blake  <ebb9@byu.net>
3024
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.
3030
3031 2006-06-18  Eric Blake  <ebb9@byu.net>
3032
3033         * configure.ac (AC_INIT): Bump version number.
3034         * NEWS: Describe changes in 1.4.4c.
3035
3036 2006-06-17  Eric Blake  <ebb9@byu.net>
3037
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.
3042
3043         * Makefile.am (MAINTAINERCLEANFILES): Clean files added by
3044         bootstrap.
3045         * checks/Makefile.in (maintainer-clean): Add missing target.
3046         * COPYING: Remove generated file from CVS.
3047
3048 2006-06-16  Eric Blake  <ebb9@byu.net>
3049
3050         * checks/Makefile.in (DISTFILES): Distribute wrapfifo.m4.
3051
3052 2006-06-15  Eric Blake  <ebb9@byu.net>
3053
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.
3057
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.
3065
3066         Message cleanup.
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.
3071
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
3075         gnulib.
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.
3081         * THANKS: Update.
3082
3083 2006-06-08  Eric Blake  <ebb9@byu.net>
3084
3085         * configure.ac (changeword): Work even when changeword is not a
3086         macro.
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.
3090
3091 2006-06-07  Eric Blake  <ebb9@byu.net>
3092
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.
3098
3099         Distribute a rudimentary man page.
3100         * Makefile.am (SUBDIRS): Move doc after src so that 'm4 --help'
3101         can feed help2man.
3102         * doc/Makefile.am (man_MANS, EXTRA_DIST, MAINTAINERDISTCLEAN),
3103         (SUFFIXES, m4.1): New macros and rules to build m4.1.
3104
3105 2006-06-06  Eric Blake  <ebb9@byu.net>
3106
3107         * lib/regex.c (re_match_2_internal, bcmp_translate): Avoid
3108         compiler warnings at -O2.
3109         * lib/getopt.c (_getopt_internal): Likewise.
3110
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.
3127
3128         Trace status of builtins is no longer inherited across
3129         define(...,defn(...)).  Fixes bug that autom4te had been working
3130         around.
3131         * src/builtin.c (define_builtin): Don't override trace status.
3132         * doc/m4.texinfo (Trace): Add test for this.
3133         * NEWS: Document this.
3134
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
3142         patch.
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
3151         is still in use.
3152         (lookup_symbol) <SYMBOL_INSERT>: Create new entry when old entry
3153         is still in use.
3154         (lookup_symbol) <SYMBOL_DELETE, SYMBOL_POPDEF>: Mark entries still
3155         in use as deleted and remove from the table without freeing
3156         memory.
3157         (symtab_print_list) [DEBUG_SYM]: More debug output.
3158
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
3163         hack_all_symbols.
3164
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
3172         symbol table.
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
3178         GNU trace.
3179
3180 2006-06-04  Paul Eggert  <eggert@cs.ucla.edu>  (tiny change)
3181             Eric Blake  <ebb9@byu.net>
3182
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.
3194
3195 2006-06-04  Eric Blake  <ebb9@byu.net>
3196
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.
3202
3203 2006-05-31  Eric Blake  <ebb9@byu.net>
3204             John Brzustowski  <jbrzusto@fastmail.fm>
3205
3206         * src/input.c (input_stack): Delete; use current_input instead.
3207         (wrapup_stack): Dynamically allocate, so that recursion is handled
3208         properly.
3209         (push_wrapup): Use current wrapup stack.
3210         (pop_wrapup): Rotate wrapup stack to current, and create new
3211         wrapup stack.
3212         (input_init): Dynamically allocate stacks.
3213         * NEWS: Update, now that recursive m4wrap can no longer cause
3214         core dump.
3215
3216 2006-05-31  Eric Blake  <ebb9@byu.net>
3217
3218         * lib/getopt.c: Fix copyright year.
3219         * lib/obstack.c: Ditto.
3220         * src/builtin.c: Ditto.
3221
3222 2006-05-30  Eric Blake  <ebb9@byu.net>
3223
3224         * doc/m4.texinfo (M4wrap): Add test to expose m4wrap bug.
3225         Reported by John Brzustowski.
3226         (Incompatibilities): Document known POSIX incompatibilities.
3227         * THANKS: Update.
3228
3229 2006-05-29  Eric Blake  <ebb9@byu.net>
3230
3231         * doc/m4.texinfo (Maketemp): Work even when running 'make check'
3232         in read-only dir.
3233
3234         Use automake.
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.
3257
3258         * AUTHORS: Backport from CVS head, and update.
3259         * doc/m4.texinfo (Changeword): Fix examples to match behavior.
3260
3261 2006-05-27  Eric Blake  <ebb9@byu.net>
3262
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.
3268
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.
3273
3274         * configure.ac: Update to autoconf 2.59.  Forbid ^M4_.  Fix
3275         quoting.
3276         * aclocal.m4 (fp_PROG_CC_STDC): Delete; now covered by autoconf.
3277         (fp_C_PROTOTYPES): Delete, GNU Coding Standards state we can now
3278         assume C89.
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.
3284
3285 2006-05-25  Eric Blake  <ebb9@byu.net>
3286
3287         * doc/m4.texinfo: Fix spelling errors.  Use `invalid' instead of
3288         `illegal'.
3289
3290         * doc/m4.texinfo (Francois): No longer needed as a tex variable.
3291         Reported by Karl Berry.
3292
3293 2006-05-24  Eric Blake  <ebb9@byu.net>
3294
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
3299         rendering.
3300         (Regexp) [ifhtml]: Make cross-reference to emacs manual an
3301         absolute URL.
3302         Reported by Bob Badour.
3303
3304         * THANKS: Update.  Move reporter's email addresses here, instead
3305         of in ChangeLog.
3306
3307 2006-05-11  Eric Blake  <ebb9@byu.net>
3308
3309         * THANKS: Update.
3310         * doc/m4.texinfo (Changequote): Give testsuite exposure to bug
3311         patched on 2005-12-04.
3312         Reported by Ilya N. Golubev.
3313
3314         * bootstrap: New file, so that generated files need not be stored
3315         in CVS.
3316         * Makefile.in (DISTFILES): Add bootstrap.
3317
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.
3322
3323         Portability updates for OS/2.
3324         * src/Makefile.in (EXEEXT, OBJEXT): Define.
3325         (LINK): Use CFLAGS.
3326         (.c.obj): Define.
3327         * lib/Makefile.in (OBJEXT): Define.
3328         (.c.obj): Define.
3329         * doc/Makefile.in (install, uninstall): Install info files into
3330         the dir listing.
3331         Reported by Andreas Buening.
3332
3333 2006-05-09  Eric Blake  <ebb9@byu.net>
3334
3335         * install-sh: Update to newer upstream version.
3336         * mkinstalldirs: Likewise.
3337         Reported by Andreas Buening.
3338
3339         * src/m4.c (main): Bump copyright year.
3340         * Makefile.in (datarootdir): Define, for autoconf 2.59c.
3341         * doc/Makefile.in (datarootdir): Likewise.
3342
3343 2006-05-08  Eric Blake  <ebb9@byu.net>
3344
3345         * THANKS: Update.
3346         * doc/m4.texinfo (Bugs): Backport bug email address from head.
3347         Reported by Stepan Kasal.
3348
3349 2005-12-04  Ilya N. Golubev  <gin@mo.msk.ru>  (tiny change)
3350
3351         * input.c (match_input): Do not pass expression with side effect
3352         to `obstack_grow'.  Fix <INTERNAL ERROR: Recursive push_string!>.
3353         * NEWS: Updated.
3354
3355 2005-12-04  Gary V. Vaughan  <gary@gnu.org>  (tiny change)
3356
3357         * doc/m4.texinfo (How to debug macros and input): s/woould/would/
3358         Reported by Damian Menscher.
3359
3360 2005-10-19  Gary V. Vaughan  <gary@gnu.org>  (tiny change)
3361
3362         * configure.ac (AC_INIT): Bump to 1.4.4a.
3363
3364 2005-10-19  Gary V. Vaughan  <gary@gnu.org>  (tiny change)
3365
3366         Release 1.4.4:
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.
3370
3371 2005-10-17  John Gatewood Ham  <zappaman@buraphalinux.org>  (tiny change)
3372
3373         * src/m4.c: fix return code when non-existent files are processed
3374
3375 2005-10-17  John Gatewood Ham  <zappaman@buraphalinux.org>  (tiny change)
3376
3377         * README: update email address for bug reports.
3378
3379 2005-10-17  Gary V. Vaughan  <gary@gnu.org>
3380
3381         * doc/m4.info: Generated files are not kept in the repository.
3382
3383 2005-05-01  Gary V. Vaughan  <gary@gnu.org>
3384
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'.
3388
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.
3392
3393 2005-03-31  Mike Frysinger  <vapier@gentoo.org>
3394
3395         * Makefile.in (bindir, infodir): Substitute from configure rather
3396         than hardcode.
3397         * doc/Makefile.in (infodir): Ditto.
3398         * src/Makefile.in (bindir): Ditto.
3399         * NEWS: Updated.
3400
3401 2005-03-31  Gary V. Vaughan  <gary@gnu.org>
3402
3403         Changes needed to automate the release process for 1.4.3:
3404
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.
3419
3420 2005-03-31  Gary V. Vaughan  <gary@gnu.org>  (tiny change)
3421
3422         * configure.ac (AC_INIT): Bump to 1.4.3a.
3423
3424 2005-03-31  Gary V. Vaughan  <gary@gnu.org>  (tiny change)
3425
3426         Release 1.4.3:
3427         * configure.in (AC_INIT): Bump to 1.4.3.
3428         * NEWS: Describe 1.4.3's changes.
3429
3430 2005-03-31  Gary V. Vaughan  <gary@gnu.org>
3431
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
3435         canonical versions.
3436
3437 2005-03-31  Eric Blake  <ebb9@byu.net>  (tiny change)
3438
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
3443         @comment marks.
3444
3445 2005-03-31  Eric Blake  <ebb9@byu.net>  (tiny change)
3446
3447         * doc/Makefile.in (install, uninstall): Accomodate DESTDIR.
3448         * src/Makefile.in (install, uninstall): Likewise.
3449
3450 2005-02-07  Gary V. Vaughan  <gary@gnu.org>
3451
3452         * lib/regex.c, lib/regex.h:  Reverted gnulib update, which broke
3453         on Cygwin.
3454         Reported by Eric Blake.
3455
3456 2005-02-04  Gary V. Vaughan  <gary@gnu.org>
3457
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.
3461         * NEWS: Updated.
3462         Reported by Frank Schwidom.
3463
3464         * Makefile.in (stamp-h): Regenerate config.h properly.
3465
3466 2005-02-03  Gary V. Vaughan  <gary@gnu.org>
3467
3468         * configure.ac (AC_DEFINE): Fix overquoting of description
3469         argument.
3470
3471         * src/m4.h (__CYGWIN__, WIN32): Canonicalise Windows and Cygwin
3472         recognition macros.
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.
3476
3477         * src/m4.c (main): Modernise the --version output.
3478
3479 2005-02-03  Gary V. Vaughan  <gary@gnu.org>
3480
3481         Modernise the configury a little to prevent spurious errors from
3482         Autoconf-2.59's autoreconf:
3483
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
3491         entry comments.
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.
3504
3505 2005-02-03  Noah Misch  <noah@cs.caltech.edu>
3506
3507         * src/output.c (mkstemp): Make non-static, and build regardless of
3508         HAVE_TMPFILE; src/builtin.c also needs this replacement.
3509         * NEWS: Update.
3510
3511 2004-09-09  Vincent Lonngren  <Vincent.lonngren.759@student.lu.se>
3512
3513         * configure.in (AC_CHECK_HEADERS): Commit works best when you save
3514         changes from your editor buffer first.
3515
3516         * configure.in (AC_CHECK_HEADERS):  Add signal.h, sys/signal.h.
3517         * src/m4.c: And include them as appropriate.
3518         * NEWS: Updated.
3519
3520 2004-09-09  Andreas Schwab  <schwab@suse.de>
3521
3522         Refactoring of the string read case in next_char provides about a
3523         20% speedup of M4 as typically used by autoconf:
3524
3525         * src/input.c (next_char_1): Renamed from next_char.
3526         (next_char): New macro.
3527         * NEWS: Updated.
3528
3529 2004-08-21  Gary V. Vaughan  <gary@gnu.org>
3530
3531         * configure.in (VERSION): Bump to 1.4.2a.
3532
3533 2004-08-19  Paul Eggert  <eggert@twinsun.com>
3534
3535         Release 1.4.2.
3536         * configure.in (VERSION): Bump to 1.4.2.
3537         * News: Describe 1.4.2's changes.
3538
3539         * src/m4.c (reference_error): Preserve errno, since M4ERROR
3540         relies on this.
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
3544         returning NULL.
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>.
3549
3550 2004-06-09  Gary V. Vaughan  <gary@gnu.org>
3551
3552         * configure.in (VERSION): Bump to 1.4.1a.
3553         * NEWS: Place holder for next stable release.
3554
3555 2004-06-03  Paul Eggert  <eggert@cs.ucla.edu>
3556
3557         Release 1.4.1.
3558         * configure.in (VERSION): Bump to 1.4.1.
3559         * NEWS: Describe 1.4.1's changes.
3560
3561         * aclocal.m4 (fp_PROG_CC_STDC): Use AC_DEFUN, not define, to
3562         pacify Autoconf 2.59.
3563
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.
3567
3568         * src/m4.h, src/debug.c: Use #ifdef __STDC__, not #if __STDC__, to
3569         pacify Sun C compilers.
3570
3571 2003-09-28  Akim Demaille  <akim@epita.fr>
3572
3573         * src/symtab.c (lookup_symbol): Fix an uninitialized-variable
3574         botch.
3575
3576 2003-09-03  Santiago Vila  <sanvila@debian.org>
3577
3578         * examples/stackovf.sh: Use tempfile if available.
3579
3580 2001-04-02  Robert Bihlmeyer  <robbe@orcus.priv.at>
3581
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)
3585
3586 2001-02-01  Santiago Vila  <sanvila@debian.org>
3587
3588         http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=84451
3589         * src/m4.c (main): Fix format vulnerabilities.  (trivial change)
3590
3591 2001-02-01  Matt Kraai  <kraai@debian.org>
3592
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
3596         security hole.
3597         * src/builtin.c (m4_maketemp): Implement the above, by using
3598         mkstemp rather than mktemp.  (trivial change)
3599
3600 2000-01-09  Akim Demaille  <demaille@inf.enst.fr>
3601
3602         * src/builtin.c (expand_ranges): Added break after trailing dash.
3603         This caused misbehaviors on some systems.
3604
3605 Sat Nov  5 15:52:47 1994  Francois Pinard  (pinard@icule)
3606
3607         Release 1.4.
3608         * doc/Makefile.in (realclean): Also remove stamp-vti.
3609         Reported by Eric Backus.
3610
3611 Wed Nov  2 00:47:53 1994  Francois Pinard  (pinard@icule)
3612
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.
3616
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.
3620
3621 Tue Nov  1 22:02:37 1994  Francois Pinard  (pinard@icule)
3622
3623         * src/macro.c (collect_arguments): Cast obstack arguments to
3624         (voidstar), so avoiding compiler warnings.
3625         Reported by Joseph E. Sacco.
3626
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.
3630
3631         * src/m4.c (main): Cast the argument to xfree to (voidstar).
3632         * src/symtab.c (free_symbol): Idem.
3633         Reported by Karl Vogel.
3634
3635 Mon Oct 31 02:11:19 1994  Francois Pinard  (pinard@icule)
3636
3637         * Makefile.in (DISTFILES): Distribute BACKLOG.
3638
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.
3643
3644 Sun Oct 30 08:13:03 1994  Francois Pinard  (pinard@icule)
3645
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.
3650
3651         * configure.in: Added obsolescent tests for AIX and Minix.
3652
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
3656         Joseph E. Sacco.
3657
3658 Sat Oct 29 05:10:03 1994  Francois Pinard  (pinard@icule)
3659
3660         * aclocal.m4 (fp_C_PROTOTYPES): Force -D_HPUX_SOURCE with -Aa.
3661         Reported by John David Anglin.
3662
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.
3676
3677         * Makefile.in: Remove binprefix.  Use transform_name instead.
3678         Reported by David MacKenzie.
3679
3680         * doc/Makefile.in: Create version.texi, use it, clean it.
3681         Reported by Jim Meyering.
3682
3683 Fri Oct 28 20:33:55 1994  Francois Pinard  (pinard@icule)
3684
3685         * Makefile.in (all, install, uninstall): Depend on Makefile.
3686
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.
3691
3692         * {,/*}Makefile.in: Use && after all cd, in case they fail.
3693
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.
3697
3698         * {,*/}Makefile.in (dist): Always try a hard link before a copy.
3699
3700 Thu Oct 27 22:32:58 1994  Francois Pinard  (pinard@icule)
3701
3702         * Makefile.in (mostlyclean-local): Do not remove *~.
3703         * */Makefile.in (mostlyclean): Idem.
3704         Reported by Robert E. Brown and Richard Stallman.
3705
3706 Sun Oct  9 08:30:13 1994  Francois Pinard  (pinard@icule)
3707
3708         * src/m4.h: Get rid of CONFIG_BROKETS.
3709
3710 Sun Oct  2 16:48:10 1994  Francois Pinard  (pinard@icule)
3711
3712         * configure.in: Use AC_ARG_PROGRAM.
3713         * aclocal.m4 (fp_C_PROTOTYPES): Substitute @kr@ by kr or empty.
3714         Reported by David MacKenzie.
3715
3716 Sat Oct  1 11:22:42 1994  Francois Pinard  (pinard@icule)
3717
3718         * configure.in: Do not add -O to CFLAGS for GNU C, now that
3719         configure does it automatically.
3720         Reported by Jim Meyering.
3721
3722 Fri Sep 23 08:16:58 1994  Francois Pinard  (pinard@icule)
3723
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.
3729
3730         * src/m4.c (main): Initialize program_name to argv[0] without
3731         basename'ing it.
3732         Reported by Karl Berry.
3733
3734 Sun Sep 18 11:42:50 1994  Francois Pinard  (pinard@icule)
3735
3736         * src/Makefile.in (TAGS): Include a ../lib/TAGS reference.
3737         Reported by Karl Berry.
3738
3739 Wed Sep 14 10:00:22 1994  Francois Pinard  (pinard@icule)
3740
3741         * lib/Makefile.in (mostlyclean): Added.
3742         (TAGS): Make in $(srcdir).
3743
3744         * configure.in: Use `choke me' in test, like everywhere!
3745
3746         * {doc,examples,lib,src}/Makefile.in (check): Deleted, as
3747         unreacheable and useless.
3748
3749         * doc/Makefile.in (texclean): Deleted, merged in mostlyclean.
3750
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.
3756
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.
3761 \f
3762 Tue Sep 13 19:21:05 1994  Francois Pinard  (pinard@icule)
3763
3764         Release 1.3.
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.
3769
3770         * src/m4.h (memcpy): Define with bcopy for BSD systems.
3771         Reported by Kaveh R. Ghazi.
3772
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
3775         specify it.
3776
3777         * configure.in: Use date instead of touch for stamp-h.
3778         * Makefile.in (stamp-h.in): Idem.
3779
3780         * Makefile.in (distclean, realclean): Force serial execution of
3781         both goals, in case parallel makes are being used.
3782         Reported by Jim Meyering.
3783
3784         * src/Makefile.in (DISTFILES): Distribute TAGS.
3785         (distclean): Do not remove TAGS.
3786         (realclean): Remove it.
3787         Reported by Karl Berry.
3788
3789 Sat Sep 10 12:34:04 1994  Francois Pinard  (pinard@icule)
3790
3791         * configure.in: Use fp_ to match aclocal.m4.  Revert _OS_ macros
3792         to old names, for following Autoconf.
3793
3794 Thu Sep  8 15:07:27 1994  Francois Pinard  (pinard@icule)
3795
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.
3799
3800         * doc/Makefile.in (texclean): Remove *.cps and *.fns too.
3801         Reported by Eric Backus.
3802
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.
3809
3810 Tue Sep  6 12:07:33 1994  Francois Pinard  (pinard@icule)
3811
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.
3816
3817         * src/Makefile.in (TAGS): Remote -t from etags call.
3818
3819 Fri Sep  2 10:37:10 1994  Francois Pinard  (pinard@icule)
3820
3821         * lib/Makefile.in (install): Depend on all.
3822
3823 Wed Aug 31 11:17:21 1994  Francois Pinard  (pinard@icule)
3824
3825         * examples/Makefile.in (mostlyclean): Do not depend on texclean.
3826         Reported by Jim Meyering and John David Anglin.
3827
3828         * Makefile.in (distclean-local): Delete config.log.
3829         Reported by Jim Meyering.
3830
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.
3838
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.
3843
3844         * configure.in: Use AC_TYPE_SIGNAL.
3845         * src/stackovf.c (setup_stackovf_trap): Use RETSIGTYPE.
3846         Reported by Robert Bernstein.
3847
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.
3852
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.
3856
3857         * src/output.c (output_text): New function, for optimizing the
3858         output of strings of characters.  Use it.
3859
3860 Tue Aug 30 01:44:29 1994  Francois Pinard  (pinard@icule)
3861
3862         * doc, src: New directories reorganizing the distribution.
3863         * doc/Makefile.in, src/Makefile.in, examples/Makefile.in: New
3864         files.
3865         * Makefile.in: Adjusted.
3866         * configure.in: Configure new Makefiles.
3867
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.
3873
3874 Mon Aug 29 12:27:19 1994  Francois Pinard  (pinard@icule)
3875
3876         * m4.h: Include <unistd.h> if it exists.
3877         * stackovf.c: Don't.
3878
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
3883         current_diversion.
3884         * builtin.c (builtin_init, m4_divert): Leave current_diversion
3885         alone.
3886
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.
3894
3895         Freeze diversions:
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.
3903
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
3910         structures.
3911         (insert_file): Use better buffering.
3912         Reported by David MacKenzie.
3913
3914 Sun Aug 28 05:20:02 1994  Francois Pinard  (pinard@icule)
3915
3916         * Makefile.in, lib/Makefile.in, checks/Makefile.in: Arrange so
3917         dist works from another build directory.
3918
3919 Sat Aug 27 14:32:45 1994  Francois Pinard  (pinard@icule)
3920
3921         * symtab.c (hack_all_symbols): Use hash_table_size instead of
3922         constant HASHMAX, for -H option to work better.
3923
3924         * builtin.c (DECLARE): Simplify by using _ ().
3925
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.
3935
3936 Wed Aug 24 16:14:19 1994  Francois Pinard  (pinard@icule)
3937
3938         * builtin.c (dumpdef_cmp): Rewrite so the cast protect the const
3939         specifier.
3940
3941         * configure.in: Implement --with-dmalloc.
3942         * acconfig.h: Document WITH_DMALLOC.
3943         * m4.h: Add code for when WITH_DMALLOC.
3944
3945 Mon Aug 15 12:38:05 1994  Francois Pinard  (pinard@icule)
3946
3947         * m4.c (long_options): Use "error-output", the dash was missing.
3948         Reported by Akiko Matsushita.
3949
3950 Fri Aug 12 16:38:01 1994  Francois Pinard  (pinard@icule)
3951
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.
3955         int.
3956         * input.c: Declare len_lquote, len_rquote, len_bcomm and len_ecomm
3957         as size_t, not int.
3958         * builtin.c (dump_args): Declare len as size_t, not int.
3959
3960         * debug.c: Prototype the forward declaration of debug_set_file.
3961
3962         * builtin.c (m4_undivert):  Replace div by file, for avoiding the
3963         shadowing of this variable.
3964         * output.c (insert_diversion): Idem.
3965
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.
3972
3973         * configure.in: Updated for Autoconf 2.0.
3974         * Makefile.in (distclean-local): Also delete config.cache.
3975
3976         * m4.c (usage): Reorganize the --help output by topic.  Include a
3977         description for debugging flags.
3978
3979 Fri Jul 29 10:15:52 1994  Francois Pinard  (pinard@icule)
3980
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
3986         and Simon Leinen.
3987
3988 Thu Jul 21 22:43:17 1994  Francois Pinard  (pinard@icule)
3989
3990         * m4.c (usage): Replace printf par fputs.
3991 \f
3992 Mon Jul 18 23:48:23 1994  Francois Pinard  (pinard@icule)
3993
3994         * Release 1.2
3995
3996 Sun Jul 17 08:08:25 1994  Francois Pinard  (pinard@icule)
3997
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.
4005
4006 Sat Jul 16 20:36:19 1994  Francois Pinard  (pinard@icule)
4007
4008         * ansi2knr.c: New version sent by its author, Peter Deutsch.
4009
4010 Fri Jul 15 14:36:21 1994  Francois Pinard  (pinard@icule)
4011
4012         * Makefile.in: Modify so parallel make will not try making
4013         lib/libm4.a twice simultaneously.
4014         Reported by Jim Meyering.
4015
4016 Thu Jul 14 17:23:17 1994  Francois Pinard  (pinard@icule)
4017
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.
4022
4023         * Makefile.in (install): Have install depend on all too, for lib
4024         to be remade as needed.
4025
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.
4029
4030 Tue Jul 12 06:54:31 1994  Francois Pinard  (pinard@icule)
4031
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.
4034
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
4039         messages.
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.
4045
4046 Thu Jul  7 22:38:10 1994  Francois Pinard  (pinard@icule)
4047
4048         * macro.c (expand_macro): Cast value to (boolean) prior to
4049         assigning it to traced.
4050         Reported by Tom McConnell.
4051
4052         * Makefile.in (m4): Always make all in lib first.
4053         Reported by Jim Meyering.
4054
4055 Wed Jul  6 13:16:31 1994  Jim Avera (jima@netcom.com)
4056
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.
4066
4067 Tue Jul  5 19:13:54 1994  Francois Pinard  (pinard@icule)
4068
4069         * configure.in: Use AC_SET_MAKE.
4070         * Makefile.in: Use @SET_MAKE@.
4071         Reported by Jim Meyering.
4072
4073         * checks/check-them: Do not trap on SIGQUIT or SIGALRM.
4074         Reported by Ian Taylor.
4075
4076 Sat Jul  2 00:58:47 1994  Francois Pinard  (pinard@icule)
4077
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.
4082
4083         * acconfig.h, aclocal.m4, m4.h: Replace HAVE_PROTOTYPES by
4084         PROTOTYPES.
4085         * aclocal.m4, configure.in: Replace AC_HAVE_PROTOTYPES by
4086         AC_PROTOTYPES.
4087
4088 Wed Jun 29 22:41:53 1994  Francois Pinard  (pinard@icule)
4089
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.
4094
4095 Mon Jun 27 14:24:23 1994  Francois Pinard  (pinard@icule)
4096
4097         * m4.c: Complete prototype for forwarded declaration of usage.
4098
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.
4103
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.
4116
4117         * macro.c: Complete the prototypes of forwarded expand_macro and
4118         expand_token.
4119         Reported by Thorsten Ohl.
4120
4121         * m4.h: Define voidstar as void * or char * depending on __STDC__.
4122         The Ultrix 3.1 compiler cannot do much with void pointers.
4123
4124         * builtin.c (dumpdef_cmp): Replace void * by voidstar.
4125         * m4.c (xfree):  Replace void * by voidstar.
4126         Reported by Tom McConnell.
4127
4128         * ansi2knr.1: New, from elsewhere.
4129         * Makefile.in (DISTFILES): Distribute ansi2knr.1
4130
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.
4135
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.
4140
4141 Sat Jun 25 00:10:05 1994  Francois Pinard  (pinard@icule)
4142
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.
4152
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.
4158
4159         * configure.in: m4_undefine changeword before using AC_ENABLE.
4160
4161         * m4.h: Declare prototypes for error (for ANSI compilers only),
4162         prefix_all_builtins and reference_error.
4163         Reported by Tom McConnell.
4164
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.
4168
4169         * Makefile.in (dist): Clean examples/ before saving it.
4170         (distclean-local): Also remove stamp-h.
4171         Reported by Eric Backus.
4172
4173         * Makefile.in (_stackovf.c): Goal for compiling stacokovf.c with
4174         non ANSI compilers.
4175         Reported by Tom McConnell.
4176
4177         * checks/Makefile.in (clean): Depends on mostlyclean.
4178         (mostlyclean): New goal.
4179
4180 Fri Jun 24 23:30:31 1994  Francois Pinard  (pinard@icule)
4181
4182         * Makefile.in (DISTFILES): Distribute install.sh.
4183         * install.sh: New file, copied from elsewhere.
4184         Reported by Assar Westerlund and Kaveh R. Ghazi.
4185
4186 Thu Jun 23 00:00:30 1994  Francois Pinard  (pinard@icule)
4187
4188         * configure.in: Define ENABLE_CHANGEWORD if --enable-changeword.
4189         * acconfig.h: Explain ENABLE_CHANGEWORD.
4190
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
4202         the original text.
4203         * macro.c (expand_token): Ship out original text if not a macro
4204         name.
4205         Reported by Krste Asanovic and Pete Chown.
4206
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.
4213
4214         * Makefile.in (m4): Revert Jan 3 1994 change.  I'm unable to
4215         agree with it.
4216
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.
4220
4221         * m4.c: Declare nesting_limit and initialize it to 250.
4222         Implement -LNUMBER or --nesting-limit=NUMBER to change its
4223         value.
4224         * m4.h: Declare nesting_limit as external.
4225         * macro.c (expand_macro): Stop execution whenever nesting limit
4226         is exceeded.
4227         Reported by Bengt Mertensson.
4228
4229         * eval.c (evaluate): Diagnose excess characters in eval input.
4230         Things like `eval(08)' used to return 0 with no diagnostic.
4231
4232         * m4.h: Capitalize first letter of all macro arguments in
4233         definitions.
4234
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.
4245
4246         * examples/incl-test.m4: Renamed from incl_test.m4.
4247         * examples/include.m4: Include incl-test.m4 instead of
4248         incl_test.m4.
4249         * examples/multiquotes.m4: Renamed from multi-quotes.m.
4250
4251 Wed Jun 22 21:58:54 1994  Francois Pinard  (pinard@icule)
4252
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.
4256
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.
4262
4263         * format.c (format): Remove const from char *fmt declaration when
4264         not HAVE_EFGCVT, because a NUL may be forced into it.
4265
4266         * m4.h: Declare atof() when not STDC_HEADERS.
4267         Reported by Joseph E. Sacco.
4268
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.
4272
4273 Sun Jun  5 16:25:19 1994  Francois Pinard  (pinard@icule)
4274
4275         * m4.h (_): Change argument from `x' to `Args'.
4276
4277 Wed May  4 23:59:39 1994  Francois Pinard  (pinard@icule)
4278
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.
4282
4283 Fri Apr 22 15:59:35 1994  Francois Pinard  (pinard@icule)
4284
4285         * m4.h: Rename Args() to _().
4286         * m4.h: Remove extern specifier from all function declarations.
4287
4288 Fri Apr 22 15:51:21 1994  Jim Avera (jima@netcom.com)
4289
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.
4299
4300 Wed Apr 13 14:10:30 1994  Francois Pinard  (pinard@icule)
4301
4302         * checks/Makefile.in: Rename .all-stamp to stamp-checks.
4303
4304         * Makefile.in (Makefile, etc.): Adapt for Autoconf 1.8.
4305
4306 Sun Jan 30 14:24:19 1994    (pinard at icule)
4307
4308         * m4.h: Remove definition of volatile, not used anymore.
4309         Reported by Jim Meyering and Joseph E. Sacco.
4310
4311         * m4.h: Consistently use `do { ... } while (0)' in macros, instead
4312         of `if ... else /* nothing */' for if macros.
4313         Reported by Jim Meyering.
4314
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.
4318
4319         * m4.h: Avoid a pre-ANSI <memory.h> together with <string.h>.
4320         Reported by Jim Meyering.
4321
4322 Tue Jan 25 18:39:37 1994  Francois Pinard  (pinard at icule)
4323
4324         * m4.h: Move the conditional definition of volatile after the
4325         inclusion of system files, because they may define it first.
4326
4327 Tue Jan  4 19:46:50 1994  Francois Pinard  (pinard@icule)
4328
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.
4332
4333 Mon Jan  3 00:21:45 1994  Francois Pinard  (pinard@icule)
4334
4335         * Makefile.in: Do not define LDFLAGS, use CFLAGS on link calls.
4336         Reported by Richard Stallman.
4337
4338 Sat Dec 25 08:06:05 1993  Francois Pinard  (pinard@icule)
4339
4340         * configure.in: Correct test for strerror, AC_FUNC_CHECK was used
4341         instead of AC_HAVE_FUNCS.
4342         Reported by Noah Friedman.
4343
4344 Wed Dec  1 09:37:53 1993  Francois Pinard  (pinard@icule)
4345
4346         * m4.c: Initialize show_help and show_version to zero.
4347
4348         * m4.c: Ensure EXIT_SUCCESS and EXIT_FAILURE are defined.
4349         Use them in exit() and usage() calls.
4350
4351 Sat Nov 27 10:43:24 1993  Francois Pinard  (pinard@icule)
4352
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.
4362
4363 Wed Nov 24 22:16:15 1993  Francois Pinard  (pinard@icule)
4364
4365         * checks/get-them: Escape braces with backslashes in patterns,
4366         because HPUX-9.01 awk needs this.
4367         Reported by Jim Meyering.
4368
4369 Mon Nov 22 10:55:52 1993  Francois Pinard  (pinard@icule)
4370
4371         * builtin.c: Declare "FILE *popen ();".
4372
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.
4379
4380         * m4.h: Remove const in sys_errlist[] declaration, it creates
4381         conflicts on SGI and Alpha.
4382         Reported by Kaveh R. Ghazi.
4383
4384 Sat Nov 20 08:26:15 1993  Francois Pinard  (pinard@icule)
4385
4386         * m4.c: Include <getopt.h> instead of "getopt.h".
4387
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".
4394
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.
4397
4398 Wed Nov 17 09:34:55 1993  Francois Pinard  (pinard@icule)
4399
4400         * builtin.c (m4_eval): Cast strlen to (int) before comparing.
4401
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.
4405
4406         * checks/check-them: Reverse arguments to both diff, so the
4407         expected is on the left and the obtained on the right.
4408
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
4416         INTERNAL_ERROR*.
4417         * Makefile.in (_m4.c): Do not adjust ansi2knr output for va_alist,
4418         this is not needed anymore.
4419
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.
4430
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__.
4434
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.
4441
4442         * path.c (add_include_directory): Use xstrdup.
4443
4444         * builtin.c (find_builtin_by_name): Declare static.
4445
4446         * *.[ch]: Add const to a few "char *" declarations.
4447
4448         * configure.in: Remove commented tests for fileno() and fstat().
4449         * debug.c: Remove comments about HAVE_FILENO and HAVE_FSTAT.
4450
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.
4455
4456 Fri Nov 12 10:02:26 1993  Francois Pinard  (pinard@icule)
4457
4458         * Makefile.in (m4.dvi): Use m4.texinfo instead of m4.texi.
4459         Reported by Joel Sherrill.
4460
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.
4464
4465         * builtin.c (prefix_all_builtins): Cast xmalloc to (char *).
4466         Reported by Kaveh R. Ghazi.
4467
4468         * macro.c (call_macro): Add * in (*SYMBOL_FUNC (sym)) (...).
4469         Reported by Karl Vogel.
4470
4471 Tue Nov  9 09:31:47 1993  Francois Pinard  (pinard@icule)
4472
4473         * m4.h: Do not define volatile if already defined.
4474         Reported by Rene' Seindal.
4475
4476         * lib/Makefile.in: Add a forgotten ALLOCA=@ALLOCA@.  Grrr!
4477
4478         Reported by Bernhard Daeubler, Eric Backus, Hal Peterson, Hoang
4479         Uong, Ian Taylor, Kaveh R. Ghazi, Tom McConnell and Walter Wong.
4480
4481 Mon Nov  8 21:11:44 1993  Francois Pinard  (pinard@icule)
4482
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.
4486
4487         * input.c (next_char): Remove a "break;" after a "return ...;".
4488         Reported by Tom McConnell.
4489 \f
4490 Mon Nov  8 12:45:34 1993  Francois Pinard  (pinard@icule)
4491
4492         * Release 1.1
4493
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.
4503
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.
4508
4509 Fri Nov  5 09:49:30 1993  Francois Pinard  (pinard@compy.IRO.UMontreal.CA)
4510
4511         * m4.c (usage): Use "%s" instead of "m4" in format string.
4512         Reported by Jim Meyering.
4513
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.
4519
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.
4525
4526 Thu Nov  4 13:50:52 1993  Francois Pinard  (pinard@lagrande.IRO.UMontreal.CA)
4527
4528         * lib/Makefile.in (dist): Correct permissions on files.
4529
4530         * output.c: Declare tmpfile, some systems don't.
4531
4532 Wed Nov  3 09:09:16 1993  Francois Pinard  (pinard@icule)
4533
4534         * checks/Makefile.in (dist): Correct permissions on files.
4535
4536         * Makefile.in (dist): Ensure recursive linking for subdirectory
4537         `examples', also set read/write permissions on all its files.
4538
4539         * mkinstalldirs: New, from elsewhere.
4540         * Makefile.in: Use it.
4541
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.
4546
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.
4551
4552 Tue Nov  2 00:55:41 1993  Francois Pinard  (pinard@icule)
4553
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.
4557
4558         * m4.c (main): exit (0), instead of return 0.
4559
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.
4565
4566         * c-boxes.el: New, from elsewhere.
4567         * Makefile.in: Distribute it.
4568
4569         * m4.h: Do not define bcopy if <string.h> defines it.
4570         Reported by Stephen Perkins.
4571
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.
4575
4576 Mon Nov  1 07:45:24 1993  Francois Pinard  (pinard@icule)
4577
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.
4586
4587         * configure.in: Ensure an exit status of 0 on completion.
4588         Reported by Vivek P. Singhal.
4589
4590         * eval.c (eval_lex): Admit both lower and upper case letters for
4591         bases greater than 10.  Only lower case letters were accepted.
4592
4593         * eval.c (eval_lex): Recognize 0bDIGITS and 0rRADIX:DIGITS syntax.
4594         Reported by Krste Asanovic.
4595
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 ^.
4603
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.
4609
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.
4617
4618         * m4.h: Delete #define const, let Autoconf takes care of this.
4619
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.
4623
4624         * m4.c: Rename --no-gnu-extensions to --traditional.
4625         Reported by Ben A. Mesander.
4626
4627         * m4.c (usage): Add a status parameter.  Supply one in various
4628         calls.  Add --help processing.  Remove -V for --version.
4629
4630         * lib/Makefile.in: Put $(CFLAGS) last in .c.o rule.
4631
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.
4638
4639 Sat Oct 30 12:51:47 1993  Francois Pinard  (pinard@icule)
4640
4641         * Makefile.in (m4.info): Use -I$(srcdir) on $(MAKEINFO).
4642         Reported by Noah Friedman.
4643
4644 Mon Oct 25 14:58:48 1993  Francois Pinard  (pinard@icule)
4645
4646         * Makefile.in: Remove MDEFINES and cleanup.
4647
4648 Wed Jun  9 14:59:46 1993  Francois Pinard  (pinard@icule)
4649
4650         * Makefile.in (dist): Replace "echo `pwd`" by a mere "pwd".
4651         Create a gzip file.
4652
4653 Sat Feb  6 14:59:22 1993  Francois Pinard  (pinard@icule)
4654
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
4657         modes properly.
4658
4659 Sun Jan 17 15:38:05 1993  Francois Pinard  (pinard@icule)
4660
4661         * Makefile.in, lib/Makefile.in: Put $(CFLAGS) after $(CPPFLAGS),
4662         so the installer can override automatically configured choices.
4663         Reported by Karl Berry.
4664
4665 Fri Jan 15 16:07:00 1993  Francois Pinard  (pinard@icule)
4666
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.
4670
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.
4675
4676 Fri Jan  1 19:42:23 1993  Francois Pinard  (pinard at icule)
4677
4678         * Makefile.in, lib/Makefile.in: Reinstate $(CPPFLAGS), use it.
4679         Richard wants it there.
4680
4681 Sun Dec 27 07:01:54 1992  Francois Pinard  (pinard at icule)
4682
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.
4687
4688 Wed Dec 23 12:46:55 1992  Francois Pinard  (pinard at icule)
4689
4690         * Makefile.in (dvi, m4.dvi): New goals.
4691
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.
4695
4696         * examples/divert.m4: Deleted, this bug has been corrected.
4697
4698         * Makefile.in (texclean, mostlyclean): New goals.
4699
4700         * Makefile.in (clean): Remove clutter from ansi2knr.
4701         Reported by Pierre Gaumond.
4702         Reported by Greg A. Woods.
4703
4704 Sun Dec 20 10:40:20 1992  Francois Pinard  (pinard at icule)
4705
4706         * Makefile.in: Remove $(CPPFLAGS) from the .c.o rule.  The user
4707         might well use CFLAGS is s/he needs it.
4708
4709         * Makefile.in: Allow installation of info files from a separate
4710         build directory.
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.
4716 \f
4717 Sat Dec 19 08:21:34 1992  Francois Pinard  (pinard at icule)
4718
4719         * Release 1.0.3
4720         This is still a beta release for the future GNU m4 version 1.1.
4721
4722         * lib/alloca.c: New, from elsewhere.
4723         * lib/Makefile.in: Distribute it.  Define and use $(ALLOCA).
4724
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.
4728
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.
4735
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.
4739
4740         * m4.h, m4.c, builtin.c, output.c: Change all divertion/DIVERTION
4741         to diversion/DIVERSION, this was a spelling error.
4742
4743         * m4.c: Declare version[], remove #include "version.h".
4744         * version.h: Deleted.
4745         * Makefile.in: Remove references to version.h.
4746
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
4753         to output_lines.
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
4760         consistency.
4761
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.
4767
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.
4770
4771         * builtin.c (m4_regexp, m4_patsubst): Use re_search instead of
4772         re_search_2.
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!
4777
4778 Fri Dec 18 11:08:03 1992  Francois Pinard  (pinard at icule)
4779
4780         * m4.c: Change `--no-warnings' to `--silent'.
4781         Reported by David MacKenzie.
4782
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.
4786
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.
4789
4790         * Makefile.in: Add a new `info' goal.  Use macro MAKEINFO.
4791
4792         * Makefile.in: Ensure recursive cleaning is done before local
4793         cleaning for all clean goals.
4794
4795         * builtin.c (ntoa): Ensure the value is always interpreted as a
4796         signed quantity, whatever the radix is.
4797
4798 Wed Nov 18 07:57:19 1992  Jim Meyering  (meyering@idefix)
4799
4800         * builtin.c, format.c, input.c: Split long lines.
4801         * m4.c: Use typedef macro_definition instead of struct
4802         macro_definition.
4803         * symtab.c: Use typedef symbol instead of struct symbol.
4804
4805 Tue Nov 17 01:58:40 1992  Francois Pinard  (pinard at icule)
4806
4807         * *.[ch]: Remove all trailing whitespace, in code and comments.
4808
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.
4815
4816 Mon Nov 16 20:42:56 1992  Francois Pinard  (pinard at icule)
4817
4818         * Makefile.in (realclean): Delete m4.info*.
4819         Reported by Jim Meyering.
4820
4821         * Makefile.in: Adjust and link with checks/Makefile.
4822         * checks/Makefile.in: New.
4823         * configure.in: Output checks/Makefile.
4824
4825         * checks/get_them: Have the dnl header of each test more
4826         recognizable by next-error, also use a better message.
4827
4828 Mon Nov 16 07:48:52 1992  Jim Meyering  (meyering@idefix)
4829
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
4833         return.
4834
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
4839         from gcc -W -Wall.
4840
4841         * eval.c (most functions): Add parentheses to assignments used
4842         as truth values go avoid warnings from gcc -Wall.
4843
4844         * input.c, m4.c, output.c, path.c, symtab.c: Declare static
4845         any functions that don't need external scope.
4846
4847         * builtin.c, debug.c, format.c, m4.c, m4.h, macro.c, symtab.c
4848         (many functions and arrays): Declare `const'.
4849
4850 Sun Nov 15 09:42:09 1992  Francois Pinard  (pinard at icule)
4851
4852         * *.[ch]: Rename nil to NULL, using the declaration from <stdio.h>,
4853         removing the declaration from m4.h.  Also rename false to FALSE
4854         and true to TRUE.
4855
4856         * lib/Makefile.in (Makefile): New goal.
4857
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.
4861
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.
4865
4866 Sat Nov 14 11:01:20 1992  Francois Pinard  (pinard at icule)
4867
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.
4871
4872 Fri Nov 13 00:12:50 1992  Francois Pinard  (pinard at icule)
4873
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.
4879
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:'.
4883
4884         * checks/get_them, checks/check_them: Reindented.
4885
4886         * Makefile.in (dist): chmod a+r before making the tar file.
4887
4888 Thu Nov 12 14:42:57 1992  Francois Pinard  (pinard at icule)
4889
4890         * builtin.c (m4_dnl): Diagnose any parameter to `dnl'.
4891
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.
4897
4898         * m4.h: Before declaring errno, first include <errno.h> and
4899         ensure that it does not define errno.
4900         Reported by Richard Stallman.
4901
4902 Wed Nov 11 17:40:35 1992  Francois Pinard  (pinard at icule)
4903
4904         * builtin.c: Define and use DECLARE macro for builtins.
4905
4906         * builtin.c (m4_ifelse): Avoid any diagnostic when exactly one
4907         argument, this is a common idiom for introducing long comments.
4908
4909         * builtin.c (m4_ifelse): If 3n + 2 arguments, diagnose missing
4910         arguments.  The last argument was silently ignored.
4911
4912         * m4.c (cmd_error): Add a missing semicolon before va_end().
4913
4914 Tue Nov 10 08:57:05 1992  Francois Pinard  (pinard at icule)
4915
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.
4942
4943 Fri Nov  6 02:05:21 1992  Francois Pinard  (pinard at icule)
4944
4945         * m4.texinfo: Remove directory from diagnostics in 30.include,
4946         51.eval, 56.errprint and 57.m4exit tests.
4947
4948         * m4.h: Remove declarations for int or void system functions, they
4949         cause more conflicting trouble than they make good.
4950
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.
4955
4956 Thu Nov  5 12:37:13 1992  Francois Pinard  (pinard at icule)
4957
4958         * format.c (format): Avoid syntax error if not HAVE_EFGCVT,
4959         because of a misplaced #endif.
4960
4961         * Many *.[hc] files: Correct intra-line spacing here and there,
4962         according to GNU indent 1.6 advice.
4963
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.
4969
4970         * symtab.c (hash): Change (char) NULL to '\0'.
4971         Reported by Jason Merrill.
4972
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.
4976
4977         * m4.c: Changes in order to use a newer getopt.h.
4978         Reported by David MacKenzie.
4979
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/.
4987
4988 Tue Mar 10 00:29:46 1992  Francois Pinard  (pinard at icule)
4989
4990         * Makefile.in (check): Add m4 as dependency.
4991
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.
4996
4997 Mon Mar  9 14:53:40 1992  Francois Pinard  (pinard at icule)
4998
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.
5002
5003         * Makefile.in: Transmit $(CC) while making in lib.
5004
5005         * Many *.[hc] files: GNU indent'ed, with further fine tuning of
5006         code disposition by hand.
5007
5008 Sun Mar  8 11:01:55 1992  Francois Pinard  (pinard at icule)
5009
5010         * m4.h: Delete definitions for abort() and exit().
5011         Reported by Richard Stallman.
5012
5013         * config/hmake-unicos, config/s-unicos.h: New files.
5014         Reported by Hal Peterson.
5015
5016         * eval.c (exp_term): Have N^0 return 1.
5017         Reported by Michael Fetterman.
5018
5019         * eval.c, input.c, m4.h: Remove last comma in enums.
5020         Reported by Mike Lijewski.
5021
5022         * Transfer of maintenance duties from Rene' to Franc,ois.
5023 \f
5024 Thu Oct 24 15:18:46 1991  Rene' Seindal (seindal at diku.dk)
5025
5026         * Release 1.0.  Many thanks to those, who provided me with bug
5027         reports and feedback.
5028
5029         * Uses GNU configure, taken from the gdb distribution.
5030
5031         * Uses GNU getopt(), with long option names.
5032
5033         * The -Q/+quiet option is added, which suppresses warnings about
5034         missing or superflous arguments to built-in macros.
5035
5036         * Added default options via the M4OPTS environment variable.
5037
5038         * The built-in format can now be configured to use sprintf as
5039         the formatting engine, for systems without [efg]cvt(3).
5040
5041         * GNU library code is moved to the ./lib subdirectory; other
5042         utility files are now in ./etc.
5043
5044         * Several minor bugs have been fixed.
5045 \f
5046 Fri Jul 26 15:28:42 1991  Rene' Seindal (seindal at diku.dk)
5047
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.
5050
5051         * The builtins incr and decr are now implemented without use of
5052         eval.
5053
5054         * The builtin indir is added, to allow for indirect macro calls
5055         (allows use of "illegal" macro names).
5056
5057         * The debugging and tracing facilities has been enhanced
5058         considerably.  See the manual for details.
5059
5060         * The -tMACRO option is added, marks MACRO for tracing as soon
5061         as it is defined.
5062
5063         * Builtins are traced after renaming iff they were before.
5064
5065         * Named files can now be undiverted.
5066
5067         * The -Nnum option can be used to increase the number of
5068         divertions available.
5069
5070         * Calling changecom without arguments now disables all comment
5071         handling.
5072
5073         * The function m4_patsubst() is now consistently declared
5074         static.
5075
5076         * A bug in dnl is fixed.
5077
5078         * A bug in the multi-character quoting code is fixed.
5079
5080         * Several typos in the manual has been corrected.  More probably
5081         persist.
5082
5083         * The m4.info file is now installed along with the program.
5084 \f
5085 Thu Nov 15 21:51:06 1990  Rene' Seindal (seindal at diku.dk)
5086
5087         * Updated and enhanced version.  Release 0.75, manual 0.07.
5088
5089         * Implemented search path for include files (-I option and
5090         M4PATH envronment variable).
5091
5092         * Implemented builtin "format" for printf-like formatting.
5093
5094         * Implemented builtin "regexp" for searching for regular
5095         expressions.
5096
5097         * Implemented builtin "patsubst" for substitution with regular
5098         expressions.
5099
5100         * Implemented builtin "esyscmd", which expands to a shell
5101         commands output.
5102
5103         * Implemented "__file__" and "__line__" for use in error
5104         messages.
5105
5106         * Implemented character ranges in "translit".
5107
5108         * Implemented control over debugging output.
5109
5110         * Implemented multi-character quotes.
5111
5112         * Implemented multi-character comment delimiters.
5113
5114         * Changed predefined macro "gnu" to "__gnu__".
5115
5116         * Changed predefined macro "unix" to "__unix__", when the -G
5117         option is not used.  With -G, "unix" is still defined.
5118
5119         * Changed "shift", "$@" and "$*" to not insert spaces afters
5120         commas.
5121
5122         * Added program name to error messages.
5123
5124         * Fixed two missing null bytes bugs.
5125 \f
5126 Mon Jan 22 21:08:52 1990  Rene' Seindal (seindal at diku.dk)
5127
5128         * Initial beta release.  Release 0.50, manual 0.05.
5129
5130         -----
5131
5132         Local Variables:
5133         coding: utf-8
5134         End:
5135
5136         Copyright (C) 1990, 1991, 1992, 1993, 1994, 2000, 2001, 2003,
5137         2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
5138         Inc.
5139
5140         Copying and distribution of this file, with or without
5141         modification, are permitted provided the copyright notice
5142         and this notice are preserved.