* Makefile.cfg (url_dir_list): Fix location.
[m4/ericb.git] / ChangeLog
bloba9af2821a73702f6f76294d0a632f9905f03c95b
1 2008-02-25  Eric Blake  <ebb9@byu.net>
3         * Makefile.cfg (url_dir_list): Fix location.
5         Minor tweaks, learned from the release.
6         * Makefile.maint (VC-tag): Avoid dashed git commands, and use
7         signing key from Makefile.cfg.
8         (delta-diff): Avoid blank lines mid-macro.
9         * HACKING: Tweak instructions.
10         * NEWS: Bump version.
11         * configure.ac (AC_INIT): Likewise.
13         Beta Release Version 1.4.10b.
14         * configure.ac (AC_INIT): Bump version.
15         (AM_INIT_AUTOMAKE): Increase requirement, and add dist-lzma.
16         * NEWS: Bump version.
17         * HACKING: Update for git release procedures.
18         * README: Update to mention this is a beta release on the stable
19         branch.
20         * bootstrap: Mention new automake dependency.
21         * Makefile.cfg: New file.
22         * GNUmakefile: Use it.
23         * Makefile.maint (gzip_rsyncable, GZIP_ENV, GIT, VC, VC-tag)
24         (VERSION_REGEXP, this-vc-tag, my_distdir, null_AM_MAKEFLAGS)
25         (TMPDIR, gnulib-version): New macros, borrowed from coreutils.
26         (makefile-check, news-date-check, changelog-check, m4-check)
27         (vc-diff-check, maintainer-distcheck, vc-dist, my-distcheck)
28         (announcement, alpha, beta, major): New rules, borrowed from
29         coreutils.
30         (TEXI2HTML, cvs-release, update-timestamps, cvs-news, cvs-commit)
31         (cvs-dist): Delete.
32         * Makefile.am (EXTRA_DIST): Distribute new file.
33         * m4/gnulib-cache.m4: Import announce-gen module.
35 2008-02-23  Eric Blake  <ebb9@byu.net>
37         Use size_t consistently for string length truncation.
38         * src/m4.h (max_debug_argument_length): Change type to size_t.
39         (shipout_string_trunc, arg_print): Change parameter type.
40         * src/debug.c (trace_format, trace_pre): Adjust all callers.
41         * src/input.c (input_print): Likewise.
42         * src/m4.c (max_debug_argument_length, main): Likewise.
43         * src/macro.c (arg_print): Likewise.
44         * src/output.c (shipout_string_trunc): Likewise.
45         Reported by Ralf Wildenhues.
47         s/obstack_print/shipout_string_trunc/.
48         * src/m4.h (obstack_print): Rename...
49         (shipout_string_trunc): ...to this, to leave obstack_ prefix for
50         actual obstack API.
51         * src/debug.c (trace_format): Adjust caller.
52         (obstack_print): Move...
53         * src/output.c (shipout_string_trunc): ...here, including rename.
54         * src/input.c (input_print): Adjust caller.
55         * src/macro.c (arg_print): Likewise.
56         Reported by Ralf Wildenhues.
58         s/shipout_text/divert_text/.
59         * src/m4.h (shipout_text): Rename...
60         (divert_text): ...to this, so that shipout_ prefix can be used for
61         functions that do not do #line tracking.
62         * src/output.c (divert_text): Rename.
63         * src/macro.c (expand_token): Adjust all callers.
65         Stage 18: try harder to reuse argv in recursion.
66         When pushing arguments that contain an existing $@ ref, reuse the
67         ref rather than creating another layer of wrappers.
68         Memory impact: noticeable improvement, due to better $@ reuse.
69         Speed impact: noticeable improvement, due to O(n^2) to O(n)
70         reduction in unboxed recursion.
71         * src/macro.c (make_argv_ref_token): Avoid wrapping $@ when
72         possible.
73         (push_args): Let make_argv_ref_token take care of pending data.
74         * doc/m4.texinfo (Improved foreach): Tweak wording to match new
75         performance capability.  Add regression tests.
76         * NEWS: Document the speedup.
77         * src/m4.c (AUTHORS): Claim credit for my rewrite.
79 2008-02-22  Eric Blake  <ebb9@byu.net>
81         Stage 17: pass argv through quoted strings.
82         Allow the concatenation of $@ references with other text input
83         inside quoted contexts, which requires distinguishing between a
84         wrapper around many arguments vs. a reference serving as part of a
85         single argument.  Also optimize based on whether argv contains
86         builtin tokens that might need flattening to the empty string.
87         Memory impact: noticeable improvement, due to O(n^2) to O(n)
88         reduction from total reuse of $@ references.
89         Speed impact: noticeable improvement, due to O(n^2) to O(n)
90         reduction in boxed recursion.
91         * src/input.c (append_quote_token): Allow an argv ref inside
92         quotes.
93         (init_argv_token): Populate new fields.
94         (push_macro): Ensure a macro is actually pushed.
95         * src/m4.h (struct token_chain): Add has_func member.
96         (struct token_data): Add wrapper and has_func members.
97         * src/macro.c (struct macro_arguments): Add flatten and has_func
98         members.
99         (expand_argument, collect_arguments, make_argv_ref_token)
100         (make_argv_ref): Populate new fields.
101         (arg_equal, arg_len) Handle embedded argv.
102         (arg_token, arg_mark, arg_type): Use new fields.
104 2008-02-21  Eric Blake  <ebb9@byu.net>
106         Stage 16: cache quotes and improve arg_print.
107         Cache rather than always copying quotes when pushing $@ refs; in
108         particular, reconstruct single-byte quotes on the fly.  Allow NUL
109         through m4wrap.  Improve sharing of code that prints arguments.
110         Memory impact: slight improvement, due to cached quotes.
111         Speed impact: slight improvement, due to less copying.
112         * src/m4.h (push_wrapup_init, push_wrapup_finish, quote_cache)
113         (func_print): New prototypes.
114         (arg_print): Adjust prototype.
115         * src/builtin.h (func_print): New function.
116         (define_user_macro): Slight cleanup.
117         (dump_args): Delete, no longer used.
118         (m4_errprint): Use arg_print.
119         (m4_m4wrap): Handle embedded NUL.
120         * src/debug.c (trace_pre): Use arg_print.
121         * src/input.c (cached_quote): New variable.
122         (push_wrapup): Split...
123         (push_wrapup_init, push_wrapup_finish): ...into these.
124         (input_print): Use arg_print.
125         (quote_cache): New function.
126         (pop_input, next_char_1, append_quote_token, set_quote_age):
127         Adjust users.
128         * src/macro.c (arg_text, make_argv_ref_token): Adjust users.
129         (arg_print): Add parameters.
130         * examples/null.m4: Test for NUL in m4wrap.
131         * examples/null.out: Update expected output.
132         * doc/m4.texinfo (Debug Levels): Test --arglength truncation.
134         Fix out-of-bounds read for sanitized macro names, from 2008-02-06.
135         * src/m4.c (m4_verror_at_line): Properly terminate the string.
136         Reported by Ralf Wildenhues.
138 2008-02-19  Eric Blake  <ebb9@byu.net>
140         Clean up foreach example.
141         * doc/m4.texinfo (Foreach, Improved foreach): Document another
142         shortcoming in foreach.m4.
144 2008-02-18  Eric Blake  <ebb9@byu.net>
146         Avoid some magic numbers.
147         * src/m4.h (DEBUG_TRACE_ARGS, DEBUG_TRACE_EXPANSION)
148         (DEBUG_TRACE_QUOTE, DEBUT_TRACE_ALL, DEBUG_TRACE_LINE)
149         (DEBUG_TRACE_FILE, DEBUG_TRACE_PATH, DEBUG_TRACE_CALL)
150         (DEBUG_TRACE_INPUT, DEBUG_TRACE_CALLID, DEBUG_TRACE_VERBOSE)
151         (DEBUG_TRACE_DEFAULT): Use hex constants, to make it obvious these
152         are bit fields.
153         * src/input.c (CHAR_EOF, CHAR_MACRO, CHAR_QUOTE, CHAR_ARGV):
154         Define in terms of UCHAR_MAX.
155         (set_word_regexp): Likewise.
156         * src/builtin.c (compile_pattern, m4_translit): Likewise.
157         Reported by Ralf Wildenhues.
159 2008-02-16  Eric Blake  <ebb9@byu.net>
161         Add regression test for multi-character quote recursion.
162         * examples/foreach2.m4: Use $0 rather than spelling out name.
163         * examples/foreachq2.m4: Likewise.
164         * examples/forloop2.m4: Likewise.
165         * examples/hanoi.m4: Likewise.
166         * examples/trace.m4: Likewise.
167         * doc/m4.texinfo (Improved forloop): Document advantage of $0.
168         (Improved foreach): Adjust dump from file.
170         Stage 15: return argv refs back to collect_arguments.
171         Collect an entire $@ reference at once rather than one argument at
172         a time, outside of quotes (but inside quotes, $@ is still
173         flattened for now).  The skip_last field allows concatenation of
174         $@ with other text when collecting arguments.
175         Memory impact: noticeable improvement, due to better reuse of $@.
176         Speed impact: noticeable improvement, due to less parsing.
177         * src/m4.h (enum token_type): Add TOKEN_ARGV.
178         (struct token_chain): Add skip_last member to argv link.
179         (next_token): Update prototype.
180         * src/input.c (CHAR_ARGV): New placeholder input character.
181         (peek_input): Add parameter, to pass $@ at once.
182         (next_char_1, append_quote_token): Handle $@ inside quotes.
183         (init_argv_token): New function.
184         (push_token, match_input, next_token, peek_token, lex_debug):
185         Update callers.
186         * src/macro.c (expand_input, collect_arguments): Likewise.
187         (expand_argument): Handle incoming $@ token.
188         (arg_adjust_refcount, arg_token, arg_text, make_argv_ref_token):
189         Handle nested $@ refs.
190         * src/symtab.c (symtab_debug): Update caller.
191         * examples/null.m4: Document more tests that are needed.  Add
192         tests for NUL with divert, patsubst, and regexp.
193         * examples/null.out: Update for new tests.
194         * doc/m4.texinfo (Syntax): Add test for m4exit and NUL.
195         * checks/get-them (AWK): Give a default value.
196         * checks/check-them: Allow tests to invoke child processes with
197         same include path.  Perform message normalization on stderr.
199 2008-02-15  Eric Blake  <ebb9@byu.net>
201         Use fastmaps for better regex performance.
202         * src/builtin.c (compile_pattern): Allocate a fastmap.
203         * src/input.c (word_start): Delete.
204         (set_word_regexp): Compile a fastmap instead.
205         (peek_token, next_token): Use fastmap.
206         (pop_wrapup): Free memory on exit.
208 2008-02-13  Eric Blake  <ebb9@byu.net>
210         Fix texinfo grammar.
211         * doc/m4.texinfo (Incompatibilities): Use @. after capital.
212         (History): Use @: after abbreviations.
213         (M4exit): Use correct Latin abbreviation.
215 2008-02-11  Eric Blake  <ebb9@byu.net>
217         Document behavior of __gnu__().
218         * doc/m4.texinfo (Platform macros): Enhance test.
219         (Macro expansion): New test.
221         Use gnulib's git-merge-changelog driver when available.
222         * .gitattributes: New file.
223         * bootstrap: Install driver, if not already present.
225 2008-02-06  Eric Blake  <ebb9@byu.net>
227         Fix security hole introduced 2007-11-22.
228         * src/m4.h (includes): Add quotearg.h.
229         * src/m4.c (m4_verror_at_line): Properly escape macro names.
230         (main): Manage quoteargs defaults.
231         * doc/m4.texinfo (Indir): Document and test this.
233 2008-02-05  Eric Blake  <ebb9@byu.net>
235         * m4/gnulib-cache.m4: Import the strtod module.
237 2008-02-02  Eric Blake  <ebb9@byu.net>
239         Stage 14: allow pushing argv references.
240         Push a $@ reference to the input engine in one go, rather than
241         pushing each element.  For now, argument collection still gets one
242         argument of a $@ at a time; but the penalties of this patch make
243         it easier to manage $@ efficiently in future patches.
244         Memory impact: noticeable penalty, due to larger struct and O(n)
245         to O(n^2) on unboxed recursion.
246         Speed impact: noticeable penalty, due to more bookkeeping.
247         * src/m4.h (struct token_chain): Add comma and quotes fields.
248         (arg_adjust_refcount, arg_print, push_arg_quote): New prototypes.
249         * src/input.c (push_token, pop_input, input_print, peek_input)
250         (next_char_1): Support $@ references.
251         * src/macro.c (struct macro_arguments): Add level field.  Match
252         type of arraylen to argc.
253         (collect_arguments): Populate new field.
254         (expand_macro, make_argv_ref, push_arg): Factor...
255         (arg_adjust_refcount, make_argv_ref_token, push_arg_quote):
256         ...into these new methods.
257         (arg_token): Add new parameter.
258         (arg_print): New function.
259         (arg_mark, arg_type, arg_text, arg_equal, arg_empty, arg_len)
260         (arg_func, push_args): Adjust callers.
261         * doc/m4.texinfo (Ifelse): Augment test.
263 2008-01-31  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
265         * checks/Makefile.in: Use @SET_MAKE@, and use @SHELL@ rather
266         than hard-coding /bin/sh.
267         * THANKS: Update.
268         Reported by Lawson Chan.
270 2008-01-27  Eric Blake  <ebb9@byu.net>
272         Stage 13: push composite text tokens.
273         Support pushing composite tokens, allowing back-references to be
274         reused through multiple macro expansions.  Add hueristic that
275         avoids creating new reference when pushing existing references.
276         Memory impact: noticeable improvement due to better reference
277         reuse, except for O(n) to O(n^2) copying in boxed recursion.
278         Speed impact: slight penalty, due to more bookkeeping.
279         * src/m4.h (push_token): Adjust prototype.
280         * src/input.c (push_token): Add parameter, and handle composite
281         tokens.
282         (append_quote_token): Inline short strings.
283         * src/macro.c (push_arg, push_args): Adjust callers.
285 2008-01-26  Eric Blake  <ebb9@byu.net>
287         Stage 12: make token_chain a union, add string_pair.
288         Shrink size of symbol chains by using a union.  Make passing quote
289         delimiters around more efficient.  Other code cleanups.
290         Memory impact: slight improvement, due to smaller struct.
291         Speed impact: slight penalty, due to more bookkeeping.
292         * src/m4.h (STRING): Delete typedef.
293         (struct string_pair, enum token_chain_type): New types.
294         (struct token_chain): Reduce size via a union.
295         (ARG_LEN): New macro.
296         (ARG): Move here...
297         * src/builtin.c (ARG): ...from here.
298         (dump_args, define_macro, m4_dumpdef, m4_builtin, m4_indir)
299         (m4_defn, mkstemp_helper, m4_maketemp, m4_mkstemp, m4___file__)
300         (m4___program__, m4_m4wrap, m4_len, m4_index, m4_substr)
301         (m4_regexp, m4_patsubst): Adjust callers.
302         * src/input.c (rquote, lquote, bcomm, ecomm): Delete...
303         (curr_quote, curr_comm): ...replaced by these.
304         (make_text_link, push_token, pop_input, input_print, peek_input)
305         (next_char_1, input_init, set_quotes, set_comment, set_quote_age)
306         (next_token, peek_token): Adjust callers.
307         * src/macro.c (expand_macro, arg_token, arg_mark, arg_text)
308         (arg_equal, arg_len, make_argv_ref, push_arg, push_args):
309         Likewise.
310         * src/format.c (ARG_INT, ARG_LONG, ARG_STR, ARG_DOUBLE, format):
311         Likewise.
312         * src/freeze.c (produce_frozen_state): Likewise.
313         * src/debug.c (trace_format, trace_pre): Likewise.
314         (debug_decode): Don't lose partial traces prior to reducing
315         debugmode.
317 2008-01-22  Eric Blake  <ebb9@byu.net>
319         Stage 11: full circle for single argument references.
320         Pass quoted strings through to argument collection in a single
321         action, so that an argument can be reused throughout macro
322         recursion if it remains unchanged.
323         Memory impact: noticeable improvement, due to more reuse in
324         argument collection stacks; O(n^2) to O(n) on boxed recursion.
325         Speed impact: noticeable improvement, due to less copying.
326         * src/m4.h (struct token_chain): Add quote_age member.
327         (struct token_data): Add end member to chain alternate.
328         (make_text_link): New prototype.
329         * src/input.c (CHAR_QUOTE): New macro.
330         (word_start): Pre-allocate.
331         (set_word_regexp): Simplify.
332         (make_text_link): Export, and handle new fields.
333         (next_char, next_char_1): Add parameter.
334         (append_quote_token): New function.
335         (match_input, next_token): Adjust callers to handle quoted input
336         blocks.
337         * src/macro.c (struct macro_arguments): Add wrapper member.
338         (expand_argument): Accept composite blocks from input engine.
339         (expand_macro): Reduce refcounts of composite arguments.
340         (collect_arguments, arg_token, arg_mark, make_argv_ref): Update to
341         use new fields.
342         (arg_type, arg_text, arg_equal, arg_len): Treat composite
343         arguments as text.
344         (push_arg, push_args): Handle composites.
346 2008-01-17  Eric Blake  <ebb9@byu.net>
348         Stage 10: avoid extra copying of strings and comments.
349         When collecting tokens that are immune to further expansion, avoid
350         copying data from one obstack to another by outputting it into the
351         destination obstack to begin with.  Also reduce copying done in
352         format builtin.
353         Memory impact: slight improvement, due to better obstack usage.
354         Speed impact: noticeable improvement, due less data copying.
355         * m4/gnulib-cache.m4: Import the intprops and vasnprintf-posix
356         modules.
357         * src/m4.h (includes): Use new gnulib modules.
358         (next_token): Adjust prototype.
359         (bad_argc): New prototype.
360         * src/format.c (arg_int, arg_long, arg_double): New helper
361         functions.
362         (ARG_INT, ARG_LONG, ARG_STR, ARG_DOUBLE): Track missing
363         arguments.
364         (format): Improve warnings, and avoid copying into obstack in the
365         common case.
366         * src/input.c (next_token): Add new parameter.
367         (lex_debug): Adjust caller.
368         * src/symtab.c (symtab_debug): Likewise.
369         * src/macro.c (expand_input, expand_token, expand_argument)
370         (collect_arguments): Likewise.
371         * src/output.c (m4_tmpname): Guarantee correct buffer size.
372         * src/builtin.c (builtin_init): Improve efficiency.
373         (bad_argc): Export.
374         (ntoa): Tighten buffer allocation.
375         * doc/m4.texinfo (Format): Test the improvements.
376         * NEWS: Document the improvement.
378 2008-01-14  Eric Blake  <ebb9@byu.net>
380         Fix --warn-macro-sequence regression from 2007-11-29.
381         * src/builtin.c (define_user_macro): Use correct length.
382         * doc/m4.texinfo (Arguments): Test the fix.
383         (History): Reword to account for new year and eventual result of
384         the argv_ref branch.
386 2008-01-08  Eric Blake  <ebb9@byu.net>
388         Bump copyright year.
389         * NEWS: Update year.  Mention effect of my recent memmem
390         contributions to gnulib.
392 2007-12-21  Eric Blake  <ebb9@byu.net>
394         Stage 9: share rather than copy single-arg refs.
395         Use hooks of previous patch to create back-references to arguments
396         in the input engine, and inline short text rather than always
397         creating a FIFO link.  Also start testing embedded NUL behavior.
398         Until the argument collection engine also shares references, the
399         memory usage increases.
400         Memory impact: noticeable penalty, due to longer life of argv
401         changing O(n) to O(n^2) on boxed recursion.
402         Speed impact: slight improvement, due less data copying.
403         * m4/gnulib-cache.m4: Import quote and memmem modules.
404         * src/m4.h (arg_scratch): New prototype.
405         * src/input.c (INPUT_INLINE_THRESHOLD): New define.
406         (push_token): Use it to inline short text, and save references to
407         longer text.
408         (input_init, next_token): Simplify obstack handling.
409         * src/macro.c (expand_argument): Likewise.
410         (expand_macro): Track scratch space.
411         (arg_scratch): New function.
412         (make_argv_ref): Use it.
413         (push_args): Likewise, and simplify comma handling, since most
414         separators are short enough to be inlined.
415         * src/builtin.c (builtin_init): Avoid cast.
416         (m4_errprint, m4_index): Transparently support NUL.
417         (m4_translit): Use scratch space, rather than leaking memory on
418         expansion stack.
419         * doc/m4.texinfo (Syntax): Add new test of embedded NUL.
420         * checks/get-them: Extract test that uses external files.
421         * checks/check-them: Run the new test.  Use unified diff if
422         possible, and force text mode when debugging NUL handling.
423         * examples/null.m4: New file.
424         * examples/null.out: Likewise.
425         * examples/null.err: Likewise.
426         * examples/Makefile.am (EXTRA_FILES): Distribute these files.
427         * .gitattributes: Treat new files as text, in spite of embedded
428         NUL.
430 2007-12-18  Eric Blake  <ebb9@byu.net>
432         Stage 8: extend life of references into argv.
433         Add hooks to lengthen the lifetime of arguments reused in a macro
434         expansion, rather than always discarding arguments at the end of
435         expand_macro.  Rework the expand_macro obstacks to handle longer
436         lifetimes.  For now, the hooks remain unused.
437         Memory impact: slight penalty, due to larger structs.
438         Speed impact: slight penalty, due to more bookkeeping.
439         * src/m4.h (obstack_regrow): Delete, now that it is unused.
440         (struct token_chain): Add level field.
441         (push_token): Adjust prototype.
442         (adjust_refcount): New prototype.
443         * src/macro.c [DEBUG_MACRO]: Add debugging hooks for $@ reference
444         counting.
445         (argc_stack, argv_stack): Delete, replaced by...
446         (struct macro_arg_stacks, stacks, stacks_count): ...these new
447         structure for tracking $@ references.
448         (expand_input): Initialize new structure.
449         (collect_arguments): Alter signature.
450         (expand_macro): Rework obstack handling, in order to keep $@
451         references alive until they have been rescanned.
452         (adjust_refcount, arg_mark): New functions.
453         (make_argv_ref): Use new field.
454         (push_arg, push_args): Update callers.
455         * src/input.c (make_text_link): Use new field.
456         (push_token): Change signature.
457         (pop_input, next_char_1): Call new function.
458         * doc/m4.texinfo: Clean up some examples of -d option usage.
459         (Ifelse): Add some stress tests.
461 2007-12-13  Eric Blake  <ebb9@byu.net>
463         Yet more rewording.
464         * doc/m4.texinfo (Inhibiting Invocation): Missed one instance in
465         the previous patch.
467         * THANKS: Update.
469 2007-12-13  Paolo Bonzini  <bonzini@gnu.org>  (tiny change)
471         * doc/m4.texinfo (Inhibiting Invocation): Fix quoting of a quoting
472         example.
473         Reported by Giovanni Toffetti.
475 2007-12-11  Eric Blake  <ebb9@byu.net>
477         Stage 7: add chained token support to input parser.
478         Allow the LIFO input engine to rescan a macro expansion composed
479         of smaller chunks of FIFO data, rather than the old approach of a
480         monolithic string.  For now, all chunks are still copied.
481         Memory impact: slight penalty, due to FIFO chain overhead.
482         Speed impact: noticeable penalty, due to extra bookkeeping.
483         * src/m4.h (struct token_chain): Add const safety.
484         (push_token): New prototype.
485         * src/input.c (INPUT_CHAIN): New enumerator.
486         (struct input_block): Add new input type u_c, and change u_s to
487         length-based processing.
488         (make_text_link): New helper function.
489         (push_token): New function.
490         (push_string_finish): Use it.
491         (pop_input, input_print, peek_input, next_char, next_char_1):
492         Adjust to handle new input type.
493         * src/macro.c (push_arg, push_args): Use new function.
495 2007-12-10  Eric Blake  <ebb9@byu.net>
497         Stage 6: convert builtins to push arg at a time.
498         Add new methods to factor all builtins whose expansion includes an
499         argument, making back-reference creation easier in future patches.
500         Factor out length-limited printing to obstacks, and use -1 rather
501         than 0 for unlimited length.
502         Memory impact: none.
503         Speed impact: slight improvement, due to better code sharing.
504         * src/m4.h (includes): Include <limits.h> here, instead of in
505         individual files.
506         (input_block): New typedef.
507         (trace_pre, trace_post, push_string_finish): Update prototypes.
508         (obstack_print, input_print, push_arg, push_args): New
509         prototypes.
510         * src/input.c (push_string_finish): Change return type.
511         (input_print): New function.
512         * src/debug.c (trace_format): Add %B specifier, and use new
513         function.
514         (trace_pre): Remove redundant argc parameter.
515         (trace_post): Likewise, and change signature.
516         (obstack_print): New function.
517         * src/macro.c (expand_macro): Update caller.
518         (push_arg, push_args): New functions.
519         * src/builtin.c (m4_ifdef, m4_ifelse, m4_shift, m4_substr)
520         (m4_patsubst, expand_user_macro): Use new functions.
521         (mkstemp_helper, m4_maketemp): Avoid extra trailing NULs.
522         * src/m4.c (max_debug_argument_length, main): Set to INT_MAX, not
523         0, for unlimited.
524         * src/output.c: Update includes.
525         * src/symtab.c: Likewise.
527 2007-12-07  Eric Blake  <ebb9@byu.net>
529         Minor security fix: Quote output of mkstemp.
530         * src/builtin.c (mkstemp_helper): Produce quoted output.
531         * doc/m4.texinfo (Mkstemp): Update the documentation and tests.
532         * NEWS: Document this change.
534         Stage 5: add notion of quote age.
535         Cache the quoting rules that were in effect when a string was
536         parsed, to avoid reparsing that string if no changequote or other
537         quote age change took place in the meantime.  A quote_age of 0 is
538         always safe, but does not benefit from caching.
539         Memory impact: slight penalty, due to larger struct.
540         Speed impact: slight penalty, due to more bookkeeping.
541         * src/input.c: Comment cleanups.
542         (current_quote_age): New global variable.
543         (set_quote_age): New helper function.
544         (input_init, set_word_regexp): Use it.
545         (set_quotes, set_comment): Likewise, and detect no-op changes.
546         (quote_age, safe_quotes): New functions.
547         (next_token): Track quote age.
548         * src/m4.h (struct token_data): Add quote_age member.
549         (TOKEN_DATA_QUOTE_AGE, quote_age, safe_quotes): New prototypes.
550         * src/macro.c (struct macro_arguments): Add quote_age member.
551         (expand_token): Alter signature and track quote age.
552         (expand_input, expand_argument): All callers changed.
553         (collect_arguments, make_argv_ref): Track quote age.
554         (arg_text, arg_len, arg_func): Detect type mismatch.
555         * doc/m4.texinfo (Ifelse, Changequote): Add more tests.
556         (Incompatibilities): Fix typo.
557         * examples/wraplifo.m4: New file.
558         * examples/Makefile.am (EXTRA_DIST): Distribute it.
560 2007-12-04  Eric Blake  <ebb9@byu.net>
562         Fix builds with OpenBSD make.
563         * doc/Makefile.am (HELP2MAN): New macro.
564         (man_MANS, m4.1): Fix rules for building m4.1 into srcdir.
565         * README: Update copyright.
566         * HACKING: Mention help2man and makeinfo dependencies.
568 2007-11-29  Eric Blake  <ebb9@byu.net>
570         Stage 4: route indir, builtin through ref; make argv opaque.
571         Finish making struct opaque to all but the input engine, by
572         reworking obstack usage in expand_macro to better support creation
573         of a $@ reference.  Canonicalize the empty argument, to allow
574         pointer comparison optimizations.
575         Memory impact: slight penalty, due to larger struct.
576         Speed impact: slight improvement, due to fewer function calls.
577         * src/m4.h (obstack_regrow): Borrow definition from head.
578         (struct token_chain): Add flatten and len members.
579         (arg_equal, arg_empty, make_argv_ref): New prototypes.
580         (struct macro_arguments): Move...
581         * src/macro.c (struct macro_arguments): ...here, making it
582         opaque.  Add has_ref member.
583         (empty_token): New placeholder, for optimizing comparison with
584         empty string.
585         (collect_arguments): Change signature, and populate new fields.
586         (expand_macro): Alter handling of obstacks.
587         (arg_token): New helper method.
588         (arg_equal, arg_empty, make_argv_ref): New methods.
589         (arg_type, arg_text, arg_len, arg_func): Use new methods.
590         * src/builtin.c (m4_ifelse, m4_builtin, m4_indir, m4_eval):
591         Likewise.
592         * src/format.c (format): Likewise.
594         Stage 3: cache length, rather than computing it.
595         Cache the length of a token, to avoid repeating lots of strlen
596         calls.  Additionally, by using obstack length rather than strlen,
597         the input engine can now support embedded NUL.
598         Memory impact: slight penalty, due to larger struct.
599         Speed impact: noticeable improvement, due to fewer function
600         calls.
601         * src/input.c (next_token): Grab length from obstack rather than
602         calling strlen.
603         * src/m4.h (token_data, macro_arguments): Add length field.
604         (TOKEN_DATA_LEN): New accessor.
605         (define_user_macro): Add parameter.
606         * src/builtin.c (define_user_macro, mkstemp_helper): Use
607         pre-computed length.
608         (builtin_init, define_macro, m4_maketemp, m4_mkstemp): Adjust
609         callers.
610         (dump_args, m4_ifdef, m4_ifelse, m4_builtin, m4_indir, m4_eval)
611         (m4_len, m4_substr, m4_translit, m4_regexp, m4_patsubst)
612         (expand_user_macro): Use cached lengths.
613         * src/freeze.c (reload_frozen_state): Adjust callers.
614         * src/m4.c (main): Likewise.
615         * src/macro.c (expand_token, expand_argument, collect_arguments)
616         (arg_len): Use cached length.
617         * doc/m4.texinfo (Mkstemp): Ensure mkstemp does not produce NUL.
619 2007-11-27  Eric Blake  <ebb9@byu.net>
621         Stage 2: use accessors, not direct reference, into argv.
622         Outside of macro.c, use accessor methods rather than direct access
623         into the argv struct.
624         Memory impact: none.
625         Speed impact: slight penalty, due to increased function calls.
626         * src/m4.h (TOKEN_EOF): Alter value, to ease debugging.
627         (arg_argc, arg_type, arg_text, arg_len, arg_func): New
628         prototypes.
629         * src/macro.c (arg_argc, arg_type, arg_text, arg_len, arg_func):
630         New accessor functions.
631         * src/builtin.c (ARG, dump_args, define_macro, m4_builtin)
632         (m4_indir): Use new accessors.
633         * src/debug.c (trace_pre): Likewise.
634         * src/format.c (ARG_INT, ARG_LONG, ARG_STR, ARG_DOUBLE):
635         Likewise.
637 2007-11-24  Eric Blake  <ebb9@byu.net>
639         Stage 1: convert token_data** into new object.
640         Pass a variable-size wrapper structure instead of an array to
641         builtins, so that subsequent optimizations in the structure need
642         not impact every builtin client.
643         Memory impact: slight penalty, since struct is larger than array.
644         Speed impact: slight penalty, due to increased bookkeeping.
645         * m4/gnulib-cache.m4: Import flexmember module.
646         * src/m4.h (struct macro_arguments, struct token_chain): New
647         structs.
648         (builtin_func): Alter signature.
649         (token_data): Add new TOKEN_COMP alternative.
650         * src/builtin.c: All builtins changed.
651         (ARG, dump_args, define_macro, expand_user_macro): Update to use
652         struct.
653         * src/debug.c (trace_pre, trace_post): Likewise.
654         * src/format.c (ARG_INT, ARG_LONG, ARG_STR, ARG_DOUBLE, format):
655         Likewise.
656         * src/macro.c (collect_arguments): Build new struct.
657         (call_macro, expand_macro): Update to use new struct.
659 2007-11-22  Eric Blake  <ebb9@byu.net>
661         More error messages tied to macro names.
662         * src/input.c (set_word_regexp): Take additional parameter.
663         (input_init): Adjust caller.
664         * src/debug.c (debug_set_file, debug_set_output): Take additional
665         parameter.
666         (debug_init): Adjust caller.
667         (expansion_level): Move declaration...
668         * src/m4.h (expansion_level): ...here.
669         (debug_set_output, set_word_regexp): Adjust prototypes.
670         * src/builtin.c (m4_changeword, m4_m4exit, m4_debugfile): Adjust
671         callers.
672         * src/m4.c (main): Likewise.
674         Refactor error messages to avoid macros.
675         * src/m4.h (_): Define, as a placeholder for now.
676         (M4ERROR, M4ERROR_AT_LINE): Delete.
677         (m4_error, m4_error_at_line): Change prototype.
678         (m4_warn, m4_warn_at_line): New prototypes.
679         * src/m4.c (m4_verror_at_line): New helper function.
680         (m4_error, m4_error_at_line): Use new function, and properly call
681         va_end.
682         (m4_warn, m4_warn_at_line): New functions.
683         (stackovf_handler, main): All callers changed.
684         * src/builtin.c: Likewise.
685         * src/debug.c: Likewise.
686         * src/eval.c: Likewise.
687         * src/format.c: Likewise.
688         * src/freeze.c: Likewise.
689         * src/input.c: Likewise.
690         * src/macro.c: Likewise.
691         * doc/m4.texinfo (Indir, Builtin, Dumpdef, Incr, Eval, Substr)
692         (Improved forloop): Adjust tests accordingly.
694         Security fix: avoid arbitrary code execution with 'm4 -F'.
695         * src/freeze.c (produce_frozen_state): Never pass raw file name as
696         printf format.
697         * NEWS: Document this fix.
699 2007-11-21  Eric Blake  <ebb9@byu.net>
701         Consistently report macro name first in messages.
702         * src/m4.h (evaluate): Adjust prototype.
703         * src/builtin.c (bad_argc, numeric_arg, m4_placeholder): Alter
704         wording to match head.
705         (mkstemp_helper, substitute): Adjust signature.  All callers
706         changed.
707         (m4_dumpdef, m4_builtin, m4_indir, m4_defn, m4_esyscmd, m4_eval)
708         (m4_undivert, m4_maketemp, m4_m4exit, m4_debugmode)
709         (m4_debugfile, m4_regexp, m4_patsubst): Mention macro name in
710         message.
711         (m4_format): Adjust call.
712         * src/format.c (format): No longer skip argv[0].
713         * src/eval.c (evaluate): Mention macro name in message.
714         (logical_or_term, logical_and_term, or_term, xor_term, and_term)
715         (equality_term, cmp_term, shift_term, add_term, mult_term)
716         (exp_term, unary_term, simple_term): Adjust signature.
717         * src/macro.c (warn_builtin_concat): Likewise.
718         (expand_argument): Adjust caller.
719         * doc/m4.texinfo (Macro Arguments, Ifdef, Ifelse, Debug Output)
720         (Dnl, Improved fatal_error, Defn, Builtin, Index macro, Regexp)
721         (Substr, Translit, Patsubst, Format, Eval, Dumpdef, Include)
722         (Improved forloop, Indir, Trace, Incr): Adjust tests to match.
724         Make argument checking a bit more sane.
725         * src/builtin.c (bad_argc): Adjust signature, and don't force
726         callers to add 1.  Adjust all callers.
727         (numeric_arg): Adjust signature.  Adjust all callers.
729         Make dnl diagnostic print macro name.
730         * src/m4.h (skip_line): Adjust prototype.
731         * src/input.c (skip_line): Report error on behalf of caller.
732         * src/builtin.c (m4_dnl): Adjust caller.
733         (dump_args, m4_dumpdef, m4_changequote, m4_changecom)
734         (m4_changeword, m4_traceon, m4_traceoff, expand_user_macro): Use
735         ARG macro instead of open-coding.
736         * doc/m4.texinfo (Dnl): Adjust test.
738 2007-11-20  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
740         * Makefile.am (EXTRA_DIST): gendocs.sh is gone here.
742 2007-11-14  Eric Blake  <ebb9@byu.net>
744         Avoid builtin concatenation in macro arguments.
745         * doc/m4.texinfo (Defn): Add tests.
746         * src/macro.c (warn_builtin_concat): New function.
747         (expand_argument): Use it to warn on more corner cases.
748         * NEWS: Mention new warning.
750 2007-11-13  Eric Blake  <ebb9@byu.net>
752         Simplify previous patch.
753         * src/input.c (pop_input): Change signature.
754         (push_string_init, next_char_1): Adjust callers.
756         Note: Patches titled Stage 0 through N form a series of patches
757         which decreases the algorithmic complexity of tail recursion in
758         macro expansions from O(n^2) to O(n) in both time and memory, then
759         performs cleanups, such as handling of embedded NUL, made easier
760         by the code refactoring.
762         Stage 0: Fix memory leak in tail recursion.
763         Free expansion text in the input engine as soon as it is parsed,
764         rather than when the recursive expansion completes.
765         Memory impact: noticeable improvement, due to reduction from
766         O(n^2) to O(n) on recursion.
767         Speed impact: minor improvement, due to better memory usage.
768         * src/input.c (push_string_init): Let go of memory earlier.
769         (next_char_1): Make end of string detection reliable.
770         (match_input): Simplify use of push_string_init.
771         * NEWS: Document this fix.
773 2007-11-07  Eric Blake  <ebb9@byu.net>
775         * doc/m4.texinfo (Pseudo Arguments): Test more corner cases.
777 2007-11-05  Eric Blake  <ebb9@byu.net>
779         Use assert, rather than INTERNAL ERROR.
780         * src/m4.h: Include <assert.h>.
781         * src/builtin.c (m4_dumpdef, define_macro, m4_defn): Use assert.
782         * src/debug.c (trace_pre): Likewise.
783         * src/eval.c (evaluate, cmp_term, shift_term, mult_term):
784         Likewise.
785         * src/freeze.c (produce_frozen_state): Likewise.
786         * src/input.c (push_string_init, pop_input, init_macro_token)
787         (peek_input, next_char_1, set_word_regexp): Likewise.
788         * src/m4.c (main): Likewise.
789         * src/macro.c (expand_token, expand_argument, call_macro):
790         Likewise.
791         * src/output.c (make_diversion): Likewise.
792         * src/symtab.c (symtab_init): Likewise.
794         Use build-aux directory.
795         * configure.ac (PACKAGE, VERSION): Delete, since Automake does
796         this now.
797         (AC_CONFIG_AUX_DIR): Add, with auxiliary files in build-aux
798         instead of the top level.
799         * bootstrap: Adjust accordingly.
800         * m4/gnulib-cache.m4: Add --aux-dir option.
801         * doc/Makefile.am (m4.1): Rewrite rule to use build-aux/missing.
803 2007-11-02  Eric Blake  <ebb9@byu.net>
805         Update some documentation about version control.
806         * NEWS: M4 is now stored in git.
807         * HACKING: Likewise.
808         * README: Likewise.
809         * bootstrap: Likewise.
810         * commit: Delete, now that CVS commits are no longer necessary.
812         Adjust to recent gnulib change.
813         * m4/gnulib-cache.m4: Drop vasprintf-posix and xvasprintf, and use
814         xvasprintf-posix instead.
816 2007-11-01  Eric Blake  <ebb9@byu.net>
818         Improve error message when early end of file occurs.
819         * doc/m4.texinfo (Macro Arguments, Changequote, Changecom)
820         (M4wrap): Adjust to new messages.
821         (Improved capitalize): Enhance test.
822         * src/m4.h (next_token): Adjust prototype.
823         * src/input.c (next_token): Add new parameter, and improve error
824         message.
825         (lex_debug): Adjust callers.
826         * src/symtab.c (symtab_debug): Likewise.
827         * src/macro.c (expand_input, collect_arguments): Likewise.
828         (expand_argument): Likewise, and add parameter.
830 2007-10-31  Eric Blake  <ebb9@byu.net>
832         Test more corner cases.
833         * doc/m4.texinfo (Changecom, Pseudo Arguments): Beef up tests.
834         (Improved foreach): Document alternate foreachq style.
835         * examples/foreachq3.m4: New file.
836         * examples/loop.m4: New file.
837         * examples/Makefile.am (EXTRA_DIST): Distribute them.
839 2007-10-28  Eric Blake  <ebb9@byu.net>
841         More test coverage for autoconf usage patterns.
842         * doc/m4.texinfo (Inhibiting Invocation, Pseudo Arguments)
843         (Builtin): Add new undocumented tests.
844         (Shift): Document cond macro, and add new test.
846 2007-10-27  Eric Blake  <ebb9@byu.net>
848         Document one use of changequote(`(',`)').
849         * doc/m4.texinfo (Changequote): Add new test, based on recent
850         autoconf addition of m4_expand.
852 2007-10-24  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
854         * examples/Makefile.am (EXTRA_DIST): Add capitalize2.m4.
856 2007-10-24  Eric Blake  <ebb9@byu.net>
858         Reduce number of mingw testsuite failures.
859         * doc/m4.texinfo (Using frozen files): Skip test on mingw.
861 2007-10-22  Eric Blake  <ebb9@byu.net>
863         Add DEBUG_REGEX debugging information.
864         * src/m4.h (DEBUG_REGEX): New debug macro.
865         * src/m4.c (main) [DEBUG_REGEX]: Open regex trace file when
866         requested.
867         * src/builtin.c (m4_patsubst, m4_regexp, compile_pattern)
868         [DEBUG_REGEX]: Trace regex usage.
870         Never let printf failures go undetected.
871         * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
872         xprintf'.
873         * src/m4.h: Include xprintf.h.
874         * src/format.c (format): Warn on format failures.
875         * src/builtin.c (ntoa): Export.
876         (m4_errprint): Adjust all *printf callers.
877         * src/debug.c (debug_message_prefix, trace_format): Likewise.
878         * src/freeze.c (produce_frozen_state): Likewise.
879         * src/input.c [DEBUG_INPUT]: Likewise.
880         * src/m4.c (usage): Likewise.
881         * src/m4.h (DEBUG_PRINT1, DEBUG_PRINT3, DEBUG_MESSAGE)
882         (DEBUG_MESSAGE1, DEBUG_MESSAGE2): Likewise.
883         * src/output.c (m4_tmpname, shipout_text, freeze_diversione):
884         Likewise.
885         * src/path.c [DEBUG_INCL]: Likewise.
886         * src/stackovf.c (process_sigsegv) [DEBUG_STKOVF]: Likewise.
887         * src/symtab.c [DEBUG_SYM]: Likewise.
889 2007-10-17  Eric Blake  <ebb9@byu.net>
891         Fix 'm4 -F file -t undefined'.
892         * src/freeze.c (produce_frozen_state): Avoid core dump.
893         * doc/m4.texinfo (Using frozen files): Test for the bug.
894         * NEWS: Mention the fix.
896 2007-10-09  Eric Blake  <ebb9@byu.net>
898         * NEWS: Document recent speedups.
900         Fix regexp regression of 2007-09-29.
901         * src/builtin.c (substitute): Allow NULL regs when no
902         subexpressions were present.
903         (m4_regexp): Handle \ escapes even with empty regex.
904         * doc/m4.texinfo (Regexp, Patsubst): Catch this bug.
906         Cache regex compilation for another autoconf speedup.
907         * src/m4.h (free_macro_sequence): Rename...
908         (free_regex): ...to this.
909         * src/m4.c (main): Update caller.
910         * src/builtin.c (REGEX_CACHE_SIZE, m4_regex, regex_cache): New
911         declarations.
912         (compile_pattern): New function; cache recent regexes.
913         (free_regex): Rename, and clean up additional memory.
914         (m4_regexp, m4_patsubst): Use new function.
916 2007-10-02  Eric Blake  <ebb9@byu.net>
918         Document quoting pitfalls in capitalize.
919         * doc/m4.texinfo (Patsubst): Use the examples directory.  Also
920         document shortfall.
921         (Improved capitalize): New node.
922         * examples/capitalize.m4: Update to match manual.
923         * examples/capitalize2.m4: New file.
925 2007-10-01  Eric Blake  <ebb9@byu.net>
927         Another Autoconf usage pattern optimization.
928         * src/builtin.c (m4_index): Optimize search for one byte.
929         * doc/m4.texinfo (Index macro, Regexp, Patsubst): Test the new
930         code paths.
932 2007-09-29  Eric Blake  <ebb9@byu.net>
934         Optimize for Autoconf usage pattern.
935         * src/builtin.c (m4_regexp, m4_patsubst): Handle empty regex
936         faster.
938 2007-09-24  Eric Blake  <ebb9@byu.net>
940         Create .gitignore alongside .cvsignore.
941         * bootstrap (LC_ALL): Set up front.
942         (version control) Borrow idea from head, to avoid churn in
943         m4/.*ignore files modified by gnulib-tool.
945 2007-09-13  Eric Blake  <ebb9@byu.net>
947         * AUTHORS: Fix typo.
949 2007-09-07  Eric Blake  <ebb9@byu.net>
951         * AUTHORS: Simplify, to match libtool and autoconf layout.
952         * THANKS: Sync with head.
954 2007-08-10  Eric Blake  <ebb9@byu.net>
956         * doc/m4.texinfo (Compatibility): Sync with head.
958 2007-08-10  Konrad Schwarz  <konrad.schwarz@siemens.com>  (tiny change)
959         and Eric Blake  <ebb9@byu.net>
961         * doc/m4.texinfo (Defn): Update wording.
963 2007-08-09  Eric Blake  <ebb9@byu.net>
965         POSIX requires defn(`a',`b') to concatenate definitions.
966         * src/builtin.c (m4_defn): Allow multiple arguments, but warn if
967         trying to mix a builtin with anything else.
968         * doc/m4.texinfo (Defn): Document a use for this POSIX
969         requirement.
970         (Incompatibilities): Update to match current status.
971         * NEWS: Document this change.
972         * THANKS: Update.
973         Reported by Konrad Schwarz.
975 2007-08-04  Eric Blake  <ebb9@byu.net>
977         Normalize all GPL license notices.
978         * GNUmakefile: Update license wording.
979         * Makefile.am: Likewise.
980         * Makefile.maint: Likewise.
981         * bootstrap: Likewise.
982         * commit: Likewise.
983         * configure.ac: Likewise.
984         * checks/Makefile.in: Likewise.
985         * doc/Makefile.am: Likewise.
986         * examples/Makefile.am: Likewise.
987         * src/Makefile.am: Likewise.
988         * src/builtin.c: Likewise.
989         * src/debug.c: Likewise.
990         * src/eval.c: Likewise.
991         * src/format.c: Likewise.
992         * src/freeze.c: Likewise.
993         * src/input.c: Likewise.
994         * src/m4.c: Likewise.
995         * src/m4.h: Likewise.
996         * src/macro.c: Likewise.
997         * src/output.c: Likewise.
998         * src/path.c: Likewise.
999         * src/stackovf.c: Likewise.
1000         * src/symtab.c: Likewise.
1002 2007-07-21  Eric Blake  <ebb9@byu.net>
1004         Fix regression on NetBSD from 2007-05-28.
1005         * src/output.c (m4_tmpopen): Explicitly reset append-mode stream
1006         position to byte 0.
1007         * NEWS: Document this fix.
1008         * THANKS: Update.
1009         Reported by Thomas Klausner.
1011 2007-07-20  Eric Blake  <ebb9@byu.net>
1013         Fix 'make distcheck' issues.
1014         * Makefile.am (EXTRA_DIST): No need to distribute
1015         gpl-3.0.texi.diff anymore.
1016         * m4/gnulib-cache.m4: Update to latest gnulib.
1018 2007-07-14  Eric Blake  <ebb9@byu.net>
1020         Reflect upstream license .texi changes.
1021         * doc/m4.texinfo (Copying): Rename node...
1022         (GNU General Public License): ...to this.
1023         (GNU Free Documentation License): Adjust node location.
1024         * local/doc/gpl-3.0.texi.diff: Remove file.
1026 2007-07-10  Eric Blake  <ebb9@byu.net>
1028         Start 1.4.10a.
1029         * configure.ac (AC_INIT): Bump version number.
1030         * NEWS: Start changes since 1.4.10.
1031         * doc/m4.texinfo (History): Mention 1.4.11.
1032         (Copying This Package, Copying This Manual): Add index entries.
1033         * local/lib/version-etc.c.diff: Delete, now that gnulib has been
1034         updated.
1035         * Makefile.am (EXTRA_DIST): Remove dead file.
1037 2007-07-09  Eric Blake  <ebb9@byu.net>
1039         Release Version 1.4.10.
1040         * doc/Makefile.am (m4_TEXINFOS): Distribute gpl-3.0.texi.
1041         * Makefile.am (EXTRA_DIST): Distribute gnulib diffs.
1042         * configure.ac (AC_INIT): Bump version number.
1043         * NEWS: Describe changes since 1.4.9.
1045         * src/format.c: Missed a GPLv3 conversion.
1047         Avoid undefined behavior of %.*c in printf.
1048         * src/format.c (format): Special case %c.
1049         * TODO: Document that more remains to be done.
1050         * NEWS: Document the fix.
1052 2007-07-05  Eric Blake  <ebb9@byu.net>
1054         Fix up gnulib-tool usage.
1055         * m4/gnulib-cache.m4: Change local-dir to local, not `.'.
1056         * version-etc.c.diff: Move to...
1057         * local/lib/version-etc.c.diff: ...here.
1058         * gpl-3.0.texi.diff: Move to...
1059         * local/doc/gpl-3.0.texi.diff: ...here.
1061 2007-07-04  Eric Blake  <ebb9@byu.net>
1063         Upgrade to GPL version 3 or later.
1064         * bootstrap: Pick up GPLv3.
1065         * m4/gnulib-cache.m4: Augment with 'gnulib-tool
1066         --local-dir=. --import gpl-3.0'.
1067         * doc/m4.texinfo (Copying This Package): New appendix.
1068         * NEWS: Mention this change.
1069         * README: Mention why some files still claim to be version 2.
1070         * version-etc.c.diff: New file, to make sure --version claims
1071         correct GPL version.  Temporary until gnulib makes move.
1072         * gpl-3.0.texi.diff: New file, to allow inclusion of GPLv3 as
1073         appendix, rather than section, of the manual.
1074         * GNUmakefile: Update to new license.
1075         * Makefile.am: Likewise.
1076         * Makefile.maint: Likewise.
1077         * commit: Likewise.
1078         * configure.ac: Likewise.
1079         * checks/Makefile.in: Likewise.
1080         * doc/Makefile.am: Likewise.
1081         * examples/Makefile.am: Likewise.
1082         * src/Makefile.am: Likewise.
1083         * src/builtin.c: Likewise.
1084         * src/debug.c: Likewise.
1085         * src/eval.c: Likewise.
1086         * src/freeze.c: Likewise.
1087         * src/input.c: Likewise.
1088         * src/m4.c: Likewise.
1089         * src/m4.h: Likewise.
1090         * src/macro.c: Likewise.
1091         * src/output.c: Likewise.
1092         * src/path.c: Likewise.
1093         * src/stackovf.c: Likewise.
1094         * src/symtab.c: Likewise.
1096 2007-06-26  Eric Blake  <ebb9@byu.net>
1098         * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import assert'.
1100 2007-06-26  Karl Berry  <karl@freefriends.org>  (tiny change)
1102         Match Free Software Directory categories.
1103         * doc/m4.texinfo (dircategory): Update.
1105 2007-05-31  Eric Blake  <ebb9@byu.net>
1107         * src/output.c (output_text): Fix regression from 2007-05-28.
1108         * doc/m4.texinfo (History): Mention 1.4.10.
1109         (Format): Make testsuite output easier to debug.
1111 2007-05-29  Eric Blake  <ebb9@byu.net>
1113         Start 1.4.9c.
1114         * configure.ac (AC_INIT): Bump version number.
1115         * NEWS: Start changes since 1.4.9b, and fix typo.
1117         Beta Release Version 1.4.9b.
1118         * configure.ac (AC_INIT): Bump version number.
1119         * NEWS: Describe changes since 1.4.9.
1121         Improve format support.
1122         * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
1123         vasprintf-posix'.
1124         * src/format.c (format): Parse %'hhd, %a, %A.  Avoid calling
1125         printf with too few arguments, as in format(%*.*d,-1,-1,1).
1126         * doc/m4.texinfo (Format): Expand tests, and improve
1127         documentation.
1128         * NEWS: Document this change.
1130 2007-05-28  Eric Blake  <ebb9@byu.net>
1132         Fix large diversion corner cases, including 1.4.8 regression.
1133         * src/output.c (m4_tmpfile, m4_tmpopen): Simplify use of errno.
1134         (make_room_for): Use NULL, not 0, for pointers.
1135         (insert_diversion_helper): Avoid using rewind.
1136         (freeze_diversions): Allow freezing large diversions.
1137         * NEWS: Document this fix.
1139         Also run gnulib unit tests during make check.
1140         * m4/gnulib-cache.m4: Augment with 'gnulib-tool
1141         --tests-base=tests --with-tests'.
1142         * configure.ac (AC_CONFIG_FILES): Build gnulib testdir.
1143         * Makefile.am (SUBDIRS): Run gnulib tests before ours.
1145 2007-05-25  Eric Blake  <ebb9@byu.net>
1147         Backport prompts in examples from head.
1148         * src/macro.c (expand_macro): Shorten message.
1149         * doc/m4.texinfo (Manual, Command line files, Comments)
1150         (Inhibiting Invocation, Macro Arguments, Macro expansion, Indir)
1151         (Builtin, Shift, Forloop, Foreach, Dumpdef, Trace, Debug Levels)
1152         (Debug Output, Include, Format, Syscmd, Mkstemp, Location)
1153         (Using frozen files, Improved forloop, Improved foreach): Add
1154         prompts to examples.
1155         * checks/get-them: Ignore prompts in examples.
1157         Fix sync line interaction with multiline comments.
1158         * doc/m4.texinfo (Other Incompatibilities): Add example, and
1159         document bug in --syncline/divert interaction.
1160         (Preprocessor features): Augment test.
1161         * src/m4.h (output_text): Export.
1162         (shipout_text, next_token): Add parameter.
1163         * src/freeze.c (reload_frozen_state): Don't interfere with
1164         synclines when reloading state.
1165         * src/output.c (output_text): Export.
1166         (shipout_text): Take new parameter for start line of token.
1167         Output at most one syncline per token.
1168         * src/input.c (next_token): Report line where multiline tokens
1169         start.
1170         * src/macro.c (expand_input, expand_token, expand_argument):
1171         Adjust callers so that line is passed from input to output.
1172         * NEWS: Document this fix.
1173         Reported by Sergey Poznyakoff.
1175         Test -s in testsuite.
1176         * doc/m4.texinfo (Preprocessor features): Add a test.
1177         * checks/get-them: Support extra options in testsuite.
1178         * checks/check-them (examples): Use extra options.
1179         * THANKS: Update.
1180         Reported by Sergey Poznyakoff.
1182 2007-05-24  Eric Blake  <ebb9@byu.net>
1184         Support POSIX flush semantics on all platforms.
1185         * m4/gnulib-cache.m4: Remove closeout, and augment with
1186         'gnulib-tool --import closein fflush'.
1187         * src/m4.h (includes): Use closein, not closeout.
1188         * src/m4.c (main): Ensure stdin is flushed when not all input is
1189         consumed.
1190         (process_file): No return needed.
1191         * src/debug.c (debug_flush_files): Rely on gnulib module, rather
1192         than excluding mingw.
1193         * NEWS: Document this change.
1195         Work around cygwin and mingw fseeko bugs.
1196         * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import fseeko'.
1197         * src/debug.c (debug_flush_files): Prefer fseeko over fseek.
1199 2007-04-25  Eric Blake  <ebb9@byu.net>
1201         Fix negative division within eval, regression of 2007-01-06.
1202         * doc/m4.texinfo (Eval): Catch this bug.
1203         * src/eval.c (mult_term): Fix it.
1204         * NEWS: Document this.
1205         * THANKS: Update.
1206         Reported by Cesar Strauss.
1208 2007-04-23  Eric Blake  <ebb9@byu.net>
1210         Start 1.4.9a.
1211         * configure.ac (AC_INIT): Bump version number.
1212         * NEWS: Start changes since 1.4.9.
1214 2007-03-23  Eric Blake  <ebb9@byu.net>
1216         Release 1.4.9:
1217         * configure.ac (AC_INIT): Bump version number.
1218         * NEWS: Describe changes since 1.4.8b.
1220 2007-03-16  Eric Blake  <ebb9@byu.net>
1222         * doc/m4.texinfo (Mkstemp): Tweak wording.
1223         * src/output.c (output_init): Adjust to latest gnulib.
1225 2007-03-15  Eric Blake  <ebb9@byu.net>
1227         Avoid Tandem/NSK's broken long long (without a symmetric unsigned
1228         long long, it confuses gnulib).
1229         * configure.ac (AC_TYPE_LONG_LONG_INT): Declare long long broken
1230         if unsigned long long doesn't work.
1231         * THANKS: Update.
1232         Reported by Matthew Woehlke.
1234 2007-03-07  Eric Blake  <ebb9@byu.net>
1236         * AUTHORS: Update.
1237         * doc/m4.texinfo: Minor tweaks, avoid makeinfo warning.
1239 2007-03-01  Eric Blake  <ebb9@byu.net>
1241         * doc/m4.texinfo: Pick up more index entries from head.  Follow
1242         more texinfo recommendations.
1243         (Sysval): Improve tests.
1245         Avoid overfull \vbox warning from texinfo, due to indices that
1246         weren't quite big enough to split across page boundaries.
1247         * doc/m4.texinfo: Add lots of concept index entries.
1248         (Concept Index): Move to be last, as recommended by texinfo
1249         manual.
1250         (Define, Arguments, Pseudo Arguments): Add more function entries.
1252 2007-02-28  Eric Blake  <ebb9@byu.net>
1254         * doc/m4.texinfo (Eval): Clean up wording to reflext POSIX XCU ERN
1255         137.
1256         (Pseudo Arguments): Add useful example.
1258         * doc/m4.texinfo (Pushdef, Incompatibilities): Clean up wording to
1259         reflect POSIX XCU ERN 118.
1261         * src/m4.h (DEFAULT_MACRO_SEQUENCE): Factor out from...
1262         * src/m4.c (usage): ...here,...
1263         * src/builtin.c (set_macro_sequence): ...and here.
1264         (define_user_macro): Fix typo.
1265         * doc/m4.texinfo (Preprocessor features, Arguments): Fix minor
1266         inaccuracies.
1267         (Shift): Document composite macro argn for portably getting at
1268         positional parameters beyond 9.
1269         * configure.ac (AC_INIT): Bump version number.
1270         * NEWS: Start changes of 1.4.8c.
1272 2007-02-24  Eric Blake  <ebb9@byu.net>
1274         Beta Release 1.4.8b:
1275         * configure.ac (AC_INIT): Bump version number.
1276         * NEWS: Describe changes since 1.4.8.
1278         Reserve all uses of raw ${} in macro definitions, not just
1279         ${<digit>}.
1280         * src/builtin.c (set_macro_sequence): Change default macro
1281         sequence.
1282         * doc/m4.texinfo (Operation modes): Update to match.
1283         * src/m4.c (usage): Likewise.
1284         * NEWS: Likewise.
1286 2007-02-23  Eric Blake  <ebb9@byu.net>
1288         * src/m4.h (includes): Update to latest gnulib.
1290 2007-02-08  Eric Blake  <ebb9@byu.net>
1292         Rename --warn-syntax to --warn-macro-sequence[=regex], to make it
1293         more flexible, and so that autoconf can use it.
1294         * src/m4.h (set_macro_sequence, free_macro_sequence): New
1295         prototypes.
1296         * src/builtin.c (macro_sequence_buf, macro_sequence_regs)
1297         (macro_sequence_inuse, set_macro_sequence, free_macro_sequence):
1298         New variables and functions.
1299         (define_user_macro): Allow flexibility in regular expression used
1300         to trigger warning.
1301         * src/m4.c (warn_syntax): Delete.
1302         (usage, WARN_MACRO_SEQUENCE_OPTION, main): Implement changed
1303         spelling of option, along with optional argument.
1304         * doc/m4.texinfo (Operation modes, Arguments): Document this
1305         change.
1306         * NEWS: Document this change.
1308 2007-02-05  Eric Blake  <ebb9@byu.net>
1310         * m4/gnulib-cache.m4: Module strstr no longer exists.
1312         Avoid bool bitfields, as they don't work on AIX.
1313         * src/m4.h (bool_bitfield): New typedef.
1314         (struct symbol, struct builtin): Use it.
1315         * src/input.c (struct input_block): Likewise.
1316         Reported by Albert Chin.
1318         * doc/m4.texinfo (Sysval): Avoid SIGPIPE in test as unreliable.
1319         Reported by Albert Chin.
1320         * THANKS: Update.
1322 2006-06-18  Bruno Haible  <bruno@clisp.org>  (tiny change)
1324         * doc/m4.texinfo (Input processing): Further clarifications.
1326 2007-02-03  Eric Blake  <ebb9@byu.net>
1328         * doc/m4.texinfo (Input processing, Quoting Arguments): Beef up
1329         the examples.
1330         Reported by Bruno Haible.
1332 2007-02-01  Eric Blake  <ebb9@byu.net>
1334         * src/m4.c (fatal_warnings): New variable.
1335         (usage): Document new -E behavior.
1336         (main): Make -E an additive option.
1337         (m4_error, m4_error_at_line): Change exit status when required.
1338         * NEWS: Document this change.
1339         * doc/m4.texinfo (Operation modes): Likewise.
1340         Reported by Ralf Wildenhues.
1342 2007-01-27  Eric Blake  <ebb9@byu.net>
1344         * src/m4.h (warn_syntax): Declare.
1345         (init_pattern_buffer): Export.
1346         * src/m4.c (warn_syntax, usage, WARN_SYNTAX_OPTIONS)
1347         (long_options, main): Implement new option.
1348         * src/builtin.c (init_pattern_buffer): Allow NULL regs argument.
1349         (define_user_macro): Warn on $11 and ${1} if requested.
1350         * src/input.c (init_pattern_buffer): Delete duplicate method.
1351         * doc/m4.texinfo (Operation modes): Document it.
1352         (Arguments): Document future direction of ${11} vs. $11.
1353         (Incompatibilities): Fix wording on POSIX limitations.
1354         * checks/get-them: Parse @{ and @} correctly.
1355         * NEWS: Document this change.
1357 2007-01-26  Eric Blake  <ebb9@byu.net>
1359         * src/builtin.c (includes): Adjust to gnulib changes.
1361 2007-01-15  Eric Blake  <ebb9@byu.net>
1363         * doc/m4.texinfo: Pull in various improvements from head.
1364         * src/builtin.c (include): Alter exit status on failure.
1365         * NEWS: Document this fix.
1367 2007-01-13  Eric Blake  <ebb9@byu.net>
1369         * configure.ac (AC_CHECK_MEMBERS): Check for stack_t.ss_sp, and
1370         assume the fallback of ss_base for BSDI 4.0.1.
1371         * src/stackovf.c (setup_stackovf_trap) [HAVE_SIGALTSTACK &&
1372         ! HAVE_STACK_T_SS_SP]: Use this check.
1373         Reported by Chris McGuire.
1374         * THANKS: Update.
1375         * NEWS: Document the improvement.
1377 2007-01-09  Eric Blake  <ebb9@byu.net>
1379         * src/eval.c (ASSIGN): New enumerator.
1380         (eval_lex): Recognize '='.
1381         (equality_term): Treat '=' like '==', but warn that it is
1382         deprecated.
1383         * doc/m4.texinfo (Eval): Document and test this.
1384         (Incompatibilities): Document the POSIX incompatibility.
1385         * NEWS: Document this change.
1387 2007-01-06  Eric Blake  <ebb9@byu.net>
1389         * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import stdint'.
1390         * checks/check-them: Record expected exit status.
1391         * checks/get-them: Check exit status.
1392         * src/m4.h (eval_t, unsigned_eval_t): Delete, use POSIX int32_t
1393         instead.
1394         * src/builtin.c: All users changed.
1395         * src/eval.c: Likewise.  Also document where we are triggering
1396         undefined or implementation-defined behavior.
1397         (BADOP, NEGATIVE_EXPONENT, INVALID_OPERATOR, eval_lex, evaluate)
1398         (logical_or_term, logical_and_term, logical_not_term, not_term)
1399         (equality_term, unary_term): Port from head to follow POSIX
1400         semantics.
1401         (exp_term): Reject 0**0 as undefined.
1402         * doc/m4.texinfo (History): Mention 1.4.9.
1403         (Format, Incompatibilities): Update to document POSIX compliance.
1404         * NEWS: Document this change.
1406 2007-01-04  Eric Blake  <ebb9@byu.net>
1408         * NEWS: Document previous fix.
1409         * THANKS: Update.
1411 2007-01-04  Sami Liedes  <sliedes@cc.hut.fi>  (tiny change)
1413         Fix Debian bug 405594, introduced 2006-11-01 from a bad
1414         copy-n-paste from head.
1415         * src/m4.c (main): Use correct file name after --.
1417 2007-01-04  Eric Blake  <ebb9@byu.net>
1419         Fix regression from 1.4.7 in large file handling on some
1420         platforms, introduced on 2006-10-13.
1421         * configure.ac (AC_LARGE_SYSFILE): Guarantee that large files
1422         will be handled.
1423         * NEWS: Document this fix.
1425 2007-01-03  Eric Blake  <ebb9@byu.net>
1427         * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
1428         version-etc-fsf'.
1429         * src/m4.c (AUTHORS, main): Use FSF wording for --version (plus
1430         it bumps the copyright year).
1432 2006-12-27  Eric Blake  <ebb9@byu.net>
1434         * doc/m4.texinfo (Patsubst): Fix typo.
1436 2006-12-16  Eric Blake  <ebb9@byu.net>
1438         * src/m4.c (main): Check for errors when closing stdin.
1440 2006-12-09  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1442         * doc/m4.texinfo: Fix some typos.
1444 2006-12-09  Eric Blake  <ebb9@byu.net>
1446         * configure.ac (AC_INIT): Bump version number.
1447         * NEWS: Start changes of 1.4.8a.
1449 2006-11-20  Eric Blake  <ebb9@byu.net>
1451         Release 1.4.8:
1452         * configure.ac (AC_INIT): Bump version number.
1453         * NEWS: Describe changes since 1.4.7.
1455 2006-11-16  Eric Blake  <ebb9@byu.net>
1457         * doc/m4.texinfo (Include, Search Path, Diversions, Divert):
1458         Minor tweaks noticed while porting to head.
1460 2006-11-14  Eric Blake  <ebb9@byu.net>
1462         * src/output.c (cleanup_tmpfile, freeze_diversions): Clean up
1463         spent iterators.
1464         (m4_tmpname): Avoid memory leak.
1466 2006-11-13  Eric Blake  <ebb9@byu.net>
1468         * src/output.c (cleanup_tmpfile): Avoid double error message when
1469         umask is prohibitive.
1470         (m4_tmpname, m4_tmpopen, m4_tmpclose, m4_tmpremove): New
1471         functions.
1472         (m4_tmpfile): Add parameter, move cloexec action here.
1473         (make_room_for): Adjust caller.  Don't keep too many files open.
1474         (insert_diversion_helper): Unlink emptied temp files.
1475         (make_diversion): Don't keep too many files open.
1476         * doc/m4.texinfo (Diversions): Tweak wording, now that open file
1477         descriptors are no longer a limiting factor.
1478         * NEWS: Document this change.
1480         Backport sparse diversion handling from head.
1481         * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
1482         avltree-oset'.
1483         * src/output.c (struct m4_diversion): Rename from struct
1484         diversion, and update members.  All users changed.
1485         (diversion_table): Change to an ordered set, instead of an array.
1486         (div0): New storage for diversion 0.
1487         (diversions): No longer needed.
1488         (free_list): New list to allow recycling diversion storage.
1489         (diversion_storage): New storage to reduce malloc overhead.
1490         (cmp_diversion_CB, threshold_diversion_CB): New callbacks.
1491         (output_init, output_exit, cleanup_tmpfile, make_room_for)
1492         (make_diversion): Handle new diversion storage scheme.
1493         (insert_diversion_helper): New function.
1494         (insert_diversion, undivert_all, freeze_diversions): Use it.
1495         * doc/m4.texinfo (Divert, Diversions): Move hidden test of memory
1496         exhaustion to visible test of large diversion numbers.
1497         * NEWS: Document this fix.
1499 2006-11-11  Eric Blake  <ebb9@byu.net>
1501         * src/builtin.c (m4_translit): Slight optimization.
1503         * src/m4.h (to_uchar): Depend on HAVE_INLINE.
1505         * src/builtin.c: Remove unnecessary casts.
1506         (expand_ranges): Make 8-bit clean.
1507         * doc/m4.texinfo (Translit): Add tests and wording.
1508         * NEWS: Document this fix.
1510 2006-11-07  Eric Blake  <ebb9@byu.net>
1512         * src/m4.h (output_exit): New prototype.
1513         * src/m4.c (main): Use it.
1514         * src/output.c (cleanup_tmpfile): Close files before removing
1515         directory.
1516         (insert_diversion): Check for failure.
1517         (output_exit): Avoid memory leak.
1518         * doc/m4.texinfo (Diversions): Test this bug.
1520         * doc/m4.texinfo (Esyscmd, Errprint): Minor touchups.
1522 2006-11-01  Eric Blake  <ebb9@byu.net>
1524         Allow C++ compilation on Linux, as a safety measure in type
1525         checking.
1526         * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
1527         stdbool'.
1528         * src/m4.h (hack_symbol, hack_all_symbols): Use full prototype.
1529         (boolean): Kill this, and use stdbool.h instead.
1530         * src/debug.c, src/eval.c, src/input.c, src/macro.c, src/m4.c:
1531         * src/output.c, src/symtab.c: All users changed.
1532         * src/symtab.c (hack_all_symbols): Update prototype.
1533         * src/builtin.c (dump_symbol, set_trace): Update signature.
1534         (m4_dumpdef, m4_traceon, m4_traceoff): Update callers.
1535         (mkstemp_helper, m4_m4wrap, expand_ranges, m4_translit): Allow
1536         C++ compilation.
1537         * src/debug.c (trace_flush): Likewise.
1538         * src/freeze.c (reload_frozen_state): Likewise.
1539         * src/input.c (push_file, push_string_finish, push_wrapup):
1540         (token_bottom, next_token): Likewise.
1541         * src/m4.c (main): Likewise.
1543         * doc/m4.texinfo (Invoking m4): Update according to POSIX 200x
1544         draft wording.
1545         * src/m4.h (m4_path_search): Tweak signature.
1546         * src/path.c (m4_path_search): Likewise.
1547         * src/builtin.c (include): Update caller.
1548         * src/m4.c (main): Allow -D, -U, -t, and -s to be interspersed
1549         with file names.  Don't write to **argv.
1550         (process_file): New helper method.
1551         * NEWS: Document this fix.
1553 2006-10-31  Eric Blake  <ebb9@byu.net>
1555         * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import strstr'.
1556         * doc/m4.texinfo (Translit): Improve the documentation.
1557         * src/builtin.c (m4_translit): Optimize to O(n) instead of O(n^2)
1558         algorithm.
1559         (m4_index): Simplify, and speed up slightly.
1560         * NEWS: Document this fix.
1562 2006-10-28  Eric Blake  <ebb9@byu.net>
1564         * src/input.c (set_quotes): Don't allow empty end-quote with
1565         non-empty start-quote.
1566         (set_comment): Likewise for end-comment.
1567         * src/builtin.c (m4_changecom): Adjust caller.
1568         * doc/m4.texinfo (Changequote, Changecom): Update documentation to
1569         match behavior.
1570         (Incompatibilities): Document another POSIX bug.
1571         * NEWS: Mention this change.
1573 2006-10-27  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1575         * examples/Makefile.am (EXTRA_DIST): Distribute recently-added
1576         files.
1578 2006-10-26  Eric Blake  <ebb9@byu.net>
1580         Silence -Wwrite-strings -Wpointer-arith warnings.
1581         * src/builtin.c (define_user_macro): Allow NULL argument.
1582         (m4_builtin, m4_indir): Cast away const of "".
1583         * src/format.c (format): Likewise.
1584         * src/macro.c (collect_arguments): Likewise.
1585         (expand_macro): Avoid math on void*.
1586         * src/m4.c (main): Adjust caller.
1587         * src/output.c (freeze_diversions): Detect off_t overflow.
1589         * src/input.c (pop_input): Remove unnecessary code.
1591 2006-10-25  Eric Blake  <ebb9@byu.net>
1593         * src/symtab.c (symtab_init): Avoid size_t overflow.
1594         * src/output.c (make_diversion): Avoid size_t overflow.
1595         * doc/m4.texinfo (Diversions): Test this fix.
1596         * src/input.c (input_block): Remove unused member.  Reduce size
1597         of struct.
1598         (push_file, pop_input): Avoid useless assignment.
1599         * NEWS: Document the bug fix.
1601         Redo location tracking.  Instead of having just files track the
1602         line to return to when popping input, now all input blocks track
1603         their current line.
1604         * src/input.c (INPUT_STRING_WRAP, INPUT_FILE_INIT): No longer
1605         needed.
1606         (input_block): Have line and file storage for all input types, and
1607         rename some members.
1608         (input_change): New global flag.
1609         (push_file, push_macro, push_string_init, push_wrapup): Store
1610         location.
1611         (push_string_finish, pop_input, pop_wrapup): Notice changes in
1612         input blocks.
1613         (peek_input): Adjust to new member names.
1614         (next_char, next_char1): Adjust location if needed.
1615         (skip_line): Simplify restoring location.
1616         * doc/m4.texinfo (Location): Augment the test to catch line
1617         location of expansion of multi-line arguments.
1618         Reported by Stepan Kasal.
1620 2006-10-23  Eric Blake  <ebb9@byu.net>
1622         * doc/m4.texinfo (Macro Arguments): Document that leading space
1623         in argument collection stops at macro expansion.
1624         (Incompatibilities): Document POSIX whitespace wording issue.
1626 2006-10-20  Eric Blake  <ebb9@byu.net>
1628         * doc/m4.texinfo: Trailing '@comment' doesn't format nicely in
1629         TeX, so recognize '@w{ }' instead.  Likewise, @code{_name} at the
1630         end of a TeX line splits incorrectly.
1631         (Foreach, Improved foreach): Write these sections, borrowing ideas
1632         from CVS head and from m4sugar.
1633         * checks/get-them: Accomodate new way to show trailing space in
1634         examples.
1635         * examples/foreach.m4: Make usable in documentation.
1636         * examples/foreachq.m4: New file.
1637         * examples/foreachq2.m4: New file.
1638         * examples/foreach2.m4: New file.
1639         * NEWS: Document the documentation updates.
1641 2006-10-19  Eric Blake  <ebb9@byu.net>
1643         * src/builtin.c (mkstemp_helper, m4_mkstemp): New functions.
1644         (m4_maketemp): Provide traditional behavior.
1645         * doc/m4.texinfo (Mkstemp): Rename from Maketemp.  Document the
1646         new `mkstemp' macro and the flaws of the old `maketemp'.
1647         (Incompatibilities): Move maketemp discussion to...
1648         (Extensions): ...here, since -G now supresses the GNU extension.
1649         * NEWS: Document this.
1651         * examples/forloop.m4: Simplify.
1652         * examples/forloop2.m4: New file.
1653         * examples/quote.m4: New file.
1654         * doc/m4.texinfo (Loops): Rename to...
1655         (Shift): ...this node.
1656         (Forloop, Foreach, Improved forloop, Improved foreach): New
1657         nodes.
1659 2006-10-17  Eric Blake  <ebb9@byu.net>
1661         * m4/gnulib-cache.m4: Update with 'gnulib-tool --import
1662         config-h'.
1663         * configure.ac (AC_CONFIG_HEADERS): Create config.h alongside
1664         gnulib headers, rather than in top directory.
1665         * src/Makefile.am (AUTOMAKE_OPTIONS): Add nostdinc, to reduce make
1666         output clutter.
1668 2006-10-16  Eric Blake  <ebb9@byu.net>
1670         * doc/m4.texinfo: Backport some minor cleanups from head.
1671         (Cleardivert): Rename from cleardiv.
1673         * doc/m4.texinfo (Invoking m4): Promote to a chapter, instead of
1674         a section of Preliminaries.
1675         (Operation modes, Preprocessor features, Limits control)
1676         (Frozen state, Debugging options, Command line files): Subdivide
1677         into new sections.
1678         (Input processing, Quoting Arguments, Define, Arguments)
1679         (Cleardiv, Format, M4exit): Fix grammar of references.
1680         (Inhibiting Invocation, Macro Arguments, Builtin, Trace)
1681         (Debug Levels, Debug Output, Include, Search Path, Divert)
1682         (Platform macros, Syscmd, Location, Extensions): Point to new
1683         sections.
1684         (Top, Loops, Include, Undivert, Location, Incompatibilities):
1685         Improve file references.
1687 2006-10-14  Eric Blake  <ebb9@byu.net>
1689         * m4/input.c (file_clean): Don't close stdin twice, POSIX says it
1690         is not portable.
1691         Reported by Ralf Wildenhues.
1693         * src/builtin.c (m4_undivert): Check for read error.
1695 2006-10-13  Eric Blake  <ebb9@byu.net>
1697         * src/m4.h (UNIX, W32_NATIVE, OS2): Move platform checks after
1698         header files are included, since <unistd.h> can affect the tests.
1699         * THANKS: Updated.
1700         Reported by Martin Koeppe.
1702         Backport head's usage of clean-temp module, as it is cleaner than
1703         using tmpfile-safer.
1704         * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
1705         clean-temp closeout', and remove tmpfile-safer.
1706         * src/m4.h (includes): Adjust.
1707         (m4_path_search): Rename from path_search, to avoid collision
1708         with gnulib.
1709         * src/m4.c (main): Install closeout handler.  Adjust caller.
1710         (usage): Now done by closeout module.
1711         * src/builtin.c (m4_m4exit): Likewise.
1712         (m4_undivert, include): Adjust callers.
1713         * src/freeze.c (reload_frozen_state): Likewise.
1714         * src/path.c (m4_path_search): Rename from path_search.
1715         * src/output.c (output_temp_dir): New variable.
1716         (cleanup_tmpfile, m4_tmpfile): New functions, from head.
1717         (insert_diversion, make_room_for): Use them.
1718         * doc/m4.texinfo (Diversions): Document this, and add a test.
1719         (Improved fatal_error): Fix typo.
1720         (Maketemp): Port test to mingw, and no longer hide from
1721         documentation.
1722         * NEWS: Document the change in TMPDIR behavior.
1724         * configure.ac (m4_pattern_forbid): Narrow the range of forbidden
1725         macros, to work with recent gnulib-tool update.
1727         * src/builtin.c (m4_builtin, m4_indir): Allow transparent
1728         handling of defn results.
1729         * doc/m4.texinfo (Builtin, Indir): Add test cases.
1730         * NEWS: Document this.
1732 2006-10-12  Eric Blake  <ebb9@byu.net>
1734         * doc/m4.texinfo (Location): Fix typo in previous commit.
1735         (Changeword): Catch one more case.
1736         * src/input.c (skip_line): Fix case when outer file used macro to
1737         supply the \n.
1739 2006-10-11  Eric Blake  <ebb9@byu.net>
1741         * src/input.c (enum input_type): Add additional types, to shave
1742         time off the common case.
1743         (push_wrapup): Wrapped strings remember location.
1744         (push_string_finish): Normal strings carry no location.
1745         (push_file): Start new files uninitialized.
1746         (peek_input, next_char_1): Optimize common cases by updating
1747         location only on new input types.
1748         (pop_input): Update to honor new input types.
1749         (skip_line, push_string_finish): Fix regression in previous patch
1750         when dnl is not followed by newline in included file.
1751         (push_string_init): Initialize all fields of INPUT_STRING sooner.
1752         (peek_token): Simplify.
1753         (peek_input): Don't pop input files on peek, so that __file__ and
1754         __line__ as last token of include file work correctly.
1755         * doc/m4.texinfo (History): Mention 1.4.8.
1756         (Answers): Split into sections, one per answer.
1757         (Improved exch, Improved cleardivert, Improved fatal_error): New
1758         nodes.
1759         (Dnl, M4wrap, Location, M4exit, Improved fatal_error): Update to
1760         new m4wrap location semantics.
1761         (Changeword): Add test that caught the regression.
1762         * NEWS: Document this.
1764         * src/macro.c (expand_macro): In macro expansion errors, report
1765         line number at open parenthesis.
1766         * src/input.c (next_token): Fix off-by-one bug in reporting end
1767         of file in unterminated comment and string.
1768         (file_names): New obstack, necessary since expand_macro now hangs
1769         on to file names longer than the files remain open.
1770         (input_init): Initialize new obstack.
1771         (push_file): Use new obstack.  Delay updates to current_file
1772         until after expand_macro has restored state.
1773         (peek_input, next_char_1): Update current_file if necessary.
1774         (pop_wrapup): Release memory.
1775         * doc/m4.texinfo (Macro Arguments, Changequote, Changecom): Catch
1776         the off-by-one bug.
1777         (Dnl): Update to the new location reporting rules.
1778         * NEWS: Document these changes.
1780 2006-10-10  Eric Blake  <ebb9@byu.net>
1782         * src/macro.c (argc_stack, argv_stack): New variables for sharing
1783         obstacks across multiple macro calls.
1784         (expand_input): Initialize and tear down stack once per input
1785         file, instead of once per macro.
1786         (expand_macro): Reuse existing stacks when possible.
1787         (collect_arguments): Simplify slightly.
1789         * src/path.c (include_env_init): Fix botched patch application.
1790         Reported by Ralf Wildenhues.
1792 2006-10-09  Eric Blake  <ebb9@byu.net>
1794         * src/m4.c (usage, main): Detect write failures to stderr.
1795         * src/builtin.c (m4_m4exit): Likewise.
1796         * NEWS: Document this.
1798         * src/macro.c (expand_macro): Allow --nesting-limit=0 to remove
1799         the limit.
1800         * NEWS: Document this.
1801         * doc/m4.texinfo (Invoking m4): Likewise.
1803 2006-10-09  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1805         * src/path.c (include_env_init): Copy the string returned
1806         by getenv before overwriting it; POSIX disallows this.
1808 2006-10-09  Eric Blake  <ebb9@byu.net>
1810         * src/m4.c (main): Defer debugfile until after --help.
1811         * configure.ac (AC_INIT): Bump version number.
1812         * NEWS: Start changes of 1.4.7a.
1814 2006-09-25  Eric Blake  <ebb9@byu.net>
1816         Release 1.4.7:
1817         * configure.ac (AC_INIT): Bump version number.
1818         * NEWS: Describe changes since 1.4.6.
1820 2006-09-21  Eric Blake  <ebb9@byu.net>
1822         * doc/m4.texinfo (Invoking m4): Add clarification on option
1823         processing behavior.
1824         * THANKS: Update.
1825         Reported by Mikhail Teterin.
1827         * bootstrap: Add --force option, based on idea from coreutils.
1828         * README: Document that ./bootstrap and autoreconf are for
1829         developers, and not lightly done in tarballs.
1831 2006-09-20  Eric Blake  <ebb9@byu.net>
1833         * src/m4.c (usage, OPTSTRING, main): Rename -e to -i, and give
1834         deprecation warning on -e.
1835         * doc/m4.texinfo (Invoking m4, Extensions): Document this.
1836         * NEWS: Document this.
1838 2006-09-19  Eric Blake  <ebb9@byu.net>
1840         * src/m4.c (usage, long_options, main, DEBUGFILE_OPTION): Rename
1841         -o/--error-output to --debugfile, and deprecate the former.  This
1842         will allow a future release to be more consistent with other GNU
1843         tools, with -o/--output affecting stdout, not debug.
1844         * doc/m4.texinfo (Invoking m4, Debug Output): Document this.
1845         * NEWS: Document this.
1847 2006-09-14  Eric Blake  <ebb9@byu.net>
1849         * src/m4.c (main): Warn on deprecated options -B, -S, -T, -N,
1850         --diversions. `m4 --help --version' now displays help, not
1851         version.
1852         (interactive, frozen_file_to_read, frozen_file_to_write): Move to
1853         smaller scope.
1854         (show_help, show_version): No longer needed.
1855         (long_options, DIVERSIONS_OPTION): Backport patch from head to
1856         distinguish between -N and --diversions in warning.
1857         * doc/m4.texinfo (Invoking m4): Document this.
1858         * NEWS: Likewise.
1860 2006-09-11  Eric Blake  <ebb9@byu.net>
1862         * src/Makefile.am (m4_LDADD): Add any gnulib dependent libraries.
1863         * src/debug.c (debug_flush_files) [UNIX]: Flush stdin if it is
1864         seekable.
1865         (debug_set_file): Use STDOUT_FILENO.
1866         * src/builtin.c (m4_m4exit): Flush stdin before exiting, to comply
1867         with POSIX in regards to unread input.
1868         * NEWS: Document this fix.
1869         * doc/m4.texinfo (Syscmd, Esyscmd, M4exit): Likewise.
1871 2006-09-07  Eric Blake  <ebb9@byu.net>
1873         * m4/gnulib-cache.m4: Update to newer gnulib-tool.
1874         * src/m4.h (push_file): Change prototype.
1875         * src/input.c (push_file, peek_input, next_char_1): Only call getc
1876         once at EOF, to avoid double ^D on terminal stdin; regression from
1877         2006-09-04.
1878         (push_file, pop_file): Allow reading stdin twice.
1879         * src/m4.c (main): Likewise.
1880         * src/builtin.c (include): Update caller.
1881         * NEWS: Document this change.
1882         * doc/m4.texinfo (Invoking m4, Incompatibilities): Likewise.
1883         (Syscmd): Add a test that failed before this patch.
1885 2006-09-07  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1887         * checks/check-them: Quote $pwd.
1889 2006-09-05  Eric Blake  <ebb9@byu.net>
1891         * src/builtin.c (define_macro): Warn on invalid macro name.
1892         * NEWS: Document this change.
1893         * doc/m4.texinfo: Fix typos.
1894         (Invoking m4, Macro Arguments, Pseudo Arguments, Defn, Indir)
1895         (Ifelse): Backport some improvements from head.
1897 2006-09-04  Eric Blake  <ebb9@byu.net>
1899         * doc/m4.texinfo (Changeword): Skip test on mingw, where the
1900         native echo is braindead.
1901         * checks/check-them (strip_needed): Ignore \r in output.  Now the
1902         testsuite will pass when cross-compiling from cygwin to mingw.
1904         * src/input.c (peek_input): Fix regression in handling macro
1905         without arguments as last token in file; debian bug 385720.
1906         (next_token): Always consume an input character.
1907         Reported by Andreas Schultz.
1908         * configure.ac (AC_INIT): Bump version number.
1909         * NEWS: Document this fix.
1910         * doc/m4.texinfo (History): Mention next version.
1911         (Changeword): Add example that exposes this bug.
1912         * THANKS: Update.
1914 2006-08-25  Eric Blake  <ebb9@byu.net>
1916         Release 1.4.6:
1917         * configure.ac (AC_INIT): Bump version number.
1918         * NEWS: Describe changes since 1.4.5.
1920         * Makefile.maint (web-manual): Give up on VPATH build during
1921         distribution.  But distributions are made so infrequently that
1922         this is not too much of a hardship.
1923         * Makefile.am (MAINTAINERCLEANFILES): Avoid error if lib/CVS/
1924         exists.
1926 2006-08-24  Eric Blake  <ebb9@byu.net>
1928         * src/builtin.c (m4_index, m4_substr, m4_translit): Similar to
1929         Solaris, produce output on just one argument.
1930         (m4_regexp, m4_patsubst): For consistency, do likewise.
1931         (m4_patsubst): Allow zero-length match at end of string.
1932         * doc/m4.texinfo (Sysval): Fix overfull hbox.
1933         (Bugs, Macro Arguments): Minor fixes.
1934         (Other tokens): Rearrange node order.
1935         (Index macro, Substr, Translit, Regexp, Patsubst): Add tests.
1936         * NEWS: Document these fixes.
1938 2006-08-22  Eric Blake  <ebb9@byu.net>
1940         * src/input.c (pop_input): Avoid empty filename with -di option.
1941         * src/debug.c (debug_message_prefix): Put space before message.
1943         * m4/gnulib-cache.m4: We don't explicitly use alloca module.
1945         * m4/gnulib-cache.m4: Augment with gnulib-tool --import gnupload.
1946         * Makefile.maint (fetch): Simplify, now that we can use gnupload.
1948         * checks/check-them: State why a test is skipped.
1949         * doc/m4.texinfo (Changeword, Sysval, Maketemp): Likewise.
1951         * ChangeLog: Add copyright.
1952         * AUTHORS: Likewise.
1953         * BACKLOG: Likewise.
1954         * README: Likewise.
1955         * THANKS: Likewise.
1956         * TODO: Likewise.
1957         * examples/COPYING: New file, add copyright for all the examples.
1958         * checks/get-them: Put copyright on testsuite files.
1960 2006-08-18  Eric Blake  <ebb9@byu.net>
1962         Don't let unrelated child processes see too many files.
1963         * m4/gnulib-cache.m4: Augment with gnulib-tool --import cloexec.
1964         * src/builtin.c (m4_esyscmd, m4_regexp, m4_patsubst): Fix
1965         spelling in error message.
1966         * src/debug.c [!__STDC__]: Assume C89, and nuke old varargs.h.
1967         (debug_set_output): Close debug file on exec.
1968         * src/m4.h (includes): Add cloexec.h.
1969         * src/output.c (make_room_for): Close diversions on exec.
1970         * src/path.c (path_search): Close include files on exec.
1971         * NEWS: Document this.
1973         Regular expressions were leaking memory.
1974         * src/builtin.c (init_pattern_buffer, free_pattern_buffer): New
1975         helper methods.
1976         (m4_regexp, m4_patsubst): Avoid memory leak.
1977         * src/input.c (init_pattern_buffer) [ENABLE_CHANGEWORD]: Make
1978         static.
1979         (set_word_regexp) [ENABLE_CHANGEWORD]: Avoid memory leak.  Change
1980         from O(n^2) to O(n) for calculating word_start.
1981         (next_token, peek_token) [ENABLE_CHANGEWORD]: Treat word_start as
1982         O(1) bitmap, not O(n) search string.
1983         * NEWS: Document this fix.
1985 2006-08-17  Eric Blake  <ebb9@byu.net>
1987         * NEWS: Document previous checkin.
1989         * src/builtin.c (substitute): Avoid core dump when accessing
1990         beyond bound of regular expression.
1991         Reported by Karl Nelson.
1992         * doc/m4.texinfo (Regexp): Add example that causes core dump on
1993         some architectures prior to this patch.
1994         * THANKS: Updated.
1996 2006-08-16  Eric Blake  <ebb9@byu.net>
1998         * doc/m4.texinfo (Invoking m4, Debug Output): Fix wording to be
1999         clear that dumpdef does not always go to stderr.
2001         * src/builtin.c (m4_errprint): Flush buffers before printing to
2002         stderr.
2003         * THANKS: Updated.
2005 2006-08-15  Eric Blake  <ebb9@byu.net>
2007         * src/builtin.c (m4_m4wrap, m4_errprint, m4_shift): Make blind,
2008         per debian bug 96075.
2009         * doc/m4.texinfo (Loops, M4wrap, Errprint): Document this change.
2010         (Changeword): Don't use shift as an example of a swallowed word.
2011         (Divert): Discuss fact that divert is an English word.
2012         Reported by Richard A Nelson.
2014 2006-08-14  Eric Blake  <ebb9@byu.net>
2016         * doc/m4.texinfo (Invoking m4): Minor fixes.
2018 2006-08-12  Eric Blake  <ebb9@byu.net>
2020         * doc/m4.texinfo (Arguments): Hint at better exch macro.
2021         (Answers): Provide a better definition.
2023 2006-08-09  Eric Blake  <ebb9@byu.net>
2025         * doc/m4.texinfo (Incompatibilities): Document that m4 does not
2026         yet understand locales.
2027         * NEWS: Fix wording of a few items.
2029 2006-08-08  Eric Blake  <ebb9@byu.net>
2031         Avoid printing `NONE:0:' in error messages.
2032         * src/m4.h (m4_error_at_line): New function.
2033         * src/m4.c (m4_error_at_line): Implement.
2034         * src/input.c (skip_line, input_init, next_token): Use "", not
2035         "NONE", for no file, since NONE can be a real file name.
2036         * src/macro.c (expand_argument): Likewise.
2037         * src/debug.c (debug_message_prefix, trace_header): Check for
2038         current file.
2039         * doc/m4.texinfo (Dnl, M4wrap): Adjust accordingly.
2040         (Location): Document that synclines and internal message format
2041         are not impacted by redefining these macros.
2042         (M4exit): Hint at bug in fatal_error.
2043         (Answers): Provide workaround to match m4 output.
2045         * m4/gnulib-cache.m4: Augment with gnulib-tool --import verror.
2046         * src/m4.h (m4_error): New function.
2047         (M4ERROR, M4ERROR_AT_LINE): Reimplement without hacking around
2048         error module deficiencies.
2049         (reference_error, suppress_line): No longer needed.
2050         * src/m4.c (m4_error): Implement.
2051         (main): No longer need to install error callback.
2053 2006-08-04  Eric Blake  <ebb9@byu.net>
2055         * src/m4.h (program_name): Declare.
2056         (suppress_line): New variable.
2057         (M4ERROR_AT_LINE): New macro.
2058         * src/m4.c (reference_error, main): Follow GNU Coding Standards
2059         for error message format.
2060         * src/input.c (skip_line, next_token): Use M4ERROR_AT_LINE.
2061         * src/macro.c (expand_argument): Likewise.
2062         * checks/check-them (examples): Adjust to new message format.
2063         * src/builtin.c (m4___program__): New builtin.
2064         * doc/m4.texinfo (Location): Split from Errprint into new node,
2065         and document __program__.
2066         (Builtin, Ifdef, Ifelse, Dumpdef, Trace, Debug Output, Dnl)
2067         (Include, Regexp, Patsubst, Incr, Eval): Adjust error message
2068         format.
2069         (Extensions): Document __program__.
2070         * NEWS: Document this change.
2072 2006-08-03  Eric Blake  <ebb9@byu.net>
2074         Don't confuse leading `(' in comment or quote with start of
2075         argument collection.
2076         * src/m4.h (enum token_type): Add TOKEN_OPEN, TOKEN_COMMA,
2077         TOKEN_CLOSE.
2078         (peek_input): Make private to input.c.
2079         (peek_token): New prototype.
2080         * src/input.c (default_word_regexp): Reduce ifdefs.
2081         (peek_input): Make static.
2082         (next_token): Return new token types.
2083         (match_input, MATCH): Add argument consume, which controls
2084         whether match should be pushed back.
2085         (peek_token): New function.
2086         (token_type_string) [DEBUG_INPUT]: New function.
2087         * src/macro.c (expand_token, expand_argument, collect_arguments):
2088         Handle new token types.
2089         * doc/m4.texinfo (Changequote, Changecom): Document this.
2090         * NEWS: Document this.
2092         * src/stackovf.c (setup_stackovf_trap): Free memory on failure.
2094         * src/stackovf.c (setup_stackovf_trap): Gracefully avoid stack
2095         overflow detection when sigstack exists but is not implemented.
2096         Fixes debian bug 154053.
2097         * THANKS: Updated.
2098         Reported by David Perlin.
2100 2006-08-02  Eric Blake  <ebb9@byu.net>
2102         * src/input.c (MATCH): Fix EOF detection on multi-byte comment
2103         close.
2105 2006-08-01  Eric Blake  <ebb9@byu.net>
2107         * src/input.c (skip_line, next_token): Remember current file in
2108         case input file ends abruptly.  Addresses debian bug 175365.
2109         (pop_input): Defer freeing storage that holds previous file
2110         name...
2111         (pop_wrapup): to here, after error message is issued.
2112         * src/macro.c (expand_argument): Remember current file in case
2113         input file ends abruptly.
2114         * doc/m4.texinfo (Macro Arguments, Dnl, Changequote, Changecom)
2115         (M4wrap): Adjust testsuite accordingly.
2116         (Errprint): Document line number limitation of m4wrap.
2117         * NEWS: Document this fix.
2118         * THANKS: Update.
2120 2006-07-31  Eric Blake  <ebb9@byu.net>
2122         * src/input.c (peek_input, next_char, match_input): Be eight-bit
2123         clean; fixes debian bug 311378.
2124         * doc/m4.texinfo (Syntax): Describe eight-bit handling.
2125         (Changequote, Changecom): Add examples to test this.
2126         * NEWS: Document this fix.
2127         * THANKS: Update.
2128         Reported by Steven Augart.
2130         * doc/m4.texinfo: Whitespace fix.
2131         * checks/get-them: Avoid exceeding 14-char file name limit.
2132         * THANKS: Update.
2134 2006-07-30  Eric Blake  <ebb9@byu.net>
2136         * src/path.c (path_search): Detect allocation failure.
2138         Use native free when it is good enough.
2139         * m4/gnulib-cache.m4: Augment with gnulib-tool --import free.
2140         * src/builtin.c (define_user_macro, m4_regexp, m4_patsubst):
2141         Adjust calls.
2142         * src/symtab.c (free_symbol): Likewise.
2143         * src/m4.c (xfree, main): Likewise.
2144         * src/m4.h (obstack_chunk_free): Likewise.
2145         * src/path.c (path_search): Likewise.
2146         * src/input.c (pop_wrapup, set_quotes, set_comment): Likewise.
2148         * doc/m4.texinfo (Errprint): Add example for last patch.
2149         * checks/check-them: Account for VPATH in latest example.
2151 2006-07-29  Eric Blake  <ebb9@byu.net>
2153         * src/path.c (path_search): Add result parameter, so that
2154         -I can be accounted for.  Debian bug 53685.
2155         * src/m4.h (path_search): Update prototype.
2156         * src/m4.c (main): Adjust callers.
2157         * src/freeze.c (reload_frozen_state): Likewise.
2158         * src/builtin.c (include, m4_undivert): Likewise.
2159         * NEWS: Document this change.
2160         Reported by Nicolas Lichtmaier.
2162 2006-07-28  Eric Blake  <ebb9@byu.net>
2164         * Makefile.am (MAINTAINERCLEANFILES): Fix typo that tripped up
2165         several non-GNU makes.
2166         * src/stackovf.c (setup_stackovf_trap): Missed _ from yesterday.
2167         * src/m4.h: Likewise.
2168         * src/input.c (push_wrapup): Avoid compiler warning with Solaris
2169         /usr/ccs/bin/ucbcc.
2171 2006-07-27  Eric Blake  <ebb9@byu.net>
2173         * doc/m4.texinfo: Use @acronym{GNU} throughout.
2174         (History): Update for 1.4.6.
2176         * src/m4.h (_): Remove K&R cruft.
2177         * src/builtin.c: Likewise.
2178         * src/debug.c: Likewise.
2179         * src/eval.c: Likewise.
2180         * src/macro.c: Likewise.
2181         * src/stackovf.c: Likewise.
2183         * doc/Makefile.am (m4.1): Improve man page.
2184         * src/m4.c (usage): Improve --help output, including adding the
2185         bug reporting address.
2186         (main): Follow GNU Coding Standards for --version output.
2188 2006-07-26  Eric Blake  <ebb9@byu.net>
2190         * doc/m4.texinfo: Use begin-quote, end-quote, begin-comment, and
2191         end-comment consistently, to match POSIX.
2193         * doc/m4.texinfo (Macro Arguments, Changequote, Changecom)
2194         (Dnl, M4wrap, Include): Document EOF issues, and add examples.
2195         (Incompatibilities): Document incompatibility of changecom
2196         vs. macro names, and of EOF in include.
2197         * src/input.c (next_token): Reject unterminated comments at EOF.
2198         (skip_line): Warn on unterminated dnl at EOF.
2199         * NEWS: Document these changes.
2201 2006-07-25  Eric Blake  <ebb9@byu.net>
2203         * m4/gnulib-cache.m4: Update to reflect gnulib's split of
2204         stdio-safer into fopen-safer and tmpfile-safer.
2205         * src/m4.c: Remove redundant include.
2207 2006-07-24  Eric Blake  <ebb9@byu.net>
2209         Fix bugs related to stream handling.
2210         * m4/gnulib-cache.m4: Augment with gnulib-tool --import
2211         unlocked-io stdio-safer stdlib-safer close-stream.
2212         * configure.ac (AC_CHECK_FUNCS_ONCE): Assume tmpfile; it can be
2213         provided by gnulib if needed.
2214         * src/output.c [! HAVE_TMPFILE]: Likewise.
2215         * src/m4.h (includes): Replace unistd, stdio, and stdlib with
2216         their safer counterparts.
2217         (retcode): New global variable.
2218         * src/input.c (pop_input): Check for read failure.
2219         * src/freeze.c (reload_frozen_state): Likewise.
2220         (produce_frozen_state): Check for write failure.
2221         * src/debug.c (debug_set_file): Likewise.
2222         * src/m4.c (usage, main): Likewise.
2223         (retcode): Make global.
2224         * src/builtin.c (m4_m4exit): Likewise.  Ensure that the exit
2225         status is non-zero except when everything succeeds.
2226         * doc/m4.texinfo (M4exit): Document these changes.
2227         (Incompatibilities): Remove documentation of bug now fixed.
2228         * NEWS: Document these fixes.
2230 2006-07-22  Eric Blake  <ebb9@byu.net>
2232         * src/format.c (format): Avoid compiler warning that str may be
2233         used uninitialized.
2235 2006-07-21  Eric Blake  <ebb9@byu.net>
2237         * src/m4.h [UNIX]: Add more platforms that are close enough to
2238         categorize as UNIX, but which don't predefine __unix__.
2239         Reported by Nelson H. F. Beebe.
2241 2006-07-20  Eric Blake  <ebb9@byu.net>
2243         * m4/gnulib-cache.m4: gnulib-tool has changed again.  Regenerate
2244         to explicitly ask for --assume-autoconf=2.60.
2246 2006-07-19  Eric Blake  <ebb9@byu.net>
2248         * doc/m4.texinfo (Sysval): Avoid kill -1, since ksh traps SIGHUP
2249         and exits normally with 129.
2250         Reported by Nelson H. F. Beebe.
2251         * THANKS: Update.
2253         * src/m4.h (EXIT_MISMATCH): Define.
2254         * src/freeze.c (reload_frozen_state): Detect version mismatch, by
2255         exiting with status 63.
2256         * src/m4.c (usage): Document this.
2257         * doc/m4.texinfo (Invoking m4, Using frozen files): Likewise.
2258         * NEWS: Likewise.
2260         * doc/m4.texinfo (copying): Relax restriction on front-cover and
2261         back-cover texts.
2263 2006-07-17  Eric Blake  <ebb9@byu.net>
2265         * src/format.c (format): Support F, g, and G specifiers.
2266         * doc/m4.texinfo (Format): Document this.
2267         * NEWS: Document this addition.
2269         * doc/m4.texinfo (Builtin): Delete redundant text.
2271         * configure.ac (AC_INIT): Bump version number.
2272         * src/builtin.c (substitute): Bah.  Fix buffer overrun.
2273         * NEWS: Document this fix.
2275 2006-07-15  Eric Blake  <ebb9@byu.net>
2277         Release 1.4.5:
2278         * configure.ac (AC_INIT): Bump version number.
2279         * NEWS: Describe changes since 1.4.4.
2281         * src/m4.c (usage): Document exit status.
2282         * doc/m4.texinfo: Use `exit status', not `exit code'.
2283         (Invoking m4): Document exit status.
2285         * bootstrap: Backport --help, --version from head.
2286         (func_update): New function, for easily grabbing up-to-date files
2287         from gnulib.
2288         * Makefile.maint (web-manual): Fix for VPATH builds.
2290 2006-07-14  Eric Blake  <ebb9@byu.net>
2292         * doc/m4.texinfo: Global cleanup.  Avoid @code{...}'d, as it
2293         looks bad in info.  Use @deffn rather than @example for
2294         describing prototypes.  Fix awkward wording and grammar.
2296         * src/builtin.c (substitute): Warn on bad escape sequences.
2297         Ignore trailing backslash.
2298         * doc/m4.texinfo (Regexp): Add documentation for this.
2299         * NEWS: Document this change.
2301         * src/builtin.c (m4_format, m4_indir): Warn on too few arguments.
2302         * doc/m4.texinfo (Defn, Builtin, Debug Levels, Debug Output): Add
2303         more examples.
2304         (Dnl): Update example to show side effects.
2305         * checks/get-them: Generate three digit test names.
2306         * checks/Makefile.in (CHECKS): Accomodate 100+ tests.
2308 2006-07-13  Eric Blake  <ebb9@byu.net>
2310         * src/input.c (input_init): Simplify.
2311         (set_word_regexp): Treat empty string as default, since empty
2312         regexp would disable word parsing.
2313         * src/m4.c (user_word_regexp): Default to empty string.
2314         * src/builtin.c (builtin_tab): Make changeword blind.
2315         * doc/m4.texinfo (Changeword): Document this.
2316         * NEWS: Document this.
2317         * TODO: Knock off completed items.
2319         * src/builtin.c (m4_undefine, m4_popdef): Visit all arguments, not
2320         just the first.
2321         * doc/m4.texinfo (Undefine, Pushdef): Test this.
2322         * NEWS: Document this change.
2324         * src/builtin.c (numeric_arg): Treat empty string as 0, with a
2325         warning.  Detect quoted leading space and overflow as warnings.
2326         (m4_eval): Treat empty radix as 10, and allow output in radix 1.
2327         Treat width as minimum number of digits, as required by POSIX.
2328         (m4_ifdef, m4_divert, m4_m4exit, m4_translit): Ignore extra
2329         arguments.
2330         (m4_substr): Likewise.  Silently treat empty start as 0.
2331         (m4_undivert): Treat ` 1a' as file, not diversion 1.
2332         * src/eval.c (eval_lex): Parse radix 1 numbers.
2333         * doc/m4.texinfo (Invoking m4): Fix wording; there is more than
2334         one type of warning.
2335         (Manual): Document behavior of numeric parsing of empty string.
2336         (Divert, Incr): Document error handling.
2337         (Eval): Document radices better.
2338         (Incompatibilities): Document translit incompatibility.
2339         * NEWS: Document these changes.
2341         * Makefile.maint (fetch): Get gendocs from gnulib, not texinfo.
2342         (web-manual): Simplify.
2343         * m4/gnulib-cache.m4: Augment with gnulib-tool --import gendocs.
2344         * Makefile.am (EXTRA_DIST): Distribute gendocs.sh.
2345         (MAINTAINERCLEANFILES): Clean it as well.
2346         * doc/Makefile.am (EXTRA_DIST): Distribute gendocs_template.
2347         (MAINTAINERCLEANFILES): Clean it as well.
2349 2006-07-12  Eric Blake  <ebb9@byu.net>
2351         * doc/m4.texinfo (Extensions): Document how to overcome
2352         implementation difference in > 9 positional parameters.
2354         * src/m4.c (usage): Sort within sections.
2355         (nesting_limit): Raise default from 250 to 1024.
2356         * doc/m4.texinfo: Use file name, not filename, per GNU coding
2357         standard.  Use @option where appropriate.
2358         (Invoking m4): Sort to match --help output.
2359         (Debug Levels): Sort.
2360         (Frozen files): Sort and break into two nodes.
2362         * src/m4.c (nesting_limit): Raise default from 250 to 1024.
2363         * NEWS: Document raised -L limit.
2365 2006-07-11  Eric Blake  <ebb9@byu.net>
2367         * Makefile.am (DISTCHECK_CONFIGURE_FLAGS): New macro, to
2368         stress-test changeword before a release.
2369         * doc/m4.texinfo: More doc cleanups.
2370         (Copying This Manual): New node; actually include the FDL in the
2371         documentation.
2372         * doc/Makefile.am (m4_TEXINFOS): Mention dependence on fdl.texi.
2373         * m4/gnulib-cache.m4: Augment with gnulib-tool --import fdl.
2374         * NEWS: Mention documentation improvements.
2376         * src/m4.h (OS2): New platform macro.
2377         * src/builtin.c (predefined_tab) [OS2]: Use it to give OS/2 a
2378         platform macro.
2379         * doc/m4.texinfo (Platform macros): Document it.
2380         (Sysval): Remove non-portable test of system("").
2381         * NEWS: Document this change.
2382         Reported by Andreas Buening.
2384 2006-07-09  Eric Blake  <ebb9@byu.net>
2386         * doc/m4.texinfo (Undivert): Fix typo in last commit.
2387         * src/m4.c (usage): Document M4PATH.
2388         * src/path.c (path_search): Reject empty string.
2389         * src/output.c (insert_diversion): Ignore diversion 0.
2390         * src/builtin.c (m4_undivert): Ignore empty string.
2391         * NEWS: Document this fix.
2393 2006-07-08  Eric Blake  <ebb9@byu.net>
2395         * checks/get-them: Make filtering easier.
2396         * checks/check-them: Filter non-input lines, so line counts are
2397         more realistic in the documentation, and so changeword tests work
2398         even when dnl is disabled.
2399         * doc/m4.texinfo: Adjust example line numbers.  Clean up
2400         front-matter, following autoconf's example.
2401         (Changeword): Enable tests, skipping if changeword not supported.
2402         (Define, Defn, Ifelse): Backport more examples from head.
2403         (Input processing, Answers): New nodes, backported from head.
2404         (Include): Expand test to cover empty filename.
2405         (Undivert): Add test of undivert(0).
2407 2006-07-07  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
2409         * doc/m4.texinfo: Fix spelling errors.
2411 2006-07-07  Eric Blake  <ebb9@byu.net>
2413         * THANKS: Update.
2415         * doc/Makefile.am (m4.1): No need to go through a temporary file;
2416         this also ensures timestamps are updated.
2417         * src/m4.h (includes): Require config.h.  Assume string.h,
2418         stdlib.h, errno.  Include error.h, exit.h, and xalloc.h rather
2419         than prototyping ourselves.
2420         (builtin_func): Add parameter type-checking.
2421         (voidstar): Delete, now that we assume C89.
2422         * src/builtin.c, src/m4.c, src/macro.c, src/symtab.c: All users of
2423         voidstar changed.
2424         * src/m4.c (xfree) [WITH_DMALLOC]: Avoid clash with dmalloc's
2425         xfree.
2427 2006-07-06  Eric Blake  <ebb9@byu.net>
2429         * m4/gnulib-cache.m4: Augment with gnulib-tool --import
2430         binary-io.
2431         * src/m4.h (includes): Add binary-io.h for O_BINARY.
2432         * src/freeze.c (produce_frozen_state): Use O_BINARY to remove
2433         #ifdef.  Fixes patch from 2005-02-03 for cygwin.
2434         * NEWS: Mention this fix.
2436         * configure.ac (FUNC_SYSTEM_BROKEN): New check for OS/2 bug.
2437         * src/builtin.c (m4_syscmd): Work around OS/2 bug.
2439         * Makefile.am (SUBDIRS): Build . before src, so that autoheader
2440         runs first when needed.
2441         * doc/Makefile.am (m4.1): Backport rule from CVS head: build m4.1
2442         once in srcdir rather than multiple times in VPATH builds.
2444 2006-07-03  Eric Blake  <ebb9@byu.net>
2446         * checks/check-them: Use portable = in test.
2447         * src/Makefile.am (AM_CPPFLAGS): Omit space between -I and
2448         directory, as required by Solaris cc.  Include built headers, as
2449         required by Solaris make in VPATH build.
2450         * checks/Makefile.in: Use $(srcdir) where needed.
2451         (CHECKS): Factor $(srcdir) into macro.
2452         (DISTFILES): Likewise.  Automake takes care of distributing
2453         Makefile.in.
2454         (dist): Simplify.
2455         (Makefile): Use modern syntax of config.status.
2456         * doc/m4.texinfo (Loops, Include, Undivert, Incompatibilities):
2457         Avoid overfull and underfull hboxes in dvi.
2459         Fix 'make check' in VPATH build.  All files included by testsuite
2460         now live in a single directory.  Use forloop.m4 in testsuite.
2461         * checks/incl.m4, checks/foo, checks/wrapfifo.m4: Move from
2462         here...
2463         * examples/incl.m4, examples/foo, examples/wrapfifo.m4: ...to
2464         here.
2465         * checks/Makefile.in (DISTFILES): Don't distribute moved files.
2466         * examples/Makefile.am (EXTRA_DIST): Distribute new files.
2467         * checks/check-them: Avoid s/// when filename is in pattern.
2468         * examples/forloop.m4: Fix to match documentation.
2469         * doc/m4.texinfo (Include, Undivert, Incompatibilities): Reflect
2470         new locations.
2471         (Loops, Format): Actually use forloop.m4 in tests.
2473 2006-07-02  Eric Blake  <ebb9@byu.net>
2475         * checks/Makefile.in (exec_prefix, prefix): New macros, so that
2476         $(bindir) works in installcheck.
2477         (check, installcheck): No longer change directory, so that
2478         distcheck works with a read-only builddir.
2479         * checks/check-them: Work when pwd is no longer builddir.
2481 2006-07-01  Eric Blake  <ebb9@byu.net>
2483         * GNUmakefile: New file, borrowed from coreutils.
2484         * Makefile.am (EXTRA_DIST): Distribute GNUmakefile.
2485         * Makefile.maint (Makefile): Delete this rule, now that
2486         GNUmakefile includes Makefile.
2488 2006-06-30  Eric Blake  <ebb9@byu.net>
2490         For compatibility with other m4 implementations, sysval returns
2491         signal<<8 rather than 0 if syscmd is terminated by a signal.
2492         * configure.ac (AC_CHECK_HEADERS_ONCE): Check for sys/wait.h.
2493         * src/builtin.c (include): Include sys/wait.h when stdlib.h does
2494         not provide wait macros.
2495         (WTERMSIG, WIFSIGNALED, WIFEXITED): More fallback macros.
2496         (M4SYSVAL_EXITBITS, M4SYSVAL_TERMSIGBITS): New helper macros.
2497         (m4_esyscmd): Set sysval to -1 on failure.
2498         (m4_sysval): Print 127 on failure, and accomodate signals if they
2499         are detectable.
2500         * NEWS: Document this change.
2501         * doc/m4.texinfo (Platform macros, Esyscmd, Sysval): Fix typos in
2502         last commit.
2503         * checks/check-them: Likewise.
2504         * src/debug.c (debug_set_file): Work around mingw fstat bug.
2506         * src/m4.h (UNIX, W32_NATIVE): Improve platform detection macros.
2507         * src/freeze.c (produce_frozen_state): Use new spelling of
2508         platform macro.
2509         * src/builtin.c (predefined_tab): Add __windows__ on non-unix
2510         platforms.
2511         (m4_syscmd, m4_esyscmd): The empty command is successful.
2512         * doc/m4.texinfo (Shell commands): Rename from UNIX commands.
2513         Document platform-dependence of system().
2514         (Syscmd): Add example.
2515         (Esyscmd): Make example more robust, and actually demonstrate
2516         rescanning.
2517         (Sysval): Expand test to cover esyscmd code path, and to check
2518         that empty command is successful.  Add conditional check for
2519         signal behavior.
2520         (Other Incompatibilities): Move platform macros from here...
2521         (Platform macros): ...to this new node.  Add windows macro.
2522         Check that exactly one platform macro is provided.
2523         * checks/check-them: Improve trap cleanup.  Tolerate dirname and
2524         .exe in error messages.  Allow for skipping checks.
2525         * configure.ac (HAVE_EFGCVT): Kill dead configure check.
2526         * NEWS: Document platform macros.
2528 2006-06-29  Eric Blake  <ebb9@byu.net>
2530         Fix buffer overrun bug.
2531         * m4/gnulib-cache.m4: Augment with gnulib-tool --import
2532         xvasprintf.
2533         * src/format.c [HAVE_EFGCVT]: Delete this code, and use *printf
2534         variant instead, since [efg]cvt are obsolete and our use of them
2535         was buggy (savannah sr #104303).
2536         (format): Fix buffer overflow by using xasprintf.
2537         * doc/m4.texinfo (Format): Expand format test to catch both bugs.
2538         * NEWS: Document this fix.
2540         * configure.ac (AC_CANONICAL_HOST, AC_CANONICAL_BUILD): Allow
2541         cross-compilation.
2542         (AC_CACHE_CHECK): Cache search for ecvt.
2544 2006-06-27  Eric Blake  <ebb9@byu.net>
2546         * doc/m4.texinfo (Eval): Document 32-bit signed limitations
2547         required by POSIX, and add example that exposed core dump on x86
2548         architectures.
2549         (Incompatibilities): Document incompatibility in eval precedence.
2550         * src/eval.c (shift_term): Explicitly mask, to avoid undefined
2551         behavior.
2552         (mult_term): Explicitly check for -1, to avoid SIGFPE on x86.
2553         * NEWS: Document this change.
2555         * doc/m4.texinfo: Use @noindent consistently.
2556         (Quoting Arguments): Document that unquoted parentheses group
2557         arguments.
2558         (Pseudo Arguments): Expand tests to show this.
2559         (Incompatibilities): Contrast traditional behavior of
2560         changequote.
2562 2006-06-24  Eric Blake  <ebb9@byu.net>
2564         * configure.ac (AC_PREREQ): Autoconf 2.60 is now released.
2565         (AC_CHECK_HEADERS_ONCE): Use this new feature.
2566         (AC_CHECK_FUNCS_ONCE): Likewise.
2568 2006-06-23  Eric Blake  <ebb9@byu.net>
2570         * doc/m4.texinfo: Quoting cleanup throughout - follow
2571         autoconf-recommended style of one level of quote per parenthesis
2572         in the normal case.  Adjust error messages to match GNU coding
2573         standards (and to allow 'make check' to pass again).
2574         (Quoted strings, Inhibiting Invocation): Turn more examples into
2575         tests.
2576         (Comments): Resolve FIXME by adding example.
2577         (Define): Add example about underquoting.
2578         (Defn): Add example about use of $0.
2579         (Indir, Format): Resolve FIXME done in last commit.
2580         (Ifelse): Add example about creating blind macro.
2581         (Debugging): Fix grammar.
2582         (Dnl): Add example about dnl with arguments.
2583         (M4wrap): Be explicit that LIFO order is non compliant, and will
2584         change in m4 2.0.
2585         (Undivert): Resolve FIXME by adding example.
2586         (Frozen files): Document that m4wrap and sysval will not work
2587         consistently until m4 2.0.
2588         (Incompatibilities): Document another POSIX compliance bug, this
2589         time with changequote.  Document a traditional incompatibility
2590         with partial input spanning file boundaries.
2592         Make error messages more consistent with GNU coding standards -
2593         start with lower case, and don't end sentence with punctuation.
2594         * src/debug.c (trace_pre): Update message wording.
2595         * src/eval.c (evaluate, cmp_term, shift_term, mult_term):
2596         Likewise.
2597         * src/freeze.c (produce_frozen_state, issue_expect_message),
2598         (reload_frozen_state): Likewise.
2599         * src/input.c (push_string_init, pop_init, init_macro_token),
2600         (peek_input, next_char_1, set_word_regexp, next_token): Likewise.
2601         * src/m4.c (stackovf_handler, main): Likewise.
2602         * src/macro.c (expand_token, expand_argument, call_macro),
2603         (expand_macro): Likewise.
2604         * src/output.c (make_room_for, output_text, insert_file),
2605         (freeze_diversions): Likewise.
2606         * src/symtab.c (symtab_init, lookup_symbol): Likewise.
2608         * src/builtin.c (builtin_tab): Make format and indir blind.
2609         (substitute): Prefer "Warning:" vs. "ERROR:" in messages.
2610         * NEWS: Mention the change to builtins.
2612 2006-06-22  Eric Blake  <ebb9@byu.net>
2614         Robustify frozen file format.
2615         * src/freeze.c (reload_frozen_state): Add GET_DIRECTIVE helper
2616         macro.  Require V first, and only accept it once.  For F, use
2617         placeholder if builtin is not found, rather than warning.
2618         * src/m4.h (m4_placeholder): New prototype.
2619         * src/builtin.c: Unify error message style.
2620         (m4_placeholder): New function, warn if invoked.
2621         (builtin_tab): Add m4_placeholder.
2622         (m4_defn): Warn if placeholder is encountered.
2623         (find_builtin_by_addr): Handle placeholder.
2624         (find_builtin_by_name): Return placeholder on failure.
2625         (m4_builtin): Treat placeholder as undefined.
2626         * doc/m4.texinfo (Frozen files): Document changes in V and F.
2627         * NEWS: Document this change.
2628         Reported by Bruno Haible.
2630         * doc/m4.texinfo: Whitespace cleanup.  TABs are evil in texinfo.
2631         (tabchar): New macro, so that 'make check' still works.
2632         (Invoking m4): Document that ignored compatibility options -B, -S,
2633         and -T each consume an argument.
2634         * checks/get-them: Honor @tabchar{}.
2636         Avoid compiler warnings during -DDEBUG.
2637         * src/m4.h (M4_GNUC_ATTRIBUTE, M4_GNUC_UNUSED): New macros.
2638         [DEBUG]: Also imply DEBUG_OUTPUT and DEBUG_STKOVF.
2639         * src/input.c (print_token) [DEBUG_INPUT]: Use correct format.
2640         (lex_debug) [DEBUG_INPUT]: Fix to compile.  Mark unused.
2641         (next_token) [DEBUG_INPUT]: Print before returning.
2642         * src/path.c (include_dump) [DEBUG_INCL]: Mark unused.
2643         * src/symtab.c (symtab_debug) [DEBUG_SYM]: Mark unused.
2645         Avoid mkstemp bugs on various platforms.
2646         * m4/gnulib-cache.c: Augment with gnulib-tool --import mkstemp.
2647         * src/output.c [! HAVE_MKSTEMP]: Delete.
2648         * configure.ac (AC_CHECK_FUNCS): Don't check for mkstemp.
2649         * src/m4.h (mkstemp) [! HAVE_MKSTEMP]: Prototype, if needed.
2650         * NEWS: Document this.
2652         * Makefile.am (EXTRA_DIST): Distribute gnulib-cache.m4.
2653         Reported by Bruno Haible.
2655 2006-06-21  Eric Blake  <ebb9@byu.net>
2657         Avoid obsolete sigstack when POSIX sigaltstack is available.
2658         * src/m4.c: Blindly assume signal.h, since stackovf.c and gnulib
2659         do likewise.
2660         * configure.ac (AC_CHECK_HEADERS): Likewise.
2661         (AC_CHECK_TYPES): New check for siginfo_t, since siginfo.h is
2662         obsolete and most hosts now have it in signal.h.
2663         (AC_CHECK_MEMBERS): New check for sigaction.sa_sigaction.
2664         (AC_CACHE_CHECK): Cache decision to use stackovf.
2665         (AC_EGREP_HEADER): Switch to AC_CHECK_TYPES.
2666         * src/stackovf.c (DEBUG_STACKOVF): Remove unused define.
2667         (SA_RESETHAND, SA_SIGINFO): Provide fallback definitions, to
2668         simplify later code.
2669         (PARAM_STACKOVF, PARAM_NOSTACKOVF): Move further away from NULL,
2670         in case of dereferencing a member of a NULL pointer.
2671         (sigsegv_handler) [HAVE_STRUCT_SIGACTION_SA_SIGACTION]: Define a
2672         POSIX handler.
2673         (setup_stackovf_trap): Use NULL instead of 0 for pointers, use
2674         EXIT_FAILURE in error, indent preprocessor directives.
2675         [HAVE_SIGALTSTACK && HAVE_SIGINFO_T]: Depend on siginfo_t, not
2676         siginfo.h.
2677         [HAVE_SIGACTION && defined SA_ONSTACK]: Prefer POSIX handler.
2678         Reported by Santiago Vila.
2680 2006-06-19  Eric Blake  <ebb9@byu.net>
2682         * THANKS: Update.
2684 2006-06-18  Andreas Buening  <andreas.buening@nexgo.de>  (tiny change)
2686         * checks/Makefile.in (PATH_SEPARATOR): New macro.
2687         (check, installcheck): Use it, for OS/2.
2689 2006-06-18  Eric Blake  <ebb9@byu.net>
2691         Consistently use "GNU M4" as package name, "m4" as executable
2692         name.
2693         * NEWS: Document previous fix.
2694         * THANKS: Update.
2695         * README: Fix grammar.  Document that --enable-changeword is on
2696         its last leg.
2697         * doc/m4.texinfo (Top, Changeword): Likewise.
2698         (Sysval): Enhance this test.
2699         (History): Backport this section from CVS head, and update.
2701 2006-06-18  Bruno Haible  <bruno@clisp.org>  (tiny change)
2702             Eric Blake  <ebb9@byu.net>
2704         * src/builtin.c (WEXITSTATUS): Provide fallback definition.
2705         (m4_esyscmd): Set sysval to 0xffff, to accomodate both
2706         big-endian and little-endian wait status definitions.
2707         (m4_sysval): Use WEXITSTATUS.
2708         Reported by Andreas Buening.
2710 2006-06-18  Eric Blake  <ebb9@byu.net>
2712         * configure.ac (AC_INIT): Bump version number.
2713         * NEWS: Describe changes in 1.4.4c.
2715 2006-06-17  Eric Blake  <ebb9@byu.net>
2717         Beta Release 1.4.4b:
2718         * configure.ac (AC_INIT): Bump version number.
2719         * NEWS: Describe changes since 1.4.4.
2720         * Makefile.maint (cvs-news): Accomodate copyright line wrapping.
2722         * Makefile.am (MAINTAINERCLEANFILES): Clean files added by
2723         bootstrap.
2724         * checks/Makefile.in (maintainer-clean): Add missing target.
2725         * COPYING: Remove generated file from CVS.
2727 2006-06-16  Eric Blake  <ebb9@byu.net>
2729         * checks/Makefile.in (DISTFILES): Distribute wrapfifo.m4.
2731 2006-06-15  Eric Blake  <ebb9@byu.net>
2733         * checks/wrapfifo.m4: New file.  Use it...
2734         * doc/m4.texinfo (Incompatibilities): here, in a new test case to
2735         demonstrate how to get POSIX behavior of m4wrap prior to m4 2.0.
2737         * src/m4.h (to_uchar): New function.
2738         * src/eval.c (eval_lex): Use it to avoid passing signed char to
2739         isdigit, isalpha, isupper, islower, isspace, isalnum.
2740         * src/builtin.c (expand_user_macro): Likewise.
2741         * src/format.c (format): Likewise.
2742         * src/macro.c (expand_argument): Likewise.
2743         * NEWS: Document this security fix.
2745         Message cleanup.
2746         * src/symtab.c (lookup_symbol): Use invalid, not illegal.
2747         * src/freeze.c (reload_frozen_state): Fix typo in message.
2748         (produce_frozen_state): Standardize on builtin, not built-in.
2749         * src/builtin.c (numeric_arg, bad_argc): Likewise.
2751         * configure.ac (M4_EARLY, M4_INIT): Use gnulib.
2752         (AC_PROG_RANLIB, AC_AIX, AC_MINIX, AC_CHECK_HEADERS),
2753         (AC_FUNC_ALLOCA, AC_REPLACE_FUNCS): Avoid checks now done by
2754         gnulib.
2755         * Makefile.am (ACLOCAL_AMFLAGS): New entry, for gnulib.
2756         * m4/gnulib-cache.m4: New file, from gnulib.
2757         * bootstrap: Invoke gnulib-tool --update.
2758         * src/m4.c (main): Cast away const.
2759         * NEWS: Document that regex is updated.
2760         * THANKS: Update.
2762 2006-06-08  Eric Blake  <ebb9@byu.net>
2764         * configure.ac (changeword): Work even when changeword is not a
2765         macro.
2766         (AC_PROG_AWK, AC_PROG_INSTALL, AC_PROG_MAKE_SET, AC_HEADER_STDC):
2767         Delete; now done by automake.
2768         (AC_ISC_POSIX, AC_C_CONST): Delete; now obsolete.
2770 2006-06-07  Eric Blake  <ebb9@byu.net>
2772         * lib/regex.c (bcmp_translate): Canonicalize type name.
2773         * doc/Makefile.am (MAINTAINERCLEANFILES): Fix typo.
2774         * configure.ac (changeword): Disable changeword for the creation
2775         of configure, in case of bootstrapping with an m4 configured with
2776         --enable-changeword.
2778         Distribute a rudimentary man page.
2779         * Makefile.am (SUBDIRS): Move doc after src so that 'm4 --help'
2780         can feed help2man.
2781         * doc/Makefile.am (man_MANS, EXTRA_DIST, MAINTAINERDISTCLEAN),
2782         (SUFFIXES, m4.1): New macros and rules to build m4.1.
2784 2006-06-06  Eric Blake  <ebb9@byu.net>
2786         * lib/regex.c (re_match_2_internal, bcmp_translate): Avoid
2787         compiler warnings at -O2.
2788         * lib/getopt.c (_getopt_internal): Likewise.
2790         Cleanup of previous patches.
2791         * src/input.c (struct input_block): Remove traced member.
2792         (push_macro, init_macro_token): Don't pass trace status around.
2793         * src/m4.h (struct token_data): Remove traced member.
2794         (struct symbol, struct builtin): Reduce unused space.
2795         (TOKEN_DATA_FUNC): Simplify.
2796         (TOKEN_DATA_FUNC_TRACED): Remove unused macro.
2797         (push_macro, define_builtin): Remove unused parameter.
2798         * src/builtin.c (define_builtin, builtin_init, define_macro),
2799         (m4_defn): Don't pass trace status around.
2800         * src/macro.c (expand_argument): Likewise.
2801         * src/freeze.c (reload_frozen_state): Likewise.
2802         * src/symtab.c: Whitespace cleanup.
2803         * NEWS: Clean up wording.
2804         * doc/m4.texinfo (Undefine, Dumpdef, Trace): Cleanup wording;
2805         ensure tests actually expose bugs prior to today's patches.
2807         Trace status of builtins is no longer inherited across
2808         define(...,defn(...)).  Fixes bug that autom4te had been working
2809         around.
2810         * src/builtin.c (define_builtin): Don't override trace status.
2811         * doc/m4.texinfo (Trace): Add test for this.
2812         * NEWS: Document this.
2814         When changing macro definitions inside the arguments to the macro,
2815         consistently preserve the old definition that was in effect before
2816         argument collection, similar to the C pre-processor.
2817         Reported by John Brzustowski.
2818         * NEWS: Document this change.
2819         * doc/m4.texinfo (Macro Arguments, Undefine, Dumpdef): Document
2820         this policy, and add tests that expose core dumps prior to this
2821         patch.
2822         * src/m4.h (struct symbol): New members to track when a symbol is
2823         still in use after removal from the symbol table.
2824         (SYMBOL_PENDING_EXPANSIONS, SYMBOL_DELETED): Define.
2825         (free_symbol): Prototype.
2826         * src/macro.c (expand_macro): Track pending expansions of a
2827         symbol.  On completion, if a symbol is deleted and no longer
2828         pending, free its memory.
2829         * src/symtab.c (free_symbol): Export.  Don't free memory if symbol
2830         is still in use.
2831         (lookup_symbol) <SYMBOL_INSERT>: Create new entry when old entry
2832         is still in use.
2833         (lookup_symbol) <SYMBOL_DELETE, SYMBOL_POPDEF>: Mark entries still
2834         in use as deleted and remove from the table without freeing
2835         memory.
2836         (symtab_print_list) [DEBUG_SYM]: More debug output.
2838         * src/symtab.c (hack_all_symbols): Allow certain modifications of
2839         the symbol table during traversal.
2840         * src/builtin.c (set_trace): Replace SYMBOL_DELETE with
2841         SYMBOL_POPDEF, since only the latter is safe with
2842         hack_all_symbols.
2844         Solve crash when passing "indir(`foo')" to "m4 -tfoo".
2845         * src/symtab.c (lookup_symbol) <SYMBOL_DELETE, SYMBOL_POPDEF>:
2846         Preserve placeholder when macro is being traced.
2847         * src/builtin.c (m4_ifdef, m4_indir): A traced but undefined
2848         symbol is not defined.
2849         (set_trace): Remove placeholder when no longer traced.
2850         (m4_traceon): On named traces, always reserve a slot in the
2851         symbol table.
2852         (m4_traceoff): Don't warn about untracing a nonexistent symbol.
2853         * NEWS: Document new trace behavior.
2854         * doc/m4.texinfo (Trace): Tracing by name now consistently works
2855         no matter whether that macro is currently defined.
2856         (Incompatibilities): Document differences between traditional and
2857         GNU trace.
2859 2006-06-04  Paul Eggert  <eggert@cs.ucla.edu>  (tiny change)
2860             Eric Blake  <ebb9@byu.net>
2862         * src/m4.h (hash_table_size): Now size_t instead of int.
2863         * src/m4.c (hash_table_size): Likewise.
2864         (main): Adjust to this; use atol rather than atoi.
2865         * src/symtab.c: Include <limits.h>, for CHAR_BIT.
2866         (symtab_init, lookup_symbol, hack_all_symbols):
2867         Use size_t for sizes and indexes, not int.
2868         (symtab_print_list) [DEBUG_SYM]: Likewise.
2869         (hash): Likewise.  Don't case-fold in the hash function.
2870         Shift by 7, not 3, for consistency with gnulib/lib/hash.c.
2871         Don't assume hash word is 32 bits.
2872         * NEWS: Document this change.
2874 2006-06-04  Eric Blake  <ebb9@byu.net>
2876         * src/symtab.c (symtab_debug, symtab_print_list) [DEBUG_SYM]: Fix
2877         to allow compilation, for use in debugger.
2878         (profiles, current_mode) [DEBUG_SYM]: New variables.
2879         (show_profile, profile_strcmp) [DEBUG_SYM]: New methods for
2880         determining hash table performance.
2882 2006-05-31  Eric Blake  <ebb9@byu.net>
2883             John Brzustowski  <jbrzusto@fastmail.fm>
2885         * src/input.c (input_stack): Delete; use current_input instead.
2886         (wrapup_stack): Dynamically allocate, so that recursion is handled
2887         properly.
2888         (push_wrapup): Use current wrapup stack.
2889         (pop_wrapup): Rotate wrapup stack to current, and create new
2890         wrapup stack.
2891         (input_init): Dynamically allocate stacks.
2892         * NEWS: Update, now that recursive m4wrap can no longer cause
2893         core dump.
2895 2006-05-31  Eric Blake  <ebb9@byu.net>
2897         * lib/getopt.c: Fix copyright year.
2898         * lib/obstack.c: Ditto.
2899         * src/builtin.c: Ditto.
2901 2006-05-30  Eric Blake  <ebb9@byu.net>
2903         * doc/m4.texinfo (M4wrap): Add test to expose m4wrap bug.
2904         Reported by John Brzustowski.
2905         (Incompatibilities): Document known POSIX incompatibilities.
2906         * THANKS: Update.
2908 2006-05-29  Eric Blake  <ebb9@byu.net>
2910         * doc/m4.texinfo (Maketemp): Work even when running 'make check'
2911         in read-only dir.
2913         Use automake.
2914         * Makefile.am: New file.
2915         * doc/Makefile.am: Ditto.
2916         * examples/Makefile.am: Ditto.
2917         * lib/Makefile.am: Ditto.
2918         * src/Makefile.am: Ditto.
2919         * acinclude.m4: New file, renamed from aclocal.m4.
2920         * configure.ac (AM_INIT_AUTOMAKE): Invoke new macro.
2921         (AC_ARG_PROGRAM): Now redundant.
2922         (STACKOVF): Turn into automake conditional.
2923         (AC_CONFIG_COMMANDS): stamp-h is a command, not a file.
2924         * checks/Makefile.in: Converting this dir to automake was not
2925         trivial; for now, just add missing targets demanded by top-level.
2926         * INSTALL: Remove files that are now generated from CVS.
2927         * Makefile.in: Ditto.
2928         * aclocal.m4: Ditto.
2929         * install-sh: Ditto.
2930         * mkinstalldirs: Ditto.
2931         * doc/Makefile.in: Ditto.
2932         * doc/texinfo.tex: Ditto.
2933         * examples/Makefile.in: Ditto.
2934         * lib/Makefile.in: Ditto.
2935         * src/Makefile.in: Ditto.
2937         * AUTHORS: Backport from CVS head, and update.
2938         * doc/m4.texinfo (Changeword): Fix examples to match behavior.
2940 2006-05-27  Eric Blake  <ebb9@byu.net>
2942         * lib/regex.c (regex_compile): Kill compiler warnings.
2943         * lib/getopt.c: Likewise.
2944         * lib/obstack.c: Likewise.
2945         * src/builtin.c (builtin_init): Likewise.
2946         * src/path.c (path_search): Likewise.
2948         * doc/m4.texinfo: Fix usage of a vs. an.
2949         (Loops, Include, Cleardiv, Patsubst, Format, M4exit): Kill
2950         overfull hbox warnings.
2951         (Inhibiting Invocation, Divert, Maketemp, M4exit): Add new tests.
2953         * configure.ac: Update to autoconf 2.59.  Forbid ^M4_.  Fix
2954         quoting.
2955         * aclocal.m4 (fp_PROG_CC_STDC): Delete; now covered by autoconf.
2956         (fp_C_PROTOTYPES): Delete, GNU Coding Standards state we can now
2957         assume C89.
2958         (M4_WITH_DMALLOC): Rename from fp_WITH_DMALLOC. Fix quoting.
2959         * src/m4.h (_): PROTOTYPES is no longer provided, assume C89.
2960         * src/Makefile.in: Delete remains of ansi2knr.
2961         * src/ansi2knr.1: Delete.
2962         * src/ansi2knr.c: Delete.
2964 2006-05-25  Eric Blake  <ebb9@byu.net>
2966         * doc/m4.texinfo: Fix spelling errors.  Use `invalid' instead of
2967         `illegal'.
2969         * doc/m4.texinfo (Francois): No longer needed as a tex variable.
2970         Reported by Karl Berry.
2972 2006-05-24  Eric Blake  <ebb9@byu.net>
2974         * Makefile.in (html): New target.
2975         * doc/Makefile.in (html, m4.html): Likewise.
2976         (MAKEINFOHTML): New macro.
2977         * doc/m4.texinfo (Francois) [ifnottex]: Use newer texinfo
2978         rendering.
2979         (Regexp) [ifhtml]: Make cross-reference to emacs manual an
2980         absolute URL.
2981         Reported by Bob Badour.
2983         * THANKS: Update.  Move reporter's email addresses here, instead
2984         of in ChangeLog.
2986 2006-05-11  Eric Blake  <ebb9@byu.net>
2988         * THANKS: Update.
2989         * doc/m4.texinfo (Changequote): Give testsuite exposure to bug
2990         patched on 2005-12-04.
2991         Reported by Ilya N. Golubev.
2993         * bootstrap: New file, so that generated files need not be stored
2994         in CVS.
2995         * Makefile.in (DISTFILES): Add bootstrap.
2997         Make testsuite less sensitive to doc changes.
2998         * doc/m4.texinfo: Use m4.input instead of filename.
2999         * checks/check-them (xerr): Turn m4.input into filename.
3000         * checks/Makefile.in (dist): Depend on stamp-checks.
3002         Portability updates for OS/2.
3003         * src/Makefile.in (EXEEXT, OBJEXT): Define.
3004         (LINK): Use CFLAGS.
3005         (.c.obj): Define.
3006         * lib/Makefile.in (OBJEXT): Define.
3007         (.c.obj): Define.
3008         * doc/Makefile.in (install, uninstall): Install info files into
3009         the dir listing.
3010         Reported by Andreas Buening.
3012 2006-05-09  Eric Blake  <ebb9@byu.net>
3014         * install-sh: Update to newer upstream version.
3015         * mkinstalldirs: Likewise.
3016         Reported by Andreas Buening.
3018         * src/m4.c (main): Bump copyright year.
3019         * Makefile.in (datarootdir): Define, for autoconf 2.59c.
3020         * doc/Makefile.in (datarootdir): Likewise.
3022 2006-05-08  Eric Blake  <ebb9@byu.net>
3024         * THANKS: Update.
3025         * doc/m4.texinfo (Bugs): Backport bug email address from head.
3026         Reported by Stepan Kasal.
3028 2005-12-04  Ilya N. Golubev  <gin@mo.msk.ru>  (tiny change)
3030         * input.c (match_input): Do not pass expression with side effect
3031         to `obstack_grow'.  Fix <INTERNAL ERROR: Recursive push_string!>.
3032         * NEWS: Updated.
3034 2005-12-04  Gary V. Vaughan  <gary@gnu.org>  (tiny change)
3036         * doc/m4.texinfo (How to debug macros and input): s/woould/would/
3037         Reported by Damian Menscher.
3039 2005-10-19  Gary V. Vaughan  <gary@gnu.org>  (tiny change)
3041         * configure.ac (AC_INIT): Bump to 1.4.4a.
3043 2005-10-19  Gary V. Vaughan  <gary@gnu.org>  (tiny change)
3045         Release 1.4.4:
3046         * configure.ac (AC_INIT): Bump to 1.4.4.
3047         * NEWS: Describe 1.4.4's changes.
3048         * INSTALL, install-sh, doc/texinfo.tex: Updated from upstream.
3050 2005-10-17  John Gatewood Ham  <zappaman@buraphalinux.org>  (tiny change)
3052         * src/m4.c: fix return code when non-existent files are processed
3054 2005-10-17  John Gatewood Ham  <zappaman@buraphalinux.org>  (tiny change)
3056         * README: update email address for bug reports.
3058 2005-10-17  Gary V. Vaughan  <gary@gnu.org>
3060         * doc/m4.info: Generated files are not kept in the repository.
3062 2005-05-01  Gary V. Vaughan  <gary@gnu.org>
3064         The FSF are moving offices today.  Changed their contact address
3065         in all files from `59 Temple Place, Suite 330, MA 02111-1307' to
3066         `51 Franklin Street, Fifth Floor, MA 02110-1301'.
3068         Also, some of the files here were never updated from the previous
3069         '675 Mass Ave, Cambridge, MA 02139', so changed those to the
3070         '51 Franklin Street, Fifth Floor, MA 02110-1301' address too.
3072 2005-03-31  Mike Frysinger  <vapier@gentoo.org>
3074         * Makefile.in (bindir, infodir): Substitute from configure rather
3075         than hardcode.
3076         * doc/Makefile.in (infodir): Ditto.
3077         * src/Makefile.in (bindir): Ditto.
3078         * NEWS: Updated.
3080 2005-03-31  Gary V. Vaughan  <gary@gnu.org>
3082         Changes needed to automate the release process for 1.4.3:
3084         * Makefile.in (dist): Make .tar.bz2 tarball too.
3085         * Makefile.maint (TSDEPS_DIST): Remove m4/libtool.m4.
3086         (cvs-news): Look 1 line further down for NEWS release number.
3087         (cvs-dist): We don't use automake, so make dist is fine.
3088         Remove double . before suffixes.
3089         (cvs-release): Don't mention manual.html.
3090         (fetch): Get latest gendocs files.
3091         (web-manual): Rewritten to use gendoc for multiformat manuals.
3092         * doc/gendocs.sh: Don't save an old version in m4 CVS!
3093         * doc/m4.texinfo (Index): HFS+ (the file system on my Mac) is case
3094         preserving, but case insensitive, so generating html docs per node
3095         clashes between Index.html, the node file, and index.html, the
3096         top-level of the document tree...
3097         (Index macro): ...so renamed to this.  Changed all references.
3099 2005-03-31  Gary V. Vaughan  <gary@gnu.org>  (tiny change)
3101         * configure.ac (AC_INIT): Bump to 1.4.3a.
3103 2005-03-31  Gary V. Vaughan  <gary@gnu.org>  (tiny change)
3105         Release 1.4.3:
3106         * configure.in (AC_INIT): Bump to 1.4.3.
3107         * NEWS: Describe 1.4.3's changes.
3109 2005-03-31  Gary V. Vaughan  <gary@gnu.org>
3111         * Makefile.maint: New file with release rules, from CVS libtool.
3112         * Makefile.in (DISTFILES): Add Makefile.maint.
3113         * INSTALL, install-sh, doc/texinfo.tex: Updated to latest
3114         canonical versions.
3116 2005-03-31  Eric Blake  <ebb9@byu.net>  (tiny change)
3118         * doc/m4.texinfo (Patsubst): Re-add trailing space required by
3119         checks/47.patsubst, with a redundant @comment to prevent emacs
3120         from removing it accidentally again.
3121         * checks/get-them: Allow for trailing spaces tucked behind
3122         @comment marks.
3124 2005-03-31  Eric Blake  <ebb9@byu.net>  (tiny change)
3126         * doc/Makefile.in (install, uninstall): Accomodate DESTDIR.
3127         * src/Makefile.in (install, uninstall): Likewise.
3129 2005-02-07  Gary V. Vaughan  <gary@gnu.org>
3131         * lib/regex.c, lib/regex.h:  Reverted gnulib update, which broke
3132         on Cygwin.
3133         Reported by Eric Blake.
3135 2005-02-04  Gary V. Vaughan  <gary@gnu.org>
3137         * lib/regex.c, lib/regex.h: Updated from gnulib.
3138         * src/input.c (set_word_regexp):  Don't change the word_regexp
3139         unless it compiles correctly.
3140         * NEWS: Updated.
3141         Reported by Frank Schwidom.
3143         * Makefile.in (stamp-h): Regenerate config.h properly.
3145 2005-02-03  Gary V. Vaughan  <gary@gnu.org>
3147         * configure.ac (AC_DEFINE): Fix overquoting of description
3148         argument.
3150         * src/m4.h (__CYGWIN__, WIN32): Canonicalise Windows and Cygwin
3151         recognition macros.
3152         * src/freeze.c (produce_frozen_state): Use \n line-endings even
3153         on Windows, so that the frozen file reader will work.
3154         Reported by Josef T. Burger.
3156         * src/m4.c (main): Modernise the --version output.
3158 2005-02-03  Gary V. Vaughan  <gary@gnu.org>
3160         Modernise the configury a little to prevent spurious errors from
3161         Autoconf-2.59's autoreconf:
3163         * config.h.in: Renamed to...
3164         * config-h.in: ...this to better support DOS 8.3 file systems.
3165         * acconfig.h: Removed.
3166         * configure.in: Renamed to...
3167         * configure.ac: ...this, and AC_DEFINE used to declare config.h
3168         entry comments.  Slight reorganisation and reformatting.
3169         * aclocal.m4: Use third argument to AC_DEFINE to declare config.h
3170         entry comments.
3171         (AC_INIT): Use a modern 3 argument call.
3172         * Makefile.in, checks/Makefile.in, doc/Makefile.in,
3173         examples/Makefile.in, lib/Makefile.in, src/Makefile.in:
3174         s/PRODUCT/PACKAGE/g.
3175         * Makefile.in (DISTFILES): Removed acconfig.h, configure.in,
3176         config.h.in.  Added configure.ac, config-h.in.
3177         (stamp-h.in): Removed acconfig.h from dependencies.
3178         (configure): Depends on configure.ac, not configure.in.
3179         * doc/Makefile.in (stamp-vti): Ditto.
3180         * src/freeze.c (produce_frozen_state), src/m4.c (main): Adjust for
3181         difference between PRODUCT="m4" and PACKAGE="GNU M4".
3182         * configure: Regenerated.
3184 2005-02-03  Noah Misch  <noah@cs.caltech.edu>
3186         * src/output.c (mkstemp): Make non-static, and build regardless of
3187         HAVE_TMPFILE; src/builtin.c also needs this replacement.
3188         * NEWS: Update.
3190 2004-09-09  Vincent Lonngren  <Vincent.lonngren.759@student.lu.se>
3192         * configure.in (AC_CHECK_HEADERS): Commit works best when you save
3193         changes from your editor buffer first.
3195         * configure.in (AC_CHECK_HEADERS):  Add signal.h, sys/signal.h.
3196         * src/m4.c: And include them as appropriate.
3197         * NEWS: Updated.
3199 2004-09-09  Andreas Schwab  <schwab@suse.de>
3201         Refactoring of the string read case in next_char provides about a
3202         20% speedup of M4 as typically used by autoconf:
3204         * src/input.c (next_char_1): Renamed from next_char.
3205         (next_char): New macro.
3206         * NEWS: Updated.
3208 2004-08-21  Gary V. Vaughan  <gary@gnu.org>
3210         * configure.in (VERSION): Bump to 1.4.2a.
3212 2004-08-19  Paul Eggert  <eggert@twinsun.com>
3214         Release 1.4.2.
3215         * configure.in (VERSION): Bump to 1.4.2.
3216         * News: Describe 1.4.2's changes.
3218         * src/m4.c (reference_error): Preserve errno, since M4ERROR
3219         relies on this.
3220         * src/builtin.c (m4_esyscmd): Clear errno before calling popen.
3221         (m4_maketemp): Clear errno before calling mkstemp.
3222         * src/path.c (path_search): Don't let "free" trash errno when
3223         returning NULL.
3224         * src/output.c (insert_file): Don't assume errno has a valid
3225         value simply because fread returns zero.  This fixes a
3226         portability bug reported by Marion Hakanson in
3227         <http://lists.gnu.org/archive/html/bug-m4/2004-07/msg00029.html>.
3229 2004-06-09  Gary V. Vaughan  <gary@gnu.org>
3231         * configure.in (VERSION): Bump to 1.4.1a.
3232         * NEWS: Place holder for next stable release.
3234 2004-06-03  Paul Eggert  <eggert@cs.ucla.edu>
3236         Release 1.4.1.
3237         * configure.in (VERSION): Bump to 1.4.1.
3238         * NEWS: Describe 1.4.1's changes.
3240         * aclocal.m4 (fp_PROG_CC_STDC): Use AC_DEFUN, not define, to
3241         pacify Autoconf 2.59.
3243         * doc/m4.texinfo: Insert commas after @xref's that lack them,
3244         to pacify Texinfo 4.7.
3245         * doc/Makefile.in (info): Remove info-1, info-2, info-3.
3247         * src/m4.h, src/debug.c: Use #ifdef __STDC__, not #if __STDC__, to
3248         pacify Sun C compilers.
3250 2003-09-28  Akim Demaille  <akim@epita.fr>
3252         * src/symtab.c (lookup_symbol): Fix an uninitialized-variable
3253         botch.
3255 2003-09-03  Santiago Vila  <sanvila@debian.org>
3257         * examples/stackovf.sh: Use tempfile if available.
3259 2001-04-02  Robert Bihlmeyer  <robbe@orcus.priv.at>
3261         http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=92629
3262         * src/output.c (m4_insert_file): Do not mix buffered and
3263         unbuffered I/O, as this breaks on the Hurd.  (trivial change)
3265 2001-02-01  Santiago Vila  <sanvila@debian.org>
3267         http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=84451
3268         * src/m4.c (main): Fix format vulnerabilities.  (trivial change)
3270 2001-02-01  Matt Kraai  <kraai@debian.org>
3272         http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=84416
3273         * doc/m4.texinfo (Maketemp): Change maketemp to refer to a new,
3274         empty file rather than to a nonexistent file.  This closes a common
3275         security hole.
3276         * src/builtin.c (m4_maketemp): Implement the above, by using
3277         mkstemp rather than mktemp.  (trivial change)
3279 2000-01-09  Akim Demaille  <demaille@inf.enst.fr>
3281         * src/builtin.c (expand_ranges): Added break after trailing dash.
3282         This caused misbehaviors on some systems.
3284 Sat Nov  5 15:52:47 1994  Francois Pinard  (pinard@icule)
3286         Release 1.4.
3287         * doc/Makefile.in (realclean): Also remove stamp-vti.
3288         Reported by Eric Backus.
3290 Wed Nov  2 00:47:53 1994  Francois Pinard  (pinard@icule)
3292         * src/freeze.c (produce_frozen_state): If the frozen file cannot
3293         be opened, return immediately after producing the error message.
3294         Reported by Andreas Schwab.
3296         * configure.in: Check for const only after having found possible
3297         ANSIfying compiler flags, this is of no use to check it before.
3298         Reported by Alexander Lehmann.
3300 Tue Nov  1 22:02:37 1994  Francois Pinard  (pinard@icule)
3302         * src/macro.c (collect_arguments): Cast obstack arguments to
3303         (voidstar), so avoiding compiler warnings.
3304         Reported by Joseph E. Sacco.
3306         * src/freeze.c (produce_frozen_state): Cast printed lengths to
3307         (int) so they correspond to %d format items.
3308         Reported by Joseph E. Sacco.
3310         * src/m4.c (main): Cast the argument to xfree to (voidstar).
3311         * src/symtab.c (free_symbol): Idem.
3312         Reported by Karl Vogel.
3314 Mon Oct 31 02:11:19 1994  Francois Pinard  (pinard@icule)
3316         * Makefile.in (DISTFILES): Distribute BACKLOG.
3318         * configure.in: Define PRODUCT and VERSION.
3319         * acconfig.h: Document PRODUCT and VERSION.
3320         * src/m4.c, src/freeze.c: Use PRODUCT and VERSION instead of the
3321         constant string m4 and variable or parameter named version.
3323 Sun Oct 30 08:13:03 1994  Francois Pinard  (pinard@icule)
3325         * src/m4.h, src/debug.c: Replace all #ifdef __STDC__ by #if
3326         __STDC__.  Alliant FX/2800 Concentrix 2.2 (i860-BSD4.3) compiler
3327         defines __STDC__ to 0, for indicating it is *not* ANSI!
3328         Reported by Kaveh R. Ghazi.
3330         * configure.in: Added obsolescent tests for AIX and Minix.
3332         * doc/Makefile.in (mostlyclean): Remove texclean in dependencies,
3333         which texclean does not exist anymore.
3334         Reported by Eric Backus, Jim Meyering, John David Anglin and
3335         Joseph E. Sacco.
3337 Sat Oct 29 05:10:03 1994  Francois Pinard  (pinard@icule)
3339         * aclocal.m4 (fp_C_PROTOTYPES): Force -D_HPUX_SOURCE with -Aa.
3340         Reported by John David Anglin.
3342         * src/ansi2knr.c: New version, sent by Peter Deutsch.
3343         * aclocal.m4 (fp_C_PROTOTYPES): Substitute empty or ansi2knr for
3344         ANSI2KNR, depending on the fact the compiler is ANSI or not.
3345         * src/Makefile.in: Use -Ovarargs=convert on ansi2knr calls.
3346         Remove the sed filter after ansi2knr for debug.c.  Use $O instead
3347         of $U, put underline in extensions rather than in basenames.  Use
3348         implicit rules, now that regularity makes this possible.
3349         Have $(OBJECTS) depend on $(ANSI2KNR), so to trigger compilation
3350         of ansi2knr whenever it is needed.
3351         * configure.in: Adjusted for correct STACKOVF substitution.
3352         * src/debug.c (trace_format): When not __STDC__, use (...) as a
3353         parameter list, so ansi2knr will convert it to (va_alist) va_dcl.
3354         Reported by David MacKenzie.
3356         * Makefile.in: Remove binprefix.  Use transform_name instead.
3357         Reported by David MacKenzie.
3359         * doc/Makefile.in: Create version.texi, use it, clean it.
3360         Reported by Jim Meyering.
3362 Fri Oct 28 20:33:55 1994  Francois Pinard  (pinard@icule)
3364         * Makefile.in (all, install, uninstall): Depend on Makefile.
3366         * Makefile.in: For actions invoking $(MAKE) from within compound
3367         sh statements, exit non-zero if the sub-make fails.  Otherwise,
3368         the top-level make may exit successfully when it should fail.
3369         Reported by Jim Kingdon.
3371         * {,/*}Makefile.in: Use && after all cd, in case they fail.
3373         * {,*/}Makefile.in: Declare PRODUCT and VERSION macros.
3374         (dist): Use PRODUCT and VERSION instead of tricks on .fname.
3375         * configure.in: Substitute PRODUCT and VERSION.
3377         * {,*/}Makefile.in (dist): Always try a hard link before a copy.
3379 Thu Oct 27 22:32:58 1994  Francois Pinard  (pinard@icule)
3381         * Makefile.in (mostlyclean-local): Do not remove *~.
3382         * */Makefile.in (mostlyclean): Idem.
3383         Reported by Robert E. Brown and Richard Stallman.
3385 Sun Oct  9 08:30:13 1994  Francois Pinard  (pinard@icule)
3387         * src/m4.h: Get rid of CONFIG_BROKETS.
3389 Sun Oct  2 16:48:10 1994  Francois Pinard  (pinard@icule)
3391         * configure.in: Use AC_ARG_PROGRAM.
3392         * aclocal.m4 (fp_C_PROTOTYPES): Substitute @kr@ by kr or empty.
3393         Reported by David MacKenzie.
3395 Sat Oct  1 11:22:42 1994  Francois Pinard  (pinard@icule)
3397         * configure.in: Do not add -O to CFLAGS for GNU C, now that
3398         configure does it automatically.
3399         Reported by Jim Meyering.
3401 Fri Sep 23 08:16:58 1994  Francois Pinard  (pinard@icule)
3403         * src/stackovf.c: Declare the handler_t typedef earlier in the
3404         code, use it for stackovf_handler.
3405         (setup_stackovf_trap): Use RETSIGTYPE instead of void while
3406         casting sigsegv_handler.
3407         Reported by Robert Bernstein.
3409         * src/m4.c (main): Initialize program_name to argv[0] without
3410         basename'ing it.
3411         Reported by Karl Berry.
3413 Sun Sep 18 11:42:50 1994  Francois Pinard  (pinard@icule)
3415         * src/Makefile.in (TAGS): Include a ../lib/TAGS reference.
3416         Reported by Karl Berry.
3418 Wed Sep 14 10:00:22 1994  Francois Pinard  (pinard@icule)
3420         * lib/Makefile.in (mostlyclean): Added.
3421         (TAGS): Make in $(srcdir).
3423         * configure.in: Use `choke me' in test, like everywhere!
3425         * {doc,examples,lib,src}/Makefile.in (check): Deleted, as
3426         unreacheable and useless.
3428         * doc/Makefile.in (texclean): Deleted, merged in mostlyclean.
3430         * lib/Makefile.in (DISTFILES): Distribute TAGS.
3431         (distclean): Do not remove TAGS.
3432         (realclean): Remove it.
3433         * Makefile.in: Make TAGS in lib also, not just in src.
3434         Reported by Karl Berry.
3436         * Makefile.in (distclean, realclean): Instead of recursively
3437         calling $(MAKE) for the -local part, allow parallel execution of
3438         -recursive and -local, only delay the removal of config.status,
3439         which is repeated in both goals.
3441 Tue Sep 13 19:21:05 1994  Francois Pinard  (pinard@icule)
3443         Release 1.3.
3444         * Makefile.in: Group all *clean-recursive goals in one, using sed
3445         to remove `-recursive' while calling make recursively.  Also, use
3446         a subshell for each recursive $(MAKE).
3447         Reported by Jim Meyering.
3449         * src/m4.h (memcpy): Define with bcopy for BSD systems.
3450         Reported by Kaveh R. Ghazi.
3452         * src/Makefile.in (ansi2knr): Use $(LIBS) while linking, for SunOS
3453         4.1.3 requires -ldl to link even ansik2nr, and we need a way to
3454         specify it.
3456         * configure.in: Use date instead of touch for stamp-h.
3457         * Makefile.in (stamp-h.in): Idem.
3459         * Makefile.in (distclean, realclean): Force serial execution of
3460         both goals, in case parallel makes are being used.
3461         Reported by Jim Meyering.
3463         * src/Makefile.in (DISTFILES): Distribute TAGS.
3464         (distclean): Do not remove TAGS.
3465         (realclean): Remove it.
3466         Reported by Karl Berry.
3468 Sat Sep 10 12:34:04 1994  Francois Pinard  (pinard@icule)
3470         * configure.in: Use fp_ to match aclocal.m4.  Revert _OS_ macros
3471         to old names, for following Autoconf.
3473 Thu Sep  8 15:07:27 1994  Francois Pinard  (pinard@icule)
3475         * Makefile.in (MDEFINES): Remove INSTALL substitutions, for
3476         ./install.sh will not be correctly referred to in sub-Makefiles.
3477         Reported by John David Anglin.
3479         * doc/Makefile.in (texclean): Remove *.cps and *.fns too.
3480         Reported by Eric Backus.
3482         * Makefile.in, checks/Makefile.in, doc/Makefile.in,
3483         examples/Makefile.in, lib/Makefile.in, src/Makefile.in: Limit
3484         config.status into remaking this directory's Makefile only.
3485         * Makefile.in (stamp-h): Do not check nor touch stamp-h.
3486         * configure.in (AC_OUTPUT): Touch stamp-h if CONFIG_HEADERS.
3487         Reported by Jim Meyering.
3489 Tue Sep  6 12:07:33 1994  Francois Pinard  (pinard@icule)
3491         * configure.in: Correct stack overflow detection logic, taking
3492         care of systems having only incomplete implementations (like for
3493         Pyramid 9820 OSx 5.0d).
3494         Reported by Kaveh R. Ghazi.
3496         * src/Makefile.in (TAGS): Remote -t from etags call.
3498 Fri Sep  2 10:37:10 1994  Francois Pinard  (pinard@icule)
3500         * lib/Makefile.in (install): Depend on all.
3502 Wed Aug 31 11:17:21 1994  Francois Pinard  (pinard@icule)
3504         * examples/Makefile.in (mostlyclean): Do not depend on texclean.
3505         Reported by Jim Meyering and John David Anglin.
3507         * Makefile.in (distclean-local): Delete config.log.
3508         Reported by Jim Meyering.
3510         Solidify frozen files with respect to -P:
3511         * src/m4.c: Have -P set prefix_all_buitins variable instead of
3512         calling a function by that name.  Declare the variable.
3513         * src/m4.h: Adjust declaration for prefix_all_buitins.
3514         * src/builtin.c (builtin_init): Merge in functionality from
3515         previous prefix_all_buitins function, while making entries in the
3516         symbol table, but not modifying the builtin description itself.
3518         * src/freeze.c (reload_frozen_state): Add a useless `break;',
3519         because *many* compilers do not accept an empty `default:'.
3520         Reported by Akiko Matsushita, Eric Backus, John David Anglin,
3521         Joseph E. Sacco, Kaveh R. Ghazi, Tom McConnell and Ulrich Drepper.
3523         * configure.in: Use AC_TYPE_SIGNAL.
3524         * src/stackovf.c (setup_stackovf_trap): Use RETSIGTYPE.
3525         Reported by Robert Bernstein.
3527         * checks/Makefile.in (check): Modify PATH so check-them will find
3528         m4 in the src directory.
3529         * Makefile.in (check): Don't.
3530         Reported by Akiko Matsushita and Jim Meyering.
3532         * src/output.c (make_room_for, output_character_helper): New
3533         functions, for implementing a global MAXIMUM_TOTAL_SIZE instead of
3534         a per buffer MAXIMUM_BUFFER_SIZE.
3536         * src/output.c (output_text): New function, for optimizing the
3537         output of strings of characters.  Use it.
3539 Tue Aug 30 01:44:29 1994  Francois Pinard  (pinard@icule)
3541         * doc, src: New directories reorganizing the distribution.
3542         * doc/Makefile.in, src/Makefile.in, examples/Makefile.in: New
3543         files.
3544         * Makefile.in: Adjusted.
3545         * configure.in: Configure new Makefiles.
3547         * m4.h: Declare STRING typedef.  Use it for comment and quote
3548         strings, adjusting all references.  (This is the rudiments of a
3549         beginning for the eventual withdrawal of NUL terminated strings.)
3550         * output.c (shipout_text): Accept a length parameter, and use it.
3551         All callers adjusted.
3553 Mon Aug 29 12:27:19 1994  Francois Pinard  (pinard@icule)
3555         * m4.h: Include <unistd.h> if it exists.
3556         * stackovf.c: Don't.
3558         Clean up for current_diversion variable:
3559         * output.c: Move current_diversion from builtin.c.
3560         * m4.h: Declare current_diversion so builtin.c can access it.
3561         * output.c (output_init, make_diversion): Initialize or update
3562         current_diversion.
3563         * builtin.c (builtin_init, m4_divert): Leave current_diversion
3564         alone.
3566         Remove limit on number of diversions:
3567         * output.c: Replace ndiversion by diversions, declare it.
3568         (output_init): Allocate only diversion 0.
3569         (make_diversion): Allocate new diversions as needed.
3570         * m4.h, m4.c: Remove NDIVERSIONS and ndiversion related stuff.
3571         * m4.c: Still accept -N, but do nothing with it.
3572         Reported by David MacKenzie.
3574         Freeze diversions:
3575         * output.c (freeze_diversions): New function.
3576         * m4.h: Declare freeze_diversions.
3577         * freeze.c: Document frozen file format, revise it, call
3578         freeze_diversions to add diversions to frozen format, and code to
3579         reload them properly.
3580         * m4.c: Do not undivert automatically at end when status being
3581         frozen.  Do not call builtin_init when reloading frozen state.
3583         Speed up diversion processing:
3584         * output.c: Add INITIAL_BUFFER_SIZE, MAXIMUM_BUFFER_SIZE,
3585         COPY_BUFFER_SIZE, in-memory diversion buffers, struct diversion
3586         structure and variables, cached variables out of output_diversion,
3587         reallocate_diversion_for and OUTPUT_CHARACTER.
3588         (shipout_text, make_diversion, insert_diversion): Adapted to new
3589         structures.
3590         (insert_file): Use better buffering.
3591         Reported by David MacKenzie.
3593 Sun Aug 28 05:20:02 1994  Francois Pinard  (pinard@icule)
3595         * Makefile.in, lib/Makefile.in, checks/Makefile.in: Arrange so
3596         dist works from another build directory.
3598 Sat Aug 27 14:32:45 1994  Francois Pinard  (pinard@icule)
3600         * symtab.c (hack_all_symbols): Use hash_table_size instead of
3601         constant HASHMAX, for -H option to work better.
3603         * builtin.c (DECLARE): Simplify by using _ ().
3605         * freeze.c: New file.
3606         * Makefile.in: Compile it, distribute it.
3607         * m4.c: Recognize, document and process --freeze-state (-F) and
3608         --reload-state (-R) options.  Pass a true flag to builtin_init
3609         only if no reloading some state.
3610         * builtin.c (define_builtin): Remove static specifier.
3611         (find_builtin_by_name): Remove static specifier.
3612         (builtin_init): Accept and obey a flag argument.
3613         * m4.h: Add declarations for freeze.c, changes for builtin.c.
3615 Wed Aug 24 16:14:19 1994  Francois Pinard  (pinard@icule)
3617         * builtin.c (dumpdef_cmp): Rewrite so the cast protect the const
3618         specifier.
3620         * configure.in: Implement --with-dmalloc.
3621         * acconfig.h: Document WITH_DMALLOC.
3622         * m4.h: Add code for when WITH_DMALLOC.
3624 Mon Aug 15 12:38:05 1994  Francois Pinard  (pinard@icule)
3626         * m4.c (long_options): Use "error-output", the dash was missing.
3627         Reported by Akiko Matsushita.
3629 Fri Aug 12 16:38:01 1994  Francois Pinard  (pinard@icule)
3631         * m4.h: Include <sys/types.h>.
3632         * builtin.c, debug.c, m4.c, output.c, stackovf.c: Don't.
3633         * m4.h: Declare len_lquote and len_rquote as size_t, not int.
3634         int.
3635         * input.c: Declare len_lquote, len_rquote, len_bcomm and len_ecomm
3636         as size_t, not int.
3637         * builtin.c (dump_args): Declare len as size_t, not int.
3639         * debug.c: Prototype the forward declaration of debug_set_file.
3641         * builtin.c (m4_undivert):  Replace div by file, for avoiding the
3642         shadowing of this variable.
3643         * output.c (insert_diversion): Idem.
3645         * input.c: Delete def_rquote, def_lquote, def_bcomm and def_ecomm.
3646         (input_init): Duplicate default quote and comment strings.
3647         (set_quotes): Free previous quote strings in all cases.  Duplicate
3648         even default quote strings.
3649         (set_comment): Free previous comment strings in all cases.
3650         Duplicate even default comment strings.
3652         * configure.in: Updated for Autoconf 2.0.
3653         * Makefile.in (distclean-local): Also delete config.cache.
3655         * m4.c (usage): Reorganize the --help output by topic.  Include a
3656         description for debugging flags.
3658 Fri Jul 29 10:15:52 1994  Francois Pinard  (pinard@icule)
3660         * configure.in: If sigaction is available and SA_ONSTACK defined,
3661         use sigaction.  Otherwise, if sigvec is available and SV_ONSTACK
3662         defined, use sigvec.  Else don't compile stackovf.c.
3663         * stackovf.c (setup_stackovf_trap): Idem.
3664         Reported by Jim Avera, Karl Berry, Kaveh R. Ghazi, Matthias Rabe
3665         and Simon Leinen.
3667 Thu Jul 21 22:43:17 1994  Francois Pinard  (pinard@icule)
3669         * m4.c (usage): Replace printf par fputs.
3671 Mon Jul 18 23:48:23 1994  Francois Pinard  (pinard@icule)
3673         * Release 1.2
3675 Sun Jul 17 08:08:25 1994  Francois Pinard  (pinard@icule)
3677         * configure.in: Check for sigaction and sigvec.  Add a new delayed
3678         check for RLIMIT_STACK, combine in the checking for getrlimit.
3679         All those things are not universally available.
3680         * stackovf.c: Split setting up the trap handler and catching
3681         signals, for better taking care of various configure outcomes.
3682         * examples/stackovf.sh: Correct a typo.
3683         Reported by Eric Backus, Jim Avera and Jim Meyering.
3685 Sat Jul 16 20:36:19 1994  Francois Pinard  (pinard@icule)
3687         * ansi2knr.c: New version sent by its author, Peter Deutsch.
3689 Fri Jul 15 14:36:21 1994  Francois Pinard  (pinard@icule)
3691         * Makefile.in: Modify so parallel make will not try making
3692         lib/libm4.a twice simultaneously.
3693         Reported by Jim Meyering.
3695 Thu Jul 14 17:23:17 1994  Francois Pinard  (pinard@icule)
3697         * stackovf.c (setup_stackovf_trap): Replace "Don't" by "Do not" in
3698         error message, for when no code possibility exists.  Even if this
3699         line is completely #ifdef'ed out, it brings a syntax error.
3700         Reported by Andreas Schwab, Jim Meyering and Joseph E. Sacco.
3702         * Makefile.in (install): Have install depend on all too, for lib
3703         to be remade as needed.
3705         * examples/stackovf.sh: Try ksh, bsh and bash for shells
3706         providing ulimit, instead of using only ksh.
3707         Reported by Jim Avera and Joseph E. Sacco.
3709 Tue Jul 12 06:54:31 1994  Francois Pinard  (pinard@icule)
3711         * Makefile.in (check): Have it depend on all instead of m4.  In
3712         this way, a change in lib will be detected and processed.
3714         * builtin.c (numeric_arg): Use strtol and verify the conversion,
3715         instead of using sscanf which stops as soon as there is a
3716         non-digit in the input.  Previously, incr(1xyzzy), eval(1,2xyzzy)
3717         and divert(1xyzzy) were all accepted without any warning or error
3718         messages.
3719         * m4.h: Declare strtol as long if not including stdlib.h.
3720         * configure.in: Check for limits.h, and replace strtol if missing.
3721         * lib/Makefile.in: Substitute LIBOBJS.  Distribute strtol.c.
3722         * lib/strtol.c: New file, from elsewhere.
3723         Reported by Andreas Schwab.
3725 Thu Jul  7 22:38:10 1994  Francois Pinard  (pinard@icule)
3727         * macro.c (expand_macro): Cast value to (boolean) prior to
3728         assigning it to traced.
3729         Reported by Tom McConnell.
3731         * Makefile.in (m4): Always make all in lib first.
3732         Reported by Jim Meyering.
3734 Wed Jul  6 13:16:31 1994  Jim Avera (jima@netcom.com)
3736         * stackovf.c: Isolated OS-dependent sections; Improved portability,
3737         adding support for SunOS/BSD (sigvec, sigstack, and 4-parameter signal
3738         handlers), and a default error message if the fault address is not
3739         available (when neither siginfo.h nor BSD sigcontext are supported).
3740         * configure.in: Changes for stackovf.h: Check for sigcontext,
3741         sigaction, sigstack, and define rlim_t as int if necessary.
3742         * acconfig.h: Added HAVE_SIGCONTEXT and rlim_t.
3743         * examples/stackovf.sh: Run m4 -L99999999 to allow stack overflow.
3744         * ansi2knr.c: Fix for func-ptr args; convert "..." to varargs syntax.
3746 Tue Jul  5 19:13:54 1994  Francois Pinard  (pinard@icule)
3748         * configure.in: Use AC_SET_MAKE.
3749         * Makefile.in: Use @SET_MAKE@.
3750         Reported by Jim Meyering.
3752         * checks/check-them: Do not trap on SIGQUIT or SIGALRM.
3753         Reported by Ian Taylor.
3755 Sat Jul  2 00:58:47 1994  Francois Pinard  (pinard@icule)
3757         * configure.in: Remove dependency of USE_STACKOVF on STDC_HEADERS,
3758         because siginfo.h is unrelated to standard headers, and siginfo.h
3759         is already checked for.
3760         Reported by Joseph E. Sacco.
3762         * acconfig.h, aclocal.m4, m4.h: Replace HAVE_PROTOTYPES by
3763         PROTOTYPES.
3764         * aclocal.m4, configure.in: Replace AC_HAVE_PROTOTYPES by
3765         AC_PROTOTYPES.
3767 Wed Jun 29 22:41:53 1994  Francois Pinard  (pinard@icule)
3769         * builtin.c (substitute): Use \& to represent this part of the
3770         string which was matched by the whole regexp, instead of
3771         representing the whole string.  Any usage of \0 issues a warning
3772         and acts like \&, it will disappear in some subsequent release.
3774 Mon Jun 27 14:24:23 1994  Francois Pinard  (pinard@icule)
3776         * m4.c: Complete prototype for forwarded declaration of usage.
3778         * input.c (init_macro_token): Correct own reference in error
3779         message.  Previous name get_macro_func was referred to instead.
3780         (next_char):  Correct own reference in error message.  Previous
3781         name advance_input was referred to instead.
3783         * m4.h: Declare eval_t and unsigned_eval_t typedefs to 32 bits.
3784         * eval.c (logical_or_term, logical_and_term, or_term, xor_term,
3785         and_term, not_term, logical_not_term, cmp_term, shift_term,
3786         add_term, mult_term, exp_term, unary_term, simple_term): Add
3787         prototype to forwarded declarations.  Declare parameter v1 as
3788         eval_t * instead of int *.  Same for local variable v2 in dyadic
3789         functions.  Same for result in exp_term.
3790         * builtin.c (m4_eval): Declare value as eval_t instead of int.
3791         (ntoa): Declare value as eval_t instead of int.  Declare uvalue as
3792         unsigned_eval_t instead of unsigned int.  Change casts accordingly.
3793         (shipout_int): Cast first argument of ntoa to eval_t.
3794         Reported by Thorsten Ohl.
3796         * macro.c: Complete the prototypes of forwarded expand_macro and
3797         expand_token.
3798         Reported by Thorsten Ohl.
3800         * m4.h: Define voidstar as void * or char * depending on __STDC__.
3801         The Ultrix 3.1 compiler cannot do much with void pointers.
3803         * builtin.c (dumpdef_cmp): Replace void * by voidstar.
3804         * m4.c (xfree):  Replace void * by voidstar.
3805         Reported by Tom McConnell.
3807         * ansi2knr.1: New, from elsewhere.
3808         * Makefile.in (DISTFILES): Distribute ansi2knr.1
3810         * Makefile.in (stamp-h.in): Avoid running ./config.status if
3811         stamp-h does not exist yet.  This avoids running it a second time
3812         just after the initial ./configure.
3813         Reported by David MacKenzie and Tom McConnell.
3815         * m4.h: Replace the enum debug_info declaration with a series of
3816         #define's.  The Ultrix 3.1 compiler would otherwise need casting
3817         (int) to most references, when used in expressions.
3818         Reported by Tom McConnell.
3820 Sat Jun 25 00:10:05 1994  Francois Pinard  (pinard@icule)
3822         * aclocal.m4: Replace FP_PROTOTYPES by AC_HAVE_PROTOTYPES,
3823         following an idea from Brook G. Milligan.  AC_HAVE_PROTOTYPES
3824         calls the compiler.  Previously, FP_PROTOTYPES was only calling
3825         the preprocessor; by not being subject to CFLAGS, this was
3826         discouraging those flags asking for ANSI compilation.
3827         * acconfig.h: Document HAVE_PROTOTYPES.
3828         * configure.in: Use AC_HAVE_PROTOTYPES instead of FP_PROTOTYPES.
3829         * m4.h: Define _() according to HAVE_PROTOTYPES, not __STDC__.
3830         Reported by Eric Backus.
3832         * configure.in: Substitute CFLAGS and LDFLAGS, taking their value
3833         from the environment.  Default CFLAGS to -g if not set.
3834         * Makefile.in: Have CFLAGS and LDFLAGS substituted from configure.
3835         * lib/Makefile.in: Have CFLAGS substituted from configure.
3836         Reported by Eric Backus and Tom McConnell.
3838         * configure.in: m4_undefine changeword before using AC_ENABLE.
3840         * m4.h: Declare prototypes for error (for ANSI compilers only),
3841         prefix_all_builtins and reference_error.
3842         Reported by Tom McConnell.
3844         * input.c (set_word_regexp): Do not try to initialize the array
3845         test from a string, this does not work with non-ANSI compilers.
3846         Reported by Eric Backus.
3848         * Makefile.in (dist): Clean examples/ before saving it.
3849         (distclean-local): Also remove stamp-h.
3850         Reported by Eric Backus.
3852         * Makefile.in (_stackovf.c): Goal for compiling stacokovf.c with
3853         non ANSI compilers.
3854         Reported by Tom McConnell.
3856         * checks/Makefile.in (clean): Depends on mostlyclean.
3857         (mostlyclean): New goal.
3859 Fri Jun 24 23:30:31 1994  Francois Pinard  (pinard@icule)
3861         * Makefile.in (DISTFILES): Distribute install.sh.
3862         * install.sh: New file, copied from elsewhere.
3863         Reported by Assar Westerlund and Kaveh R. Ghazi.
3865 Thu Jun 23 00:00:30 1994  Francois Pinard  (pinard@icule)
3867         * configure.in: Define ENABLE_CHANGEWORD if --enable-changeword.
3868         * acconfig.h: Explain ENABLE_CHANGEWORD.
3870         [These modifs all depend upon ENABLE_CHANGEWORD and are adapted
3871         from code provided by Pete Chown]
3872         * m4.h: Add original_text field to u_t variant of union u.
3873         Declare TOKEN_DATA_FUNC macro.
3874         * builtin.c: Declare changeword.
3875         (m4_changeword): New function.
3876         * input.c: Include "regex.h", define variables with word regexps.
3877         (input_init): Initialize the word regexp.
3878         (set_word_regexp): New.
3879         (next_token): Declare local variables, use the previous code if
3880         default_word_regexp is true.  Else, match using a new code.  Save
3881         the original text.
3882         * macro.c (expand_token): Ship out original text if not a macro
3883         name.
3884         Reported by Krste Asanovic and Pete Chown.
3886         [These modifs all depend upon ENABLE_CHANGEWORD]
3887         * m4.h: Declare external user_word_regexp.
3888         * m4.c: Declare user_word_regexp, and initialize it from
3889         --word-regexp or -W, or NULL if not specified.
3890         * input.c: Use user_word_regexp if specified, instead of
3891         DEFAULT_WORD_REGEXP.
3893         * Makefile.in (m4): Revert Jan 3 1994 change.  I'm unable to
3894         agree with it.
3896         * Makefile.in, lib/Makefile.in: Limit suffixes to .c and .o.
3897         * checks/Makefile.in: Empty the suffix list.
3898         Reported by Geoff Russell, Joel Sherrill and Roland McGrath.
3900         * m4.c: Declare nesting_limit and initialize it to 250.
3901         Implement -LNUMBER or --nesting-limit=NUMBER to change its
3902         value.
3903         * m4.h: Declare nesting_limit as external.
3904         * macro.c (expand_macro): Stop execution whenever nesting limit
3905         is exceeded.
3906         Reported by Bengt Mertensson.
3908         * eval.c (evaluate): Diagnose excess characters in eval input.
3909         Things like `eval(08)' used to return 0 with no diagnostic.
3911         * m4.h: Capitalize first letter of all macro arguments in
3912         definitions.
3914         * m4.c: Declare warning_status, initialize it to 0.  Add new
3915         option -E, or --fatal-warnings, which sets warning_status to
3916         EXIT_FAILURE instead.
3917         * m4.h: Declare external warning_status.  Define EXIT_SUCCESS and
3918         EXIT_FAILURE if not otherwise done by header files.
3919         * m4.c: Delete declarations for EXIT_SUCCESS and EXIT_FAILURE.
3920         * m4.c, input.c, output.c, symtab.c, builtin.c, macro.c, debug.c,
3921         eval.c: Replace 0 by warning_status and 1 by EXIT_FAILURE in first
3922         argument of all M4ERROR calls.
3923         Reported by Noah Friedman.
3925         * examples/incl-test.m4: Renamed from incl_test.m4.
3926         * examples/include.m4: Include incl-test.m4 instead of
3927         incl_test.m4.
3928         * examples/multiquotes.m4: Renamed from multi-quotes.m.
3930 Wed Jun 22 21:58:54 1994  Francois Pinard  (pinard@icule)
3932         * configure.in: Avoid USE_STACKOVF if <siginfo.h> not found.  Note
3933         that Jim developped stackovf.c on a 486 running SVR4.0 (ESIX), and
3934         also tested it on a Sun Sparc workstation running SunOS 4.x.
3936         * format.c (format): When not HAVE_EFGCVT, m4 was failing the
3937         49.format check, abusing a `union values' argument with sprintf
3938         without selecting the proper field.  Now, save the formatting type
3939         first, delaying the fetch of the corresponding argument.
3940         Reported by Joseph E. Sacco and Tom Quinn.
3942         * format.c (format): Remove const from char *fmt declaration when
3943         not HAVE_EFGCVT, because a NUL may be forced into it.
3945         * m4.h: Declare atof() when not STDC_HEADERS.
3946         Reported by Joseph E. Sacco.
3948         * Regenerate configure using Autoconf 1.11, this corrects a
3949         problem about an incorrect cpp seting on NeXT 3.1.
3950         Reported by Alexander Lehmann.
3952 Sun Jun  5 16:25:19 1994  Francois Pinard  (pinard@icule)
3954         * m4.h (_): Change argument from `x' to `Args'.
3956 Wed May  4 23:59:39 1994  Francois Pinard  (pinard@icule)
3958         * Makefile.in: Remove all occurrences of $(MFLAGS), which were
3959         bringing more evil than good on a few systems.
3960         Reported by Greg A. Woods.
3962 Fri Apr 22 15:59:35 1994  Francois Pinard  (pinard@icule)
3964         * m4.h: Rename Args() to _().
3965         * m4.h: Remove extern specifier from all function declarations.
3967 Fri Apr 22 15:51:21 1994  Jim Avera (jima@netcom.com)
3969         * stackovf.c: New file implementing stack-overflow detection.
3970         * configure.in: Check for getrlimit, sigaction.  If all of
3971         standard headers, getrlimit and sigaction, define USE_STACKOVF and
3972         substitute ${U}stackovf.o for STACKOVF.
3973         * acconfig.h: Declare USE_STACKOVF.
3974         * Makefile.in: Distribute stackovf.c, link with $(STACKOVF).
3975         * m4.h: Declare setup_stackovf_trap().
3976         * m4.c: Call setup_stackovf_trap().
3977         * tests/stackovf_test.sh: New file.
3979 Wed Apr 13 14:10:30 1994  Francois Pinard  (pinard@icule)
3981         * checks/Makefile.in: Rename .all-stamp to stamp-checks.
3983         * Makefile.in (Makefile, etc.): Adapt for Autoconf 1.8.
3985 Sun Jan 30 14:24:19 1994    (pinard at icule)
3987         * m4.h: Remove definition of volatile, not used anymore.
3988         Reported by Jim Meyering and Joseph E. Sacco.
3990         * m4.h: Consistently use `do { ... } while (0)' in macros, instead
3991         of `if ... else /* nothing */' for if macros.
3992         Reported by Jim Meyering.
3994         * builtin.c (m4_regexp): Reorganize the code for avoiding a
3995         warning from gcc about `repl' possibly used before defined.
3996         Reported by Jim Meyering.
3998         * m4.h: Avoid a pre-ANSI <memory.h> together with <string.h>.
3999         Reported by Jim Meyering.
4001 Tue Jan 25 18:39:37 1994  Francois Pinard  (pinard at icule)
4003         * m4.h: Move the conditional definition of volatile after the
4004         inclusion of system files, because they may define it first.
4006 Tue Jan  4 19:46:50 1994  Francois Pinard  (pinard@icule)
4008         * checks/Makefile.in (CHECKS): Add a useless `*' before `[', to
4009         get around a problem with Alpha make seeing a syntax error, there.
4010         Reported by Vern Paxson.
4012 Mon Jan  3 00:21:45 1994  Francois Pinard  (pinard@icule)
4014         * Makefile.in: Do not define LDFLAGS, use CFLAGS on link calls.
4015         Reported by Richard Stallman.
4017 Sat Dec 25 08:06:05 1993  Francois Pinard  (pinard@icule)
4019         * configure.in: Correct test for strerror, AC_FUNC_CHECK was used
4020         instead of AC_HAVE_FUNCS.
4021         Reported by Noah Friedman.
4023 Wed Dec  1 09:37:53 1993  Francois Pinard  (pinard@icule)
4025         * m4.c: Initialize show_help and show_version to zero.
4027         * m4.c: Ensure EXIT_SUCCESS and EXIT_FAILURE are defined.
4028         Use them in exit() and usage() calls.
4030 Sat Nov 27 10:43:24 1993  Francois Pinard  (pinard@icule)
4032         * m4.h: Delete extern sys_nerr, sys_errlist declarations, and
4033         syserr() macro.  Delete errref, add reference_error and M4ERROR.
4034         * m4.c: Replace errref, which was returning an input reference
4035         string, with reference_error, which prints it on standard error.
4036         * builtin.c, output.c: Use errno as second parameter to error,
4037         instead of using syserr() with %s.
4038         * *.c: Use M4ERROR instead of error: no more errref() with %s.
4039         Doing so, the program name appears after the input reference
4040         instead of before, which eases M-x next-error processing.
4042 Wed Nov 24 22:16:15 1993  Francois Pinard  (pinard@icule)
4044         * checks/get-them: Escape braces with backslashes in patterns,
4045         because HPUX-9.01 awk needs this.
4046         Reported by Jim Meyering.
4048 Mon Nov 22 10:55:52 1993  Francois Pinard  (pinard@icule)
4050         * builtin.c: Declare "FILE *popen ();".
4052         * m4.h: Remove MESSAGE{,1,2}, WARNING1, FATAL{,1}, INTERNAL_ERROR
4053         macros, replace error_message_prefix() declaration by errref()'s.
4054         Declare xrealloc, for use in errref().
4055         * m4.c: Delete error_message_prefix() function, add errref().
4056         * *.c: Use error() systematically in place of all error macros,
4057         now that error() flushes stdout first.  Make needed adjustments.
4059         * m4.h: Remove const in sys_errlist[] declaration, it creates
4060         conflicts on SGI and Alpha.
4061         Reported by Kaveh R. Ghazi.
4063 Sat Nov 20 08:26:15 1993  Francois Pinard  (pinard@icule)
4065         * m4.c: Include <getopt.h> instead of "getopt.h".
4067         * configure.in: Output to config.h.  Use HAVE_FUNCS preferably.
4068         * acconfig.h: New, for documenting HAVE_EFGCVT.
4069         * Makefile.in: Distribute acconfig.h, .stamp-h.in and config.h.in,
4070         use them wherever appropriate.  Also use -I. for compilations.
4071         * lib/Makefile.in: Use -I.. for compilations.
4072         * *.c: Include <config.h> or "config.h".
4074         * m4.h: Test for HAVE_MEMORY_H instead of NEED_MEMORY_H.
4075         * configure.in: Use AC_HAVE_HEADERS(memory.h), delete AC_MEMORY_H.
4077 Wed Nov 17 09:34:55 1993  Francois Pinard  (pinard@icule)
4079         * builtin.c (m4_eval): Cast strlen to (int) before comparing.
4081         * input.c (input_init): Initialize quote and comment strings
4082         explicitely instead of calling set_quotes and set_comment: by
4083         doing so, we ensure we do not free uninitialized variables.
4085         * checks/check-them: Reverse arguments to both diff, so the
4086         expected is on the left and the obtained on the right.
4088         * m4.h: Add MESSAGE{,1,2}, WARNING1, FATAL{,1} and INTERNAL_ERROR
4089         macros. Delete declarations for m4error, warning, fatal and
4090         internal_error, add declaration for error_message_prefix.
4091         * m4.c:  Delete m4error, warning, fatal and internal_error
4092         routines, add error_message_prefix routine.
4093         * *.c: Replace m4error routine calls with MESSAGE* macro calls,
4094         warning with WARNING*, fatal with FATAL* and internal_error with
4095         INTERNAL_ERROR*.
4096         * Makefile.in (_m4.c): Do not adjust ansi2knr output for va_alist,
4097         this is not needed anymore.
4099         * m4.h: Declare extern FILE *debug.  Add DEBUG_PRINT{1,3} and
4100         DEBUG_MESSAGE{,1,2} macros.  Delete declarations for debug_print
4101         and debug_message, add declaration for debug_message_prefix.
4102         * debug.c: Remove static specifier for FILE *debug declaration.
4103         Delete debug_print and debug_message routines, add
4104         debug_message_prefix routine.
4105         * builtin.c, debug.c: Replace debug_print routine calls with
4106         DEBUG_PRINT* macro calls.
4107         * input.c, path.c: Replace debug_message routine calls with
4108         DEBUG_MESSAGE* macro calls.
4110         * m4.h: Remove inclusion of <varargs.h>.
4111         * debug.c: Include <stdarg.h> or <varargs.h>.
4112         (trace_format): Use stdarg instead of varargs if __STDC__.
4114         * configure.in: Remove checks for vfprintf and _doprnt.  These
4115         implementations use varargs tricks which are not portable enough.
4116         * lib/vfprintf.c: Deleted.
4117         * lib/_doprnt.c: Deleted.
4118         * lib/Makefile.in: Adjusted accordingly.  Remove LIBOBJS.
4119         Reported by Joel Sherrill.
4121         * path.c (add_include_directory): Use xstrdup.
4123         * builtin.c (find_builtin_by_name): Declare static.
4125         * *.[ch]: Add const to a few "char *" declarations.
4127         * configure.in: Remove commented tests for fileno() and fstat().
4128         * debug.c: Remove comments about HAVE_FILENO and HAVE_FSTAT.
4130         * debug.c (debug_flush_files): New.
4131         * m4.h: Declares it.
4132         * builtin.c (m4_syscmd, m4_esyscmd): Use it.
4133         Reported by Nicolas Pioch.
4135 Fri Nov 12 10:02:26 1993  Francois Pinard  (pinard@icule)
4137         * Makefile.in (m4.dvi): Use m4.texinfo instead of m4.texi.
4138         Reported by Joel Sherrill.
4140         * builtin.c (prefix_all_builtins): Instead of the table size, use
4141         the null entry at end for stopping the loop.  It was overwritten.
4142         Reported by Andreas Schwab and Jim Meyering.
4144         * builtin.c (prefix_all_builtins): Cast xmalloc to (char *).
4145         Reported by Kaveh R. Ghazi.
4147         * macro.c (call_macro): Add * in (*SYMBOL_FUNC (sym)) (...).
4148         Reported by Karl Vogel.
4150 Tue Nov  9 09:31:47 1993  Francois Pinard  (pinard@icule)
4152         * m4.h: Do not define volatile if already defined.
4153         Reported by Rene' Seindal.
4155         * lib/Makefile.in: Add a forgotten ALLOCA=@ALLOCA@.  Grrr!
4157         Reported by Bernhard Daeubler, Eric Backus, Hal Peterson, Hoang
4158         Uong, Ian Taylor, Kaveh R. Ghazi, Tom McConnell and Walter Wong.
4160 Mon Nov  8 21:11:44 1993  Francois Pinard  (pinard@icule)
4162         * m4.h: Define strchr and strrchr in terms of index and rindex,
4163         instead of the other way around.
4164         * builtin.c, m4.c, path.c: Use strchr instead of index.
4166         * input.c (next_char): Remove a "break;" after a "return ...;".
4167         Reported by Tom McConnell.
4169 Mon Nov  8 12:45:34 1993  Francois Pinard  (pinard@icule)
4171         * Release 1.1
4173         * configure.in: Do not copy check files in the build hierarchy.
4174         * checks/check-them: Identify the m4 version being checked.  For
4175         finding m4, look in $PATH instead of in the parent directory.
4176         * Makefile.in (check): Prepend `pwd` to $PATH before checking.
4177         * checks/Makefile.in (.all-stamp): Always create check files in
4178         the source hierarchy, not anymore in the build hierarchy.
4179         (check): cd to the source hierarchy before performing checks.
4180         Do not copy nor clean COPYING anymore, take it from `..'.
4181         Reported by Tom McConnell.
4183         * Makefile.in (Makefile): Use $(SHELL).
4184         (config.status): Use $(SHELL).  Use "config.status --recheck"
4185         instead of "configure --no-create", which is obsolete.
4186         Reported by Tom McConnell.
4188 Fri Nov  5 09:49:30 1993  Francois Pinard  (pinard@compy.IRO.UMontreal.CA)
4190         * m4.c (usage): Use "%s" instead of "m4" in format string.
4191         Reported by Jim Meyering.
4193         * Makefile.in: Distribute mkinstalldirs.
4194         Reported by Pierre Gaumond.
4195         Reported by Jim Meyering.
4196         Reported by Tom McConnell.
4197         Reported by Andreas Gustafsson.
4199         * checks/check-them: Renamed from checks/check_them.
4200         * checks/get-them: Renamed from checks/get_them.
4201         * checks/.all-stamp: Renamed from checks/.all_stamp.
4202         * checks/Makefile.in: Changed accordingly.
4203         Reported by Jim Meyering.
4205 Thu Nov  4 13:50:52 1993  Francois Pinard  (pinard@lagrande.IRO.UMontreal.CA)
4207         * lib/Makefile.in (dist): Correct permissions on files.
4209         * output.c: Declare tmpfile, some systems don't.
4211 Wed Nov  3 09:09:16 1993  Francois Pinard  (pinard@icule)
4213         * checks/Makefile.in (dist): Correct permissions on files.
4215         * Makefile.in (dist): Ensure recursive linking for subdirectory
4216         `examples', also set read/write permissions on all its files.
4218         * mkinstalldirs: New, from elsewhere.
4219         * Makefile.in: Use it.
4221         * debug.c: Synchronize debug messages and regular output when
4222         the debug file and stdout are redirected to the same file.
4223         * configure.in: Add (commented) checks for fileno and fstat.
4224         Reported by Jim Avera.
4226         * builtin.c (m4_ifelse): Diagnose excess arguments if 5, 8, 11,
4227         etc., arguments, then ignore the superfluous one.  m4 used to
4228         diagnose missing arguments and return the empty string.
4229         Reported by Nick S. Kanakakorn.
4231 Tue Nov  2 00:55:41 1993  Francois Pinard  (pinard@icule)
4233         * m4.c (main): At end of all input, ensure all undiverted text
4234         goes to the main output stream.
4235         Reported by Andreas Gustafsson.
4237         * m4.c (main): exit (0), instead of return 0.
4239         * m4.c: Implement -P and --prefix-builtins.
4240         * builtin.c: Delete const specifier on builtin_tab.
4241         (prefix_all_builtins): New.
4242         Reported by Noah Friedman.
4243         Reported by Scott Bartram.
4245         * c-boxes.el: New, from elsewhere.
4246         * Makefile.in: Distribute it.
4248         * m4.h: Do not define bcopy if <string.h> defines it.
4249         Reported by Stephen Perkins.
4251         * builtin.c (define_macro): Allow a missing second argument, in
4252         which case it is implied empty.  Affects define and pushdef.
4253         Reported by Eric Allman.
4255 Mon Nov  1 07:45:24 1993  Francois Pinard  (pinard@icule)
4257         * m4.h: Add blind_if_no_args in struct builtin, blind_no_args in
4258         struct symbol adn SYMBOL_BLIND_NO_ARGS macro.
4259         * builtin.c: Initialize all the blindness fields in builtin_tab.
4260         (define_builtin): Copy the blindness of a builtin into its symbol.
4261         * macro.c (expand_token): Avoid processing a blind builtin if the
4262         next character is not an opening parenthesis.
4263         Reported by David MacKenzie.
4264         Reported by Noah Friedman.
4266         * configure.in: Ensure an exit status of 0 on completion.
4267         Reported by Vivek P. Singhal.
4269         * eval.c (eval_lex): Admit both lower and upper case letters for
4270         bases greater than 10.  Only lower case letters were accepted.
4272         * eval.c (eval_lex): Recognize 0bDIGITS and 0rRADIX:DIGITS syntax.
4273         Reported by Krste Asanovic.
4275         * eval.c:  Rename NOT to LNOT.  Add XOR, NOT, LSHIFT and RSHIFT.
4276         * eval.c (logical_not_term): New name for not_term.
4277         * eval.c (xor_term): New, between or_term and and_term.
4278         * eval.c (not_term): New, between and_term and logical_not_term.
4279         * eval.c (shift_term): New, between cmp_term and add_term.
4280         Reported by Krste Asanovic: ~, ^, <<, >>.
4281         Reported by Ben A. Mesander: ** vs ^.
4283         * m4.c: Delete xmalloc.c, xrealloc.c, xstrdup.c.
4284         * m4.h: Delete xrealloc.c.
4285         * lib/xmalloc.c: New, from elsewhere.
4286         * lib/xstrdup.c: New, from elsewhere.
4287         * lib/Makefile.in: Distribute and compile them.
4289         * m4.c: Change progname to program_name.
4290         * builtin.c, eval.c, m4.c, m4.h: Rename error to m4error.
4291         * lib/error.c: New, from elsewhere.
4292         * lib/Makefile.in: Distribute and compile error.c.
4293         * configure.in: Check AC_VPRINTF and for strerror.
4294         * m4.c: Delete cmd_error.  Use error instead.
4295         * m4.c: Change label capitalisation to "ERROR", "Warning", etc.
4297         * m4.h: Delete #define const, let Autoconf takes care of this.
4299         * m4.c: Remove all code conditionalized by IMPLEMENT_M4OPTS.
4300         Merge parse_args into main.  Declare argv to be `char *const *',
4301         then remove superfluous casts.
4303         * m4.c: Rename --no-gnu-extensions to --traditional.
4304         Reported by Ben A. Mesander.
4306         * m4.c (usage): Add a status parameter.  Supply one in various
4307         calls.  Add --help processing.  Remove -V for --version.
4309         * lib/Makefile.in: Put $(CFLAGS) last in .c.o rule.
4311         * lib/Makefile.in: Have an AR=ar declaration.
4312         Reported by Eric Backus.
4313         Reported by Bjorn R. Bjornsson.
4314         Reported by Tom Tromey.
4315         Reported by Kristine Lund.
4316         Reported by Marion Hakanson.
4318 Sat Oct 30 12:51:47 1993  Francois Pinard  (pinard@icule)
4320         * Makefile.in (m4.info): Use -I$(srcdir) on $(MAKEINFO).
4321         Reported by Noah Friedman.
4323 Mon Oct 25 14:58:48 1993  Francois Pinard  (pinard@icule)
4325         * Makefile.in: Remove MDEFINES and cleanup.
4327 Wed Jun  9 14:59:46 1993  Francois Pinard  (pinard@icule)
4329         * Makefile.in (dist): Replace "echo `pwd`" by a mere "pwd".
4330         Create a gzip file.
4332 Sat Feb  6 14:59:22 1993  Francois Pinard  (pinard@icule)
4334         * Makefile.in, lib/Makefile.in, check/Makefile.in: In dist goals,
4335         ensure 777 mode for directories, so older tar's will restore file
4336         modes properly.
4338 Sun Jan 17 15:38:05 1993  Francois Pinard  (pinard@icule)
4340         * Makefile.in, lib/Makefile.in: Put $(CFLAGS) after $(CPPFLAGS),
4341         so the installer can override automatically configured choices.
4342         Reported by Karl Berry.
4344 Fri Jan 15 16:07:00 1993  Francois Pinard  (pinard@icule)
4346         * lib/vfprintf.c: Stolen from Oleo distribution and adapted.  The
4347         previous version was not working properly on m68k-hp-bsd4.3.
4348         Reported by Roland McGrath.
4350         * lib/_doprnt.c: Stolen from Oleo distribution.
4351         * configure.in: Check for _doprnt.c if vfprintf.c selected.
4352         * lib/Makefile.in: Distribute _doprnt.c.
4353         Do not distribute regex.[ch].old anymore.
4355 Fri Jan  1 19:42:23 1993  Francois Pinard  (pinard at icule)
4357         * Makefile.in, lib/Makefile.in: Reinstate $(CPPFLAGS), use it.
4358         Richard wants it there.
4360 Sun Dec 27 07:01:54 1992  Francois Pinard  (pinard at icule)
4362         * Makefile.in: Add DEFS to MDEFINES.
4363         * lib/Makefile.in (.c.o): Remove $(CPPFLAGS).
4364         (libm4.a): Remove the library before creating it.
4365         (distclean): Remove tags and TAGS too.
4367 Wed Dec 23 12:46:55 1992  Francois Pinard  (pinard at icule)
4369         * Makefile.in (dvi, m4.dvi): New goals.
4371         * builtin.c, eval.c, format.c, input.c, m4.[ch], m4.texinfo,
4372         macro.c, output.c, path.c, symtab.c: Change Copyright from
4373         1989-1992 to the explicit enumeration 1989, 1990, 1991, 1992.
4375         * examples/divert.m4: Deleted, this bug has been corrected.
4377         * Makefile.in (texclean, mostlyclean): New goals.
4379         * Makefile.in (clean): Remove clutter from ansi2knr.
4380         Reported by Pierre Gaumond.
4381         Reported by Greg A. Woods.
4383 Sun Dec 20 10:40:20 1992  Francois Pinard  (pinard at icule)
4385         * Makefile.in: Remove $(CPPFLAGS) from the .c.o rule.  The user
4386         might well use CFLAGS is s/he needs it.
4388         * Makefile.in: Allow installation of info files from a separate
4389         build directory.
4390         Reported by Jason Merrill.
4391         Reported by David MacKenzie.
4392         Reported by Skip Montanaro.
4393         Reported by Erez Zadok.
4394         Reported by Assar Westerlund.
4396 Sat Dec 19 08:21:34 1992  Francois Pinard  (pinard at icule)
4398         * Release 1.0.3
4399         This is still a beta release for the future GNU m4 version 1.1.
4401         * lib/alloca.c: New, from elsewhere.
4402         * lib/Makefile.in: Distribute it.  Define and use $(ALLOCA).
4404         * m4.h: Do not define index/rindex if already defined.  If
4405         FALSE/TRUE are already defined, do not redefine them, but merely
4406         define boolean typedef to int.
4408         * Makefile.in: Use $(DEFS) while compiling ansi2knr.
4409         * ansi2knr.c: Rewrite #ifdef HAVE_STRING_H || STDC_HEADERS,
4410         because some C compilers do not like connectives with #ifdef.
4411         * m4.h: Define `volatile' only if __GNUC__, instead of once for
4412         __GNUC__ and once for __STDC__.
4413         * lib/regex.h: Leave const alone, AC_CONST will take care of it.
4415         * checks/Makefile.in: Use .all_stamp instead of $(CHECKS) for
4416         Makefile dependencies.  Without it, make keeps destroying and
4417         remaking $(CHECKS) in a loop (why?).  Distribute .all_stamp.
4419         * m4.h, m4.c, builtin.c, output.c: Change all divertion/DIVERTION
4420         to diversion/DIVERSION, this was a spelling error.
4422         * m4.c: Declare version[], remove #include "version.h".
4423         * version.h: Deleted.
4424         * Makefile.in: Remove references to version.h.
4426         * output.c (shipout_text): Centralize all `#line NUM ["FILE"]'
4427         production, by using a simpler and more robust algorithm.  This
4428         solves the problem of synclines sometimes written in the middle of
4429         an output line.  Delete sync_line() and output_lines variable.
4430         * m4.h: Remove sync_line prototype and output_lines declaration.
4431         * input.c (next_char), output.c (shipout_text): Remove references
4432         to output_lines.
4433         * input.c (push_file, pop_file): Merely put the value -1 in
4434         output_current_line instead of calling sync_line, for delaying a
4435         single `#line NUM FILE' before next output line.  Do not test
4436         for sync_output, because this is unnecessary clutter.
4437         * output.c (make_divertion, insert_divertion): Idem.
4438         * input.c: Rename must_advance_line to start_of_input_line, for
4439         consistency.
4441         * debug.c (trace_header): Select a new debug line format, which
4442         better complies with GNU standards for formatting error messages.
4443         With option `-dfl', M-x next-error might be used on the output.
4444         * m4.c (vmesg): Adjust format of error output to GNU standards.
4445         * m4.texinfo: Adjust examples for `make check' to work.
4447         * m4.h, builtin.c, debug.c, input.c, macro.c, path.c: Use upper
4448         case for enum debug_info constants, which were all lower case.
4450         * builtin.c (m4_regexp, m4_patsubst): Use re_search instead of
4451         re_search_2.
4452         * lib/regex.[ch]: Use new version from textutils 1.3.6, with some
4453         collected patches.  I tried a few times using newer regex.[ch], it
4454         mysteriously stopped aborting with this one.  Insecure feeling...
4455         * lib/Makefile.in: Distribute regex.[ch].old, just in case!
4457 Fri Dec 18 11:08:03 1992  Francois Pinard  (pinard at icule)
4459         * m4.c: Change `--no-warnings' to `--silent'.
4460         Reported by David MacKenzie.
4462         * m4.c: Put all M4OPTS code upon IMPLEMENT_M4OPTS control, and
4463         leave it off for now.  See comment in m4.c for justification.
4464         Reported by David MacKenzie.
4466         * configure.in: Replace AC_USG by AC_HAVE_HEADERS(string.h).
4467         * m4.h, ansi2knr.c, lib/regex.h: Replace USG by HAVE_STRING_H.
4469         * Makefile.in: Add a new `info' goal.  Use macro MAKEINFO.
4471         * Makefile.in: Ensure recursive cleaning is done before local
4472         cleaning for all clean goals.
4474         * builtin.c (ntoa): Ensure the value is always interpreted as a
4475         signed quantity, whatever the radix is.
4477 Wed Nov 18 07:57:19 1992  Jim Meyering  (meyering@idefix)
4479         * builtin.c, format.c, input.c: Split long lines.
4480         * m4.c: Use typedef macro_definition instead of struct
4481         macro_definition.
4482         * symtab.c: Use typedef symbol instead of struct symbol.
4484 Tue Nov 17 01:58:40 1992  Francois Pinard  (pinard at icule)
4486         * *.[ch]: Remove all trailing whitespace, in code and comments.
4488         * configure.in: Find some awk.
4489         * Makefile.in: Add $(AWK) to MDEFINES.
4490         * checks/Makefile.in: Transmit $(AWK) to get_them.
4491         * checks/get_them: Use $AWK instead of gawk.  Add a close in the
4492         awk script when switching files, because without this, mawk runs
4493         out of file descriptors.
4495 Mon Nov 16 20:42:56 1992  Francois Pinard  (pinard at icule)
4497         * Makefile.in (realclean): Delete m4.info*.
4498         Reported by Jim Meyering.
4500         * Makefile.in: Adjust and link with checks/Makefile.
4501         * checks/Makefile.in: New.
4502         * configure.in: Output checks/Makefile.
4504         * checks/get_them: Have the dnl header of each test more
4505         recognizable by next-error, also use a better message.
4507 Mon Nov 16 07:48:52 1992  Jim Meyering  (meyering@idefix)
4509         * m4.h [__GNUC__]: Use __volatile__ instead of `volatile.'
4510         And use that only if __GNUC__ since we're using it's GCC-specific
4511         semantics that tell the compiler the associated function doesn't
4512         return.
4514         * builtin.c (substitute): Don't use character as an array index.
4515         (dumpdef_cmp): Make formal arguments `const void *' to avoid
4516         warnings with gcc -W -Wall on systems with qsort prototype.
4517         (m4_errprint): Cast obstack_finish to `char *' to avoid warnings
4518         from gcc -W -Wall.
4520         * eval.c (most functions): Add parentheses to assignments used
4521         as truth values go avoid warnings from gcc -Wall.
4523         * input.c, m4.c, output.c, path.c, symtab.c: Declare static
4524         any functions that don't need external scope.
4526         * builtin.c, debug.c, format.c, m4.c, m4.h, macro.c, symtab.c
4527         (many functions and arrays): Declare `const'.
4529 Sun Nov 15 09:42:09 1992  Francois Pinard  (pinard at icule)
4531         * *.[ch]: Rename nil to NULL, using the declaration from <stdio.h>,
4532         removing the declaration from m4.h.  Also rename false to FALSE
4533         and true to TRUE.
4535         * lib/Makefile.in (Makefile): New goal.
4537         * Makefile.in, lib/Makefile.in: Add a .c.o rule, so CFLAGS is not
4538         so heavily loaded.  It gets more easily overridable, calling make.
4539         Reported by Jim Meyering.
4541         * Makefile.in (dist): Get .fname from the current directory name,
4542         instead of from version.h.  I need updating many files manually,
4543         when the version changes, version.h is just one of them.
4545 Sat Nov 14 11:01:20 1992  Francois Pinard  (pinard at icule)
4547         * m4.h: Remove the tag `boolean' on the enum introducing typedef
4548         `boolean'.  This tag conflicts with <sys/types.h> on SVR4.
4549         Reported by Tom McConnell.
4551 Fri Nov 13 00:12:50 1992  Francois Pinard  (pinard at icule)
4553         * m4.texinfo: Correct the examples for 33.divert, 38.divnum,
4554         39.cleardiv, which were describing missing or spurious newlines.
4555         Modify examples 52.eval, 53.esyscmd and 54.sysval so the results
4556         do not depend on machine word size, `/bin/false' implementation,
4557         or `wc' output format.  `make check' is more dependable, now.
4559         * checks/check_them: Summarize the failed tests by listing their
4560         name, at end.  If none, issue `All checks successful'.  Output
4561         `Checking' instead of `Input file:'.
4563         * checks/get_them, checks/check_them: Reindented.
4565         * Makefile.in (dist): chmod a+r before making the tar file.
4567 Thu Nov 12 14:42:57 1992  Francois Pinard  (pinard at icule)
4569         * builtin.c (m4_dnl): Diagnose any parameter to `dnl'.
4571         * input.c (next_token): Reinitialize token_buttom just after using
4572         it as a watermark with obstack_free.  Or else, a future token, big
4573         enough for triggering reallocation of the obstack chunk, could
4574         void the initialized value of token_buttom, later causing panic in
4575         obstack_free.  Rename token_buttom to token_bottom everywhere.
4577         * m4.h: Before declaring errno, first include <errno.h> and
4578         ensure that it does not define errno.
4579         Reported by Richard Stallman.
4581 Wed Nov 11 17:40:35 1992  Francois Pinard  (pinard at icule)
4583         * builtin.c: Define and use DECLARE macro for builtins.
4585         * builtin.c (m4_ifelse): Avoid any diagnostic when exactly one
4586         argument, this is a common idiom for introducing long comments.
4588         * builtin.c (m4_ifelse): If 3n + 2 arguments, diagnose missing
4589         arguments.  The last argument was silently ignored.
4591         * m4.c (cmd_error): Add a missing semicolon before va_end().
4593 Tue Nov 10 08:57:05 1992  Francois Pinard  (pinard at icule)
4595         * Makefile.in: Now handle protoized sources.  Define and use U.
4596         Compile and use ansi2knr with old compilers.  Update DISTFILES.
4597         Add `aclocal.m4' to `configure' dependencies.
4598         * ansi2knr.c: New, from Ghostscript distribution.
4599         * configure.in: Define U through FP_PROTOTYPES for old compilers.
4600         Add AC_ISC_POSIX, AC_CONST, AC_SIZE_T.
4601         * aclocal.m4: New, provide FP_PROTOTYPES.
4602         * m4.h: Conditionnaly protoized through Args, save for varags.
4603         * builtin.c: Protoized.  Then:
4604         Include <sys/types.h> if size_t is not defined, before "regex.h".
4605         (m4_ifelse): Fetch built-in name properly for diagnostic.
4606         (m4_dumpdef): Remove wrong (char *) cast calling dump_symbol.
4607         (m4_regexp): Add const to `msg' declaration.
4608         (m4_patsubst): Add const to `msg' declaration.
4609         * debug.c: Protoized, save for varargs.
4610         * eval.c: Protoized.
4611         * format.c: Protoized.
4612         * input.c: Protoized.
4613         * m4.c: Protoized, save for varargs.  Then:
4614         (xfree): Accept void * instead of char *.
4615         (xmalloc): Return void * instead of char *.
4616         (xrealloc): Accept and return void * instead of char *.
4617         * macro.c: Protoized.
4618         * output.c: Protoized.
4619         * path.c: Protoized.  Then cast some (char *) over xmalloc's.
4620         * symtab.c: Protoized.
4622 Fri Nov  6 02:05:21 1992  Francois Pinard  (pinard at icule)
4624         * m4.texinfo: Remove directory from diagnostics in 30.include,
4625         51.eval, 56.errprint and 57.m4exit tests.
4627         * m4.h: Remove declarations for int or void system functions, they
4628         cause more conflicting trouble than they make good.
4630         * configure.in: Avoid configuration header file.  Add some tests.
4631         * m4.h: Remove #include "config.h".
4632         * Makefile.in, lib/Makefile.in: Implement Autoconf interface.
4633         Then, rewritten for better compliance with GNU standards.
4635 Thu Nov  5 12:37:13 1992  Francois Pinard  (pinard at icule)
4637         * format.c (format): Avoid syntax error if not HAVE_EFGCVT,
4638         because of a misplaced #endif.
4640         * Many *.[hc] files: Correct intra-line spacing here and there,
4641         according to GNU indent 1.6 advice.
4643         * configure.in: New, using Autoconf 1.2.
4644         * m4.h: Reverse NO_MEMORY_H to NEED_MEMORY_H.
4645         * Delete old configure.in, configure, etc/configure.in,
4646         etc/configure, lib/configure.in, lib/configure and config/*.
4647         Reported by Jason Merrill.
4649         * symtab.c (hash): Change (char) NULL to '\0'.
4650         Reported by Jason Merrill.
4652         * Delete .vers, etc/newdist.sh, etc/newvers.sh and
4653         etc/nextvers.sh.  Release numbers will be edited `by hand'.
4654         * version.h: De-automatize, force value in.
4656         * m4.c: Changes in order to use a newer getopt.h.
4657         Reported by David MacKenzie.
4659         * checks/: New name for examples/.
4660         * checks/get_them: New location for etc/get_examples.
4661         * checks/check_them: New location for etc/check_examples.
4662         * Makefile.in, checks/get_them, checks/check_them: Adjust.
4663         * lib/vfprintf.c: New location for etc/vfprintf.c.
4664         * Delete empty etc/.
4665         * examples/: New name for test/.
4667 Tue Mar 10 00:29:46 1992  Francois Pinard  (pinard at icule)
4669         * Makefile.in (check): Add m4 as dependency.
4671         * m4.c: Accept --no-warnings instead of --no_warnings, and
4672         --no-gnu-extensions instead of --no_gnu_extensions.  Make the
4673         usage message more informative.
4674         Reported by David MacKenzie.
4676 Mon Mar  9 14:53:40 1992  Francois Pinard  (pinard at icule)
4678         * etc/check_examples: New name for check_examples.sh.
4679         * etc/get_examples: New name for get_examples.sh.
4680         * Makefile.in, etc/Makefile.in: Use new names.
4682         * Makefile.in: Transmit $(CC) while making in lib.
4684         * Many *.[hc] files: GNU indent'ed, with further fine tuning of
4685         code disposition by hand.
4687 Sun Mar  8 11:01:55 1992  Francois Pinard  (pinard at icule)
4689         * m4.h: Delete definitions for abort() and exit().
4690         Reported by Richard Stallman.
4692         * config/hmake-unicos, config/s-unicos.h: New files.
4693         Reported by Hal Peterson.
4695         * eval.c (exp_term): Have N^0 return 1.
4696         Reported by Michael Fetterman.
4698         * eval.c, input.c, m4.h: Remove last comma in enums.
4699         Reported by Mike Lijewski.
4701         * Transfer of maintenance duties from Rene' to Franc,ois.
4703 Thu Oct 24 15:18:46 1991  Rene' Seindal (seindal at diku.dk)
4705         * Release 1.0.  Many thanks to those, who provided me with bug
4706         reports and feedback.
4708         * Uses GNU configure, taken from the gdb distribution.
4710         * Uses GNU getopt(), with long option names.
4712         * The -Q/+quiet option is added, which suppresses warnings about
4713         missing or superflous arguments to built-in macros.
4715         * Added default options via the M4OPTS environment variable.
4717         * The built-in format can now be configured to use sprintf as
4718         the formatting engine, for systems without [efg]cvt(3).
4720         * GNU library code is moved to the ./lib subdirectory; other
4721         utility files are now in ./etc.
4723         * Several minor bugs have been fixed.
4725 Fri Jul 26 15:28:42 1991  Rene' Seindal (seindal at diku.dk)
4727         * Fixed various bugs.  Release 0.99, manual 0.09.  Many thanks to
4728         Francois Pinard and Roland H. Pesch for providing me with reports.
4730         * The builtins incr and decr are now implemented without use of
4731         eval.
4733         * The builtin indir is added, to allow for indirect macro calls
4734         (allows use of "illegal" macro names).
4736         * The debugging and tracing facilities has been enhanced
4737         considerably.  See the manual for details.
4739         * The -tMACRO option is added, marks MACRO for tracing as soon
4740         as it is defined.
4742         * Builtins are traced after renaming iff they were before.
4744         * Named files can now be undiverted.
4746         * The -Nnum option can be used to increase the number of
4747         divertions available.
4749         * Calling changecom without arguments now disables all comment
4750         handling.
4752         * The function m4_patsubst() is now consistently declared
4753         static.
4755         * A bug in dnl is fixed.
4757         * A bug in the multi-character quoting code is fixed.
4759         * Several typos in the manual has been corrected.  More probably
4760         persist.
4762         * The m4.info file is now installed along with the program.
4764 Thu Nov 15 21:51:06 1990  Rene' Seindal (seindal at diku.dk)
4766         * Updated and enhanced version.  Release 0.75, manual 0.07.
4768         * Implemented search path for include files (-I option and
4769         M4PATH envronment variable).
4771         * Implemented builtin "format" for printf-like formatting.
4773         * Implemented builtin "regexp" for searching for regular
4774         expressions.
4776         * Implemented builtin "patsubst" for substitution with regular
4777         expressions.
4779         * Implemented builtin "esyscmd", which expands to a shell
4780         commands output.
4782         * Implemented "__file__" and "__line__" for use in error
4783         messages.
4785         * Implemented character ranges in "translit".
4787         * Implemented control over debugging output.
4789         * Implemented multi-character quotes.
4791         * Implemented multi-character comment delimiters.
4793         * Changed predefined macro "gnu" to "__gnu__".
4795         * Changed predefined macro "unix" to "__unix__", when the -G
4796         option is not used.  With -G, "unix" is still defined.
4798         * Changed "shift", "$@" and "$*" to not insert spaces afters
4799         commas.
4801         * Added program name to error messages.
4803         * Fixed two missing null bytes bugs.
4805 Mon Jan 22 21:08:52 1990  Rene' Seindal (seindal at diku.dk)
4807         * Initial beta release.  Release 0.50, manual 0.05.
4809         -----
4811         $Revision$ $Date$
4813         Local Variables:
4814         coding: utf-8
4815         End:
4817         Copyright (C) 1990, 1991, 1992, 1993, 1994, 2000, 2001, 2003,
4818         2005, 2006, 2007, 2008 Free Software Foundation, Inc.
4820         Copying and distribution of this file, with or without
4821         modification, are permitted provided the copyright notice
4822         and this notice are preserved.