1 2007-09-29 Eric Blake <ebb9@byu.net>
3 Optimize for Autoconf usage pattern.
4 * src/builtin.c (m4_regexp, m4_patsubst): Handle empty regex
7 2007-09-24 Eric Blake <ebb9@byu.net>
9 Create .gitignore alongside .cvsignore.
10 * bootstrap (LC_ALL): Set up front.
11 (version control) Borrow idea from head, to avoid churn in
12 m4/.*ignore files modified by gnulib-tool.
14 2007-09-13 Eric Blake <ebb9@byu.net>
18 2007-09-07 Eric Blake <ebb9@byu.net>
20 * AUTHORS: Simplify, to match libtool and autoconf layout.
21 * THANKS: Sync with head.
23 2007-08-10 Eric Blake <ebb9@byu.net>
25 * doc/m4.texinfo (Compatibility): Sync with head.
27 2007-08-10 Konrad Schwarz <konrad.schwarz@siemens.com> (tiny change)
28 and Eric Blake <ebb9@byu.net>
30 * doc/m4.texinfo (Defn): Update wording.
32 2007-08-09 Eric Blake <ebb9@byu.net>
34 POSIX requires defn(`a',`b') to concatenate definitions.
35 * src/builtin.c (m4_defn): Allow multiple arguments, but warn if
36 trying to mix a builtin with anything else.
37 * doc/m4.texinfo (Defn): Document a use for this POSIX
39 (Incompatibilities): Update to match current status.
40 * NEWS: Document this change.
42 Reported by Konrad Schwarz.
44 2007-08-04 Eric Blake <ebb9@byu.net>
46 Normalize all GPL license notices.
47 * GNUmakefile: Update license wording.
48 * Makefile.am: Likewise.
49 * Makefile.maint: Likewise.
50 * bootstrap: Likewise.
52 * configure.ac: Likewise.
53 * checks/Makefile.in: Likewise.
54 * doc/Makefile.am: Likewise.
55 * examples/Makefile.am: Likewise.
56 * src/Makefile.am: Likewise.
57 * src/builtin.c: Likewise.
58 * src/debug.c: Likewise.
59 * src/eval.c: Likewise.
60 * src/format.c: Likewise.
61 * src/freeze.c: Likewise.
62 * src/input.c: Likewise.
65 * src/macro.c: Likewise.
66 * src/output.c: Likewise.
67 * src/path.c: Likewise.
68 * src/stackovf.c: Likewise.
69 * src/symtab.c: Likewise.
71 2007-07-21 Eric Blake <ebb9@byu.net>
73 Fix regression on NetBSD from 2007-05-28.
74 * src/output.c (m4_tmpopen): Explicitly reset append-mode stream
76 * NEWS: Document this fix.
78 Reported by Thomas Klausner.
80 2007-07-20 Eric Blake <ebb9@byu.net>
82 Fix 'make distcheck' issues.
83 * Makefile.am (EXTRA_DIST): No need to distribute
84 gpl-3.0.texi.diff anymore.
85 * m4/gnulib-cache.m4: Update to latest gnulib.
87 2007-07-14 Eric Blake <ebb9@byu.net>
89 Reflect upstream license .texi changes.
90 * doc/m4.texinfo (Copying): Rename node...
91 (GNU General Public License): ...to this.
92 (GNU Free Documentation License): Adjust node location.
93 * local/doc/gpl-3.0.texi.diff: Remove file.
95 2007-07-10 Eric Blake <ebb9@byu.net>
98 * configure.ac (AC_INIT): Bump version number.
99 * NEWS: Start changes since 1.4.10.
100 * doc/m4.texinfo (History): Mention 1.4.11.
101 (Copying This Package, Copying This Manual): Add index entries.
102 * local/lib/version-etc.c.diff: Delete, now that gnulib has been
104 * Makefile.am (EXTRA_DIST): Remove dead file.
106 2007-07-09 Eric Blake <ebb9@byu.net>
109 * doc/Makefile.am (m4_TEXINFOS): Distribute gpl-3.0.texi.
110 * Makefile.am (EXTRA_DIST): Distribute gnulib diffs.
111 * configure.ac (AC_INIT): Bump version number.
112 * NEWS: Describe changes since 1.4.9.
114 * src/format.c: Missed a GPLv3 conversion.
116 Avoid undefined behavior of %.*c in printf.
117 * src/format.c (format): Special case %c.
118 * TODO: Document that more remains to be done.
119 * NEWS: Document the fix.
121 2007-07-05 Eric Blake <ebb9@byu.net>
123 Fix up gnulib-tool usage.
124 * m4/gnulib-cache.m4: Change local-dir to local, not `.'.
125 * version-etc.c.diff: Move to...
126 * local/lib/version-etc.c.diff: ...here.
127 * gpl-3.0.texi.diff: Move to...
128 * local/doc/gpl-3.0.texi.diff: ...here.
130 2007-07-04 Eric Blake <ebb9@byu.net>
132 Upgrade to GPL version 3 or later.
133 * bootstrap: Pick up GPLv3.
134 * m4/gnulib-cache.m4: Augment with 'gnulib-tool
135 --local-dir=. --import gpl-3.0'.
136 * doc/m4.texinfo (Copying This Package): New appendix.
137 * NEWS: Mention this change.
138 * README: Mention why some files still claim to be version 2.
139 * version-etc.c.diff: New file, to make sure --version claims
140 correct GPL version. Temporary until gnulib makes move.
141 * gpl-3.0.texi.diff: New file, to allow inclusion of GPLv3 as
142 appendix, rather than section, of the manual.
143 * GNUmakefile: Update to new license.
144 * Makefile.am: Likewise.
145 * Makefile.maint: Likewise.
147 * configure.ac: Likewise.
148 * checks/Makefile.in: Likewise.
149 * doc/Makefile.am: Likewise.
150 * examples/Makefile.am: Likewise.
151 * src/Makefile.am: Likewise.
152 * src/builtin.c: Likewise.
153 * src/debug.c: Likewise.
154 * src/eval.c: Likewise.
155 * src/freeze.c: Likewise.
156 * src/input.c: Likewise.
157 * src/m4.c: Likewise.
158 * src/m4.h: Likewise.
159 * src/macro.c: Likewise.
160 * src/output.c: Likewise.
161 * src/path.c: Likewise.
162 * src/stackovf.c: Likewise.
163 * src/symtab.c: Likewise.
165 2007-06-26 Eric Blake <ebb9@byu.net>
167 * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import assert'.
169 2007-06-26 Karl Berry <karl@freefriends.org> (tiny change)
171 Match Free Software Directory categories.
172 * doc/m4.texinfo (dircategory): Update.
174 2007-05-31 Eric Blake <ebb9@byu.net>
176 * src/output.c (output_text): Fix regression from 2007-05-28.
177 * doc/m4.texinfo (History): Mention 1.4.10.
178 (Format): Make testsuite output easier to debug.
180 2007-05-29 Eric Blake <ebb9@byu.net>
183 * configure.ac (AC_INIT): Bump version number.
184 * NEWS: Start changes since 1.4.9b, and fix typo.
187 * configure.ac (AC_INIT): Bump version number.
188 * NEWS: Describe changes since 1.4.9.
190 Improve format support.
191 * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
193 * src/format.c (format): Parse %'hhd, %a, %A. Avoid calling
194 printf with too few arguments, as in format(%*.*d,-1,-1,1).
195 * doc/m4.texinfo (Format): Expand tests, and improve
197 * NEWS: Document this change.
199 2007-05-28 Eric Blake <ebb9@byu.net>
201 Fix large diversion corner cases, including 1.4.8 regression.
202 * src/output.c (m4_tmpfile, m4_tmpopen): Simplify use of errno.
203 (make_room_for): Use NULL, not 0, for pointers.
204 (insert_diversion_helper): Avoid using rewind.
205 (freeze_diversions): Allow freezing large diversions.
206 * NEWS: Document this fix.
208 Also run gnulib unit tests during make check.
209 * m4/gnulib-cache.m4: Augment with 'gnulib-tool
210 --tests-base=tests --with-tests'.
211 * configure.ac (AC_CONFIG_FILES): Build gnulib testdir.
212 * Makefile.am (SUBDIRS): Run gnulib tests before ours.
214 2007-05-25 Eric Blake <ebb9@byu.net>
216 Backport prompts in examples from head.
217 * src/macro.c (expand_macro): Shorten message.
218 * doc/m4.texinfo (Manual, Command line files, Comments)
219 (Inhibiting Invocation, Macro Arguments, Macro expansion, Indir)
220 (Builtin, Shift, Forloop, Foreach, Dumpdef, Trace, Debug Levels)
221 (Debug Output, Include, Format, Syscmd, Mkstemp, Location)
222 (Using frozen files, Improved forloop, Improved foreach): Add
224 * checks/get-them: Ignore prompts in examples.
226 Fix sync line interaction with multiline comments.
227 * doc/m4.texinfo (Other Incompatibilities): Add example, and
228 document bug in --syncline/divert interaction.
229 (Preprocessor features): Augment test.
230 * src/m4.h (output_text): Export.
231 (shipout_text, next_token): Add parameter.
232 * src/freeze.c (reload_frozen_state): Don't interfere with
233 synclines when reloading state.
234 * src/output.c (output_text): Export.
235 (shipout_text): Take new parameter for start line of token.
236 Output at most one syncline per token.
237 * src/input.c (next_token): Report line where multiline tokens
239 * src/macro.c (expand_input, expand_token, expand_argument):
240 Adjust callers so that line is passed from input to output.
241 * NEWS: Document this fix.
242 Reported by Sergey Poznyakoff.
244 Test -s in testsuite.
245 * doc/m4.texinfo (Preprocessor features): Add a test.
246 * checks/get-them: Support extra options in testsuite.
247 * checks/check-them (examples): Use extra options.
249 Reported by Sergey Poznyakoff.
251 2007-05-24 Eric Blake <ebb9@byu.net>
253 Support POSIX flush semantics on all platforms.
254 * m4/gnulib-cache.m4: Remove closeout, and augment with
255 'gnulib-tool --import closein fflush'.
256 * src/m4.h (includes): Use closein, not closeout.
257 * src/m4.c (main): Ensure stdin is flushed when not all input is
259 (process_file): No return needed.
260 * src/debug.c (debug_flush_files): Rely on gnulib module, rather
261 than excluding mingw.
262 * NEWS: Document this change.
264 Work around cygwin and mingw fseeko bugs.
265 * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import fseeko'.
266 * src/debug.c (debug_flush_files): Prefer fseeko over fseek.
268 2007-04-25 Eric Blake <ebb9@byu.net>
270 Fix negative division within eval, regression of 2007-01-06.
271 * doc/m4.texinfo (Eval): Catch this bug.
272 * src/eval.c (mult_term): Fix it.
273 * NEWS: Document this.
275 Reported by Cesar Strauss.
277 2007-04-23 Eric Blake <ebb9@byu.net>
280 * configure.ac (AC_INIT): Bump version number.
281 * NEWS: Start changes since 1.4.9.
283 2007-03-23 Eric Blake <ebb9@byu.net>
286 * configure.ac (AC_INIT): Bump version number.
287 * NEWS: Describe changes since 1.4.8b.
289 2007-03-16 Eric Blake <ebb9@byu.net>
291 * doc/m4.texinfo (Mkstemp): Tweak wording.
292 * src/output.c (output_init): Adjust to latest gnulib.
294 2007-03-15 Eric Blake <ebb9@byu.net>
296 Avoid Tandem/NSK's broken long long (without a symmetric unsigned
297 long long, it confuses gnulib).
298 * configure.ac (AC_TYPE_LONG_LONG_INT): Declare long long broken
299 if unsigned long long doesn't work.
301 Reported by Matthew Woehlke.
303 2007-03-07 Eric Blake <ebb9@byu.net>
306 * doc/m4.texinfo: Minor tweaks, avoid makeinfo warning.
308 2007-03-01 Eric Blake <ebb9@byu.net>
310 * doc/m4.texinfo: Pick up more index entries from head. Follow
311 more texinfo recommendations.
312 (Sysval): Improve tests.
314 Avoid overfull \vbox warning from texinfo, due to indices that
315 weren't quite big enough to split across page boundaries.
316 * doc/m4.texinfo: Add lots of concept index entries.
317 (Concept Index): Move to be last, as recommended by texinfo
319 (Define, Arguments, Pseudo Arguments): Add more function entries.
321 2007-02-28 Eric Blake <ebb9@byu.net>
323 * doc/m4.texinfo (Eval): Clean up wording to reflext POSIX XCU ERN
325 (Pseudo Arguments): Add useful example.
327 * doc/m4.texinfo (Pushdef, Incompatibilities): Clean up wording to
328 reflect POSIX XCU ERN 118.
330 * src/m4.h (DEFAULT_MACRO_SEQUENCE): Factor out from...
331 * src/m4.c (usage): ...here,...
332 * src/builtin.c (set_macro_sequence): ...and here.
333 (define_user_macro): Fix typo.
334 * doc/m4.texinfo (Preprocessor features, Arguments): Fix minor
336 (Shift): Document composite macro argn for portably getting at
337 positional parameters beyond 9.
338 * configure.ac (AC_INIT): Bump version number.
339 * NEWS: Start changes of 1.4.8c.
341 2007-02-24 Eric Blake <ebb9@byu.net>
344 * configure.ac (AC_INIT): Bump version number.
345 * NEWS: Describe changes since 1.4.8.
347 Reserve all uses of raw ${} in macro definitions, not just
349 * src/builtin.c (set_macro_sequence): Change default macro
351 * doc/m4.texinfo (Operation modes): Update to match.
352 * src/m4.c (usage): Likewise.
355 2007-02-23 Eric Blake <ebb9@byu.net>
357 * src/m4.h (includes): Update to latest gnulib.
359 2007-02-08 Eric Blake <ebb9@byu.net>
361 Rename --warn-syntax to --warn-macro-sequence[=regex], to make it
362 more flexible, and so that autoconf can use it.
363 * src/m4.h (set_macro_sequence, free_macro_sequence): New
365 * src/builtin.c (macro_sequence_buf, macro_sequence_regs)
366 (macro_sequence_inuse, set_macro_sequence, free_macro_sequence):
367 New variables and functions.
368 (define_user_macro): Allow flexibility in regular expression used
370 * src/m4.c (warn_syntax): Delete.
371 (usage, WARN_MACRO_SEQUENCE_OPTION, main): Implement changed
372 spelling of option, along with optional argument.
373 * doc/m4.texinfo (Operation modes, Arguments): Document this
375 * NEWS: Document this change.
377 2007-02-05 Eric Blake <ebb9@byu.net>
379 * m4/gnulib-cache.m4: Module strstr no longer exists.
381 Avoid bool bitfields, as they don't work on AIX.
382 * src/m4.h (bool_bitfield): New typedef.
383 (struct symbol, struct builtin): Use it.
384 * src/input.c (struct input_block): Likewise.
385 Reported by Albert Chin.
387 * doc/m4.texinfo (Sysval): Avoid SIGPIPE in test as unreliable.
388 Reported by Albert Chin.
391 2006-06-18 Bruno Haible <bruno@clisp.org> (tiny change)
393 * doc/m4.texinfo (Input processing): Further clarifications.
395 2007-02-03 Eric Blake <ebb9@byu.net>
397 * doc/m4.texinfo (Input processing, Quoting Arguments): Beef up
399 Reported by Bruno Haible.
401 2007-02-01 Eric Blake <ebb9@byu.net>
403 * src/m4.c (fatal_warnings): New variable.
404 (usage): Document new -E behavior.
405 (main): Make -E an additive option.
406 (m4_error, m4_error_at_line): Change exit status when required.
407 * NEWS: Document this change.
408 * doc/m4.texinfo (Operation modes): Likewise.
409 Reported by Ralf Wildenhues.
411 2007-01-27 Eric Blake <ebb9@byu.net>
413 * src/m4.h (warn_syntax): Declare.
414 (init_pattern_buffer): Export.
415 * src/m4.c (warn_syntax, usage, WARN_SYNTAX_OPTIONS)
416 (long_options, main): Implement new option.
417 * src/builtin.c (init_pattern_buffer): Allow NULL regs argument.
418 (define_user_macro): Warn on $11 and ${1} if requested.
419 * src/input.c (init_pattern_buffer): Delete duplicate method.
420 * doc/m4.texinfo (Operation modes): Document it.
421 (Arguments): Document future direction of ${11} vs. $11.
422 (Incompatibilities): Fix wording on POSIX limitations.
423 * checks/get-them: Parse @{ and @} correctly.
424 * NEWS: Document this change.
426 2007-01-26 Eric Blake <ebb9@byu.net>
428 * src/builtin.c (includes): Adjust to gnulib changes.
430 2007-01-15 Eric Blake <ebb9@byu.net>
432 * doc/m4.texinfo: Pull in various improvements from head.
433 * src/builtin.c (include): Alter exit status on failure.
434 * NEWS: Document this fix.
436 2007-01-13 Eric Blake <ebb9@byu.net>
438 * configure.ac (AC_CHECK_MEMBERS): Check for stack_t.ss_sp, and
439 assume the fallback of ss_base for BSDI 4.0.1.
440 * src/stackovf.c (setup_stackovf_trap) [HAVE_SIGALTSTACK &&
441 ! HAVE_STACK_T_SS_SP]: Use this check.
442 Reported by Chris McGuire.
444 * NEWS: Document the improvement.
446 2007-01-09 Eric Blake <ebb9@byu.net>
448 * src/eval.c (ASSIGN): New enumerator.
449 (eval_lex): Recognize '='.
450 (equality_term): Treat '=' like '==', but warn that it is
452 * doc/m4.texinfo (Eval): Document and test this.
453 (Incompatibilities): Document the POSIX incompatibility.
454 * NEWS: Document this change.
456 2007-01-06 Eric Blake <ebb9@byu.net>
458 * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import stdint'.
459 * checks/check-them: Record expected exit status.
460 * checks/get-them: Check exit status.
461 * src/m4.h (eval_t, unsigned_eval_t): Delete, use POSIX int32_t
463 * src/builtin.c: All users changed.
464 * src/eval.c: Likewise. Also document where we are triggering
465 undefined or implementation-defined behavior.
466 (BADOP, NEGATIVE_EXPONENT, INVALID_OPERATOR, eval_lex, evaluate)
467 (logical_or_term, logical_and_term, logical_not_term, not_term)
468 (equality_term, unary_term): Port from head to follow POSIX
470 (exp_term): Reject 0**0 as undefined.
471 * doc/m4.texinfo (History): Mention 1.4.9.
472 (Format, Incompatibilities): Update to document POSIX compliance.
473 * NEWS: Document this change.
475 2007-01-04 Eric Blake <ebb9@byu.net>
477 * NEWS: Document previous fix.
480 2007-01-04 Sami Liedes <sliedes@cc.hut.fi> (tiny change)
482 Fix Debian bug 405594, introduced 2006-11-01 from a bad
483 copy-n-paste from head.
484 * src/m4.c (main): Use correct file name after --.
486 2007-01-04 Eric Blake <ebb9@byu.net>
488 Fix regression from 1.4.7 in large file handling on some
489 platforms, introduced on 2006-10-13.
490 * configure.ac (AC_LARGE_SYSFILE): Guarantee that large files
492 * NEWS: Document this fix.
494 2007-01-03 Eric Blake <ebb9@byu.net>
496 * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
498 * src/m4.c (AUTHORS, main): Use FSF wording for --version (plus
499 it bumps the copyright year).
501 2006-12-27 Eric Blake <ebb9@byu.net>
503 * doc/m4.texinfo (Patsubst): Fix typo.
505 2006-12-16 Eric Blake <ebb9@byu.net>
507 * src/m4.c (main): Check for errors when closing stdin.
509 2006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
511 * doc/m4.texinfo: Fix some typos.
513 2006-12-09 Eric Blake <ebb9@byu.net>
515 * configure.ac (AC_INIT): Bump version number.
516 * NEWS: Start changes of 1.4.8a.
518 2006-11-20 Eric Blake <ebb9@byu.net>
521 * configure.ac (AC_INIT): Bump version number.
522 * NEWS: Describe changes since 1.4.7.
524 2006-11-16 Eric Blake <ebb9@byu.net>
526 * doc/m4.texinfo (Include, Search Path, Diversions, Divert):
527 Minor tweaks noticed while porting to head.
529 2006-11-14 Eric Blake <ebb9@byu.net>
531 * src/output.c (cleanup_tmpfile, freeze_diversions): Clean up
533 (m4_tmpname): Avoid memory leak.
535 2006-11-13 Eric Blake <ebb9@byu.net>
537 * src/output.c (cleanup_tmpfile): Avoid double error message when
538 umask is prohibitive.
539 (m4_tmpname, m4_tmpopen, m4_tmpclose, m4_tmpremove): New
541 (m4_tmpfile): Add parameter, move cloexec action here.
542 (make_room_for): Adjust caller. Don't keep too many files open.
543 (insert_diversion_helper): Unlink emptied temp files.
544 (make_diversion): Don't keep too many files open.
545 * doc/m4.texinfo (Diversions): Tweak wording, now that open file
546 descriptors are no longer a limiting factor.
547 * NEWS: Document this change.
549 Backport sparse diversion handling from head.
550 * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
552 * src/output.c (struct m4_diversion): Rename from struct
553 diversion, and update members. All users changed.
554 (diversion_table): Change to an ordered set, instead of an array.
555 (div0): New storage for diversion 0.
556 (diversions): No longer needed.
557 (free_list): New list to allow recycling diversion storage.
558 (diversion_storage): New storage to reduce malloc overhead.
559 (cmp_diversion_CB, threshold_diversion_CB): New callbacks.
560 (output_init, output_exit, cleanup_tmpfile, make_room_for)
561 (make_diversion): Handle new diversion storage scheme.
562 (insert_diversion_helper): New function.
563 (insert_diversion, undivert_all, freeze_diversions): Use it.
564 * doc/m4.texinfo (Divert, Diversions): Move hidden test of memory
565 exhaustion to visible test of large diversion numbers.
566 * NEWS: Document this fix.
568 2006-11-11 Eric Blake <ebb9@byu.net>
570 * src/builtin.c (m4_translit): Slight optimization.
572 * src/m4.h (to_uchar): Depend on HAVE_INLINE.
574 * src/builtin.c: Remove unnecessary casts.
575 (expand_ranges): Make 8-bit clean.
576 * doc/m4.texinfo (Translit): Add tests and wording.
577 * NEWS: Document this fix.
579 2006-11-07 Eric Blake <ebb9@byu.net>
581 * src/m4.h (output_exit): New prototype.
582 * src/m4.c (main): Use it.
583 * src/output.c (cleanup_tmpfile): Close files before removing
585 (insert_diversion): Check for failure.
586 (output_exit): Avoid memory leak.
587 * doc/m4.texinfo (Diversions): Test this bug.
589 * doc/m4.texinfo (Esyscmd, Errprint): Minor touchups.
591 2006-11-01 Eric Blake <ebb9@byu.net>
593 Allow C++ compilation on Linux, as a safety measure in type
595 * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
597 * src/m4.h (hack_symbol, hack_all_symbols): Use full prototype.
598 (boolean): Kill this, and use stdbool.h instead.
599 * src/debug.c, src/eval.c, src/input.c, src/macro.c, src/m4.c:
600 * src/output.c, src/symtab.c: All users changed.
601 * src/symtab.c (hack_all_symbols): Update prototype.
602 * src/builtin.c (dump_symbol, set_trace): Update signature.
603 (m4_dumpdef, m4_traceon, m4_traceoff): Update callers.
604 (mkstemp_helper, m4_m4wrap, expand_ranges, m4_translit): Allow
606 * src/debug.c (trace_flush): Likewise.
607 * src/freeze.c (reload_frozen_state): Likewise.
608 * src/input.c (push_file, push_string_finish, push_wrapup):
609 (token_bottom, next_token): Likewise.
610 * src/m4.c (main): Likewise.
612 * doc/m4.texinfo (Invoking m4): Update according to POSIX 200x
614 * src/m4.h (m4_path_search): Tweak signature.
615 * src/path.c (m4_path_search): Likewise.
616 * src/builtin.c (include): Update caller.
617 * src/m4.c (main): Allow -D, -U, -t, and -s to be interspersed
618 with file names. Don't write to **argv.
619 (process_file): New helper method.
620 * NEWS: Document this fix.
622 2006-10-31 Eric Blake <ebb9@byu.net>
624 * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import strstr'.
625 * doc/m4.texinfo (Translit): Improve the documentation.
626 * src/builtin.c (m4_translit): Optimize to O(n) instead of O(n^2)
628 (m4_index): Simplify, and speed up slightly.
629 * NEWS: Document this fix.
631 2006-10-28 Eric Blake <ebb9@byu.net>
633 * src/input.c (set_quotes): Don't allow empty end-quote with
634 non-empty start-quote.
635 (set_comment): Likewise for end-comment.
636 * src/builtin.c (m4_changecom): Adjust caller.
637 * doc/m4.texinfo (Changequote, Changecom): Update documentation to
639 (Incompatibilities): Document another POSIX bug.
640 * NEWS: Mention this change.
642 2006-10-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
644 * examples/Makefile.am (EXTRA_DIST): Distribute recently-added
647 2006-10-26 Eric Blake <ebb9@byu.net>
649 Silence -Wwrite-strings -Wpointer-arith warnings.
650 * src/builtin.c (define_user_macro): Allow NULL argument.
651 (m4_builtin, m4_indir): Cast away const of "".
652 * src/format.c (format): Likewise.
653 * src/macro.c (collect_arguments): Likewise.
654 (expand_macro): Avoid math on void*.
655 * src/m4.c (main): Adjust caller.
656 * src/output.c (freeze_diversions): Detect off_t overflow.
658 * src/input.c (pop_input): Remove unnecessary code.
660 2006-10-25 Eric Blake <ebb9@byu.net>
662 * src/symtab.c (symtab_init): Avoid size_t overflow.
663 * src/output.c (make_diversion): Avoid size_t overflow.
664 * doc/m4.texinfo (Diversions): Test this fix.
665 * src/input.c (input_block): Remove unused member. Reduce size
667 (push_file, pop_input): Avoid useless assignment.
668 * NEWS: Document the bug fix.
670 Redo location tracking. Instead of having just files track the
671 line to return to when popping input, now all input blocks track
673 * src/input.c (INPUT_STRING_WRAP, INPUT_FILE_INIT): No longer
675 (input_block): Have line and file storage for all input types, and
677 (input_change): New global flag.
678 (push_file, push_macro, push_string_init, push_wrapup): Store
680 (push_string_finish, pop_input, pop_wrapup): Notice changes in
682 (peek_input): Adjust to new member names.
683 (next_char, next_char1): Adjust location if needed.
684 (skip_line): Simplify restoring location.
685 * doc/m4.texinfo (Location): Augment the test to catch line
686 location of expansion of multi-line arguments.
687 Reported by Stepan Kasal.
689 2006-10-23 Eric Blake <ebb9@byu.net>
691 * doc/m4.texinfo (Macro Arguments): Document that leading space
692 in argument collection stops at macro expansion.
693 (Incompatibilities): Document POSIX whitespace wording issue.
695 2006-10-20 Eric Blake <ebb9@byu.net>
697 * doc/m4.texinfo: Trailing '@comment' doesn't format nicely in
698 TeX, so recognize '@w{ }' instead. Likewise, @code{_name} at the
699 end of a TeX line splits incorrectly.
700 (Foreach, Improved foreach): Write these sections, borrowing ideas
701 from CVS head and from m4sugar.
702 * checks/get-them: Accomodate new way to show trailing space in
704 * examples/foreach.m4: Make usable in documentation.
705 * examples/foreachq.m4: New file.
706 * examples/foreachq2.m4: New file.
707 * examples/foreach2.m4: New file.
708 * NEWS: Document the documentation updates.
710 2006-10-19 Eric Blake <ebb9@byu.net>
712 * src/builtin.c (mkstemp_helper, m4_mkstemp): New functions.
713 (m4_maketemp): Provide traditional behavior.
714 * doc/m4.texinfo (Mkstemp): Rename from Maketemp. Document the
715 new `mkstemp' macro and the flaws of the old `maketemp'.
716 (Incompatibilities): Move maketemp discussion to...
717 (Extensions): ...here, since -G now supresses the GNU extension.
718 * NEWS: Document this.
720 * examples/forloop.m4: Simplify.
721 * examples/forloop2.m4: New file.
722 * examples/quote.m4: New file.
723 * doc/m4.texinfo (Loops): Rename to...
724 (Shift): ...this node.
725 (Forloop, Foreach, Improved forloop, Improved foreach): New
728 2006-10-17 Eric Blake <ebb9@byu.net>
730 * m4/gnulib-cache.m4: Update with 'gnulib-tool --import
732 * configure.ac (AC_CONFIG_HEADERS): Create config.h alongside
733 gnulib headers, rather than in top directory.
734 * src/Makefile.am (AUTOMAKE_OPTIONS): Add nostdinc, to reduce make
737 2006-10-16 Eric Blake <ebb9@byu.net>
739 * doc/m4.texinfo: Backport some minor cleanups from head.
740 (Cleardivert): Rename from cleardiv.
742 * doc/m4.texinfo (Invoking m4): Promote to a chapter, instead of
743 a section of Preliminaries.
744 (Operation modes, Preprocessor features, Limits control)
745 (Frozen state, Debugging options, Command line files): Subdivide
747 (Input processing, Quoting Arguments, Define, Arguments)
748 (Cleardiv, Format, M4exit): Fix grammar of references.
749 (Inhibiting Invocation, Macro Arguments, Builtin, Trace)
750 (Debug Levels, Debug Output, Include, Search Path, Divert)
751 (Platform macros, Syscmd, Location, Extensions): Point to new
753 (Top, Loops, Include, Undivert, Location, Incompatibilities):
754 Improve file references.
756 2006-10-14 Eric Blake <ebb9@byu.net>
758 * m4/input.c (file_clean): Don't close stdin twice, POSIX says it
760 Reported by Ralf Wildenhues.
762 * src/builtin.c (m4_undivert): Check for read error.
764 2006-10-13 Eric Blake <ebb9@byu.net>
766 * src/m4.h (UNIX, W32_NATIVE, OS2): Move platform checks after
767 header files are included, since <unistd.h> can affect the tests.
769 Reported by Martin Koeppe.
771 Backport head's usage of clean-temp module, as it is cleaner than
773 * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
774 clean-temp closeout', and remove tmpfile-safer.
775 * src/m4.h (includes): Adjust.
776 (m4_path_search): Rename from path_search, to avoid collision
778 * src/m4.c (main): Install closeout handler. Adjust caller.
779 (usage): Now done by closeout module.
780 * src/builtin.c (m4_m4exit): Likewise.
781 (m4_undivert, include): Adjust callers.
782 * src/freeze.c (reload_frozen_state): Likewise.
783 * src/path.c (m4_path_search): Rename from path_search.
784 * src/output.c (output_temp_dir): New variable.
785 (cleanup_tmpfile, m4_tmpfile): New functions, from head.
786 (insert_diversion, make_room_for): Use them.
787 * doc/m4.texinfo (Diversions): Document this, and add a test.
788 (Improved fatal_error): Fix typo.
789 (Maketemp): Port test to mingw, and no longer hide from
791 * NEWS: Document the change in TMPDIR behavior.
793 * configure.ac (m4_pattern_forbid): Narrow the range of forbidden
794 macros, to work with recent gnulib-tool update.
796 * src/builtin.c (m4_builtin, m4_indir): Allow transparent
797 handling of defn results.
798 * doc/m4.texinfo (Builtin, Indir): Add test cases.
799 * NEWS: Document this.
801 2006-10-12 Eric Blake <ebb9@byu.net>
803 * doc/m4.texinfo (Location): Fix typo in previous commit.
804 (Changeword): Catch one more case.
805 * src/input.c (skip_line): Fix case when outer file used macro to
808 2006-10-11 Eric Blake <ebb9@byu.net>
810 * src/input.c (enum input_type): Add additional types, to shave
811 time off the common case.
812 (push_wrapup): Wrapped strings remember location.
813 (push_string_finish): Normal strings carry no location.
814 (push_file): Start new files uninitialized.
815 (peek_input, next_char_1): Optimize common cases by updating
816 location only on new input types.
817 (pop_input): Update to honor new input types.
818 (skip_line, push_string_finish): Fix regression in previous patch
819 when dnl is not followed by newline in included file.
820 (push_string_init): Initialize all fields of INPUT_STRING sooner.
821 (peek_token): Simplify.
822 (peek_input): Don't pop input files on peek, so that __file__ and
823 __line__ as last token of include file work correctly.
824 * doc/m4.texinfo (History): Mention 1.4.8.
825 (Answers): Split into sections, one per answer.
826 (Improved exch, Improved cleardivert, Improved fatal_error): New
828 (Dnl, M4wrap, Location, M4exit, Improved fatal_error): Update to
829 new m4wrap location semantics.
830 (Changeword): Add test that caught the regression.
831 * NEWS: Document this.
833 * src/macro.c (expand_macro): In macro expansion errors, report
834 line number at open parenthesis.
835 * src/input.c (next_token): Fix off-by-one bug in reporting end
836 of file in unterminated comment and string.
837 (file_names): New obstack, necessary since expand_macro now hangs
838 on to file names longer than the files remain open.
839 (input_init): Initialize new obstack.
840 (push_file): Use new obstack. Delay updates to current_file
841 until after expand_macro has restored state.
842 (peek_input, next_char_1): Update current_file if necessary.
843 (pop_wrapup): Release memory.
844 * doc/m4.texinfo (Macro Arguments, Changequote, Changecom): Catch
846 (Dnl): Update to the new location reporting rules.
847 * NEWS: Document these changes.
849 2006-10-10 Eric Blake <ebb9@byu.net>
851 * src/macro.c (argc_stack, argv_stack): New variables for sharing
852 obstacks across multiple macro calls.
853 (expand_input): Initialize and tear down stack once per input
854 file, instead of once per macro.
855 (expand_macro): Reuse existing stacks when possible.
856 (collect_arguments): Simplify slightly.
858 * src/path.c (include_env_init): Fix botched patch application.
859 Reported by Ralf Wildenhues.
861 2006-10-09 Eric Blake <ebb9@byu.net>
863 * src/m4.c (usage, main): Detect write failures to stderr.
864 * src/builtin.c (m4_m4exit): Likewise.
865 * NEWS: Document this.
867 * src/macro.c (expand_macro): Allow --nesting-limit=0 to remove
869 * NEWS: Document this.
870 * doc/m4.texinfo (Invoking m4): Likewise.
872 2006-10-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
874 * src/path.c (include_env_init): Copy the string returned
875 by getenv before overwriting it; POSIX disallows this.
877 2006-10-09 Eric Blake <ebb9@byu.net>
879 * src/m4.c (main): Defer debugfile until after --help.
880 * configure.ac (AC_INIT): Bump version number.
881 * NEWS: Start changes of 1.4.7a.
883 2006-09-25 Eric Blake <ebb9@byu.net>
886 * configure.ac (AC_INIT): Bump version number.
887 * NEWS: Describe changes since 1.4.6.
889 2006-09-21 Eric Blake <ebb9@byu.net>
891 * doc/m4.texinfo (Invoking m4): Add clarification on option
894 Reported by Mikhail Teterin.
896 * bootstrap: Add --force option, based on idea from coreutils.
897 * README: Document that ./bootstrap and autoreconf are for
898 developers, and not lightly done in tarballs.
900 2006-09-20 Eric Blake <ebb9@byu.net>
902 * src/m4.c (usage, OPTSTRING, main): Rename -e to -i, and give
903 deprecation warning on -e.
904 * doc/m4.texinfo (Invoking m4, Extensions): Document this.
905 * NEWS: Document this.
907 2006-09-19 Eric Blake <ebb9@byu.net>
909 * src/m4.c (usage, long_options, main, DEBUGFILE_OPTION): Rename
910 -o/--error-output to --debugfile, and deprecate the former. This
911 will allow a future release to be more consistent with other GNU
912 tools, with -o/--output affecting stdout, not debug.
913 * doc/m4.texinfo (Invoking m4, Debug Output): Document this.
914 * NEWS: Document this.
916 2006-09-14 Eric Blake <ebb9@byu.net>
918 * src/m4.c (main): Warn on deprecated options -B, -S, -T, -N,
919 --diversions. `m4 --help --version' now displays help, not
921 (interactive, frozen_file_to_read, frozen_file_to_write): Move to
923 (show_help, show_version): No longer needed.
924 (long_options, DIVERSIONS_OPTION): Backport patch from head to
925 distinguish between -N and --diversions in warning.
926 * doc/m4.texinfo (Invoking m4): Document this.
929 2006-09-11 Eric Blake <ebb9@byu.net>
931 * src/Makefile.am (m4_LDADD): Add any gnulib dependent libraries.
932 * src/debug.c (debug_flush_files) [UNIX]: Flush stdin if it is
934 (debug_set_file): Use STDOUT_FILENO.
935 * src/builtin.c (m4_m4exit): Flush stdin before exiting, to comply
936 with POSIX in regards to unread input.
937 * NEWS: Document this fix.
938 * doc/m4.texinfo (Syscmd, Esyscmd, M4exit): Likewise.
940 2006-09-07 Eric Blake <ebb9@byu.net>
942 * m4/gnulib-cache.m4: Update to newer gnulib-tool.
943 * src/m4.h (push_file): Change prototype.
944 * src/input.c (push_file, peek_input, next_char_1): Only call getc
945 once at EOF, to avoid double ^D on terminal stdin; regression from
947 (push_file, pop_file): Allow reading stdin twice.
948 * src/m4.c (main): Likewise.
949 * src/builtin.c (include): Update caller.
950 * NEWS: Document this change.
951 * doc/m4.texinfo (Invoking m4, Incompatibilities): Likewise.
952 (Syscmd): Add a test that failed before this patch.
954 2006-09-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
956 * checks/check-them: Quote $pwd.
958 2006-09-05 Eric Blake <ebb9@byu.net>
960 * src/builtin.c (define_macro): Warn on invalid macro name.
961 * NEWS: Document this change.
962 * doc/m4.texinfo: Fix typos.
963 (Invoking m4, Macro Arguments, Pseudo Arguments, Defn, Indir)
964 (Ifelse): Backport some improvements from head.
966 2006-09-04 Eric Blake <ebb9@byu.net>
968 * doc/m4.texinfo (Changeword): Skip test on mingw, where the
969 native echo is braindead.
970 * checks/check-them (strip_needed): Ignore \r in output. Now the
971 testsuite will pass when cross-compiling from cygwin to mingw.
973 * src/input.c (peek_input): Fix regression in handling macro
974 without arguments as last token in file; debian bug 385720.
975 (next_token): Always consume an input character.
976 Reported by Andreas Schultz.
977 * configure.ac (AC_INIT): Bump version number.
978 * NEWS: Document this fix.
979 * doc/m4.texinfo (History): Mention next version.
980 (Changeword): Add example that exposes this bug.
983 2006-08-25 Eric Blake <ebb9@byu.net>
986 * configure.ac (AC_INIT): Bump version number.
987 * NEWS: Describe changes since 1.4.5.
989 * Makefile.maint (web-manual): Give up on VPATH build during
990 distribution. But distributions are made so infrequently that
991 this is not too much of a hardship.
992 * Makefile.am (MAINTAINERCLEANFILES): Avoid error if lib/CVS/
995 2006-08-24 Eric Blake <ebb9@byu.net>
997 * src/builtin.c (m4_index, m4_substr, m4_translit): Similar to
998 Solaris, produce output on just one argument.
999 (m4_regexp, m4_patsubst): For consistency, do likewise.
1000 (m4_patsubst): Allow zero-length match at end of string.
1001 * doc/m4.texinfo (Sysval): Fix overfull hbox.
1002 (Bugs, Macro Arguments): Minor fixes.
1003 (Other tokens): Rearrange node order.
1004 (Index macro, Substr, Translit, Regexp, Patsubst): Add tests.
1005 * NEWS: Document these fixes.
1007 2006-08-22 Eric Blake <ebb9@byu.net>
1009 * src/input.c (pop_input): Avoid empty filename with -di option.
1010 * src/debug.c (debug_message_prefix): Put space before message.
1012 * m4/gnulib-cache.m4: We don't explicitly use alloca module.
1014 * m4/gnulib-cache.m4: Augment with gnulib-tool --import gnupload.
1015 * Makefile.maint (fetch): Simplify, now that we can use gnupload.
1017 * checks/check-them: State why a test is skipped.
1018 * doc/m4.texinfo (Changeword, Sysval, Maketemp): Likewise.
1020 * ChangeLog: Add copyright.
1021 * AUTHORS: Likewise.
1022 * BACKLOG: Likewise.
1026 * examples/COPYING: New file, add copyright for all the examples.
1027 * checks/get-them: Put copyright on testsuite files.
1029 2006-08-18 Eric Blake <ebb9@byu.net>
1031 Don't let unrelated child processes see too many files.
1032 * m4/gnulib-cache.m4: Augment with gnulib-tool --import cloexec.
1033 * src/builtin.c (m4_esyscmd, m4_regexp, m4_patsubst): Fix
1034 spelling in error message.
1035 * src/debug.c [!__STDC__]: Assume C89, and nuke old varargs.h.
1036 (debug_set_output): Close debug file on exec.
1037 * src/m4.h (includes): Add cloexec.h.
1038 * src/output.c (make_room_for): Close diversions on exec.
1039 * src/path.c (path_search): Close include files on exec.
1040 * NEWS: Document this.
1042 Regular expressions were leaking memory.
1043 * src/builtin.c (init_pattern_buffer, free_pattern_buffer): New
1045 (m4_regexp, m4_patsubst): Avoid memory leak.
1046 * src/input.c (init_pattern_buffer) [ENABLE_CHANGEWORD]: Make
1048 (set_word_regexp) [ENABLE_CHANGEWORD]: Avoid memory leak. Change
1049 from O(n^2) to O(n) for calculating word_start.
1050 (next_token, peek_token) [ENABLE_CHANGEWORD]: Treat word_start as
1051 O(1) bitmap, not O(n) search string.
1052 * NEWS: Document this fix.
1054 2006-08-17 Eric Blake <ebb9@byu.net>
1056 * NEWS: Document previous checkin.
1058 * src/builtin.c (substitute): Avoid core dump when accessing
1059 beyond bound of regular expression.
1060 Reported by Karl Nelson.
1061 * doc/m4.texinfo (Regexp): Add example that causes core dump on
1062 some architectures prior to this patch.
1065 2006-08-16 Eric Blake <ebb9@byu.net>
1067 * doc/m4.texinfo (Invoking m4, Debug Output): Fix wording to be
1068 clear that dumpdef does not always go to stderr.
1070 * src/builtin.c (m4_errprint): Flush buffers before printing to
1074 2006-08-15 Eric Blake <ebb9@byu.net>
1076 * src/builtin.c (m4_m4wrap, m4_errprint, m4_shift): Make blind,
1077 per debian bug 96075.
1078 * doc/m4.texinfo (Loops, M4wrap, Errprint): Document this change.
1079 (Changeword): Don't use shift as an example of a swallowed word.
1080 (Divert): Discuss fact that divert is an English word.
1081 Reported by Richard A Nelson.
1083 2006-08-14 Eric Blake <ebb9@byu.net>
1085 * doc/m4.texinfo (Invoking m4): Minor fixes.
1087 2006-08-12 Eric Blake <ebb9@byu.net>
1089 * doc/m4.texinfo (Arguments): Hint at better exch macro.
1090 (Answers): Provide a better definition.
1092 2006-08-09 Eric Blake <ebb9@byu.net>
1094 * doc/m4.texinfo (Incompatibilities): Document that m4 does not
1095 yet understand locales.
1096 * NEWS: Fix wording of a few items.
1098 2006-08-08 Eric Blake <ebb9@byu.net>
1100 Avoid printing `NONE:0:' in error messages.
1101 * src/m4.h (m4_error_at_line): New function.
1102 * src/m4.c (m4_error_at_line): Implement.
1103 * src/input.c (skip_line, input_init, next_token): Use "", not
1104 "NONE", for no file, since NONE can be a real file name.
1105 * src/macro.c (expand_argument): Likewise.
1106 * src/debug.c (debug_message_prefix, trace_header): Check for
1108 * doc/m4.texinfo (Dnl, M4wrap): Adjust accordingly.
1109 (Location): Document that synclines and internal message format
1110 are not impacted by redefining these macros.
1111 (M4exit): Hint at bug in fatal_error.
1112 (Answers): Provide workaround to match m4 output.
1114 * m4/gnulib-cache.m4: Augment with gnulib-tool --import verror.
1115 * src/m4.h (m4_error): New function.
1116 (M4ERROR, M4ERROR_AT_LINE): Reimplement without hacking around
1117 error module deficiencies.
1118 (reference_error, suppress_line): No longer needed.
1119 * src/m4.c (m4_error): Implement.
1120 (main): No longer need to install error callback.
1122 2006-08-04 Eric Blake <ebb9@byu.net>
1124 * src/m4.h (program_name): Declare.
1125 (suppress_line): New variable.
1126 (M4ERROR_AT_LINE): New macro.
1127 * src/m4.c (reference_error, main): Follow GNU Coding Standards
1128 for error message format.
1129 * src/input.c (skip_line, next_token): Use M4ERROR_AT_LINE.
1130 * src/macro.c (expand_argument): Likewise.
1131 * checks/check-them (examples): Adjust to new message format.
1132 * src/builtin.c (m4___program__): New builtin.
1133 * doc/m4.texinfo (Location): Split from Errprint into new node,
1134 and document __program__.
1135 (Builtin, Ifdef, Ifelse, Dumpdef, Trace, Debug Output, Dnl)
1136 (Include, Regexp, Patsubst, Incr, Eval): Adjust error message
1138 (Extensions): Document __program__.
1139 * NEWS: Document this change.
1141 2006-08-03 Eric Blake <ebb9@byu.net>
1143 Don't confuse leading `(' in comment or quote with start of
1144 argument collection.
1145 * src/m4.h (enum token_type): Add TOKEN_OPEN, TOKEN_COMMA,
1147 (peek_input): Make private to input.c.
1148 (peek_token): New prototype.
1149 * src/input.c (default_word_regexp): Reduce ifdefs.
1150 (peek_input): Make static.
1151 (next_token): Return new token types.
1152 (match_input, MATCH): Add argument consume, which controls
1153 whether match should be pushed back.
1154 (peek_token): New function.
1155 (token_type_string) [DEBUG_INPUT]: New function.
1156 * src/macro.c (expand_token, expand_argument, collect_arguments):
1157 Handle new token types.
1158 * doc/m4.texinfo (Changequote, Changecom): Document this.
1159 * NEWS: Document this.
1161 * src/stackovf.c (setup_stackovf_trap): Free memory on failure.
1163 * src/stackovf.c (setup_stackovf_trap): Gracefully avoid stack
1164 overflow detection when sigstack exists but is not implemented.
1165 Fixes debian bug 154053.
1167 Reported by David Perlin.
1169 2006-08-02 Eric Blake <ebb9@byu.net>
1171 * src/input.c (MATCH): Fix EOF detection on multi-byte comment
1174 2006-08-01 Eric Blake <ebb9@byu.net>
1176 * src/input.c (skip_line, next_token): Remember current file in
1177 case input file ends abruptly. Addresses debian bug 175365.
1178 (pop_input): Defer freeing storage that holds previous file
1180 (pop_wrapup): to here, after error message is issued.
1181 * src/macro.c (expand_argument): Remember current file in case
1182 input file ends abruptly.
1183 * doc/m4.texinfo (Macro Arguments, Dnl, Changequote, Changecom)
1184 (M4wrap): Adjust testsuite accordingly.
1185 (Errprint): Document line number limitation of m4wrap.
1186 * NEWS: Document this fix.
1189 2006-07-31 Eric Blake <ebb9@byu.net>
1191 * src/input.c (peek_input, next_char, match_input): Be eight-bit
1192 clean; fixes debian bug 311378.
1193 * doc/m4.texinfo (Syntax): Describe eight-bit handling.
1194 (Changequote, Changecom): Add examples to test this.
1195 * NEWS: Document this fix.
1197 Reported by Steven Augart.
1199 * doc/m4.texinfo: Whitespace fix.
1200 * checks/get-them: Avoid exceeding 14-char file name limit.
1203 2006-07-30 Eric Blake <ebb9@byu.net>
1205 * src/path.c (path_search): Detect allocation failure.
1207 Use native free when it is good enough.
1208 * m4/gnulib-cache.m4: Augment with gnulib-tool --import free.
1209 * src/builtin.c (define_user_macro, m4_regexp, m4_patsubst):
1211 * src/symtab.c (free_symbol): Likewise.
1212 * src/m4.c (xfree, main): Likewise.
1213 * src/m4.h (obstack_chunk_free): Likewise.
1214 * src/path.c (path_search): Likewise.
1215 * src/input.c (pop_wrapup, set_quotes, set_comment): Likewise.
1217 * doc/m4.texinfo (Errprint): Add example for last patch.
1218 * checks/check-them: Account for VPATH in latest example.
1220 2006-07-29 Eric Blake <ebb9@byu.net>
1222 * src/path.c (path_search): Add result parameter, so that
1223 -I can be accounted for. Debian bug 53685.
1224 * src/m4.h (path_search): Update prototype.
1225 * src/m4.c (main): Adjust callers.
1226 * src/freeze.c (reload_frozen_state): Likewise.
1227 * src/builtin.c (include, m4_undivert): Likewise.
1228 * NEWS: Document this change.
1229 Reported by Nicolas Lichtmaier.
1231 2006-07-28 Eric Blake <ebb9@byu.net>
1233 * Makefile.am (MAINTAINERCLEANFILES): Fix typo that tripped up
1234 several non-GNU makes.
1235 * src/stackovf.c (setup_stackovf_trap): Missed _ from yesterday.
1236 * src/m4.h: Likewise.
1237 * src/input.c (push_wrapup): Avoid compiler warning with Solaris
1240 2006-07-27 Eric Blake <ebb9@byu.net>
1242 * doc/m4.texinfo: Use @acronym{GNU} throughout.
1243 (History): Update for 1.4.6.
1245 * src/m4.h (_): Remove K&R cruft.
1246 * src/builtin.c: Likewise.
1247 * src/debug.c: Likewise.
1248 * src/eval.c: Likewise.
1249 * src/macro.c: Likewise.
1250 * src/stackovf.c: Likewise.
1252 * doc/Makefile.am (m4.1): Improve man page.
1253 * src/m4.c (usage): Improve --help output, including adding the
1254 bug reporting address.
1255 (main): Follow GNU Coding Standards for --version output.
1257 2006-07-26 Eric Blake <ebb9@byu.net>
1259 * doc/m4.texinfo: Use begin-quote, end-quote, begin-comment, and
1260 end-comment consistently, to match POSIX.
1262 * doc/m4.texinfo (Macro Arguments, Changequote, Changecom)
1263 (Dnl, M4wrap, Include): Document EOF issues, and add examples.
1264 (Incompatibilities): Document incompatibility of changecom
1265 vs. macro names, and of EOF in include.
1266 * src/input.c (next_token): Reject unterminated comments at EOF.
1267 (skip_line): Warn on unterminated dnl at EOF.
1268 * NEWS: Document these changes.
1270 2006-07-25 Eric Blake <ebb9@byu.net>
1272 * m4/gnulib-cache.m4: Update to reflect gnulib's split of
1273 stdio-safer into fopen-safer and tmpfile-safer.
1274 * src/m4.c: Remove redundant include.
1276 2006-07-24 Eric Blake <ebb9@byu.net>
1278 Fix bugs related to stream handling.
1279 * m4/gnulib-cache.m4: Augment with gnulib-tool --import
1280 unlocked-io stdio-safer stdlib-safer close-stream.
1281 * configure.ac (AC_CHECK_FUNCS_ONCE): Assume tmpfile; it can be
1282 provided by gnulib if needed.
1283 * src/output.c [! HAVE_TMPFILE]: Likewise.
1284 * src/m4.h (includes): Replace unistd, stdio, and stdlib with
1285 their safer counterparts.
1286 (retcode): New global variable.
1287 * src/input.c (pop_input): Check for read failure.
1288 * src/freeze.c (reload_frozen_state): Likewise.
1289 (produce_frozen_state): Check for write failure.
1290 * src/debug.c (debug_set_file): Likewise.
1291 * src/m4.c (usage, main): Likewise.
1292 (retcode): Make global.
1293 * src/builtin.c (m4_m4exit): Likewise. Ensure that the exit
1294 status is non-zero except when everything succeeds.
1295 * doc/m4.texinfo (M4exit): Document these changes.
1296 (Incompatibilities): Remove documentation of bug now fixed.
1297 * NEWS: Document these fixes.
1299 2006-07-22 Eric Blake <ebb9@byu.net>
1301 * src/format.c (format): Avoid compiler warning that str may be
1304 2006-07-21 Eric Blake <ebb9@byu.net>
1306 * src/m4.h [UNIX]: Add more platforms that are close enough to
1307 categorize as UNIX, but which don't predefine __unix__.
1308 Reported by Nelson H. F. Beebe.
1310 2006-07-20 Eric Blake <ebb9@byu.net>
1312 * m4/gnulib-cache.m4: gnulib-tool has changed again. Regenerate
1313 to explicitly ask for --assume-autoconf=2.60.
1315 2006-07-19 Eric Blake <ebb9@byu.net>
1317 * doc/m4.texinfo (Sysval): Avoid kill -1, since ksh traps SIGHUP
1318 and exits normally with 129.
1319 Reported by Nelson H. F. Beebe.
1322 * src/m4.h (EXIT_MISMATCH): Define.
1323 * src/freeze.c (reload_frozen_state): Detect version mismatch, by
1324 exiting with status 63.
1325 * src/m4.c (usage): Document this.
1326 * doc/m4.texinfo (Invoking m4, Using frozen files): Likewise.
1329 * doc/m4.texinfo (copying): Relax restriction on front-cover and
1332 2006-07-17 Eric Blake <ebb9@byu.net>
1334 * src/format.c (format): Support F, g, and G specifiers.
1335 * doc/m4.texinfo (Format): Document this.
1336 * NEWS: Document this addition.
1338 * doc/m4.texinfo (Builtin): Delete redundant text.
1340 * configure.ac (AC_INIT): Bump version number.
1341 * src/builtin.c (substitute): Bah. Fix buffer overrun.
1342 * NEWS: Document this fix.
1344 2006-07-15 Eric Blake <ebb9@byu.net>
1347 * configure.ac (AC_INIT): Bump version number.
1348 * NEWS: Describe changes since 1.4.4.
1350 * src/m4.c (usage): Document exit status.
1351 * doc/m4.texinfo: Use `exit status', not `exit code'.
1352 (Invoking m4): Document exit status.
1354 * bootstrap: Backport --help, --version from head.
1355 (func_update): New function, for easily grabbing up-to-date files
1357 * Makefile.maint (web-manual): Fix for VPATH builds.
1359 2006-07-14 Eric Blake <ebb9@byu.net>
1361 * doc/m4.texinfo: Global cleanup. Avoid @code{...}'d, as it
1362 looks bad in info. Use @deffn rather than @example for
1363 describing prototypes. Fix awkward wording and grammar.
1365 * src/builtin.c (substitute): Warn on bad escape sequences.
1366 Ignore trailing backslash.
1367 * doc/m4.texinfo (Regexp): Add documentation for this.
1368 * NEWS: Document this change.
1370 * src/builtin.c (m4_format, m4_indir): Warn on too few arguments.
1371 * doc/m4.texinfo (Defn, Builtin, Debug Levels, Debug Output): Add
1373 (Dnl): Update example to show side effects.
1374 * checks/get-them: Generate three digit test names.
1375 * checks/Makefile.in (CHECKS): Accomodate 100+ tests.
1377 2006-07-13 Eric Blake <ebb9@byu.net>
1379 * src/input.c (input_init): Simplify.
1380 (set_word_regexp): Treat empty string as default, since empty
1381 regexp would disable word parsing.
1382 * src/m4.c (user_word_regexp): Default to empty string.
1383 * src/builtin.c (builtin_tab): Make changeword blind.
1384 * doc/m4.texinfo (Changeword): Document this.
1385 * NEWS: Document this.
1386 * TODO: Knock off completed items.
1388 * src/builtin.c (m4_undefine, m4_popdef): Visit all arguments, not
1390 * doc/m4.texinfo (Undefine, Pushdef): Test this.
1391 * NEWS: Document this change.
1393 * src/builtin.c (numeric_arg): Treat empty string as 0, with a
1394 warning. Detect quoted leading space and overflow as warnings.
1395 (m4_eval): Treat empty radix as 10, and allow output in radix 1.
1396 Treat width as minimum number of digits, as required by POSIX.
1397 (m4_ifdef, m4_divert, m4_m4exit, m4_translit): Ignore extra
1399 (m4_substr): Likewise. Silently treat empty start as 0.
1400 (m4_undivert): Treat ` 1a' as file, not diversion 1.
1401 * src/eval.c (eval_lex): Parse radix 1 numbers.
1402 * doc/m4.texinfo (Invoking m4): Fix wording; there is more than
1403 one type of warning.
1404 (Manual): Document behavior of numeric parsing of empty string.
1405 (Divert, Incr): Document error handling.
1406 (Eval): Document radices better.
1407 (Incompatibilities): Document translit incompatibility.
1408 * NEWS: Document these changes.
1410 * Makefile.maint (fetch): Get gendocs from gnulib, not texinfo.
1411 (web-manual): Simplify.
1412 * m4/gnulib-cache.m4: Augment with gnulib-tool --import gendocs.
1413 * Makefile.am (EXTRA_DIST): Distribute gendocs.sh.
1414 (MAINTAINERCLEANFILES): Clean it as well.
1415 * doc/Makefile.am (EXTRA_DIST): Distribute gendocs_template.
1416 (MAINTAINERCLEANFILES): Clean it as well.
1418 2006-07-12 Eric Blake <ebb9@byu.net>
1420 * doc/m4.texinfo (Extensions): Document how to overcome
1421 implementation difference in > 9 positional parameters.
1423 * src/m4.c (usage): Sort within sections.
1424 (nesting_limit): Raise default from 250 to 1024.
1425 * doc/m4.texinfo: Use file name, not filename, per GNU coding
1426 standard. Use @option where appropriate.
1427 (Invoking m4): Sort to match --help output.
1428 (Debug Levels): Sort.
1429 (Frozen files): Sort and break into two nodes.
1431 * src/m4.c (nesting_limit): Raise default from 250 to 1024.
1432 * NEWS: Document raised -L limit.
1434 2006-07-11 Eric Blake <ebb9@byu.net>
1436 * Makefile.am (DISTCHECK_CONFIGURE_FLAGS): New macro, to
1437 stress-test changeword before a release.
1438 * doc/m4.texinfo: More doc cleanups.
1439 (Copying This Manual): New node; actually include the FDL in the
1441 * doc/Makefile.am (m4_TEXINFOS): Mention dependence on fdl.texi.
1442 * m4/gnulib-cache.m4: Augment with gnulib-tool --import fdl.
1443 * NEWS: Mention documentation improvements.
1445 * src/m4.h (OS2): New platform macro.
1446 * src/builtin.c (predefined_tab) [OS2]: Use it to give OS/2 a
1448 * doc/m4.texinfo (Platform macros): Document it.
1449 (Sysval): Remove non-portable test of system("").
1450 * NEWS: Document this change.
1451 Reported by Andreas Buening.
1453 2006-07-09 Eric Blake <ebb9@byu.net>
1455 * doc/m4.texinfo (Undivert): Fix typo in last commit.
1456 * src/m4.c (usage): Document M4PATH.
1457 * src/path.c (path_search): Reject empty string.
1458 * src/output.c (insert_diversion): Ignore diversion 0.
1459 * src/builtin.c (m4_undivert): Ignore empty string.
1460 * NEWS: Document this fix.
1462 2006-07-08 Eric Blake <ebb9@byu.net>
1464 * checks/get-them: Make filtering easier.
1465 * checks/check-them: Filter non-input lines, so line counts are
1466 more realistic in the documentation, and so changeword tests work
1467 even when dnl is disabled.
1468 * doc/m4.texinfo: Adjust example line numbers. Clean up
1469 front-matter, following autoconf's example.
1470 (Changeword): Enable tests, skipping if changeword not supported.
1471 (Define, Defn, Ifelse): Backport more examples from head.
1472 (Input processing, Answers): New nodes, backported from head.
1473 (Include): Expand test to cover empty filename.
1474 (Undivert): Add test of undivert(0).
1476 2006-07-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1478 * doc/m4.texinfo: Fix spelling errors.
1480 2006-07-07 Eric Blake <ebb9@byu.net>
1484 * doc/Makefile.am (m4.1): No need to go through a temporary file;
1485 this also ensures timestamps are updated.
1486 * src/m4.h (includes): Require config.h. Assume string.h,
1487 stdlib.h, errno. Include error.h, exit.h, and xalloc.h rather
1488 than prototyping ourselves.
1489 (builtin_func): Add parameter type-checking.
1490 (voidstar): Delete, now that we assume C89.
1491 * src/builtin.c, src/m4.c, src/macro.c, src/symtab.c: All users of
1493 * src/m4.c (xfree) [WITH_DMALLOC]: Avoid clash with dmalloc's
1496 2006-07-06 Eric Blake <ebb9@byu.net>
1498 * m4/gnulib-cache.m4: Augment with gnulib-tool --import
1500 * src/m4.h (includes): Add binary-io.h for O_BINARY.
1501 * src/freeze.c (produce_frozen_state): Use O_BINARY to remove
1502 #ifdef. Fixes patch from 2005-02-03 for cygwin.
1503 * NEWS: Mention this fix.
1505 * configure.ac (FUNC_SYSTEM_BROKEN): New check for OS/2 bug.
1506 * src/builtin.c (m4_syscmd): Work around OS/2 bug.
1508 * Makefile.am (SUBDIRS): Build . before src, so that autoheader
1509 runs first when needed.
1510 * doc/Makefile.am (m4.1): Backport rule from CVS head: build m4.1
1511 once in srcdir rather than multiple times in VPATH builds.
1513 2006-07-03 Eric Blake <ebb9@byu.net>
1515 * checks/check-them: Use portable = in test.
1516 * src/Makefile.am (AM_CPPFLAGS): Omit space between -I and
1517 directory, as required by Solaris cc. Include built headers, as
1518 required by Solaris make in VPATH build.
1519 * checks/Makefile.in: Use $(srcdir) where needed.
1520 (CHECKS): Factor $(srcdir) into macro.
1521 (DISTFILES): Likewise. Automake takes care of distributing
1524 (Makefile): Use modern syntax of config.status.
1525 * doc/m4.texinfo (Loops, Include, Undivert, Incompatibilities):
1526 Avoid overfull and underfull hboxes in dvi.
1528 Fix 'make check' in VPATH build. All files included by testsuite
1529 now live in a single directory. Use forloop.m4 in testsuite.
1530 * checks/incl.m4, checks/foo, checks/wrapfifo.m4: Move from
1532 * examples/incl.m4, examples/foo, examples/wrapfifo.m4: ...to
1534 * checks/Makefile.in (DISTFILES): Don't distribute moved files.
1535 * examples/Makefile.am (EXTRA_DIST): Distribute new files.
1536 * checks/check-them: Avoid s/// when filename is in pattern.
1537 * examples/forloop.m4: Fix to match documentation.
1538 * doc/m4.texinfo (Include, Undivert, Incompatibilities): Reflect
1540 (Loops, Format): Actually use forloop.m4 in tests.
1542 2006-07-02 Eric Blake <ebb9@byu.net>
1544 * checks/Makefile.in (exec_prefix, prefix): New macros, so that
1545 $(bindir) works in installcheck.
1546 (check, installcheck): No longer change directory, so that
1547 distcheck works with a read-only builddir.
1548 * checks/check-them: Work when pwd is no longer builddir.
1550 2006-07-01 Eric Blake <ebb9@byu.net>
1552 * GNUmakefile: New file, borrowed from coreutils.
1553 * Makefile.am (EXTRA_DIST): Distribute GNUmakefile.
1554 * Makefile.maint (Makefile): Delete this rule, now that
1555 GNUmakefile includes Makefile.
1557 2006-06-30 Eric Blake <ebb9@byu.net>
1559 For compatibility with other m4 implementations, sysval returns
1560 signal<<8 rather than 0 if syscmd is terminated by a signal.
1561 * configure.ac (AC_CHECK_HEADERS_ONCE): Check for sys/wait.h.
1562 * src/builtin.c (include): Include sys/wait.h when stdlib.h does
1563 not provide wait macros.
1564 (WTERMSIG, WIFSIGNALED, WIFEXITED): More fallback macros.
1565 (M4SYSVAL_EXITBITS, M4SYSVAL_TERMSIGBITS): New helper macros.
1566 (m4_esyscmd): Set sysval to -1 on failure.
1567 (m4_sysval): Print 127 on failure, and accomodate signals if they
1569 * NEWS: Document this change.
1570 * doc/m4.texinfo (Platform macros, Esyscmd, Sysval): Fix typos in
1572 * checks/check-them: Likewise.
1573 * src/debug.c (debug_set_file): Work around mingw fstat bug.
1575 * src/m4.h (UNIX, W32_NATIVE): Improve platform detection macros.
1576 * src/freeze.c (produce_frozen_state): Use new spelling of
1578 * src/builtin.c (predefined_tab): Add __windows__ on non-unix
1580 (m4_syscmd, m4_esyscmd): The empty command is successful.
1581 * doc/m4.texinfo (Shell commands): Rename from UNIX commands.
1582 Document platform-dependence of system().
1583 (Syscmd): Add example.
1584 (Esyscmd): Make example more robust, and actually demonstrate
1586 (Sysval): Expand test to cover esyscmd code path, and to check
1587 that empty command is successful. Add conditional check for
1589 (Other Incompatibilities): Move platform macros from here...
1590 (Platform macros): ...to this new node. Add windows macro.
1591 Check that exactly one platform macro is provided.
1592 * checks/check-them: Improve trap cleanup. Tolerate dirname and
1593 .exe in error messages. Allow for skipping checks.
1594 * configure.ac (HAVE_EFGCVT): Kill dead configure check.
1595 * NEWS: Document platform macros.
1597 2006-06-29 Eric Blake <ebb9@byu.net>
1599 Fix buffer overrun bug.
1600 * m4/gnulib-cache.m4: Augment with gnulib-tool --import
1602 * src/format.c [HAVE_EFGCVT]: Delete this code, and use *printf
1603 variant instead, since [efg]cvt are obsolete and our use of them
1604 was buggy (savannah sr #104303).
1605 (format): Fix buffer overflow by using xasprintf.
1606 * doc/m4.texinfo (Format): Expand format test to catch both bugs.
1607 * NEWS: Document this fix.
1609 * configure.ac (AC_CANONICAL_HOST, AC_CANONICAL_BUILD): Allow
1611 (AC_CACHE_CHECK): Cache search for ecvt.
1613 2006-06-27 Eric Blake <ebb9@byu.net>
1615 * doc/m4.texinfo (Eval): Document 32-bit signed limitations
1616 required by POSIX, and add example that exposed core dump on x86
1618 (Incompatibilities): Document incompatibility in eval precedence.
1619 * src/eval.c (shift_term): Explicitly mask, to avoid undefined
1621 (mult_term): Explicitly check for -1, to avoid SIGFPE on x86.
1622 * NEWS: Document this change.
1624 * doc/m4.texinfo: Use @noindent consistently.
1625 (Quoting Arguments): Document that unquoted parentheses group
1627 (Pseudo Arguments): Expand tests to show this.
1628 (Incompatibilities): Contrast traditional behavior of
1631 2006-06-24 Eric Blake <ebb9@byu.net>
1633 * configure.ac (AC_PREREQ): Autoconf 2.60 is now released.
1634 (AC_CHECK_HEADERS_ONCE): Use this new feature.
1635 (AC_CHECK_FUNCS_ONCE): Likewise.
1637 2006-06-23 Eric Blake <ebb9@byu.net>
1639 * doc/m4.texinfo: Quoting cleanup throughout - follow
1640 autoconf-recommended style of one level of quote per parenthesis
1641 in the normal case. Adjust error messages to match GNU coding
1642 standards (and to allow 'make check' to pass again).
1643 (Quoted strings, Inhibiting Invocation): Turn more examples into
1645 (Comments): Resolve FIXME by adding example.
1646 (Define): Add example about underquoting.
1647 (Defn): Add example about use of $0.
1648 (Indir, Format): Resolve FIXME done in last commit.
1649 (Ifelse): Add example about creating blind macro.
1650 (Debugging): Fix grammar.
1651 (Dnl): Add example about dnl with arguments.
1652 (M4wrap): Be explicit that LIFO order is non compliant, and will
1654 (Undivert): Resolve FIXME by adding example.
1655 (Frozen files): Document that m4wrap and sysval will not work
1656 consistently until m4 2.0.
1657 (Incompatibilities): Document another POSIX compliance bug, this
1658 time with changequote. Document a traditional incompatibility
1659 with partial input spanning file boundaries.
1661 Make error messages more consistent with GNU coding standards -
1662 start with lower case, and don't end sentence with punctuation.
1663 * src/debug.c (trace_pre): Update message wording.
1664 * src/eval.c (evaluate, cmp_term, shift_term, mult_term):
1666 * src/freeze.c (produce_frozen_state, issue_expect_message),
1667 (reload_frozen_state): Likewise.
1668 * src/input.c (push_string_init, pop_init, init_macro_token),
1669 (peek_input, next_char_1, set_word_regexp, next_token): Likewise.
1670 * src/m4.c (stackovf_handler, main): Likewise.
1671 * src/macro.c (expand_token, expand_argument, call_macro),
1672 (expand_macro): Likewise.
1673 * src/output.c (make_room_for, output_text, insert_file),
1674 (freeze_diversions): Likewise.
1675 * src/symtab.c (symtab_init, lookup_symbol): Likewise.
1677 * src/builtin.c (builtin_tab): Make format and indir blind.
1678 (substitute): Prefer "Warning:" vs. "ERROR:" in messages.
1679 * NEWS: Mention the change to builtins.
1681 2006-06-22 Eric Blake <ebb9@byu.net>
1683 Robustify frozen file format.
1684 * src/freeze.c (reload_frozen_state): Add GET_DIRECTIVE helper
1685 macro. Require V first, and only accept it once. For F, use
1686 placeholder if builtin is not found, rather than warning.
1687 * src/m4.h (m4_placeholder): New prototype.
1688 * src/builtin.c: Unify error message style.
1689 (m4_placeholder): New function, warn if invoked.
1690 (builtin_tab): Add m4_placeholder.
1691 (m4_defn): Warn if placeholder is encountered.
1692 (find_builtin_by_addr): Handle placeholder.
1693 (find_builtin_by_name): Return placeholder on failure.
1694 (m4_builtin): Treat placeholder as undefined.
1695 * doc/m4.texinfo (Frozen files): Document changes in V and F.
1696 * NEWS: Document this change.
1697 Reported by Bruno Haible.
1699 * doc/m4.texinfo: Whitespace cleanup. TABs are evil in texinfo.
1700 (tabchar): New macro, so that 'make check' still works.
1701 (Invoking m4): Document that ignored compatibility options -B, -S,
1702 and -T each consume an argument.
1703 * checks/get-them: Honor @tabchar{}.
1705 Avoid compiler warnings during -DDEBUG.
1706 * src/m4.h (M4_GNUC_ATTRIBUTE, M4_GNUC_UNUSED): New macros.
1707 [DEBUG]: Also imply DEBUG_OUTPUT and DEBUG_STKOVF.
1708 * src/input.c (print_token) [DEBUG_INPUT]: Use correct format.
1709 (lex_debug) [DEBUG_INPUT]: Fix to compile. Mark unused.
1710 (next_token) [DEBUG_INPUT]: Print before returning.
1711 * src/path.c (include_dump) [DEBUG_INCL]: Mark unused.
1712 * src/symtab.c (symtab_debug) [DEBUG_SYM]: Mark unused.
1714 Avoid mkstemp bugs on various platforms.
1715 * m4/gnulib-cache.c: Augment with gnulib-tool --import mkstemp.
1716 * src/output.c [! HAVE_MKSTEMP]: Delete.
1717 * configure.ac (AC_CHECK_FUNCS): Don't check for mkstemp.
1718 * src/m4.h (mkstemp) [! HAVE_MKSTEMP]: Prototype, if needed.
1719 * NEWS: Document this.
1721 * Makefile.am (EXTRA_DIST): Distribute gnulib-cache.m4.
1722 Reported by Bruno Haible.
1724 2006-06-21 Eric Blake <ebb9@byu.net>
1726 Avoid obsolete sigstack when POSIX sigaltstack is available.
1727 * src/m4.c: Blindly assume signal.h, since stackovf.c and gnulib
1729 * configure.ac (AC_CHECK_HEADERS): Likewise.
1730 (AC_CHECK_TYPES): New check for siginfo_t, since siginfo.h is
1731 obsolete and most hosts now have it in signal.h.
1732 (AC_CHECK_MEMBERS): New check for sigaction.sa_sigaction.
1733 (AC_CACHE_CHECK): Cache decision to use stackovf.
1734 (AC_EGREP_HEADER): Switch to AC_CHECK_TYPES.
1735 * src/stackovf.c (DEBUG_STACKOVF): Remove unused define.
1736 (SA_RESETHAND, SA_SIGINFO): Provide fallback definitions, to
1737 simplify later code.
1738 (PARAM_STACKOVF, PARAM_NOSTACKOVF): Move further away from NULL,
1739 in case of dereferencing a member of a NULL pointer.
1740 (sigsegv_handler) [HAVE_STRUCT_SIGACTION_SA_SIGACTION]: Define a
1742 (setup_stackovf_trap): Use NULL instead of 0 for pointers, use
1743 EXIT_FAILURE in error, indent preprocessor directives.
1744 [HAVE_SIGALTSTACK && HAVE_SIGINFO_T]: Depend on siginfo_t, not
1746 [HAVE_SIGACTION && defined SA_ONSTACK]: Prefer POSIX handler.
1747 Reported by Santiago Vila.
1749 2006-06-19 Eric Blake <ebb9@byu.net>
1753 2006-06-18 Andreas Buening <andreas.buening@nexgo.de> (tiny change)
1755 * checks/Makefile.in (PATH_SEPARATOR): New macro.
1756 (check, installcheck): Use it, for OS/2.
1758 2006-06-18 Eric Blake <ebb9@byu.net>
1760 Consistently use "GNU M4" as package name, "m4" as executable
1762 * NEWS: Document previous fix.
1764 * README: Fix grammar. Document that --enable-changeword is on
1766 * doc/m4.texinfo (Top, Changeword): Likewise.
1767 (Sysval): Enhance this test.
1768 (History): Backport this section from CVS head, and update.
1770 2006-06-18 Bruno Haible <bruno@clisp.org> (tiny change)
1771 Eric Blake <ebb9@byu.net>
1773 * src/builtin.c (WEXITSTATUS): Provide fallback definition.
1774 (m4_esyscmd): Set sysval to 0xffff, to accomodate both
1775 big-endian and little-endian wait status definitions.
1776 (m4_sysval): Use WEXITSTATUS.
1777 Reported by Andreas Buening.
1779 2006-06-18 Eric Blake <ebb9@byu.net>
1781 * configure.ac (AC_INIT): Bump version number.
1782 * NEWS: Describe changes in 1.4.4c.
1784 2006-06-17 Eric Blake <ebb9@byu.net>
1786 Beta Release 1.4.4b:
1787 * configure.ac (AC_INIT): Bump version number.
1788 * NEWS: Describe changes since 1.4.4.
1789 * Makefile.maint (cvs-news): Accomodate copyright line wrapping.
1791 * Makefile.am (MAINTAINERCLEANFILES): Clean files added by
1793 * checks/Makefile.in (maintainer-clean): Add missing target.
1794 * COPYING: Remove generated file from CVS.
1796 2006-06-16 Eric Blake <ebb9@byu.net>
1798 * checks/Makefile.in (DISTFILES): Distribute wrapfifo.m4.
1800 2006-06-15 Eric Blake <ebb9@byu.net>
1802 * checks/wrapfifo.m4: New file. Use it...
1803 * doc/m4.texinfo (Incompatibilities): here, in a new test case to
1804 demonstrate how to get POSIX behavior of m4wrap prior to m4 2.0.
1806 * src/m4.h (to_uchar): New function.
1807 * src/eval.c (eval_lex): Use it to avoid passing signed char to
1808 isdigit, isalpha, isupper, islower, isspace, isalnum.
1809 * src/builtin.c (expand_user_macro): Likewise.
1810 * src/format.c (format): Likewise.
1811 * src/macro.c (expand_argument): Likewise.
1812 * NEWS: Document this security fix.
1815 * src/symtab.c (lookup_symbol): Use invalid, not illegal.
1816 * src/freeze.c (reload_frozen_state): Fix typo in message.
1817 (produce_frozen_state): Standardize on builtin, not built-in.
1818 * src/builtin.c (numeric_arg, bad_argc): Likewise.
1820 * configure.ac (M4_EARLY, M4_INIT): Use gnulib.
1821 (AC_PROG_RANLIB, AC_AIX, AC_MINIX, AC_CHECK_HEADERS),
1822 (AC_FUNC_ALLOCA, AC_REPLACE_FUNCS): Avoid checks now done by
1824 * Makefile.am (ACLOCAL_AMFLAGS): New entry, for gnulib.
1825 * m4/gnulib-cache.m4: New file, from gnulib.
1826 * bootstrap: Invoke gnulib-tool --update.
1827 * src/m4.c (main): Cast away const.
1828 * NEWS: Document that regex is updated.
1831 2006-06-08 Eric Blake <ebb9@byu.net>
1833 * configure.ac (changeword): Work even when changeword is not a
1835 (AC_PROG_AWK, AC_PROG_INSTALL, AC_PROG_MAKE_SET, AC_HEADER_STDC):
1836 Delete; now done by automake.
1837 (AC_ISC_POSIX, AC_C_CONST): Delete; now obsolete.
1839 2006-06-07 Eric Blake <ebb9@byu.net>
1841 * lib/regex.c (bcmp_translate): Canonicalize type name.
1842 * doc/Makefile.am (MAINTAINERCLEANFILES): Fix typo.
1843 * configure.ac (changeword): Disable changeword for the creation
1844 of configure, in case of bootstrapping with an m4 configured with
1845 --enable-changeword.
1847 Distribute a rudimentary man page.
1848 * Makefile.am (SUBDIRS): Move doc after src so that 'm4 --help'
1850 * doc/Makefile.am (man_MANS, EXTRA_DIST, MAINTAINERDISTCLEAN),
1851 (SUFFIXES, m4.1): New macros and rules to build m4.1.
1853 2006-06-06 Eric Blake <ebb9@byu.net>
1855 * lib/regex.c (re_match_2_internal, bcmp_translate): Avoid
1856 compiler warnings at -O2.
1857 * lib/getopt.c (_getopt_internal): Likewise.
1859 Cleanup of previous patches.
1860 * src/input.c (struct input_block): Remove traced member.
1861 (push_macro, init_macro_token): Don't pass trace status around.
1862 * src/m4.h (struct token_data): Remove traced member.
1863 (struct symbol, struct builtin): Reduce unused space.
1864 (TOKEN_DATA_FUNC): Simplify.
1865 (TOKEN_DATA_FUNC_TRACED): Remove unused macro.
1866 (push_macro, define_builtin): Remove unused parameter.
1867 * src/builtin.c (define_builtin, builtin_init, define_macro),
1868 (m4_defn): Don't pass trace status around.
1869 * src/macro.c (expand_argument): Likewise.
1870 * src/freeze.c (reload_frozen_state): Likewise.
1871 * src/symtab.c: Whitespace cleanup.
1872 * NEWS: Clean up wording.
1873 * doc/m4.texinfo (Undefine, Dumpdef, Trace): Cleanup wording;
1874 ensure tests actually expose bugs prior to today's patches.
1876 Trace status of builtins is no longer inherited across
1877 define(...,defn(...)). Fixes bug that autom4te had been working
1879 * src/builtin.c (define_builtin): Don't override trace status.
1880 * doc/m4.texinfo (Trace): Add test for this.
1881 * NEWS: Document this.
1883 When changing macro definitions inside the arguments to the macro,
1884 consistently preserve the old definition that was in effect before
1885 argument collection, similar to the C pre-processor.
1886 Reported by John Brzustowski.
1887 * NEWS: Document this change.
1888 * doc/m4.texinfo (Macro Arguments, Undefine, Dumpdef): Document
1889 this policy, and add tests that expose core dumps prior to this
1891 * src/m4.h (struct symbol): New members to track when a symbol is
1892 still in use after removal from the symbol table.
1893 (SYMBOL_PENDING_EXPANSIONS, SYMBOL_DELETED): Define.
1894 (free_symbol): Prototype.
1895 * src/macro.c (expand_macro): Track pending expansions of a
1896 symbol. On completion, if a symbol is deleted and no longer
1897 pending, free its memory.
1898 * src/symtab.c (free_symbol): Export. Don't free memory if symbol
1900 (lookup_symbol) <SYMBOL_INSERT>: Create new entry when old entry
1902 (lookup_symbol) <SYMBOL_DELETE, SYMBOL_POPDEF>: Mark entries still
1903 in use as deleted and remove from the table without freeing
1905 (symtab_print_list) [DEBUG_SYM]: More debug output.
1907 * src/symtab.c (hack_all_symbols): Allow certain modifications of
1908 the symbol table during traversal.
1909 * src/builtin.c (set_trace): Replace SYMBOL_DELETE with
1910 SYMBOL_POPDEF, since only the latter is safe with
1913 Solve crash when passing "indir(`foo')" to "m4 -tfoo".
1914 * src/symtab.c (lookup_symbol) <SYMBOL_DELETE, SYMBOL_POPDEF>:
1915 Preserve placeholder when macro is being traced.
1916 * src/builtin.c (m4_ifdef, m4_indir): A traced but undefined
1917 symbol is not defined.
1918 (set_trace): Remove placeholder when no longer traced.
1919 (m4_traceon): On named traces, always reserve a slot in the
1921 (m4_traceoff): Don't warn about untracing a nonexistent symbol.
1922 * NEWS: Document new trace behavior.
1923 * doc/m4.texinfo (Trace): Tracing by name now consistently works
1924 no matter whether that macro is currently defined.
1925 (Incompatibilities): Document differences between traditional and
1928 2006-06-04 Paul Eggert <eggert@cs.ucla.edu> (tiny change)
1929 Eric Blake <ebb9@byu.net>
1931 * src/m4.h (hash_table_size): Now size_t instead of int.
1932 * src/m4.c (hash_table_size): Likewise.
1933 (main): Adjust to this; use atol rather than atoi.
1934 * src/symtab.c: Include <limits.h>, for CHAR_BIT.
1935 (symtab_init, lookup_symbol, hack_all_symbols):
1936 Use size_t for sizes and indexes, not int.
1937 (symtab_print_list) [DEBUG_SYM]: Likewise.
1938 (hash): Likewise. Don't case-fold in the hash function.
1939 Shift by 7, not 3, for consistency with gnulib/lib/hash.c.
1940 Don't assume hash word is 32 bits.
1941 * NEWS: Document this change.
1943 2006-06-04 Eric Blake <ebb9@byu.net>
1945 * src/symtab.c (symtab_debug, symtab_print_list) [DEBUG_SYM]: Fix
1946 to allow compilation, for use in debugger.
1947 (profiles, current_mode) [DEBUG_SYM]: New variables.
1948 (show_profile, profile_strcmp) [DEBUG_SYM]: New methods for
1949 determining hash table performance.
1951 2006-05-31 Eric Blake <ebb9@byu.net>
1952 John Brzustowski <jbrzusto@fastmail.fm>
1954 * src/input.c (input_stack): Delete; use current_input instead.
1955 (wrapup_stack): Dynamically allocate, so that recursion is handled
1957 (push_wrapup): Use current wrapup stack.
1958 (pop_wrapup): Rotate wrapup stack to current, and create new
1960 (input_init): Dynamically allocate stacks.
1961 * NEWS: Update, now that recursive m4wrap can no longer cause
1964 2006-05-31 Eric Blake <ebb9@byu.net>
1966 * lib/getopt.c: Fix copyright year.
1967 * lib/obstack.c: Ditto.
1968 * src/builtin.c: Ditto.
1970 2006-05-30 Eric Blake <ebb9@byu.net>
1972 * doc/m4.texinfo (M4wrap): Add test to expose m4wrap bug.
1973 Reported by John Brzustowski.
1974 (Incompatibilities): Document known POSIX incompatibilities.
1977 2006-05-29 Eric Blake <ebb9@byu.net>
1979 * doc/m4.texinfo (Maketemp): Work even when running 'make check'
1983 * Makefile.am: New file.
1984 * doc/Makefile.am: Ditto.
1985 * examples/Makefile.am: Ditto.
1986 * lib/Makefile.am: Ditto.
1987 * src/Makefile.am: Ditto.
1988 * acinclude.m4: New file, renamed from aclocal.m4.
1989 * configure.ac (AM_INIT_AUTOMAKE): Invoke new macro.
1990 (AC_ARG_PROGRAM): Now redundant.
1991 (STACKOVF): Turn into automake conditional.
1992 (AC_CONFIG_COMMANDS): stamp-h is a command, not a file.
1993 * checks/Makefile.in: Converting this dir to automake was not
1994 trivial; for now, just add missing targets demanded by top-level.
1995 * INSTALL: Remove files that are now generated from CVS.
1996 * Makefile.in: Ditto.
1997 * aclocal.m4: Ditto.
1998 * install-sh: Ditto.
1999 * mkinstalldirs: Ditto.
2000 * doc/Makefile.in: Ditto.
2001 * doc/texinfo.tex: Ditto.
2002 * examples/Makefile.in: Ditto.
2003 * lib/Makefile.in: Ditto.
2004 * src/Makefile.in: Ditto.
2006 * AUTHORS: Backport from CVS head, and update.
2007 * doc/m4.texinfo (Changeword): Fix examples to match behavior.
2009 2006-05-27 Eric Blake <ebb9@byu.net>
2011 * lib/regex.c (regex_compile): Kill compiler warnings.
2012 * lib/getopt.c: Likewise.
2013 * lib/obstack.c: Likewise.
2014 * src/builtin.c (builtin_init): Likewise.
2015 * src/path.c (path_search): Likewise.
2017 * doc/m4.texinfo: Fix usage of a vs. an.
2018 (Loops, Include, Cleardiv, Patsubst, Format, M4exit): Kill
2019 overfull hbox warnings.
2020 (Inhibiting Invocation, Divert, Maketemp, M4exit): Add new tests.
2022 * configure.ac: Update to autoconf 2.59. Forbid ^M4_. Fix
2024 * aclocal.m4 (fp_PROG_CC_STDC): Delete; now covered by autoconf.
2025 (fp_C_PROTOTYPES): Delete, GNU Coding Standards state we can now
2027 (M4_WITH_DMALLOC): Rename from fp_WITH_DMALLOC. Fix quoting.
2028 * src/m4.h (_): PROTOTYPES is no longer provided, assume C89.
2029 * src/Makefile.in: Delete remains of ansi2knr.
2030 * src/ansi2knr.1: Delete.
2031 * src/ansi2knr.c: Delete.
2033 2006-05-25 Eric Blake <ebb9@byu.net>
2035 * doc/m4.texinfo: Fix spelling errors. Use `invalid' instead of
2038 * doc/m4.texinfo (Francois): No longer needed as a tex variable.
2039 Reported by Karl Berry.
2041 2006-05-24 Eric Blake <ebb9@byu.net>
2043 * Makefile.in (html): New target.
2044 * doc/Makefile.in (html, m4.html): Likewise.
2045 (MAKEINFOHTML): New macro.
2046 * doc/m4.texinfo (Francois) [ifnottex]: Use newer texinfo
2048 (Regexp) [ifhtml]: Make cross-reference to emacs manual an
2050 Reported by Bob Badour.
2052 * THANKS: Update. Move reporter's email addresses here, instead
2055 2006-05-11 Eric Blake <ebb9@byu.net>
2058 * doc/m4.texinfo (Changequote): Give testsuite exposure to bug
2059 patched on 2005-12-04.
2060 Reported by Ilya N. Golubev.
2062 * bootstrap: New file, so that generated files need not be stored
2064 * Makefile.in (DISTFILES): Add bootstrap.
2066 Make testsuite less sensitive to doc changes.
2067 * doc/m4.texinfo: Use m4.input instead of filename.
2068 * checks/check-them (xerr): Turn m4.input into filename.
2069 * checks/Makefile.in (dist): Depend on stamp-checks.
2071 Portability updates for OS/2.
2072 * src/Makefile.in (EXEEXT, OBJEXT): Define.
2075 * lib/Makefile.in (OBJEXT): Define.
2077 * doc/Makefile.in (install, uninstall): Install info files into
2079 Reported by Andreas Buening.
2081 2006-05-09 Eric Blake <ebb9@byu.net>
2083 * install-sh: Update to newer upstream version.
2084 * mkinstalldirs: Likewise.
2085 Reported by Andreas Buening.
2087 * src/m4.c (main): Bump copyright year.
2088 * Makefile.in (datarootdir): Define, for autoconf 2.59c.
2089 * doc/Makefile.in (datarootdir): Likewise.
2091 2006-05-08 Eric Blake <ebb9@byu.net>
2094 * doc/m4.texinfo (Bugs): Backport bug email address from head.
2095 Reported by Stepan Kasal.
2097 2005-12-04 Ilya N. Golubev <gin@mo.msk.ru> (tiny change)
2099 * input.c (match_input): Do not pass expression with side effect
2100 to `obstack_grow'. Fix <INTERNAL ERROR: Recursive push_string!>.
2103 2005-12-04 Gary V. Vaughan <gary@gnu.org> (tiny change)
2105 * doc/m4.texinfo (How to debug macros and input): s/woould/would/
2106 Reported by Damian Menscher.
2108 2005-10-19 Gary V. Vaughan <gary@gnu.org> (tiny change)
2110 * configure.ac (AC_INIT): Bump to 1.4.4a.
2112 2005-10-19 Gary V. Vaughan <gary@gnu.org> (tiny change)
2115 * configure.ac (AC_INIT): Bump to 1.4.4.
2116 * NEWS: Describe 1.4.4's changes.
2117 * INSTALL, install-sh, doc/texinfo.tex: Updated from upstream.
2119 2005-10-17 John Gatewood Ham <zappaman@buraphalinux.org> (tiny change)
2121 * src/m4.c: fix return code when non-existent files are processed
2123 2005-10-17 John Gatewood Ham <zappaman@buraphalinux.org> (tiny change)
2125 * README: update email address for bug reports.
2127 2005-10-17 Gary V. Vaughan <gary@gnu.org>
2129 * doc/m4.info: Generated files are not kept in the repository.
2131 2005-05-01 Gary V. Vaughan <gary@gnu.org>
2133 The FSF are moving offices today. Changed their contact address
2134 in all files from `59 Temple Place, Suite 330, MA 02111-1307' to
2135 `51 Franklin Street, Fifth Floor, MA 02110-1301'.
2137 Also, some of the files here were never updated from the previous
2138 '675 Mass Ave, Cambridge, MA 02139', so changed those to the
2139 '51 Franklin Street, Fifth Floor, MA 02110-1301' address too.
2141 2005-03-31 Mike Frysinger <vapier@gentoo.org>
2143 * Makefile.in (bindir, infodir): Substitute from configure rather
2145 * doc/Makefile.in (infodir): Ditto.
2146 * src/Makefile.in (bindir): Ditto.
2149 2005-03-31 Gary V. Vaughan <gary@gnu.org>
2151 Changes needed to automate the release process for 1.4.3:
2153 * Makefile.in (dist): Make .tar.bz2 tarball too.
2154 * Makefile.maint (TSDEPS_DIST): Remove m4/libtool.m4.
2155 (cvs-news): Look 1 line further down for NEWS release number.
2156 (cvs-dist): We don't use automake, so make dist is fine.
2157 Remove double . before suffixes.
2158 (cvs-release): Don't mention manual.html.
2159 (fetch): Get latest gendocs files.
2160 (web-manual): Rewritten to use gendoc for multiformat manuals.
2161 * doc/gendocs.sh: Don't save an old version in m4 CVS!
2162 * doc/m4.texinfo (Index): HFS+ (the file system on my Mac) is case
2163 preserving, but case insensitive, so generating html docs per node
2164 clashes between Index.html, the node file, and index.html, the
2165 top-level of the document tree...
2166 (Index macro): ...so renamed to this. Changed all references.
2168 2005-03-31 Gary V. Vaughan <gary@gnu.org> (tiny change)
2170 * configure.ac (AC_INIT): Bump to 1.4.3a.
2172 2005-03-31 Gary V. Vaughan <gary@gnu.org> (tiny change)
2175 * configure.in (AC_INIT): Bump to 1.4.3.
2176 * NEWS: Describe 1.4.3's changes.
2178 2005-03-31 Gary V. Vaughan <gary@gnu.org>
2180 * Makefile.maint: New file with release rules, from CVS libtool.
2181 * Makefile.in (DISTFILES): Add Makefile.maint.
2182 * INSTALL, install-sh, doc/texinfo.tex: Updated to latest
2185 2005-03-31 Eric Blake <ebb9@byu.net> (tiny change)
2187 * doc/m4.texinfo (Patsubst): Re-add trailing space required by
2188 checks/47.patsubst, with a redundant @comment to prevent emacs
2189 from removing it accidentally again.
2190 * checks/get-them: Allow for trailing spaces tucked behind
2193 2005-03-31 Eric Blake <ebb9@byu.net> (tiny change)
2195 * doc/Makefile.in (install, uninstall): Accomodate DESTDIR.
2196 * src/Makefile.in (install, uninstall): Likewise.
2198 2005-02-07 Gary V. Vaughan <gary@gnu.org>
2200 * lib/regex.c, lib/regex.h: Reverted gnulib update, which broke
2202 Reported by Eric Blake.
2204 2005-02-04 Gary V. Vaughan <gary@gnu.org>
2206 * lib/regex.c, lib/regex.h: Updated from gnulib.
2207 * src/input.c (set_word_regexp): Don't change the word_regexp
2208 unless it compiles correctly.
2210 Reported by Frank Schwidom.
2212 * Makefile.in (stamp-h): Regenerate config.h properly.
2214 2005-02-03 Gary V. Vaughan <gary@gnu.org>
2216 * configure.ac (AC_DEFINE): Fix overquoting of description
2219 * src/m4.h (__CYGWIN__, WIN32): Canonicalise Windows and Cygwin
2221 * src/freeze.c (produce_frozen_state): Use \n line-endings even
2222 on Windows, so that the frozen file reader will work.
2223 Reported by Josef T. Burger.
2225 * src/m4.c (main): Modernise the --version output.
2227 2005-02-03 Gary V. Vaughan <gary@gnu.org>
2229 Modernise the configury a little to prevent spurious errors from
2230 Autoconf-2.59's autoreconf:
2232 * config.h.in: Renamed to...
2233 * config-h.in: ...this to better support DOS 8.3 file systems.
2234 * acconfig.h: Removed.
2235 * configure.in: Renamed to...
2236 * configure.ac: ...this, and AC_DEFINE used to declare config.h
2237 entry comments. Slight reorganisation and reformatting.
2238 * aclocal.m4: Use third argument to AC_DEFINE to declare config.h
2240 (AC_INIT): Use a modern 3 argument call.
2241 * Makefile.in, checks/Makefile.in, doc/Makefile.in,
2242 examples/Makefile.in, lib/Makefile.in, src/Makefile.in:
2243 s/PRODUCT/PACKAGE/g.
2244 * Makefile.in (DISTFILES): Removed acconfig.h, configure.in,
2245 config.h.in. Added configure.ac, config-h.in.
2246 (stamp-h.in): Removed acconfig.h from dependencies.
2247 (configure): Depends on configure.ac, not configure.in.
2248 * doc/Makefile.in (stamp-vti): Ditto.
2249 * src/freeze.c (produce_frozen_state), src/m4.c (main): Adjust for
2250 difference between PRODUCT="m4" and PACKAGE="GNU M4".
2251 * configure: Regenerated.
2253 2005-02-03 Noah Misch <noah@cs.caltech.edu>
2255 * src/output.c (mkstemp): Make non-static, and build regardless of
2256 HAVE_TMPFILE; src/builtin.c also needs this replacement.
2259 2004-09-09 Vincent Lonngren <Vincent.lonngren.759@student.lu.se>
2261 * configure.in (AC_CHECK_HEADERS): Commit works best when you save
2262 changes from your editor buffer first.
2264 * configure.in (AC_CHECK_HEADERS): Add signal.h, sys/signal.h.
2265 * src/m4.c: And include them as appropriate.
2268 2004-09-09 Andreas Schwab <schwab@suse.de>
2270 Refactoring of the string read case in next_char provides about a
2271 20% speedup of M4 as typically used by autoconf:
2273 * src/input.c (next_char_1): Renamed from next_char.
2274 (next_char): New macro.
2277 2004-08-21 Gary V. Vaughan <gary@gnu.org>
2279 * configure.in (VERSION): Bump to 1.4.2a.
2281 2004-08-19 Paul Eggert <eggert@twinsun.com>
2284 * configure.in (VERSION): Bump to 1.4.2.
2285 * News: Describe 1.4.2's changes.
2287 * src/m4.c (reference_error): Preserve errno, since M4ERROR
2289 * src/builtin.c (m4_esyscmd): Clear errno before calling popen.
2290 (m4_maketemp): Clear errno before calling mkstemp.
2291 * src/path.c (path_search): Don't let "free" trash errno when
2293 * src/output.c (insert_file): Don't assume errno has a valid
2294 value simply because fread returns zero. This fixes a
2295 portability bug reported by Marion Hakanson in
2296 <http://lists.gnu.org/archive/html/bug-m4/2004-07/msg00029.html>.
2298 2004-06-09 Gary V. Vaughan <gary@gnu.org>
2300 * configure.in (VERSION): Bump to 1.4.1a.
2301 * NEWS: Place holder for next stable release.
2303 2004-06-03 Paul Eggert <eggert@cs.ucla.edu>
2306 * configure.in (VERSION): Bump to 1.4.1.
2307 * NEWS: Describe 1.4.1's changes.
2309 * aclocal.m4 (fp_PROG_CC_STDC): Use AC_DEFUN, not define, to
2310 pacify Autoconf 2.59.
2312 * doc/m4.texinfo: Insert commas after @xref's that lack them,
2313 to pacify Texinfo 4.7.
2314 * doc/Makefile.in (info): Remove info-1, info-2, info-3.
2316 * src/m4.h, src/debug.c: Use #ifdef __STDC__, not #if __STDC__, to
2317 pacify Sun C compilers.
2319 2003-09-28 Akim Demaille <akim@epita.fr>
2321 * src/symtab.c (lookup_symbol): Fix an uninitialized-variable
2324 2003-09-03 Santiago Vila <sanvila@debian.org>
2326 * examples/stackovf.sh: Use tempfile if available.
2328 2001-04-02 Robert Bihlmeyer <robbe@orcus.priv.at>
2330 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=92629
2331 * src/output.c (m4_insert_file): Do not mix buffered and
2332 unbuffered I/O, as this breaks on the Hurd. (trivial change)
2334 2001-02-01 Santiago Vila <sanvila@debian.org>
2336 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=84451
2337 * src/m4.c (main): Fix format vulnerabilities. (trivial change)
2339 2001-02-01 Matt Kraai <kraai@debian.org>
2341 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=84416
2342 * doc/m4.texinfo (Maketemp): Change maketemp to refer to a new,
2343 empty file rather than to a nonexistent file. This closes a common
2345 * src/builtin.c (m4_maketemp): Implement the above, by using
2346 mkstemp rather than mktemp. (trivial change)
2348 2000-01-09 Akim Demaille <demaille@inf.enst.fr>
2350 * src/builtin.c (expand_ranges): Added break after trailing dash.
2351 This caused misbehaviors on some systems.
2353 Sat Nov 5 15:52:47 1994 Francois Pinard (pinard@icule)
2356 * doc/Makefile.in (realclean): Also remove stamp-vti.
2357 Reported by Eric Backus.
2359 Wed Nov 2 00:47:53 1994 Francois Pinard (pinard@icule)
2361 * src/freeze.c (produce_frozen_state): If the frozen file cannot
2362 be opened, return immediately after producing the error message.
2363 Reported by Andreas Schwab.
2365 * configure.in: Check for const only after having found possible
2366 ANSIfying compiler flags, this is of no use to check it before.
2367 Reported by Alexander Lehmann.
2369 Tue Nov 1 22:02:37 1994 Francois Pinard (pinard@icule)
2371 * src/macro.c (collect_arguments): Cast obstack arguments to
2372 (voidstar), so avoiding compiler warnings.
2373 Reported by Joseph E. Sacco.
2375 * src/freeze.c (produce_frozen_state): Cast printed lengths to
2376 (int) so they correspond to %d format items.
2377 Reported by Joseph E. Sacco.
2379 * src/m4.c (main): Cast the argument to xfree to (voidstar).
2380 * src/symtab.c (free_symbol): Idem.
2381 Reported by Karl Vogel.
2383 Mon Oct 31 02:11:19 1994 Francois Pinard (pinard@icule)
2385 * Makefile.in (DISTFILES): Distribute BACKLOG.
2387 * configure.in: Define PRODUCT and VERSION.
2388 * acconfig.h: Document PRODUCT and VERSION.
2389 * src/m4.c, src/freeze.c: Use PRODUCT and VERSION instead of the
2390 constant string m4 and variable or parameter named version.
2392 Sun Oct 30 08:13:03 1994 Francois Pinard (pinard@icule)
2394 * src/m4.h, src/debug.c: Replace all #ifdef __STDC__ by #if
2395 __STDC__. Alliant FX/2800 Concentrix 2.2 (i860-BSD4.3) compiler
2396 defines __STDC__ to 0, for indicating it is *not* ANSI!
2397 Reported by Kaveh R. Ghazi.
2399 * configure.in: Added obsolescent tests for AIX and Minix.
2401 * doc/Makefile.in (mostlyclean): Remove texclean in dependencies,
2402 which texclean does not exist anymore.
2403 Reported by Eric Backus, Jim Meyering, John David Anglin and
2406 Sat Oct 29 05:10:03 1994 Francois Pinard (pinard@icule)
2408 * aclocal.m4 (fp_C_PROTOTYPES): Force -D_HPUX_SOURCE with -Aa.
2409 Reported by John David Anglin.
2411 * src/ansi2knr.c: New version, sent by Peter Deutsch.
2412 * aclocal.m4 (fp_C_PROTOTYPES): Substitute empty or ansi2knr for
2413 ANSI2KNR, depending on the fact the compiler is ANSI or not.
2414 * src/Makefile.in: Use -Ovarargs=convert on ansi2knr calls.
2415 Remove the sed filter after ansi2knr for debug.c. Use $O instead
2416 of $U, put underline in extensions rather than in basenames. Use
2417 implicit rules, now that regularity makes this possible.
2418 Have $(OBJECTS) depend on $(ANSI2KNR), so to trigger compilation
2419 of ansi2knr whenever it is needed.
2420 * configure.in: Adjusted for correct STACKOVF substitution.
2421 * src/debug.c (trace_format): When not __STDC__, use (...) as a
2422 parameter list, so ansi2knr will convert it to (va_alist) va_dcl.
2423 Reported by David MacKenzie.
2425 * Makefile.in: Remove binprefix. Use transform_name instead.
2426 Reported by David MacKenzie.
2428 * doc/Makefile.in: Create version.texi, use it, clean it.
2429 Reported by Jim Meyering.
2431 Fri Oct 28 20:33:55 1994 Francois Pinard (pinard@icule)
2433 * Makefile.in (all, install, uninstall): Depend on Makefile.
2435 * Makefile.in: For actions invoking $(MAKE) from within compound
2436 sh statements, exit non-zero if the sub-make fails. Otherwise,
2437 the top-level make may exit successfully when it should fail.
2438 Reported by Jim Kingdon.
2440 * {,/*}Makefile.in: Use && after all cd, in case they fail.
2442 * {,*/}Makefile.in: Declare PRODUCT and VERSION macros.
2443 (dist): Use PRODUCT and VERSION instead of tricks on .fname.
2444 * configure.in: Substitute PRODUCT and VERSION.
2446 * {,*/}Makefile.in (dist): Always try a hard link before a copy.
2448 Thu Oct 27 22:32:58 1994 Francois Pinard (pinard@icule)
2450 * Makefile.in (mostlyclean-local): Do not remove *~.
2451 * */Makefile.in (mostlyclean): Idem.
2452 Reported by Robert E. Brown and Richard Stallman.
2454 Sun Oct 9 08:30:13 1994 Francois Pinard (pinard@icule)
2456 * src/m4.h: Get rid of CONFIG_BROKETS.
2458 Sun Oct 2 16:48:10 1994 Francois Pinard (pinard@icule)
2460 * configure.in: Use AC_ARG_PROGRAM.
2461 * aclocal.m4 (fp_C_PROTOTYPES): Substitute @kr@ by kr or empty.
2462 Reported by David MacKenzie.
2464 Sat Oct 1 11:22:42 1994 Francois Pinard (pinard@icule)
2466 * configure.in: Do not add -O to CFLAGS for GNU C, now that
2467 configure does it automatically.
2468 Reported by Jim Meyering.
2470 Fri Sep 23 08:16:58 1994 Francois Pinard (pinard@icule)
2472 * src/stackovf.c: Declare the handler_t typedef earlier in the
2473 code, use it for stackovf_handler.
2474 (setup_stackovf_trap): Use RETSIGTYPE instead of void while
2475 casting sigsegv_handler.
2476 Reported by Robert Bernstein.
2478 * src/m4.c (main): Initialize program_name to argv[0] without
2480 Reported by Karl Berry.
2482 Sun Sep 18 11:42:50 1994 Francois Pinard (pinard@icule)
2484 * src/Makefile.in (TAGS): Include a ../lib/TAGS reference.
2485 Reported by Karl Berry.
2487 Wed Sep 14 10:00:22 1994 Francois Pinard (pinard@icule)
2489 * lib/Makefile.in (mostlyclean): Added.
2490 (TAGS): Make in $(srcdir).
2492 * configure.in: Use `choke me' in test, like everywhere!
2494 * {doc,examples,lib,src}/Makefile.in (check): Deleted, as
2495 unreacheable and useless.
2497 * doc/Makefile.in (texclean): Deleted, merged in mostlyclean.
2499 * lib/Makefile.in (DISTFILES): Distribute TAGS.
2500 (distclean): Do not remove TAGS.
2501 (realclean): Remove it.
2502 * Makefile.in: Make TAGS in lib also, not just in src.
2503 Reported by Karl Berry.
2505 * Makefile.in (distclean, realclean): Instead of recursively
2506 calling $(MAKE) for the -local part, allow parallel execution of
2507 -recursive and -local, only delay the removal of config.status,
2508 which is repeated in both goals.
2510 Tue Sep 13 19:21:05 1994 Francois Pinard (pinard@icule)
2513 * Makefile.in: Group all *clean-recursive goals in one, using sed
2514 to remove `-recursive' while calling make recursively. Also, use
2515 a subshell for each recursive $(MAKE).
2516 Reported by Jim Meyering.
2518 * src/m4.h (memcpy): Define with bcopy for BSD systems.
2519 Reported by Kaveh R. Ghazi.
2521 * src/Makefile.in (ansi2knr): Use $(LIBS) while linking, for SunOS
2522 4.1.3 requires -ldl to link even ansik2nr, and we need a way to
2525 * configure.in: Use date instead of touch for stamp-h.
2526 * Makefile.in (stamp-h.in): Idem.
2528 * Makefile.in (distclean, realclean): Force serial execution of
2529 both goals, in case parallel makes are being used.
2530 Reported by Jim Meyering.
2532 * src/Makefile.in (DISTFILES): Distribute TAGS.
2533 (distclean): Do not remove TAGS.
2534 (realclean): Remove it.
2535 Reported by Karl Berry.
2537 Sat Sep 10 12:34:04 1994 Francois Pinard (pinard@icule)
2539 * configure.in: Use fp_ to match aclocal.m4. Revert _OS_ macros
2540 to old names, for following Autoconf.
2542 Thu Sep 8 15:07:27 1994 Francois Pinard (pinard@icule)
2544 * Makefile.in (MDEFINES): Remove INSTALL substitutions, for
2545 ./install.sh will not be correctly referred to in sub-Makefiles.
2546 Reported by John David Anglin.
2548 * doc/Makefile.in (texclean): Remove *.cps and *.fns too.
2549 Reported by Eric Backus.
2551 * Makefile.in, checks/Makefile.in, doc/Makefile.in,
2552 examples/Makefile.in, lib/Makefile.in, src/Makefile.in: Limit
2553 config.status into remaking this directory's Makefile only.
2554 * Makefile.in (stamp-h): Do not check nor touch stamp-h.
2555 * configure.in (AC_OUTPUT): Touch stamp-h if CONFIG_HEADERS.
2556 Reported by Jim Meyering.
2558 Tue Sep 6 12:07:33 1994 Francois Pinard (pinard@icule)
2560 * configure.in: Correct stack overflow detection logic, taking
2561 care of systems having only incomplete implementations (like for
2562 Pyramid 9820 OSx 5.0d).
2563 Reported by Kaveh R. Ghazi.
2565 * src/Makefile.in (TAGS): Remote -t from etags call.
2567 Fri Sep 2 10:37:10 1994 Francois Pinard (pinard@icule)
2569 * lib/Makefile.in (install): Depend on all.
2571 Wed Aug 31 11:17:21 1994 Francois Pinard (pinard@icule)
2573 * examples/Makefile.in (mostlyclean): Do not depend on texclean.
2574 Reported by Jim Meyering and John David Anglin.
2576 * Makefile.in (distclean-local): Delete config.log.
2577 Reported by Jim Meyering.
2579 Solidify frozen files with respect to -P:
2580 * src/m4.c: Have -P set prefix_all_buitins variable instead of
2581 calling a function by that name. Declare the variable.
2582 * src/m4.h: Adjust declaration for prefix_all_buitins.
2583 * src/builtin.c (builtin_init): Merge in functionality from
2584 previous prefix_all_buitins function, while making entries in the
2585 symbol table, but not modifying the builtin description itself.
2587 * src/freeze.c (reload_frozen_state): Add a useless `break;',
2588 because *many* compilers do not accept an empty `default:'.
2589 Reported by Akiko Matsushita, Eric Backus, John David Anglin,
2590 Joseph E. Sacco, Kaveh R. Ghazi, Tom McConnell and Ulrich Drepper.
2592 * configure.in: Use AC_TYPE_SIGNAL.
2593 * src/stackovf.c (setup_stackovf_trap): Use RETSIGTYPE.
2594 Reported by Robert Bernstein.
2596 * checks/Makefile.in (check): Modify PATH so check-them will find
2597 m4 in the src directory.
2598 * Makefile.in (check): Don't.
2599 Reported by Akiko Matsushita and Jim Meyering.
2601 * src/output.c (make_room_for, output_character_helper): New
2602 functions, for implementing a global MAXIMUM_TOTAL_SIZE instead of
2603 a per buffer MAXIMUM_BUFFER_SIZE.
2605 * src/output.c (output_text): New function, for optimizing the
2606 output of strings of characters. Use it.
2608 Tue Aug 30 01:44:29 1994 Francois Pinard (pinard@icule)
2610 * doc, src: New directories reorganizing the distribution.
2611 * doc/Makefile.in, src/Makefile.in, examples/Makefile.in: New
2613 * Makefile.in: Adjusted.
2614 * configure.in: Configure new Makefiles.
2616 * m4.h: Declare STRING typedef. Use it for comment and quote
2617 strings, adjusting all references. (This is the rudiments of a
2618 beginning for the eventual withdrawal of NUL terminated strings.)
2619 * output.c (shipout_text): Accept a length parameter, and use it.
2620 All callers adjusted.
2622 Mon Aug 29 12:27:19 1994 Francois Pinard (pinard@icule)
2624 * m4.h: Include <unistd.h> if it exists.
2625 * stackovf.c: Don't.
2627 Clean up for current_diversion variable:
2628 * output.c: Move current_diversion from builtin.c.
2629 * m4.h: Declare current_diversion so builtin.c can access it.
2630 * output.c (output_init, make_diversion): Initialize or update
2632 * builtin.c (builtin_init, m4_divert): Leave current_diversion
2635 Remove limit on number of diversions:
2636 * output.c: Replace ndiversion by diversions, declare it.
2637 (output_init): Allocate only diversion 0.
2638 (make_diversion): Allocate new diversions as needed.
2639 * m4.h, m4.c: Remove NDIVERSIONS and ndiversion related stuff.
2640 * m4.c: Still accept -N, but do nothing with it.
2641 Reported by David MacKenzie.
2644 * output.c (freeze_diversions): New function.
2645 * m4.h: Declare freeze_diversions.
2646 * freeze.c: Document frozen file format, revise it, call
2647 freeze_diversions to add diversions to frozen format, and code to
2648 reload them properly.
2649 * m4.c: Do not undivert automatically at end when status being
2650 frozen. Do not call builtin_init when reloading frozen state.
2652 Speed up diversion processing:
2653 * output.c: Add INITIAL_BUFFER_SIZE, MAXIMUM_BUFFER_SIZE,
2654 COPY_BUFFER_SIZE, in-memory diversion buffers, struct diversion
2655 structure and variables, cached variables out of output_diversion,
2656 reallocate_diversion_for and OUTPUT_CHARACTER.
2657 (shipout_text, make_diversion, insert_diversion): Adapted to new
2659 (insert_file): Use better buffering.
2660 Reported by David MacKenzie.
2662 Sun Aug 28 05:20:02 1994 Francois Pinard (pinard@icule)
2664 * Makefile.in, lib/Makefile.in, checks/Makefile.in: Arrange so
2665 dist works from another build directory.
2667 Sat Aug 27 14:32:45 1994 Francois Pinard (pinard@icule)
2669 * symtab.c (hack_all_symbols): Use hash_table_size instead of
2670 constant HASHMAX, for -H option to work better.
2672 * builtin.c (DECLARE): Simplify by using _ ().
2674 * freeze.c: New file.
2675 * Makefile.in: Compile it, distribute it.
2676 * m4.c: Recognize, document and process --freeze-state (-F) and
2677 --reload-state (-R) options. Pass a true flag to builtin_init
2678 only if no reloading some state.
2679 * builtin.c (define_builtin): Remove static specifier.
2680 (find_builtin_by_name): Remove static specifier.
2681 (builtin_init): Accept and obey a flag argument.
2682 * m4.h: Add declarations for freeze.c, changes for builtin.c.
2684 Wed Aug 24 16:14:19 1994 Francois Pinard (pinard@icule)
2686 * builtin.c (dumpdef_cmp): Rewrite so the cast protect the const
2689 * configure.in: Implement --with-dmalloc.
2690 * acconfig.h: Document WITH_DMALLOC.
2691 * m4.h: Add code for when WITH_DMALLOC.
2693 Mon Aug 15 12:38:05 1994 Francois Pinard (pinard@icule)
2695 * m4.c (long_options): Use "error-output", the dash was missing.
2696 Reported by Akiko Matsushita.
2698 Fri Aug 12 16:38:01 1994 Francois Pinard (pinard@icule)
2700 * m4.h: Include <sys/types.h>.
2701 * builtin.c, debug.c, m4.c, output.c, stackovf.c: Don't.
2702 * m4.h: Declare len_lquote and len_rquote as size_t, not int.
2704 * input.c: Declare len_lquote, len_rquote, len_bcomm and len_ecomm
2706 * builtin.c (dump_args): Declare len as size_t, not int.
2708 * debug.c: Prototype the forward declaration of debug_set_file.
2710 * builtin.c (m4_undivert): Replace div by file, for avoiding the
2711 shadowing of this variable.
2712 * output.c (insert_diversion): Idem.
2714 * input.c: Delete def_rquote, def_lquote, def_bcomm and def_ecomm.
2715 (input_init): Duplicate default quote and comment strings.
2716 (set_quotes): Free previous quote strings in all cases. Duplicate
2717 even default quote strings.
2718 (set_comment): Free previous comment strings in all cases.
2719 Duplicate even default comment strings.
2721 * configure.in: Updated for Autoconf 2.0.
2722 * Makefile.in (distclean-local): Also delete config.cache.
2724 * m4.c (usage): Reorganize the --help output by topic. Include a
2725 description for debugging flags.
2727 Fri Jul 29 10:15:52 1994 Francois Pinard (pinard@icule)
2729 * configure.in: If sigaction is available and SA_ONSTACK defined,
2730 use sigaction. Otherwise, if sigvec is available and SV_ONSTACK
2731 defined, use sigvec. Else don't compile stackovf.c.
2732 * stackovf.c (setup_stackovf_trap): Idem.
2733 Reported by Jim Avera, Karl Berry, Kaveh R. Ghazi, Matthias Rabe
2736 Thu Jul 21 22:43:17 1994 Francois Pinard (pinard@icule)
2738 * m4.c (usage): Replace printf par fputs.
2740 Mon Jul 18 23:48:23 1994 Francois Pinard (pinard@icule)
2744 Sun Jul 17 08:08:25 1994 Francois Pinard (pinard@icule)
2746 * configure.in: Check for sigaction and sigvec. Add a new delayed
2747 check for RLIMIT_STACK, combine in the checking for getrlimit.
2748 All those things are not universally available.
2749 * stackovf.c: Split setting up the trap handler and catching
2750 signals, for better taking care of various configure outcomes.
2751 * examples/stackovf.sh: Correct a typo.
2752 Reported by Eric Backus, Jim Avera and Jim Meyering.
2754 Sat Jul 16 20:36:19 1994 Francois Pinard (pinard@icule)
2756 * ansi2knr.c: New version sent by its author, Peter Deutsch.
2758 Fri Jul 15 14:36:21 1994 Francois Pinard (pinard@icule)
2760 * Makefile.in: Modify so parallel make will not try making
2761 lib/libm4.a twice simultaneously.
2762 Reported by Jim Meyering.
2764 Thu Jul 14 17:23:17 1994 Francois Pinard (pinard@icule)
2766 * stackovf.c (setup_stackovf_trap): Replace "Don't" by "Do not" in
2767 error message, for when no code possibility exists. Even if this
2768 line is completely #ifdef'ed out, it brings a syntax error.
2769 Reported by Andreas Schwab, Jim Meyering and Joseph E. Sacco.
2771 * Makefile.in (install): Have install depend on all too, for lib
2772 to be remade as needed.
2774 * examples/stackovf.sh: Try ksh, bsh and bash for shells
2775 providing ulimit, instead of using only ksh.
2776 Reported by Jim Avera and Joseph E. Sacco.
2778 Tue Jul 12 06:54:31 1994 Francois Pinard (pinard@icule)
2780 * Makefile.in (check): Have it depend on all instead of m4. In
2781 this way, a change in lib will be detected and processed.
2783 * builtin.c (numeric_arg): Use strtol and verify the conversion,
2784 instead of using sscanf which stops as soon as there is a
2785 non-digit in the input. Previously, incr(1xyzzy), eval(1,2xyzzy)
2786 and divert(1xyzzy) were all accepted without any warning or error
2788 * m4.h: Declare strtol as long if not including stdlib.h.
2789 * configure.in: Check for limits.h, and replace strtol if missing.
2790 * lib/Makefile.in: Substitute LIBOBJS. Distribute strtol.c.
2791 * lib/strtol.c: New file, from elsewhere.
2792 Reported by Andreas Schwab.
2794 Thu Jul 7 22:38:10 1994 Francois Pinard (pinard@icule)
2796 * macro.c (expand_macro): Cast value to (boolean) prior to
2797 assigning it to traced.
2798 Reported by Tom McConnell.
2800 * Makefile.in (m4): Always make all in lib first.
2801 Reported by Jim Meyering.
2803 Wed Jul 6 13:16:31 1994 Jim Avera (jima@netcom.com)
2805 * stackovf.c: Isolated OS-dependent sections; Improved portability,
2806 adding support for SunOS/BSD (sigvec, sigstack, and 4-parameter signal
2807 handlers), and a default error message if the fault address is not
2808 available (when neither siginfo.h nor BSD sigcontext are supported).
2809 * configure.in: Changes for stackovf.h: Check for sigcontext,
2810 sigaction, sigstack, and define rlim_t as int if necessary.
2811 * acconfig.h: Added HAVE_SIGCONTEXT and rlim_t.
2812 * examples/stackovf.sh: Run m4 -L99999999 to allow stack overflow.
2813 * ansi2knr.c: Fix for func-ptr args; convert "..." to varargs syntax.
2815 Tue Jul 5 19:13:54 1994 Francois Pinard (pinard@icule)
2817 * configure.in: Use AC_SET_MAKE.
2818 * Makefile.in: Use @SET_MAKE@.
2819 Reported by Jim Meyering.
2821 * checks/check-them: Do not trap on SIGQUIT or SIGALRM.
2822 Reported by Ian Taylor.
2824 Sat Jul 2 00:58:47 1994 Francois Pinard (pinard@icule)
2826 * configure.in: Remove dependency of USE_STACKOVF on STDC_HEADERS,
2827 because siginfo.h is unrelated to standard headers, and siginfo.h
2828 is already checked for.
2829 Reported by Joseph E. Sacco.
2831 * acconfig.h, aclocal.m4, m4.h: Replace HAVE_PROTOTYPES by
2833 * aclocal.m4, configure.in: Replace AC_HAVE_PROTOTYPES by
2836 Wed Jun 29 22:41:53 1994 Francois Pinard (pinard@icule)
2838 * builtin.c (substitute): Use \& to represent this part of the
2839 string which was matched by the whole regexp, instead of
2840 representing the whole string. Any usage of \0 issues a warning
2841 and acts like \&, it will disappear in some subsequent release.
2843 Mon Jun 27 14:24:23 1994 Francois Pinard (pinard@icule)
2845 * m4.c: Complete prototype for forwarded declaration of usage.
2847 * input.c (init_macro_token): Correct own reference in error
2848 message. Previous name get_macro_func was referred to instead.
2849 (next_char): Correct own reference in error message. Previous
2850 name advance_input was referred to instead.
2852 * m4.h: Declare eval_t and unsigned_eval_t typedefs to 32 bits.
2853 * eval.c (logical_or_term, logical_and_term, or_term, xor_term,
2854 and_term, not_term, logical_not_term, cmp_term, shift_term,
2855 add_term, mult_term, exp_term, unary_term, simple_term): Add
2856 prototype to forwarded declarations. Declare parameter v1 as
2857 eval_t * instead of int *. Same for local variable v2 in dyadic
2858 functions. Same for result in exp_term.
2859 * builtin.c (m4_eval): Declare value as eval_t instead of int.
2860 (ntoa): Declare value as eval_t instead of int. Declare uvalue as
2861 unsigned_eval_t instead of unsigned int. Change casts accordingly.
2862 (shipout_int): Cast first argument of ntoa to eval_t.
2863 Reported by Thorsten Ohl.
2865 * macro.c: Complete the prototypes of forwarded expand_macro and
2867 Reported by Thorsten Ohl.
2869 * m4.h: Define voidstar as void * or char * depending on __STDC__.
2870 The Ultrix 3.1 compiler cannot do much with void pointers.
2872 * builtin.c (dumpdef_cmp): Replace void * by voidstar.
2873 * m4.c (xfree): Replace void * by voidstar.
2874 Reported by Tom McConnell.
2876 * ansi2knr.1: New, from elsewhere.
2877 * Makefile.in (DISTFILES): Distribute ansi2knr.1
2879 * Makefile.in (stamp-h.in): Avoid running ./config.status if
2880 stamp-h does not exist yet. This avoids running it a second time
2881 just after the initial ./configure.
2882 Reported by David MacKenzie and Tom McConnell.
2884 * m4.h: Replace the enum debug_info declaration with a series of
2885 #define's. The Ultrix 3.1 compiler would otherwise need casting
2886 (int) to most references, when used in expressions.
2887 Reported by Tom McConnell.
2889 Sat Jun 25 00:10:05 1994 Francois Pinard (pinard@icule)
2891 * aclocal.m4: Replace FP_PROTOTYPES by AC_HAVE_PROTOTYPES,
2892 following an idea from Brook G. Milligan. AC_HAVE_PROTOTYPES
2893 calls the compiler. Previously, FP_PROTOTYPES was only calling
2894 the preprocessor; by not being subject to CFLAGS, this was
2895 discouraging those flags asking for ANSI compilation.
2896 * acconfig.h: Document HAVE_PROTOTYPES.
2897 * configure.in: Use AC_HAVE_PROTOTYPES instead of FP_PROTOTYPES.
2898 * m4.h: Define _() according to HAVE_PROTOTYPES, not __STDC__.
2899 Reported by Eric Backus.
2901 * configure.in: Substitute CFLAGS and LDFLAGS, taking their value
2902 from the environment. Default CFLAGS to -g if not set.
2903 * Makefile.in: Have CFLAGS and LDFLAGS substituted from configure.
2904 * lib/Makefile.in: Have CFLAGS substituted from configure.
2905 Reported by Eric Backus and Tom McConnell.
2907 * configure.in: m4_undefine changeword before using AC_ENABLE.
2909 * m4.h: Declare prototypes for error (for ANSI compilers only),
2910 prefix_all_builtins and reference_error.
2911 Reported by Tom McConnell.
2913 * input.c (set_word_regexp): Do not try to initialize the array
2914 test from a string, this does not work with non-ANSI compilers.
2915 Reported by Eric Backus.
2917 * Makefile.in (dist): Clean examples/ before saving it.
2918 (distclean-local): Also remove stamp-h.
2919 Reported by Eric Backus.
2921 * Makefile.in (_stackovf.c): Goal for compiling stacokovf.c with
2923 Reported by Tom McConnell.
2925 * checks/Makefile.in (clean): Depends on mostlyclean.
2926 (mostlyclean): New goal.
2928 Fri Jun 24 23:30:31 1994 Francois Pinard (pinard@icule)
2930 * Makefile.in (DISTFILES): Distribute install.sh.
2931 * install.sh: New file, copied from elsewhere.
2932 Reported by Assar Westerlund and Kaveh R. Ghazi.
2934 Thu Jun 23 00:00:30 1994 Francois Pinard (pinard@icule)
2936 * configure.in: Define ENABLE_CHANGEWORD if --enable-changeword.
2937 * acconfig.h: Explain ENABLE_CHANGEWORD.
2939 [These modifs all depend upon ENABLE_CHANGEWORD and are adapted
2940 from code provided by Pete Chown]
2941 * m4.h: Add original_text field to u_t variant of union u.
2942 Declare TOKEN_DATA_FUNC macro.
2943 * builtin.c: Declare changeword.
2944 (m4_changeword): New function.
2945 * input.c: Include "regex.h", define variables with word regexps.
2946 (input_init): Initialize the word regexp.
2947 (set_word_regexp): New.
2948 (next_token): Declare local variables, use the previous code if
2949 default_word_regexp is true. Else, match using a new code. Save
2951 * macro.c (expand_token): Ship out original text if not a macro
2953 Reported by Krste Asanovic and Pete Chown.
2955 [These modifs all depend upon ENABLE_CHANGEWORD]
2956 * m4.h: Declare external user_word_regexp.
2957 * m4.c: Declare user_word_regexp, and initialize it from
2958 --word-regexp or -W, or NULL if not specified.
2959 * input.c: Use user_word_regexp if specified, instead of
2960 DEFAULT_WORD_REGEXP.
2962 * Makefile.in (m4): Revert Jan 3 1994 change. I'm unable to
2965 * Makefile.in, lib/Makefile.in: Limit suffixes to .c and .o.
2966 * checks/Makefile.in: Empty the suffix list.
2967 Reported by Geoff Russell, Joel Sherrill and Roland McGrath.
2969 * m4.c: Declare nesting_limit and initialize it to 250.
2970 Implement -LNUMBER or --nesting-limit=NUMBER to change its
2972 * m4.h: Declare nesting_limit as external.
2973 * macro.c (expand_macro): Stop execution whenever nesting limit
2975 Reported by Bengt Mertensson.
2977 * eval.c (evaluate): Diagnose excess characters in eval input.
2978 Things like `eval(08)' used to return 0 with no diagnostic.
2980 * m4.h: Capitalize first letter of all macro arguments in
2983 * m4.c: Declare warning_status, initialize it to 0. Add new
2984 option -E, or --fatal-warnings, which sets warning_status to
2985 EXIT_FAILURE instead.
2986 * m4.h: Declare external warning_status. Define EXIT_SUCCESS and
2987 EXIT_FAILURE if not otherwise done by header files.
2988 * m4.c: Delete declarations for EXIT_SUCCESS and EXIT_FAILURE.
2989 * m4.c, input.c, output.c, symtab.c, builtin.c, macro.c, debug.c,
2990 eval.c: Replace 0 by warning_status and 1 by EXIT_FAILURE in first
2991 argument of all M4ERROR calls.
2992 Reported by Noah Friedman.
2994 * examples/incl-test.m4: Renamed from incl_test.m4.
2995 * examples/include.m4: Include incl-test.m4 instead of
2997 * examples/multiquotes.m4: Renamed from multi-quotes.m.
2999 Wed Jun 22 21:58:54 1994 Francois Pinard (pinard@icule)
3001 * configure.in: Avoid USE_STACKOVF if <siginfo.h> not found. Note
3002 that Jim developped stackovf.c on a 486 running SVR4.0 (ESIX), and
3003 also tested it on a Sun Sparc workstation running SunOS 4.x.
3005 * format.c (format): When not HAVE_EFGCVT, m4 was failing the
3006 49.format check, abusing a `union values' argument with sprintf
3007 without selecting the proper field. Now, save the formatting type
3008 first, delaying the fetch of the corresponding argument.
3009 Reported by Joseph E. Sacco and Tom Quinn.
3011 * format.c (format): Remove const from char *fmt declaration when
3012 not HAVE_EFGCVT, because a NUL may be forced into it.
3014 * m4.h: Declare atof() when not STDC_HEADERS.
3015 Reported by Joseph E. Sacco.
3017 * Regenerate configure using Autoconf 1.11, this corrects a
3018 problem about an incorrect cpp seting on NeXT 3.1.
3019 Reported by Alexander Lehmann.
3021 Sun Jun 5 16:25:19 1994 Francois Pinard (pinard@icule)
3023 * m4.h (_): Change argument from `x' to `Args'.
3025 Wed May 4 23:59:39 1994 Francois Pinard (pinard@icule)
3027 * Makefile.in: Remove all occurrences of $(MFLAGS), which were
3028 bringing more evil than good on a few systems.
3029 Reported by Greg A. Woods.
3031 Fri Apr 22 15:59:35 1994 Francois Pinard (pinard@icule)
3033 * m4.h: Rename Args() to _().
3034 * m4.h: Remove extern specifier from all function declarations.
3036 Fri Apr 22 15:51:21 1994 Jim Avera (jima@netcom.com)
3038 * stackovf.c: New file implementing stack-overflow detection.
3039 * configure.in: Check for getrlimit, sigaction. If all of
3040 standard headers, getrlimit and sigaction, define USE_STACKOVF and
3041 substitute ${U}stackovf.o for STACKOVF.
3042 * acconfig.h: Declare USE_STACKOVF.
3043 * Makefile.in: Distribute stackovf.c, link with $(STACKOVF).
3044 * m4.h: Declare setup_stackovf_trap().
3045 * m4.c: Call setup_stackovf_trap().
3046 * tests/stackovf_test.sh: New file.
3048 Wed Apr 13 14:10:30 1994 Francois Pinard (pinard@icule)
3050 * checks/Makefile.in: Rename .all-stamp to stamp-checks.
3052 * Makefile.in (Makefile, etc.): Adapt for Autoconf 1.8.
3054 Sun Jan 30 14:24:19 1994 (pinard at icule)
3056 * m4.h: Remove definition of volatile, not used anymore.
3057 Reported by Jim Meyering and Joseph E. Sacco.
3059 * m4.h: Consistently use `do { ... } while (0)' in macros, instead
3060 of `if ... else /* nothing */' for if macros.
3061 Reported by Jim Meyering.
3063 * builtin.c (m4_regexp): Reorganize the code for avoiding a
3064 warning from gcc about `repl' possibly used before defined.
3065 Reported by Jim Meyering.
3067 * m4.h: Avoid a pre-ANSI <memory.h> together with <string.h>.
3068 Reported by Jim Meyering.
3070 Tue Jan 25 18:39:37 1994 Francois Pinard (pinard at icule)
3072 * m4.h: Move the conditional definition of volatile after the
3073 inclusion of system files, because they may define it first.
3075 Tue Jan 4 19:46:50 1994 Francois Pinard (pinard@icule)
3077 * checks/Makefile.in (CHECKS): Add a useless `*' before `[', to
3078 get around a problem with Alpha make seeing a syntax error, there.
3079 Reported by Vern Paxson.
3081 Mon Jan 3 00:21:45 1994 Francois Pinard (pinard@icule)
3083 * Makefile.in: Do not define LDFLAGS, use CFLAGS on link calls.
3084 Reported by Richard Stallman.
3086 Sat Dec 25 08:06:05 1993 Francois Pinard (pinard@icule)
3088 * configure.in: Correct test for strerror, AC_FUNC_CHECK was used
3089 instead of AC_HAVE_FUNCS.
3090 Reported by Noah Friedman.
3092 Wed Dec 1 09:37:53 1993 Francois Pinard (pinard@icule)
3094 * m4.c: Initialize show_help and show_version to zero.
3096 * m4.c: Ensure EXIT_SUCCESS and EXIT_FAILURE are defined.
3097 Use them in exit() and usage() calls.
3099 Sat Nov 27 10:43:24 1993 Francois Pinard (pinard@icule)
3101 * m4.h: Delete extern sys_nerr, sys_errlist declarations, and
3102 syserr() macro. Delete errref, add reference_error and M4ERROR.
3103 * m4.c: Replace errref, which was returning an input reference
3104 string, with reference_error, which prints it on standard error.
3105 * builtin.c, output.c: Use errno as second parameter to error,
3106 instead of using syserr() with %s.
3107 * *.c: Use M4ERROR instead of error: no more errref() with %s.
3108 Doing so, the program name appears after the input reference
3109 instead of before, which eases M-x next-error processing.
3111 Wed Nov 24 22:16:15 1993 Francois Pinard (pinard@icule)
3113 * checks/get-them: Escape braces with backslashes in patterns,
3114 because HPUX-9.01 awk needs this.
3115 Reported by Jim Meyering.
3117 Mon Nov 22 10:55:52 1993 Francois Pinard (pinard@icule)
3119 * builtin.c: Declare "FILE *popen ();".
3121 * m4.h: Remove MESSAGE{,1,2}, WARNING1, FATAL{,1}, INTERNAL_ERROR
3122 macros, replace error_message_prefix() declaration by errref()'s.
3123 Declare xrealloc, for use in errref().
3124 * m4.c: Delete error_message_prefix() function, add errref().
3125 * *.c: Use error() systematically in place of all error macros,
3126 now that error() flushes stdout first. Make needed adjustments.
3128 * m4.h: Remove const in sys_errlist[] declaration, it creates
3129 conflicts on SGI and Alpha.
3130 Reported by Kaveh R. Ghazi.
3132 Sat Nov 20 08:26:15 1993 Francois Pinard (pinard@icule)
3134 * m4.c: Include <getopt.h> instead of "getopt.h".
3136 * configure.in: Output to config.h. Use HAVE_FUNCS preferably.
3137 * acconfig.h: New, for documenting HAVE_EFGCVT.
3138 * Makefile.in: Distribute acconfig.h, .stamp-h.in and config.h.in,
3139 use them wherever appropriate. Also use -I. for compilations.
3140 * lib/Makefile.in: Use -I.. for compilations.
3141 * *.c: Include <config.h> or "config.h".
3143 * m4.h: Test for HAVE_MEMORY_H instead of NEED_MEMORY_H.
3144 * configure.in: Use AC_HAVE_HEADERS(memory.h), delete AC_MEMORY_H.
3146 Wed Nov 17 09:34:55 1993 Francois Pinard (pinard@icule)
3148 * builtin.c (m4_eval): Cast strlen to (int) before comparing.
3150 * input.c (input_init): Initialize quote and comment strings
3151 explicitely instead of calling set_quotes and set_comment: by
3152 doing so, we ensure we do not free uninitialized variables.
3154 * checks/check-them: Reverse arguments to both diff, so the
3155 expected is on the left and the obtained on the right.
3157 * m4.h: Add MESSAGE{,1,2}, WARNING1, FATAL{,1} and INTERNAL_ERROR
3158 macros. Delete declarations for m4error, warning, fatal and
3159 internal_error, add declaration for error_message_prefix.
3160 * m4.c: Delete m4error, warning, fatal and internal_error
3161 routines, add error_message_prefix routine.
3162 * *.c: Replace m4error routine calls with MESSAGE* macro calls,
3163 warning with WARNING*, fatal with FATAL* and internal_error with
3165 * Makefile.in (_m4.c): Do not adjust ansi2knr output for va_alist,
3166 this is not needed anymore.
3168 * m4.h: Declare extern FILE *debug. Add DEBUG_PRINT{1,3} and
3169 DEBUG_MESSAGE{,1,2} macros. Delete declarations for debug_print
3170 and debug_message, add declaration for debug_message_prefix.
3171 * debug.c: Remove static specifier for FILE *debug declaration.
3172 Delete debug_print and debug_message routines, add
3173 debug_message_prefix routine.
3174 * builtin.c, debug.c: Replace debug_print routine calls with
3175 DEBUG_PRINT* macro calls.
3176 * input.c, path.c: Replace debug_message routine calls with
3177 DEBUG_MESSAGE* macro calls.
3179 * m4.h: Remove inclusion of <varargs.h>.
3180 * debug.c: Include <stdarg.h> or <varargs.h>.
3181 (trace_format): Use stdarg instead of varargs if __STDC__.
3183 * configure.in: Remove checks for vfprintf and _doprnt. These
3184 implementations use varargs tricks which are not portable enough.
3185 * lib/vfprintf.c: Deleted.
3186 * lib/_doprnt.c: Deleted.
3187 * lib/Makefile.in: Adjusted accordingly. Remove LIBOBJS.
3188 Reported by Joel Sherrill.
3190 * path.c (add_include_directory): Use xstrdup.
3192 * builtin.c (find_builtin_by_name): Declare static.
3194 * *.[ch]: Add const to a few "char *" declarations.
3196 * configure.in: Remove commented tests for fileno() and fstat().
3197 * debug.c: Remove comments about HAVE_FILENO and HAVE_FSTAT.
3199 * debug.c (debug_flush_files): New.
3200 * m4.h: Declares it.
3201 * builtin.c (m4_syscmd, m4_esyscmd): Use it.
3202 Reported by Nicolas Pioch.
3204 Fri Nov 12 10:02:26 1993 Francois Pinard (pinard@icule)
3206 * Makefile.in (m4.dvi): Use m4.texinfo instead of m4.texi.
3207 Reported by Joel Sherrill.
3209 * builtin.c (prefix_all_builtins): Instead of the table size, use
3210 the null entry at end for stopping the loop. It was overwritten.
3211 Reported by Andreas Schwab and Jim Meyering.
3213 * builtin.c (prefix_all_builtins): Cast xmalloc to (char *).
3214 Reported by Kaveh R. Ghazi.
3216 * macro.c (call_macro): Add * in (*SYMBOL_FUNC (sym)) (...).
3217 Reported by Karl Vogel.
3219 Tue Nov 9 09:31:47 1993 Francois Pinard (pinard@icule)
3221 * m4.h: Do not define volatile if already defined.
3222 Reported by Rene' Seindal.
3224 * lib/Makefile.in: Add a forgotten ALLOCA=@ALLOCA@. Grrr!
3226 Reported by Bernhard Daeubler, Eric Backus, Hal Peterson, Hoang
3227 Uong, Ian Taylor, Kaveh R. Ghazi, Tom McConnell and Walter Wong.
3229 Mon Nov 8 21:11:44 1993 Francois Pinard (pinard@icule)
3231 * m4.h: Define strchr and strrchr in terms of index and rindex,
3232 instead of the other way around.
3233 * builtin.c, m4.c, path.c: Use strchr instead of index.
3235 * input.c (next_char): Remove a "break;" after a "return ...;".
3236 Reported by Tom McConnell.
3238 Mon Nov 8 12:45:34 1993 Francois Pinard (pinard@icule)
3242 * configure.in: Do not copy check files in the build hierarchy.
3243 * checks/check-them: Identify the m4 version being checked. For
3244 finding m4, look in $PATH instead of in the parent directory.
3245 * Makefile.in (check): Prepend `pwd` to $PATH before checking.
3246 * checks/Makefile.in (.all-stamp): Always create check files in
3247 the source hierarchy, not anymore in the build hierarchy.
3248 (check): cd to the source hierarchy before performing checks.
3249 Do not copy nor clean COPYING anymore, take it from `..'.
3250 Reported by Tom McConnell.
3252 * Makefile.in (Makefile): Use $(SHELL).
3253 (config.status): Use $(SHELL). Use "config.status --recheck"
3254 instead of "configure --no-create", which is obsolete.
3255 Reported by Tom McConnell.
3257 Fri Nov 5 09:49:30 1993 Francois Pinard (pinard@compy.IRO.UMontreal.CA)
3259 * m4.c (usage): Use "%s" instead of "m4" in format string.
3260 Reported by Jim Meyering.
3262 * Makefile.in: Distribute mkinstalldirs.
3263 Reported by Pierre Gaumond.
3264 Reported by Jim Meyering.
3265 Reported by Tom McConnell.
3266 Reported by Andreas Gustafsson.
3268 * checks/check-them: Renamed from checks/check_them.
3269 * checks/get-them: Renamed from checks/get_them.
3270 * checks/.all-stamp: Renamed from checks/.all_stamp.
3271 * checks/Makefile.in: Changed accordingly.
3272 Reported by Jim Meyering.
3274 Thu Nov 4 13:50:52 1993 Francois Pinard (pinard@lagrande.IRO.UMontreal.CA)
3276 * lib/Makefile.in (dist): Correct permissions on files.
3278 * output.c: Declare tmpfile, some systems don't.
3280 Wed Nov 3 09:09:16 1993 Francois Pinard (pinard@icule)
3282 * checks/Makefile.in (dist): Correct permissions on files.
3284 * Makefile.in (dist): Ensure recursive linking for subdirectory
3285 `examples', also set read/write permissions on all its files.
3287 * mkinstalldirs: New, from elsewhere.
3288 * Makefile.in: Use it.
3290 * debug.c: Synchronize debug messages and regular output when
3291 the debug file and stdout are redirected to the same file.
3292 * configure.in: Add (commented) checks for fileno and fstat.
3293 Reported by Jim Avera.
3295 * builtin.c (m4_ifelse): Diagnose excess arguments if 5, 8, 11,
3296 etc., arguments, then ignore the superfluous one. m4 used to
3297 diagnose missing arguments and return the empty string.
3298 Reported by Nick S. Kanakakorn.
3300 Tue Nov 2 00:55:41 1993 Francois Pinard (pinard@icule)
3302 * m4.c (main): At end of all input, ensure all undiverted text
3303 goes to the main output stream.
3304 Reported by Andreas Gustafsson.
3306 * m4.c (main): exit (0), instead of return 0.
3308 * m4.c: Implement -P and --prefix-builtins.
3309 * builtin.c: Delete const specifier on builtin_tab.
3310 (prefix_all_builtins): New.
3311 Reported by Noah Friedman.
3312 Reported by Scott Bartram.
3314 * c-boxes.el: New, from elsewhere.
3315 * Makefile.in: Distribute it.
3317 * m4.h: Do not define bcopy if <string.h> defines it.
3318 Reported by Stephen Perkins.
3320 * builtin.c (define_macro): Allow a missing second argument, in
3321 which case it is implied empty. Affects define and pushdef.
3322 Reported by Eric Allman.
3324 Mon Nov 1 07:45:24 1993 Francois Pinard (pinard@icule)
3326 * m4.h: Add blind_if_no_args in struct builtin, blind_no_args in
3327 struct symbol adn SYMBOL_BLIND_NO_ARGS macro.
3328 * builtin.c: Initialize all the blindness fields in builtin_tab.
3329 (define_builtin): Copy the blindness of a builtin into its symbol.
3330 * macro.c (expand_token): Avoid processing a blind builtin if the
3331 next character is not an opening parenthesis.
3332 Reported by David MacKenzie.
3333 Reported by Noah Friedman.
3335 * configure.in: Ensure an exit status of 0 on completion.
3336 Reported by Vivek P. Singhal.
3338 * eval.c (eval_lex): Admit both lower and upper case letters for
3339 bases greater than 10. Only lower case letters were accepted.
3341 * eval.c (eval_lex): Recognize 0bDIGITS and 0rRADIX:DIGITS syntax.
3342 Reported by Krste Asanovic.
3344 * eval.c: Rename NOT to LNOT. Add XOR, NOT, LSHIFT and RSHIFT.
3345 * eval.c (logical_not_term): New name for not_term.
3346 * eval.c (xor_term): New, between or_term and and_term.
3347 * eval.c (not_term): New, between and_term and logical_not_term.
3348 * eval.c (shift_term): New, between cmp_term and add_term.
3349 Reported by Krste Asanovic: ~, ^, <<, >>.
3350 Reported by Ben A. Mesander: ** vs ^.
3352 * m4.c: Delete xmalloc.c, xrealloc.c, xstrdup.c.
3353 * m4.h: Delete xrealloc.c.
3354 * lib/xmalloc.c: New, from elsewhere.
3355 * lib/xstrdup.c: New, from elsewhere.
3356 * lib/Makefile.in: Distribute and compile them.
3358 * m4.c: Change progname to program_name.
3359 * builtin.c, eval.c, m4.c, m4.h: Rename error to m4error.
3360 * lib/error.c: New, from elsewhere.
3361 * lib/Makefile.in: Distribute and compile error.c.
3362 * configure.in: Check AC_VPRINTF and for strerror.
3363 * m4.c: Delete cmd_error. Use error instead.
3364 * m4.c: Change label capitalisation to "ERROR", "Warning", etc.
3366 * m4.h: Delete #define const, let Autoconf takes care of this.
3368 * m4.c: Remove all code conditionalized by IMPLEMENT_M4OPTS.
3369 Merge parse_args into main. Declare argv to be `char *const *',
3370 then remove superfluous casts.
3372 * m4.c: Rename --no-gnu-extensions to --traditional.
3373 Reported by Ben A. Mesander.
3375 * m4.c (usage): Add a status parameter. Supply one in various
3376 calls. Add --help processing. Remove -V for --version.
3378 * lib/Makefile.in: Put $(CFLAGS) last in .c.o rule.
3380 * lib/Makefile.in: Have an AR=ar declaration.
3381 Reported by Eric Backus.
3382 Reported by Bjorn R. Bjornsson.
3383 Reported by Tom Tromey.
3384 Reported by Kristine Lund.
3385 Reported by Marion Hakanson.
3387 Sat Oct 30 12:51:47 1993 Francois Pinard (pinard@icule)
3389 * Makefile.in (m4.info): Use -I$(srcdir) on $(MAKEINFO).
3390 Reported by Noah Friedman.
3392 Mon Oct 25 14:58:48 1993 Francois Pinard (pinard@icule)
3394 * Makefile.in: Remove MDEFINES and cleanup.
3396 Wed Jun 9 14:59:46 1993 Francois Pinard (pinard@icule)
3398 * Makefile.in (dist): Replace "echo `pwd`" by a mere "pwd".
3401 Sat Feb 6 14:59:22 1993 Francois Pinard (pinard@icule)
3403 * Makefile.in, lib/Makefile.in, check/Makefile.in: In dist goals,
3404 ensure 777 mode for directories, so older tar's will restore file
3407 Sun Jan 17 15:38:05 1993 Francois Pinard (pinard@icule)
3409 * Makefile.in, lib/Makefile.in: Put $(CFLAGS) after $(CPPFLAGS),
3410 so the installer can override automatically configured choices.
3411 Reported by Karl Berry.
3413 Fri Jan 15 16:07:00 1993 Francois Pinard (pinard@icule)
3415 * lib/vfprintf.c: Stolen from Oleo distribution and adapted. The
3416 previous version was not working properly on m68k-hp-bsd4.3.
3417 Reported by Roland McGrath.
3419 * lib/_doprnt.c: Stolen from Oleo distribution.
3420 * configure.in: Check for _doprnt.c if vfprintf.c selected.
3421 * lib/Makefile.in: Distribute _doprnt.c.
3422 Do not distribute regex.[ch].old anymore.
3424 Fri Jan 1 19:42:23 1993 Francois Pinard (pinard at icule)
3426 * Makefile.in, lib/Makefile.in: Reinstate $(CPPFLAGS), use it.
3427 Richard wants it there.
3429 Sun Dec 27 07:01:54 1992 Francois Pinard (pinard at icule)
3431 * Makefile.in: Add DEFS to MDEFINES.
3432 * lib/Makefile.in (.c.o): Remove $(CPPFLAGS).
3433 (libm4.a): Remove the library before creating it.
3434 (distclean): Remove tags and TAGS too.
3436 Wed Dec 23 12:46:55 1992 Francois Pinard (pinard at icule)
3438 * Makefile.in (dvi, m4.dvi): New goals.
3440 * builtin.c, eval.c, format.c, input.c, m4.[ch], m4.texinfo,
3441 macro.c, output.c, path.c, symtab.c: Change Copyright from
3442 1989-1992 to the explicit enumeration 1989, 1990, 1991, 1992.
3444 * examples/divert.m4: Deleted, this bug has been corrected.
3446 * Makefile.in (texclean, mostlyclean): New goals.
3448 * Makefile.in (clean): Remove clutter from ansi2knr.
3449 Reported by Pierre Gaumond.
3450 Reported by Greg A. Woods.
3452 Sun Dec 20 10:40:20 1992 Francois Pinard (pinard at icule)
3454 * Makefile.in: Remove $(CPPFLAGS) from the .c.o rule. The user
3455 might well use CFLAGS is s/he needs it.
3457 * Makefile.in: Allow installation of info files from a separate
3459 Reported by Jason Merrill.
3460 Reported by David MacKenzie.
3461 Reported by Skip Montanaro.
3462 Reported by Erez Zadok.
3463 Reported by Assar Westerlund.
3465 Sat Dec 19 08:21:34 1992 Francois Pinard (pinard at icule)
3468 This is still a beta release for the future GNU m4 version 1.1.
3470 * lib/alloca.c: New, from elsewhere.
3471 * lib/Makefile.in: Distribute it. Define and use $(ALLOCA).
3473 * m4.h: Do not define index/rindex if already defined. If
3474 FALSE/TRUE are already defined, do not redefine them, but merely
3475 define boolean typedef to int.
3477 * Makefile.in: Use $(DEFS) while compiling ansi2knr.
3478 * ansi2knr.c: Rewrite #ifdef HAVE_STRING_H || STDC_HEADERS,
3479 because some C compilers do not like connectives with #ifdef.
3480 * m4.h: Define `volatile' only if __GNUC__, instead of once for
3481 __GNUC__ and once for __STDC__.
3482 * lib/regex.h: Leave const alone, AC_CONST will take care of it.
3484 * checks/Makefile.in: Use .all_stamp instead of $(CHECKS) for
3485 Makefile dependencies. Without it, make keeps destroying and
3486 remaking $(CHECKS) in a loop (why?). Distribute .all_stamp.
3488 * m4.h, m4.c, builtin.c, output.c: Change all divertion/DIVERTION
3489 to diversion/DIVERSION, this was a spelling error.
3491 * m4.c: Declare version[], remove #include "version.h".
3492 * version.h: Deleted.
3493 * Makefile.in: Remove references to version.h.
3495 * output.c (shipout_text): Centralize all `#line NUM ["FILE"]'
3496 production, by using a simpler and more robust algorithm. This
3497 solves the problem of synclines sometimes written in the middle of
3498 an output line. Delete sync_line() and output_lines variable.
3499 * m4.h: Remove sync_line prototype and output_lines declaration.
3500 * input.c (next_char), output.c (shipout_text): Remove references
3502 * input.c (push_file, pop_file): Merely put the value -1 in
3503 output_current_line instead of calling sync_line, for delaying a
3504 single `#line NUM FILE' before next output line. Do not test
3505 for sync_output, because this is unnecessary clutter.
3506 * output.c (make_divertion, insert_divertion): Idem.
3507 * input.c: Rename must_advance_line to start_of_input_line, for
3510 * debug.c (trace_header): Select a new debug line format, which
3511 better complies with GNU standards for formatting error messages.
3512 With option `-dfl', M-x next-error might be used on the output.
3513 * m4.c (vmesg): Adjust format of error output to GNU standards.
3514 * m4.texinfo: Adjust examples for `make check' to work.
3516 * m4.h, builtin.c, debug.c, input.c, macro.c, path.c: Use upper
3517 case for enum debug_info constants, which were all lower case.
3519 * builtin.c (m4_regexp, m4_patsubst): Use re_search instead of
3521 * lib/regex.[ch]: Use new version from textutils 1.3.6, with some
3522 collected patches. I tried a few times using newer regex.[ch], it
3523 mysteriously stopped aborting with this one. Insecure feeling...
3524 * lib/Makefile.in: Distribute regex.[ch].old, just in case!
3526 Fri Dec 18 11:08:03 1992 Francois Pinard (pinard at icule)
3528 * m4.c: Change `--no-warnings' to `--silent'.
3529 Reported by David MacKenzie.
3531 * m4.c: Put all M4OPTS code upon IMPLEMENT_M4OPTS control, and
3532 leave it off for now. See comment in m4.c for justification.
3533 Reported by David MacKenzie.
3535 * configure.in: Replace AC_USG by AC_HAVE_HEADERS(string.h).
3536 * m4.h, ansi2knr.c, lib/regex.h: Replace USG by HAVE_STRING_H.
3538 * Makefile.in: Add a new `info' goal. Use macro MAKEINFO.
3540 * Makefile.in: Ensure recursive cleaning is done before local
3541 cleaning for all clean goals.
3543 * builtin.c (ntoa): Ensure the value is always interpreted as a
3544 signed quantity, whatever the radix is.
3546 Wed Nov 18 07:57:19 1992 Jim Meyering (meyering@idefix)
3548 * builtin.c, format.c, input.c: Split long lines.
3549 * m4.c: Use typedef macro_definition instead of struct
3551 * symtab.c: Use typedef symbol instead of struct symbol.
3553 Tue Nov 17 01:58:40 1992 Francois Pinard (pinard at icule)
3555 * *.[ch]: Remove all trailing whitespace, in code and comments.
3557 * configure.in: Find some awk.
3558 * Makefile.in: Add $(AWK) to MDEFINES.
3559 * checks/Makefile.in: Transmit $(AWK) to get_them.
3560 * checks/get_them: Use $AWK instead of gawk. Add a close in the
3561 awk script when switching files, because without this, mawk runs
3562 out of file descriptors.
3564 Mon Nov 16 20:42:56 1992 Francois Pinard (pinard at icule)
3566 * Makefile.in (realclean): Delete m4.info*.
3567 Reported by Jim Meyering.
3569 * Makefile.in: Adjust and link with checks/Makefile.
3570 * checks/Makefile.in: New.
3571 * configure.in: Output checks/Makefile.
3573 * checks/get_them: Have the dnl header of each test more
3574 recognizable by next-error, also use a better message.
3576 Mon Nov 16 07:48:52 1992 Jim Meyering (meyering@idefix)
3578 * m4.h [__GNUC__]: Use __volatile__ instead of `volatile.'
3579 And use that only if __GNUC__ since we're using it's GCC-specific
3580 semantics that tell the compiler the associated function doesn't
3583 * builtin.c (substitute): Don't use character as an array index.
3584 (dumpdef_cmp): Make formal arguments `const void *' to avoid
3585 warnings with gcc -W -Wall on systems with qsort prototype.
3586 (m4_errprint): Cast obstack_finish to `char *' to avoid warnings
3589 * eval.c (most functions): Add parentheses to assignments used
3590 as truth values go avoid warnings from gcc -Wall.
3592 * input.c, m4.c, output.c, path.c, symtab.c: Declare static
3593 any functions that don't need external scope.
3595 * builtin.c, debug.c, format.c, m4.c, m4.h, macro.c, symtab.c
3596 (many functions and arrays): Declare `const'.
3598 Sun Nov 15 09:42:09 1992 Francois Pinard (pinard at icule)
3600 * *.[ch]: Rename nil to NULL, using the declaration from <stdio.h>,
3601 removing the declaration from m4.h. Also rename false to FALSE
3604 * lib/Makefile.in (Makefile): New goal.
3606 * Makefile.in, lib/Makefile.in: Add a .c.o rule, so CFLAGS is not
3607 so heavily loaded. It gets more easily overridable, calling make.
3608 Reported by Jim Meyering.
3610 * Makefile.in (dist): Get .fname from the current directory name,
3611 instead of from version.h. I need updating many files manually,
3612 when the version changes, version.h is just one of them.
3614 Sat Nov 14 11:01:20 1992 Francois Pinard (pinard at icule)
3616 * m4.h: Remove the tag `boolean' on the enum introducing typedef
3617 `boolean'. This tag conflicts with <sys/types.h> on SVR4.
3618 Reported by Tom McConnell.
3620 Fri Nov 13 00:12:50 1992 Francois Pinard (pinard at icule)
3622 * m4.texinfo: Correct the examples for 33.divert, 38.divnum,
3623 39.cleardiv, which were describing missing or spurious newlines.
3624 Modify examples 52.eval, 53.esyscmd and 54.sysval so the results
3625 do not depend on machine word size, `/bin/false' implementation,
3626 or `wc' output format. `make check' is more dependable, now.
3628 * checks/check_them: Summarize the failed tests by listing their
3629 name, at end. If none, issue `All checks successful'. Output
3630 `Checking' instead of `Input file:'.
3632 * checks/get_them, checks/check_them: Reindented.
3634 * Makefile.in (dist): chmod a+r before making the tar file.
3636 Thu Nov 12 14:42:57 1992 Francois Pinard (pinard at icule)
3638 * builtin.c (m4_dnl): Diagnose any parameter to `dnl'.
3640 * input.c (next_token): Reinitialize token_buttom just after using
3641 it as a watermark with obstack_free. Or else, a future token, big
3642 enough for triggering reallocation of the obstack chunk, could
3643 void the initialized value of token_buttom, later causing panic in
3644 obstack_free. Rename token_buttom to token_bottom everywhere.
3646 * m4.h: Before declaring errno, first include <errno.h> and
3647 ensure that it does not define errno.
3648 Reported by Richard Stallman.
3650 Wed Nov 11 17:40:35 1992 Francois Pinard (pinard at icule)
3652 * builtin.c: Define and use DECLARE macro for builtins.
3654 * builtin.c (m4_ifelse): Avoid any diagnostic when exactly one
3655 argument, this is a common idiom for introducing long comments.
3657 * builtin.c (m4_ifelse): If 3n + 2 arguments, diagnose missing
3658 arguments. The last argument was silently ignored.
3660 * m4.c (cmd_error): Add a missing semicolon before va_end().
3662 Tue Nov 10 08:57:05 1992 Francois Pinard (pinard at icule)
3664 * Makefile.in: Now handle protoized sources. Define and use U.
3665 Compile and use ansi2knr with old compilers. Update DISTFILES.
3666 Add `aclocal.m4' to `configure' dependencies.
3667 * ansi2knr.c: New, from Ghostscript distribution.
3668 * configure.in: Define U through FP_PROTOTYPES for old compilers.
3669 Add AC_ISC_POSIX, AC_CONST, AC_SIZE_T.
3670 * aclocal.m4: New, provide FP_PROTOTYPES.
3671 * m4.h: Conditionnaly protoized through Args, save for varags.
3672 * builtin.c: Protoized. Then:
3673 Include <sys/types.h> if size_t is not defined, before "regex.h".
3674 (m4_ifelse): Fetch built-in name properly for diagnostic.
3675 (m4_dumpdef): Remove wrong (char *) cast calling dump_symbol.
3676 (m4_regexp): Add const to `msg' declaration.
3677 (m4_patsubst): Add const to `msg' declaration.
3678 * debug.c: Protoized, save for varargs.
3679 * eval.c: Protoized.
3680 * format.c: Protoized.
3681 * input.c: Protoized.
3682 * m4.c: Protoized, save for varargs. Then:
3683 (xfree): Accept void * instead of char *.
3684 (xmalloc): Return void * instead of char *.
3685 (xrealloc): Accept and return void * instead of char *.
3686 * macro.c: Protoized.
3687 * output.c: Protoized.
3688 * path.c: Protoized. Then cast some (char *) over xmalloc's.
3689 * symtab.c: Protoized.
3691 Fri Nov 6 02:05:21 1992 Francois Pinard (pinard at icule)
3693 * m4.texinfo: Remove directory from diagnostics in 30.include,
3694 51.eval, 56.errprint and 57.m4exit tests.
3696 * m4.h: Remove declarations for int or void system functions, they
3697 cause more conflicting trouble than they make good.
3699 * configure.in: Avoid configuration header file. Add some tests.
3700 * m4.h: Remove #include "config.h".
3701 * Makefile.in, lib/Makefile.in: Implement Autoconf interface.
3702 Then, rewritten for better compliance with GNU standards.
3704 Thu Nov 5 12:37:13 1992 Francois Pinard (pinard at icule)
3706 * format.c (format): Avoid syntax error if not HAVE_EFGCVT,
3707 because of a misplaced #endif.
3709 * Many *.[hc] files: Correct intra-line spacing here and there,
3710 according to GNU indent 1.6 advice.
3712 * configure.in: New, using Autoconf 1.2.
3713 * m4.h: Reverse NO_MEMORY_H to NEED_MEMORY_H.
3714 * Delete old configure.in, configure, etc/configure.in,
3715 etc/configure, lib/configure.in, lib/configure and config/*.
3716 Reported by Jason Merrill.
3718 * symtab.c (hash): Change (char) NULL to '\0'.
3719 Reported by Jason Merrill.
3721 * Delete .vers, etc/newdist.sh, etc/newvers.sh and
3722 etc/nextvers.sh. Release numbers will be edited `by hand'.
3723 * version.h: De-automatize, force value in.
3725 * m4.c: Changes in order to use a newer getopt.h.
3726 Reported by David MacKenzie.
3728 * checks/: New name for examples/.
3729 * checks/get_them: New location for etc/get_examples.
3730 * checks/check_them: New location for etc/check_examples.
3731 * Makefile.in, checks/get_them, checks/check_them: Adjust.
3732 * lib/vfprintf.c: New location for etc/vfprintf.c.
3733 * Delete empty etc/.
3734 * examples/: New name for test/.
3736 Tue Mar 10 00:29:46 1992 Francois Pinard (pinard at icule)
3738 * Makefile.in (check): Add m4 as dependency.
3740 * m4.c: Accept --no-warnings instead of --no_warnings, and
3741 --no-gnu-extensions instead of --no_gnu_extensions. Make the
3742 usage message more informative.
3743 Reported by David MacKenzie.
3745 Mon Mar 9 14:53:40 1992 Francois Pinard (pinard at icule)
3747 * etc/check_examples: New name for check_examples.sh.
3748 * etc/get_examples: New name for get_examples.sh.
3749 * Makefile.in, etc/Makefile.in: Use new names.
3751 * Makefile.in: Transmit $(CC) while making in lib.
3753 * Many *.[hc] files: GNU indent'ed, with further fine tuning of
3754 code disposition by hand.
3756 Sun Mar 8 11:01:55 1992 Francois Pinard (pinard at icule)
3758 * m4.h: Delete definitions for abort() and exit().
3759 Reported by Richard Stallman.
3761 * config/hmake-unicos, config/s-unicos.h: New files.
3762 Reported by Hal Peterson.
3764 * eval.c (exp_term): Have N^0 return 1.
3765 Reported by Michael Fetterman.
3767 * eval.c, input.c, m4.h: Remove last comma in enums.
3768 Reported by Mike Lijewski.
3770 * Transfer of maintenance duties from Rene' to Franc,ois.
3772 Thu Oct 24 15:18:46 1991 Rene' Seindal (seindal at diku.dk)
3774 * Release 1.0. Many thanks to those, who provided me with bug
3775 reports and feedback.
3777 * Uses GNU configure, taken from the gdb distribution.
3779 * Uses GNU getopt(), with long option names.
3781 * The -Q/+quiet option is added, which suppresses warnings about
3782 missing or superflous arguments to built-in macros.
3784 * Added default options via the M4OPTS environment variable.
3786 * The built-in format can now be configured to use sprintf as
3787 the formatting engine, for systems without [efg]cvt(3).
3789 * GNU library code is moved to the ./lib subdirectory; other
3790 utility files are now in ./etc.
3792 * Several minor bugs have been fixed.
3794 Fri Jul 26 15:28:42 1991 Rene' Seindal (seindal at diku.dk)
3796 * Fixed various bugs. Release 0.99, manual 0.09. Many thanks to
3797 Francois Pinard and Roland H. Pesch for providing me with reports.
3799 * The builtins incr and decr are now implemented without use of
3802 * The builtin indir is added, to allow for indirect macro calls
3803 (allows use of "illegal" macro names).
3805 * The debugging and tracing facilities has been enhanced
3806 considerably. See the manual for details.
3808 * The -tMACRO option is added, marks MACRO for tracing as soon
3811 * Builtins are traced after renaming iff they were before.
3813 * Named files can now be undiverted.
3815 * The -Nnum option can be used to increase the number of
3816 divertions available.
3818 * Calling changecom without arguments now disables all comment
3821 * The function m4_patsubst() is now consistently declared
3824 * A bug in dnl is fixed.
3826 * A bug in the multi-character quoting code is fixed.
3828 * Several typos in the manual has been corrected. More probably
3831 * The m4.info file is now installed along with the program.
3833 Thu Nov 15 21:51:06 1990 Rene' Seindal (seindal at diku.dk)
3835 * Updated and enhanced version. Release 0.75, manual 0.07.
3837 * Implemented search path for include files (-I option and
3838 M4PATH envronment variable).
3840 * Implemented builtin "format" for printf-like formatting.
3842 * Implemented builtin "regexp" for searching for regular
3845 * Implemented builtin "patsubst" for substitution with regular
3848 * Implemented builtin "esyscmd", which expands to a shell
3851 * Implemented "__file__" and "__line__" for use in error
3854 * Implemented character ranges in "translit".
3856 * Implemented control over debugging output.
3858 * Implemented multi-character quotes.
3860 * Implemented multi-character comment delimiters.
3862 * Changed predefined macro "gnu" to "__gnu__".
3864 * Changed predefined macro "unix" to "__unix__", when the -G
3865 option is not used. With -G, "unix" is still defined.
3867 * Changed "shift", "$@" and "$*" to not insert spaces afters
3870 * Added program name to error messages.
3872 * Fixed two missing null bytes bugs.
3874 Mon Jan 22 21:08:52 1990 Rene' Seindal (seindal at diku.dk)
3876 * Initial beta release. Release 0.50, manual 0.05.
3886 Copyright (C) 1990, 1991, 1992, 1993, 1994, 2000, 2001, 2003,
3887 2005, 2006, 2007 Free Software Foundation, Inc.
3889 Copying and distribution of this file, with or without
3890 modification, are permitted provided the copyright notice
3891 and this notice are preserved.