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