Fix out-of-bounds read for sanitized macro names, from 2008-02-06.
[m4/ericb.git] / ChangeLog
blob0f4e496311983331c89db88af65d91c67f6e2c83
1 2008-02-21  Eric Blake  <ebb9@byu.net>
3         Fix out-of-bounds read for sanitized macro names, from 2008-02-06.
4         * src/m4.c (m4_verror_at_line): Properly terminate the string.
5         Reported by Ralf Wildenhues.
7 2008-02-19  Eric Blake  <ebb9@byu.net>
9         Clean up foreach example.
10         * doc/m4.texinfo (Foreach, Improved foreach): Document another
11         shortcoming in foreach.m4.
13 2008-02-18  Eric Blake  <ebb9@byu.net>
15         Avoid some magic numbers.
16         * src/m4.h (DEBUG_TRACE_ARGS, DEBUG_TRACE_EXPANSION)
17         (DEBUG_TRACE_QUOTE, DEBUT_TRACE_ALL, DEBUG_TRACE_LINE)
18         (DEBUG_TRACE_FILE, DEBUG_TRACE_PATH, DEBUG_TRACE_CALL)
19         (DEBUG_TRACE_INPUT, DEBUG_TRACE_CALLID, DEBUG_TRACE_VERBOSE)
20         (DEBUG_TRACE_DEFAULT): Use hex constants, to make it obvious these
21         are bit fields.
22         * src/input.c (CHAR_EOF, CHAR_MACRO, CHAR_QUOTE, CHAR_ARGV):
23         Define in terms of UCHAR_MAX.
24         (set_word_regexp): Likewise.
25         * src/builtin.c (compile_pattern, m4_translit): Likewise.
26         Reported by Ralf Wildenhues.
28 2008-02-16  Eric Blake  <ebb9@byu.net>
30         Add regression test for multi-character quote recursion.
31         * examples/foreach2.m4: Use $0 rather than spelling out name.
32         * examples/foreachq2.m4: Likewise.
33         * examples/forloop2.m4: Likewise.
34         * examples/hanoi.m4: Likewise.
35         * examples/trace.m4: Likewise.
36         * doc/m4.texinfo (Improved forloop): Document advantage of $0.
37         (Improved foreach): Adjust dump from file.
39         Stage 15: return argv refs back to collect_arguments.
40         Collect an entire $@ reference at once rather than one argument at
41         a time, outside of quotes (but inside quotes, $@ is still
42         flattened for now).  The skip_last field allows concatenation of
43         $@ with other text when collecting arguments.
44         Memory impact: noticeable improvement, due to better reuse of $@.
45         Speed impact: noticeable improvement, due to less parsing.
46         * src/m4.h (enum token_type): Add TOKEN_ARGV.
47         (struct token_chain): Add skip_last member to argv link.
48         (next_token): Update prototype.
49         * src/input.c (CHAR_ARGV): New placeholder input character.
50         (peek_input): Add parameter, to pass $@ at once.
51         (next_char_1, append_quote_token): Handle $@ inside quotes.
52         (init_argv_token): New function.
53         (push_token, match_input, next_token, peek_token, lex_debug):
54         Update callers.
55         * src/macro.c (expand_input, collect_arguments): Likewise.
56         (expand_argument): Handle incoming $@ token.
57         (arg_adjust_refcount, arg_token, arg_text, make_argv_ref_token):
58         Handle nested $@ refs.
59         * src/symtab.c (symtab_debug): Update caller.
60         * examples/null.m4: Document more tests that are needed.  Add
61         tests for NUL with divert, patsubst, and regexp.
62         * examples/null.out: Update for new tests.
63         * doc/m4.texinfo (Syntax): Add test for m4exit and NUL.
64         * checks/get-them (AWK): Give a default value.
65         * checks/check-them: Allow tests to invoke child processes with
66         same include path.  Perform message normalization on stderr.
68 2008-02-15  Eric Blake  <ebb9@byu.net>
70         Use fastmaps for better regex performance.
71         * src/builtin.c (compile_pattern): Allocate a fastmap.
72         * src/input.c (word_start): Delete.
73         (set_word_regexp): Compile a fastmap instead.
74         (peek_token, next_token): Use fastmap.
75         (pop_wrapup): Free memory on exit.
77 2008-02-13  Eric Blake  <ebb9@byu.net>
79         Fix texinfo grammar.
80         * doc/m4.texinfo (Incompatibilities): Use @. after capital.
81         (History): Use @: after abbreviations.
82         (M4exit): Use correct Latin abbreviation.
84 2008-02-11  Eric Blake  <ebb9@byu.net>
86         Document behavior of __gnu__().
87         * doc/m4.texinfo (Platform macros): Enhance test.
88         (Macro expansion): New test.
90         Use gnulib's git-merge-changelog driver when available.
91         * .gitattributes: New file.
92         * bootstrap: Install driver, if not already present.
94 2008-02-06  Eric Blake  <ebb9@byu.net>
96         Fix security hole introduced 2007-11-22.
97         * src/m4.h (includes): Add quotearg.h.
98         * src/m4.c (m4_verror_at_line): Properly escape macro names.
99         (main): Manage quoteargs defaults.
100         * doc/m4.texinfo (Indir): Document and test this.
102 2008-02-05  Eric Blake  <ebb9@byu.net>
104         * m4/gnulib-cache.m4: Import the strtod module.
106 2008-02-02  Eric Blake  <ebb9@byu.net>
108         Stage 14: allow pushing argv references.
109         Push a $@ reference to the input engine in one go, rather than
110         pushing each element.  For now, argument collection still gets one
111         argument of a $@ at a time; but the penalties of this patch make
112         it easier to manage $@ efficiently in future patches.
113         Memory impact: noticeable penalty, due to larger struct and O(n)
114         to O(n^2) on unboxed recursion.
115         Speed impact: noticeable penalty, due to more bookkeeping.
116         * src/m4.h (struct token_chain): Add comma and quotes fields.
117         (arg_adjust_refcount, arg_print, push_arg_quote): New prototypes.
118         * src/input.c (push_token, pop_input, input_print, peek_input)
119         (next_char_1): Support $@ references.
120         * src/macro.c (struct macro_arguments): Add level field.  Match
121         type of arraylen to argc.
122         (collect_arguments): Populate new field.
123         (expand_macro, make_argv_ref, push_arg): Factor...
124         (arg_adjust_refcount, make_argv_ref_token, push_arg_quote):
125         ...into these new methods.
126         (arg_token): Add new parameter.
127         (arg_print): New function.
128         (arg_mark, arg_type, arg_text, arg_equal, arg_empty, arg_len)
129         (arg_func, push_args): Adjust callers.
130         * doc/m4.texinfo (Ifelse): Augment test.
132 2008-01-31  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
134         * checks/Makefile.in: Use @SET_MAKE@, and use @SHELL@ rather
135         than hard-coding /bin/sh.
136         * THANKS: Update.
137         Reported by Lawson Chan.
139 2008-01-27  Eric Blake  <ebb9@byu.net>
141         Stage 13: push composite text tokens.
142         Support pushing composite tokens, allowing back-references to be
143         reused through multiple macro expansions.  Add hueristic that
144         avoids creating new reference when pushing existing references.
145         Memory impact: noticeable improvement due to better reference
146         reuse, except for O(n) to O(n^2) copying in boxed recursion.
147         Speed impact: slight penalty, due to more bookkeeping.
148         * src/m4.h (push_token): Adjust prototype.
149         * src/input.c (push_token): Add parameter, and handle composite
150         tokens.
151         (append_quote_token): Inline short strings.
152         * src/macro.c (push_arg, push_args): Adjust callers.
154 2008-01-26  Eric Blake  <ebb9@byu.net>
156         Stage 12: make token_chain a union, add string_pair.
157         Shrink size of symbol chains by using a union.  Make passing quote
158         delimiters around more efficient.  Other code cleanups.
159         Memory impact: slight improvement, due to smaller struct.
160         Speed impact: slight penalty, due to more bookkeeping.
161         * src/m4.h (STRING): Delete typedef.
162         (struct string_pair, enum token_chain_type): New types.
163         (struct token_chain): Reduce size via a union.
164         (ARG_LEN): New macro.
165         (ARG): Move here...
166         * src/builtin.c (ARG): ...from here.
167         (dump_args, define_macro, m4_dumpdef, m4_builtin, m4_indir)
168         (m4_defn, mkstemp_helper, m4_maketemp, m4_mkstemp, m4___file__)
169         (m4___program__, m4_m4wrap, m4_len, m4_index, m4_substr)
170         (m4_regexp, m4_patsubst): Adjust callers.
171         * src/input.c (rquote, lquote, bcomm, ecomm): Delete...
172         (curr_quote, curr_comm): ...replaced by these.
173         (make_text_link, push_token, pop_input, input_print, peek_input)
174         (next_char_1, input_init, set_quotes, set_comment, set_quote_age)
175         (next_token, peek_token): Adjust callers.
176         * src/macro.c (expand_macro, arg_token, arg_mark, arg_text)
177         (arg_equal, arg_len, make_argv_ref, push_arg, push_args):
178         Likewise.
179         * src/format.c (ARG_INT, ARG_LONG, ARG_STR, ARG_DOUBLE, format):
180         Likewise.
181         * src/freeze.c (produce_frozen_state): Likewise.
182         * src/debug.c (trace_format, trace_pre): Likewise.
183         (debug_decode): Don't lose partial traces prior to reducing
184         debugmode.
186 2008-01-22  Eric Blake  <ebb9@byu.net>
188         Stage 11: full circle for single argument references.
189         Pass quoted strings through to argument collection in a single
190         action, so that an argument can be reused throughout macro
191         recursion if it remains unchanged.
192         Memory impact: noticeable improvement, due to more reuse in
193         argument collection stacks; O(n^2) to O(n) on boxed recursion.
194         Speed impact: noticeable improvement, due to less copying.
195         * src/m4.h (struct token_chain): Add quote_age member.
196         (struct token_data): Add end member to chain alternate.
197         (make_text_link): New prototype.
198         * src/input.c (CHAR_QUOTE): New macro.
199         (word_start): Pre-allocate.
200         (set_word_regexp): Simplify.
201         (make_text_link): Export, and handle new fields.
202         (next_char, next_char_1): Add parameter.
203         (append_quote_token): New function.
204         (match_input, next_token): Adjust callers to handle quoted input
205         blocks.
206         * src/macro.c (struct macro_arguments): Add wrapper member.
207         (expand_argument): Accept composite blocks from input engine.
208         (expand_macro): Reduce refcounts of composite arguments.
209         (collect_arguments, arg_token, arg_mark, make_argv_ref): Update to
210         use new fields.
211         (arg_type, arg_text, arg_equal, arg_len): Treat composite
212         arguments as text.
213         (push_arg, push_args): Handle composites.
215 2008-01-17  Eric Blake  <ebb9@byu.net>
217         Stage 10: avoid extra copying of strings and comments.
218         When collecting tokens that are immune to further expansion, avoid
219         copying data from one obstack to another by outputting it into the
220         destination obstack to begin with.  Also reduce copying done in
221         format builtin.
222         Memory impact: slight improvement, due to better obstack usage.
223         Speed impact: noticeable improvement, due less data copying.
224         * m4/gnulib-cache.m4: Import the intprops and vasnprintf-posix
225         modules.
226         * src/m4.h (includes): Use new gnulib modules.
227         (next_token): Adjust prototype.
228         (bad_argc): New prototype.
229         * src/format.c (arg_int, arg_long, arg_double): New helper
230         functions.
231         (ARG_INT, ARG_LONG, ARG_STR, ARG_DOUBLE): Track missing
232         arguments.
233         (format): Improve warnings, and avoid copying into obstack in the
234         common case.
235         * src/input.c (next_token): Add new parameter.
236         (lex_debug): Adjust caller.
237         * src/symtab.c (symtab_debug): Likewise.
238         * src/macro.c (expand_input, expand_token, expand_argument)
239         (collect_arguments): Likewise.
240         * src/output.c (m4_tmpname): Guarantee correct buffer size.
241         * src/builtin.c (builtin_init): Improve efficiency.
242         (bad_argc): Export.
243         (ntoa): Tighten buffer allocation.
244         * doc/m4.texinfo (Format): Test the improvements.
245         * NEWS: Document the improvement.
247 2008-01-14  Eric Blake  <ebb9@byu.net>
249         Fix --warn-macro-sequence regression from 2007-11-29.
250         * src/builtin.c (define_user_macro): Use correct length.
251         * doc/m4.texinfo (Arguments): Test the fix.
252         (History): Reword to account for new year and eventual result of
253         the argv_ref branch.
255 2008-01-08  Eric Blake  <ebb9@byu.net>
257         Bump copyright year.
258         * NEWS: Update year.  Mention effect of my recent memmem
259         contributions to gnulib.
261 2007-12-21  Eric Blake  <ebb9@byu.net>
263         Stage 9: share rather than copy single-arg refs.
264         Use hooks of previous patch to create back-references to arguments
265         in the input engine, and inline short text rather than always
266         creating a FIFO link.  Also start testing embedded NUL behavior.
267         Until the argument collection engine also shares references, the
268         memory usage increases.
269         Memory impact: noticeable penalty, due to longer life of argv
270         changing O(n) to O(n^2) on boxed recursion.
271         Speed impact: slight improvement, due less data copying.
272         * m4/gnulib-cache.m4: Import quote and memmem modules.
273         * src/m4.h (arg_scratch): New prototype.
274         * src/input.c (INPUT_INLINE_THRESHOLD): New define.
275         (push_token): Use it to inline short text, and save references to
276         longer text.
277         (input_init, next_token): Simplify obstack handling.
278         * src/macro.c (expand_argument): Likewise.
279         (expand_macro): Track scratch space.
280         (arg_scratch): New function.
281         (make_argv_ref): Use it.
282         (push_args): Likewise, and simplify comma handling, since most
283         separators are short enough to be inlined.
284         * src/builtin.c (builtin_init): Avoid cast.
285         (m4_errprint, m4_index): Transparently support NUL.
286         (m4_translit): Use scratch space, rather than leaking memory on
287         expansion stack.
288         * doc/m4.texinfo (Syntax): Add new test of embedded NUL.
289         * checks/get-them: Extract test that uses external files.
290         * checks/check-them: Run the new test.  Use unified diff if
291         possible, and force text mode when debugging NUL handling.
292         * examples/null.m4: New file.
293         * examples/null.out: Likewise.
294         * examples/null.err: Likewise.
295         * examples/Makefile.am (EXTRA_FILES): Distribute these files.
296         * .gitattributes: Treat new files as text, in spite of embedded
297         NUL.
299 2007-12-18  Eric Blake  <ebb9@byu.net>
301         Stage 8: extend life of references into argv.
302         Add hooks to lengthen the lifetime of arguments reused in a macro
303         expansion, rather than always discarding arguments at the end of
304         expand_macro.  Rework the expand_macro obstacks to handle longer
305         lifetimes.  For now, the hooks remain unused.
306         Memory impact: slight penalty, due to larger structs.
307         Speed impact: slight penalty, due to more bookkeeping.
308         * src/m4.h (obstack_regrow): Delete, now that it is unused.
309         (struct token_chain): Add level field.
310         (push_token): Adjust prototype.
311         (adjust_refcount): New prototype.
312         * src/macro.c [DEBUG_MACRO]: Add debugging hooks for $@ reference
313         counting.
314         (argc_stack, argv_stack): Delete, replaced by...
315         (struct macro_arg_stacks, stacks, stacks_count): ...these new
316         structure for tracking $@ references.
317         (expand_input): Initialize new structure.
318         (collect_arguments): Alter signature.
319         (expand_macro): Rework obstack handling, in order to keep $@
320         references alive until they have been rescanned.
321         (adjust_refcount, arg_mark): New functions.
322         (make_argv_ref): Use new field.
323         (push_arg, push_args): Update callers.
324         * src/input.c (make_text_link): Use new field.
325         (push_token): Change signature.
326         (pop_input, next_char_1): Call new function.
327         * doc/m4.texinfo: Clean up some examples of -d option usage.
328         (Ifelse): Add some stress tests.
330 2007-12-13  Eric Blake  <ebb9@byu.net>
332         Yet more rewording.
333         * doc/m4.texinfo (Inhibiting Invocation): Missed one instance in
334         the previous patch.
336         * THANKS: Update.
338 2007-12-13  Paolo Bonzini  <bonzini@gnu.org>  (tiny change)
340         * doc/m4.texinfo (Inhibiting Invocation): Fix quoting of a quoting
341         example.
342         Reported by Giovanni Toffetti.
344 2007-12-11  Eric Blake  <ebb9@byu.net>
346         Stage 7: add chained token support to input parser.
347         Allow the LIFO input engine to rescan a macro expansion composed
348         of smaller chunks of FIFO data, rather than the old approach of a
349         monolithic string.  For now, all chunks are still copied.
350         Memory impact: slight penalty, due to FIFO chain overhead.
351         Speed impact: noticeable penalty, due to extra bookkeeping.
352         * src/m4.h (struct token_chain): Add const safety.
353         (push_token): New prototype.
354         * src/input.c (INPUT_CHAIN): New enumerator.
355         (struct input_block): Add new input type u_c, and change u_s to
356         length-based processing.
357         (make_text_link): New helper function.
358         (push_token): New function.
359         (push_string_finish): Use it.
360         (pop_input, input_print, peek_input, next_char, next_char_1):
361         Adjust to handle new input type.
362         * src/macro.c (push_arg, push_args): Use new function.
364 2007-12-10  Eric Blake  <ebb9@byu.net>
366         Stage 6: convert builtins to push arg at a time.
367         Add new methods to factor all builtins whose expansion includes an
368         argument, making back-reference creation easier in future patches.
369         Factor out length-limited printing to obstacks, and use -1 rather
370         than 0 for unlimited length.
371         Memory impact: none.
372         Speed impact: slight improvement, due to better code sharing.
373         * src/m4.h (includes): Include <limits.h> here, instead of in
374         individual files.
375         (input_block): New typedef.
376         (trace_pre, trace_post, push_string_finish): Update prototypes.
377         (obstack_print, input_print, push_arg, push_args): New
378         prototypes.
379         * src/input.c (push_string_finish): Change return type.
380         (input_print): New function.
381         * src/debug.c (trace_format): Add %B specifier, and use new
382         function.
383         (trace_pre): Remove redundant argc parameter.
384         (trace_post): Likewise, and change signature.
385         (obstack_print): New function.
386         * src/macro.c (expand_macro): Update caller.
387         (push_arg, push_args): New functions.
388         * src/builtin.c (m4_ifdef, m4_ifelse, m4_shift, m4_substr)
389         (m4_patsubst, expand_user_macro): Use new functions.
390         (mkstemp_helper, m4_maketemp): Avoid extra trailing NULs.
391         * src/m4.c (max_debug_argument_length, main): Set to INT_MAX, not
392         0, for unlimited.
393         * src/output.c: Update includes.
394         * src/symtab.c: Likewise.
396 2007-12-07  Eric Blake  <ebb9@byu.net>
398         Minor security fix: Quote output of mkstemp.
399         * src/builtin.c (mkstemp_helper): Produce quoted output.
400         * doc/m4.texinfo (Mkstemp): Update the documentation and tests.
401         * NEWS: Document this change.
403         Stage 5: add notion of quote age.
404         Cache the quoting rules that were in effect when a string was
405         parsed, to avoid reparsing that string if no changequote or other
406         quote age change took place in the meantime.  A quote_age of 0 is
407         always safe, but does not benefit from caching.
408         Memory impact: slight penalty, due to larger struct.
409         Speed impact: slight penalty, due to more bookkeeping.
410         * src/input.c: Comment cleanups.
411         (current_quote_age): New global variable.
412         (set_quote_age): New helper function.
413         (input_init, set_word_regexp): Use it.
414         (set_quotes, set_comment): Likewise, and detect no-op changes.
415         (quote_age, safe_quotes): New functions.
416         (next_token): Track quote age.
417         * src/m4.h (struct token_data): Add quote_age member.
418         (TOKEN_DATA_QUOTE_AGE, quote_age, safe_quotes): New prototypes.
419         * src/macro.c (struct macro_arguments): Add quote_age member.
420         (expand_token): Alter signature and track quote age.
421         (expand_input, expand_argument): All callers changed.
422         (collect_arguments, make_argv_ref): Track quote age.
423         (arg_text, arg_len, arg_func): Detect type mismatch.
424         * doc/m4.texinfo (Ifelse, Changequote): Add more tests.
425         (Incompatibilities): Fix typo.
426         * examples/wraplifo.m4: New file.
427         * examples/Makefile.am (EXTRA_DIST): Distribute it.
429 2007-12-04  Eric Blake  <ebb9@byu.net>
431         Fix builds with OpenBSD make.
432         * doc/Makefile.am (HELP2MAN): New macro.
433         (man_MANS, m4.1): Fix rules for building m4.1 into srcdir.
434         * README: Update copyright.
435         * HACKING: Mention help2man and makeinfo dependencies.
437 2007-11-29  Eric Blake  <ebb9@byu.net>
439         Stage 4: route indir, builtin through ref; make argv opaque.
440         Finish making struct opaque to all but the input engine, by
441         reworking obstack usage in expand_macro to better support creation
442         of a $@ reference.  Canonicalize the empty argument, to allow
443         pointer comparison optimizations.
444         Memory impact: slight penalty, due to larger struct.
445         Speed impact: slight improvement, due to fewer function calls.
446         * src/m4.h (obstack_regrow): Borrow definition from head.
447         (struct token_chain): Add flatten and len members.
448         (arg_equal, arg_empty, make_argv_ref): New prototypes.
449         (struct macro_arguments): Move...
450         * src/macro.c (struct macro_arguments): ...here, making it
451         opaque.  Add has_ref member.
452         (empty_token): New placeholder, for optimizing comparison with
453         empty string.
454         (collect_arguments): Change signature, and populate new fields.
455         (expand_macro): Alter handling of obstacks.
456         (arg_token): New helper method.
457         (arg_equal, arg_empty, make_argv_ref): New methods.
458         (arg_type, arg_text, arg_len, arg_func): Use new methods.
459         * src/builtin.c (m4_ifelse, m4_builtin, m4_indir, m4_eval):
460         Likewise.
461         * src/format.c (format): Likewise.
463         Stage 3: cache length, rather than computing it.
464         Cache the length of a token, to avoid repeating lots of strlen
465         calls.  Additionally, by using obstack length rather than strlen,
466         the input engine can now support embedded NUL.
467         Memory impact: slight penalty, due to larger struct.
468         Speed impact: noticeable improvement, due to fewer function
469         calls.
470         * src/input.c (next_token): Grab length from obstack rather than
471         calling strlen.
472         * src/m4.h (token_data, macro_arguments): Add length field.
473         (TOKEN_DATA_LEN): New accessor.
474         (define_user_macro): Add parameter.
475         * src/builtin.c (define_user_macro, mkstemp_helper): Use
476         pre-computed length.
477         (builtin_init, define_macro, m4_maketemp, m4_mkstemp): Adjust
478         callers.
479         (dump_args, m4_ifdef, m4_ifelse, m4_builtin, m4_indir, m4_eval)
480         (m4_len, m4_substr, m4_translit, m4_regexp, m4_patsubst)
481         (expand_user_macro): Use cached lengths.
482         * src/freeze.c (reload_frozen_state): Adjust callers.
483         * src/m4.c (main): Likewise.
484         * src/macro.c (expand_token, expand_argument, collect_arguments)
485         (arg_len): Use cached length.
486         * doc/m4.texinfo (Mkstemp): Ensure mkstemp does not produce NUL.
488 2007-11-27  Eric Blake  <ebb9@byu.net>
490         Stage 2: use accessors, not direct reference, into argv.
491         Outside of macro.c, use accessor methods rather than direct access
492         into the argv struct.
493         Memory impact: none.
494         Speed impact: slight penalty, due to increased function calls.
495         * src/m4.h (TOKEN_EOF): Alter value, to ease debugging.
496         (arg_argc, arg_type, arg_text, arg_len, arg_func): New
497         prototypes.
498         * src/macro.c (arg_argc, arg_type, arg_text, arg_len, arg_func):
499         New accessor functions.
500         * src/builtin.c (ARG, dump_args, define_macro, m4_builtin)
501         (m4_indir): Use new accessors.
502         * src/debug.c (trace_pre): Likewise.
503         * src/format.c (ARG_INT, ARG_LONG, ARG_STR, ARG_DOUBLE):
504         Likewise.
506 2007-11-24  Eric Blake  <ebb9@byu.net>
508         Stage 1: convert token_data** into new object.
509         Pass a variable-size wrapper structure instead of an array to
510         builtins, so that subsequent optimizations in the structure need
511         not impact every builtin client.
512         Memory impact: slight penalty, since struct is larger than array.
513         Speed impact: slight penalty, due to increased bookkeeping.
514         * m4/gnulib-cache.m4: Import flexmember module.
515         * src/m4.h (struct macro_arguments, struct token_chain): New
516         structs.
517         (builtin_func): Alter signature.
518         (token_data): Add new TOKEN_COMP alternative.
519         * src/builtin.c: All builtins changed.
520         (ARG, dump_args, define_macro, expand_user_macro): Update to use
521         struct.
522         * src/debug.c (trace_pre, trace_post): Likewise.
523         * src/format.c (ARG_INT, ARG_LONG, ARG_STR, ARG_DOUBLE, format):
524         Likewise.
525         * src/macro.c (collect_arguments): Build new struct.
526         (call_macro, expand_macro): Update to use new struct.
528 2007-11-22  Eric Blake  <ebb9@byu.net>
530         More error messages tied to macro names.
531         * src/input.c (set_word_regexp): Take additional parameter.
532         (input_init): Adjust caller.
533         * src/debug.c (debug_set_file, debug_set_output): Take additional
534         parameter.
535         (debug_init): Adjust caller.
536         (expansion_level): Move declaration...
537         * src/m4.h (expansion_level): ...here.
538         (debug_set_output, set_word_regexp): Adjust prototypes.
539         * src/builtin.c (m4_changeword, m4_m4exit, m4_debugfile): Adjust
540         callers.
541         * src/m4.c (main): Likewise.
543         Refactor error messages to avoid macros.
544         * src/m4.h (_): Define, as a placeholder for now.
545         (M4ERROR, M4ERROR_AT_LINE): Delete.
546         (m4_error, m4_error_at_line): Change prototype.
547         (m4_warn, m4_warn_at_line): New prototypes.
548         * src/m4.c (m4_verror_at_line): New helper function.
549         (m4_error, m4_error_at_line): Use new function, and properly call
550         va_end.
551         (m4_warn, m4_warn_at_line): New functions.
552         (stackovf_handler, main): All callers changed.
553         * src/builtin.c: Likewise.
554         * src/debug.c: Likewise.
555         * src/eval.c: Likewise.
556         * src/format.c: Likewise.
557         * src/freeze.c: Likewise.
558         * src/input.c: Likewise.
559         * src/macro.c: Likewise.
560         * doc/m4.texinfo (Indir, Builtin, Dumpdef, Incr, Eval, Substr)
561         (Improved forloop): Adjust tests accordingly.
563         Security fix: avoid arbitrary code execution with 'm4 -F'.
564         * src/freeze.c (produce_frozen_state): Never pass raw file name as
565         printf format.
566         * NEWS: Document this fix.
568 2007-11-21  Eric Blake  <ebb9@byu.net>
570         Consistently report macro name first in messages.
571         * src/m4.h (evaluate): Adjust prototype.
572         * src/builtin.c (bad_argc, numeric_arg, m4_placeholder): Alter
573         wording to match head.
574         (mkstemp_helper, substitute): Adjust signature.  All callers
575         changed.
576         (m4_dumpdef, m4_builtin, m4_indir, m4_defn, m4_esyscmd, m4_eval)
577         (m4_undivert, m4_maketemp, m4_m4exit, m4_debugmode)
578         (m4_debugfile, m4_regexp, m4_patsubst): Mention macro name in
579         message.
580         (m4_format): Adjust call.
581         * src/format.c (format): No longer skip argv[0].
582         * src/eval.c (evaluate): Mention macro name in message.
583         (logical_or_term, logical_and_term, or_term, xor_term, and_term)
584         (equality_term, cmp_term, shift_term, add_term, mult_term)
585         (exp_term, unary_term, simple_term): Adjust signature.
586         * src/macro.c (warn_builtin_concat): Likewise.
587         (expand_argument): Adjust caller.
588         * doc/m4.texinfo (Macro Arguments, Ifdef, Ifelse, Debug Output)
589         (Dnl, Improved fatal_error, Defn, Builtin, Index macro, Regexp)
590         (Substr, Translit, Patsubst, Format, Eval, Dumpdef, Include)
591         (Improved forloop, Indir, Trace, Incr): Adjust tests to match.
593         Make argument checking a bit more sane.
594         * src/builtin.c (bad_argc): Adjust signature, and don't force
595         callers to add 1.  Adjust all callers.
596         (numeric_arg): Adjust signature.  Adjust all callers.
598         Make dnl diagnostic print macro name.
599         * src/m4.h (skip_line): Adjust prototype.
600         * src/input.c (skip_line): Report error on behalf of caller.
601         * src/builtin.c (m4_dnl): Adjust caller.
602         (dump_args, m4_dumpdef, m4_changequote, m4_changecom)
603         (m4_changeword, m4_traceon, m4_traceoff, expand_user_macro): Use
604         ARG macro instead of open-coding.
605         * doc/m4.texinfo (Dnl): Adjust test.
607 2007-11-20  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
609         * Makefile.am (EXTRA_DIST): gendocs.sh is gone here.
611 2007-11-14  Eric Blake  <ebb9@byu.net>
613         Avoid builtin concatenation in macro arguments.
614         * doc/m4.texinfo (Defn): Add tests.
615         * src/macro.c (warn_builtin_concat): New function.
616         (expand_argument): Use it to warn on more corner cases.
617         * NEWS: Mention new warning.
619 2007-11-13  Eric Blake  <ebb9@byu.net>
621         Simplify previous patch.
622         * src/input.c (pop_input): Change signature.
623         (push_string_init, next_char_1): Adjust callers.
625         Note: Patches titled Stage 0 through N form a series of patches
626         which decreases the algorithmic complexity of tail recursion in
627         macro expansions from O(n^2) to O(n) in both time and memory, then
628         performs cleanups, such as handling of embedded NUL, made easier
629         by the code refactoring.
631         Stage 0: Fix memory leak in tail recursion.
632         Free expansion text in the input engine as soon as it is parsed,
633         rather than when the recursive expansion completes.
634         Memory impact: noticeable improvement, due to reduction from
635         O(n^2) to O(n) on recursion.
636         Speed impact: minor improvement, due to better memory usage.
637         * src/input.c (push_string_init): Let go of memory earlier.
638         (next_char_1): Make end of string detection reliable.
639         (match_input): Simplify use of push_string_init.
640         * NEWS: Document this fix.
642 2007-11-07  Eric Blake  <ebb9@byu.net>
644         * doc/m4.texinfo (Pseudo Arguments): Test more corner cases.
646 2007-11-05  Eric Blake  <ebb9@byu.net>
648         Use assert, rather than INTERNAL ERROR.
649         * src/m4.h: Include <assert.h>.
650         * src/builtin.c (m4_dumpdef, define_macro, m4_defn): Use assert.
651         * src/debug.c (trace_pre): Likewise.
652         * src/eval.c (evaluate, cmp_term, shift_term, mult_term):
653         Likewise.
654         * src/freeze.c (produce_frozen_state): Likewise.
655         * src/input.c (push_string_init, pop_input, init_macro_token)
656         (peek_input, next_char_1, set_word_regexp): Likewise.
657         * src/m4.c (main): Likewise.
658         * src/macro.c (expand_token, expand_argument, call_macro):
659         Likewise.
660         * src/output.c (make_diversion): Likewise.
661         * src/symtab.c (symtab_init): Likewise.
663         Use build-aux directory.
664         * configure.ac (PACKAGE, VERSION): Delete, since Automake does
665         this now.
666         (AC_CONFIG_AUX_DIR): Add, with auxiliary files in build-aux
667         instead of the top level.
668         * bootstrap: Adjust accordingly.
669         * m4/gnulib-cache.m4: Add --aux-dir option.
670         * doc/Makefile.am (m4.1): Rewrite rule to use build-aux/missing.
672 2007-11-02  Eric Blake  <ebb9@byu.net>
674         Update some documentation about version control.
675         * NEWS: M4 is now stored in git.
676         * HACKING: Likewise.
677         * README: Likewise.
678         * bootstrap: Likewise.
679         * commit: Delete, now that CVS commits are no longer necessary.
681         Adjust to recent gnulib change.
682         * m4/gnulib-cache.m4: Drop vasprintf-posix and xvasprintf, and use
683         xvasprintf-posix instead.
685 2007-11-01  Eric Blake  <ebb9@byu.net>
687         Improve error message when early end of file occurs.
688         * doc/m4.texinfo (Macro Arguments, Changequote, Changecom)
689         (M4wrap): Adjust to new messages.
690         (Improved capitalize): Enhance test.
691         * src/m4.h (next_token): Adjust prototype.
692         * src/input.c (next_token): Add new parameter, and improve error
693         message.
694         (lex_debug): Adjust callers.
695         * src/symtab.c (symtab_debug): Likewise.
696         * src/macro.c (expand_input, collect_arguments): Likewise.
697         (expand_argument): Likewise, and add parameter.
699 2007-10-31  Eric Blake  <ebb9@byu.net>
701         Test more corner cases.
702         * doc/m4.texinfo (Changecom, Pseudo Arguments): Beef up tests.
703         (Improved foreach): Document alternate foreachq style.
704         * examples/foreachq3.m4: New file.
705         * examples/loop.m4: New file.
706         * examples/Makefile.am (EXTRA_DIST): Distribute them.
708 2007-10-28  Eric Blake  <ebb9@byu.net>
710         More test coverage for autoconf usage patterns.
711         * doc/m4.texinfo (Inhibiting Invocation, Pseudo Arguments)
712         (Builtin): Add new undocumented tests.
713         (Shift): Document cond macro, and add new test.
715 2007-10-27  Eric Blake  <ebb9@byu.net>
717         Document one use of changequote(`(',`)').
718         * doc/m4.texinfo (Changequote): Add new test, based on recent
719         autoconf addition of m4_expand.
721 2007-10-24  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
723         * examples/Makefile.am (EXTRA_DIST): Add capitalize2.m4.
725 2007-10-24  Eric Blake  <ebb9@byu.net>
727         Reduce number of mingw testsuite failures.
728         * doc/m4.texinfo (Using frozen files): Skip test on mingw.
730 2007-10-22  Eric Blake  <ebb9@byu.net>
732         Add DEBUG_REGEX debugging information.
733         * src/m4.h (DEBUG_REGEX): New debug macro.
734         * src/m4.c (main) [DEBUG_REGEX]: Open regex trace file when
735         requested.
736         * src/builtin.c (m4_patsubst, m4_regexp, compile_pattern)
737         [DEBUG_REGEX]: Trace regex usage.
739         Never let printf failures go undetected.
740         * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
741         xprintf'.
742         * src/m4.h: Include xprintf.h.
743         * src/format.c (format): Warn on format failures.
744         * src/builtin.c (ntoa): Export.
745         (m4_errprint): Adjust all *printf callers.
746         * src/debug.c (debug_message_prefix, trace_format): Likewise.
747         * src/freeze.c (produce_frozen_state): Likewise.
748         * src/input.c [DEBUG_INPUT]: Likewise.
749         * src/m4.c (usage): Likewise.
750         * src/m4.h (DEBUG_PRINT1, DEBUG_PRINT3, DEBUG_MESSAGE)
751         (DEBUG_MESSAGE1, DEBUG_MESSAGE2): Likewise.
752         * src/output.c (m4_tmpname, shipout_text, freeze_diversione):
753         Likewise.
754         * src/path.c [DEBUG_INCL]: Likewise.
755         * src/stackovf.c (process_sigsegv) [DEBUG_STKOVF]: Likewise.
756         * src/symtab.c [DEBUG_SYM]: Likewise.
758 2007-10-17  Eric Blake  <ebb9@byu.net>
760         Fix 'm4 -F file -t undefined'.
761         * src/freeze.c (produce_frozen_state): Avoid core dump.
762         * doc/m4.texinfo (Using frozen files): Test for the bug.
763         * NEWS: Mention the fix.
765 2007-10-09  Eric Blake  <ebb9@byu.net>
767         * NEWS: Document recent speedups.
769         Fix regexp regression of 2007-09-29.
770         * src/builtin.c (substitute): Allow NULL regs when no
771         subexpressions were present.
772         (m4_regexp): Handle \ escapes even with empty regex.
773         * doc/m4.texinfo (Regexp, Patsubst): Catch this bug.
775         Cache regex compilation for another autoconf speedup.
776         * src/m4.h (free_macro_sequence): Rename...
777         (free_regex): ...to this.
778         * src/m4.c (main): Update caller.
779         * src/builtin.c (REGEX_CACHE_SIZE, m4_regex, regex_cache): New
780         declarations.
781         (compile_pattern): New function; cache recent regexes.
782         (free_regex): Rename, and clean up additional memory.
783         (m4_regexp, m4_patsubst): Use new function.
785 2007-10-02  Eric Blake  <ebb9@byu.net>
787         Document quoting pitfalls in capitalize.
788         * doc/m4.texinfo (Patsubst): Use the examples directory.  Also
789         document shortfall.
790         (Improved capitalize): New node.
791         * examples/capitalize.m4: Update to match manual.
792         * examples/capitalize2.m4: New file.
794 2007-10-01  Eric Blake  <ebb9@byu.net>
796         Another Autoconf usage pattern optimization.
797         * src/builtin.c (m4_index): Optimize search for one byte.
798         * doc/m4.texinfo (Index macro, Regexp, Patsubst): Test the new
799         code paths.
801 2007-09-29  Eric Blake  <ebb9@byu.net>
803         Optimize for Autoconf usage pattern.
804         * src/builtin.c (m4_regexp, m4_patsubst): Handle empty regex
805         faster.
807 2007-09-24  Eric Blake  <ebb9@byu.net>
809         Create .gitignore alongside .cvsignore.
810         * bootstrap (LC_ALL): Set up front.
811         (version control) Borrow idea from head, to avoid churn in
812         m4/.*ignore files modified by gnulib-tool.
814 2007-09-13  Eric Blake  <ebb9@byu.net>
816         * AUTHORS: Fix typo.
818 2007-09-07  Eric Blake  <ebb9@byu.net>
820         * AUTHORS: Simplify, to match libtool and autoconf layout.
821         * THANKS: Sync with head.
823 2007-08-10  Eric Blake  <ebb9@byu.net>
825         * doc/m4.texinfo (Compatibility): Sync with head.
827 2007-08-10  Konrad Schwarz  <konrad.schwarz@siemens.com>  (tiny change)
828         and Eric Blake  <ebb9@byu.net>
830         * doc/m4.texinfo (Defn): Update wording.
832 2007-08-09  Eric Blake  <ebb9@byu.net>
834         POSIX requires defn(`a',`b') to concatenate definitions.
835         * src/builtin.c (m4_defn): Allow multiple arguments, but warn if
836         trying to mix a builtin with anything else.
837         * doc/m4.texinfo (Defn): Document a use for this POSIX
838         requirement.
839         (Incompatibilities): Update to match current status.
840         * NEWS: Document this change.
841         * THANKS: Update.
842         Reported by Konrad Schwarz.
844 2007-08-04  Eric Blake  <ebb9@byu.net>
846         Normalize all GPL license notices.
847         * GNUmakefile: Update license wording.
848         * Makefile.am: Likewise.
849         * Makefile.maint: Likewise.
850         * bootstrap: Likewise.
851         * commit: Likewise.
852         * configure.ac: Likewise.
853         * checks/Makefile.in: Likewise.
854         * doc/Makefile.am: Likewise.
855         * examples/Makefile.am: Likewise.
856         * src/Makefile.am: Likewise.
857         * src/builtin.c: Likewise.
858         * src/debug.c: Likewise.
859         * src/eval.c: Likewise.
860         * src/format.c: Likewise.
861         * src/freeze.c: Likewise.
862         * src/input.c: Likewise.
863         * src/m4.c: Likewise.
864         * src/m4.h: Likewise.
865         * src/macro.c: Likewise.
866         * src/output.c: Likewise.
867         * src/path.c: Likewise.
868         * src/stackovf.c: Likewise.
869         * src/symtab.c: Likewise.
871 2007-07-21  Eric Blake  <ebb9@byu.net>
873         Fix regression on NetBSD from 2007-05-28.
874         * src/output.c (m4_tmpopen): Explicitly reset append-mode stream
875         position to byte 0.
876         * NEWS: Document this fix.
877         * THANKS: Update.
878         Reported by Thomas Klausner.
880 2007-07-20  Eric Blake  <ebb9@byu.net>
882         Fix 'make distcheck' issues.
883         * Makefile.am (EXTRA_DIST): No need to distribute
884         gpl-3.0.texi.diff anymore.
885         * m4/gnulib-cache.m4: Update to latest gnulib.
887 2007-07-14  Eric Blake  <ebb9@byu.net>
889         Reflect upstream license .texi changes.
890         * doc/m4.texinfo (Copying): Rename node...
891         (GNU General Public License): ...to this.
892         (GNU Free Documentation License): Adjust node location.
893         * local/doc/gpl-3.0.texi.diff: Remove file.
895 2007-07-10  Eric Blake  <ebb9@byu.net>
897         Start 1.4.10a.
898         * configure.ac (AC_INIT): Bump version number.
899         * NEWS: Start changes since 1.4.10.
900         * doc/m4.texinfo (History): Mention 1.4.11.
901         (Copying This Package, Copying This Manual): Add index entries.
902         * local/lib/version-etc.c.diff: Delete, now that gnulib has been
903         updated.
904         * Makefile.am (EXTRA_DIST): Remove dead file.
906 2007-07-09  Eric Blake  <ebb9@byu.net>
908         Release 1.4.10:
909         * doc/Makefile.am (m4_TEXINFOS): Distribute gpl-3.0.texi.
910         * Makefile.am (EXTRA_DIST): Distribute gnulib diffs.
911         * configure.ac (AC_INIT): Bump version number.
912         * NEWS: Describe changes since 1.4.9.
914         * src/format.c: Missed a GPLv3 conversion.
916         Avoid undefined behavior of %.*c in printf.
917         * src/format.c (format): Special case %c.
918         * TODO: Document that more remains to be done.
919         * NEWS: Document the fix.
921 2007-07-05  Eric Blake  <ebb9@byu.net>
923         Fix up gnulib-tool usage.
924         * m4/gnulib-cache.m4: Change local-dir to local, not `.'.
925         * version-etc.c.diff: Move to...
926         * local/lib/version-etc.c.diff: ...here.
927         * gpl-3.0.texi.diff: Move to...
928         * local/doc/gpl-3.0.texi.diff: ...here.
930 2007-07-04  Eric Blake  <ebb9@byu.net>
932         Upgrade to GPL version 3 or later.
933         * bootstrap: Pick up GPLv3.
934         * m4/gnulib-cache.m4: Augment with 'gnulib-tool
935         --local-dir=. --import gpl-3.0'.
936         * doc/m4.texinfo (Copying This Package): New appendix.
937         * NEWS: Mention this change.
938         * README: Mention why some files still claim to be version 2.
939         * version-etc.c.diff: New file, to make sure --version claims
940         correct GPL version.  Temporary until gnulib makes move.
941         * gpl-3.0.texi.diff: New file, to allow inclusion of GPLv3 as
942         appendix, rather than section, of the manual.
943         * GNUmakefile: Update to new license.
944         * Makefile.am: Likewise.
945         * Makefile.maint: Likewise.
946         * commit: Likewise.
947         * configure.ac: Likewise.
948         * checks/Makefile.in: Likewise.
949         * doc/Makefile.am: Likewise.
950         * examples/Makefile.am: Likewise.
951         * src/Makefile.am: Likewise.
952         * src/builtin.c: Likewise.
953         * src/debug.c: Likewise.
954         * src/eval.c: Likewise.
955         * src/freeze.c: Likewise.
956         * src/input.c: Likewise.
957         * src/m4.c: Likewise.
958         * src/m4.h: Likewise.
959         * src/macro.c: Likewise.
960         * src/output.c: Likewise.
961         * src/path.c: Likewise.
962         * src/stackovf.c: Likewise.
963         * src/symtab.c: Likewise.
965 2007-06-26  Eric Blake  <ebb9@byu.net>
967         * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import assert'.
969 2007-06-26  Karl Berry  <karl@freefriends.org>  (tiny change)
971         Match Free Software Directory categories.
972         * doc/m4.texinfo (dircategory): Update.
974 2007-05-31  Eric Blake  <ebb9@byu.net>
976         * src/output.c (output_text): Fix regression from 2007-05-28.
977         * doc/m4.texinfo (History): Mention 1.4.10.
978         (Format): Make testsuite output easier to debug.
980 2007-05-29  Eric Blake  <ebb9@byu.net>
982         Start 1.4.9c.
983         * configure.ac (AC_INIT): Bump version number.
984         * NEWS: Start changes since 1.4.9b, and fix typo.
986         Beta Release 1.4.9b:
987         * configure.ac (AC_INIT): Bump version number.
988         * NEWS: Describe changes since 1.4.9.
990         Improve format support.
991         * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
992         vasprintf-posix'.
993         * src/format.c (format): Parse %'hhd, %a, %A.  Avoid calling
994         printf with too few arguments, as in format(%*.*d,-1,-1,1).
995         * doc/m4.texinfo (Format): Expand tests, and improve
996         documentation.
997         * NEWS: Document this change.
999 2007-05-28  Eric Blake  <ebb9@byu.net>
1001         Fix large diversion corner cases, including 1.4.8 regression.
1002         * src/output.c (m4_tmpfile, m4_tmpopen): Simplify use of errno.
1003         (make_room_for): Use NULL, not 0, for pointers.
1004         (insert_diversion_helper): Avoid using rewind.
1005         (freeze_diversions): Allow freezing large diversions.
1006         * NEWS: Document this fix.
1008         Also run gnulib unit tests during make check.
1009         * m4/gnulib-cache.m4: Augment with 'gnulib-tool
1010         --tests-base=tests --with-tests'.
1011         * configure.ac (AC_CONFIG_FILES): Build gnulib testdir.
1012         * Makefile.am (SUBDIRS): Run gnulib tests before ours.
1014 2007-05-25  Eric Blake  <ebb9@byu.net>
1016         Backport prompts in examples from head.
1017         * src/macro.c (expand_macro): Shorten message.
1018         * doc/m4.texinfo (Manual, Command line files, Comments)
1019         (Inhibiting Invocation, Macro Arguments, Macro expansion, Indir)
1020         (Builtin, Shift, Forloop, Foreach, Dumpdef, Trace, Debug Levels)
1021         (Debug Output, Include, Format, Syscmd, Mkstemp, Location)
1022         (Using frozen files, Improved forloop, Improved foreach): Add
1023         prompts to examples.
1024         * checks/get-them: Ignore prompts in examples.
1026         Fix sync line interaction with multiline comments.
1027         * doc/m4.texinfo (Other Incompatibilities): Add example, and
1028         document bug in --syncline/divert interaction.
1029         (Preprocessor features): Augment test.
1030         * src/m4.h (output_text): Export.
1031         (shipout_text, next_token): Add parameter.
1032         * src/freeze.c (reload_frozen_state): Don't interfere with
1033         synclines when reloading state.
1034         * src/output.c (output_text): Export.
1035         (shipout_text): Take new parameter for start line of token.
1036         Output at most one syncline per token.
1037         * src/input.c (next_token): Report line where multiline tokens
1038         start.
1039         * src/macro.c (expand_input, expand_token, expand_argument):
1040         Adjust callers so that line is passed from input to output.
1041         * NEWS: Document this fix.
1042         Reported by Sergey Poznyakoff.
1044         Test -s in testsuite.
1045         * doc/m4.texinfo (Preprocessor features): Add a test.
1046         * checks/get-them: Support extra options in testsuite.
1047         * checks/check-them (examples): Use extra options.
1048         * THANKS: Update.
1049         Reported by Sergey Poznyakoff.
1051 2007-05-24  Eric Blake  <ebb9@byu.net>
1053         Support POSIX flush semantics on all platforms.
1054         * m4/gnulib-cache.m4: Remove closeout, and augment with
1055         'gnulib-tool --import closein fflush'.
1056         * src/m4.h (includes): Use closein, not closeout.
1057         * src/m4.c (main): Ensure stdin is flushed when not all input is
1058         consumed.
1059         (process_file): No return needed.
1060         * src/debug.c (debug_flush_files): Rely on gnulib module, rather
1061         than excluding mingw.
1062         * NEWS: Document this change.
1064         Work around cygwin and mingw fseeko bugs.
1065         * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import fseeko'.
1066         * src/debug.c (debug_flush_files): Prefer fseeko over fseek.
1068 2007-04-25  Eric Blake  <ebb9@byu.net>
1070         Fix negative division within eval, regression of 2007-01-06.
1071         * doc/m4.texinfo (Eval): Catch this bug.
1072         * src/eval.c (mult_term): Fix it.
1073         * NEWS: Document this.
1074         * THANKS: Update.
1075         Reported by Cesar Strauss.
1077 2007-04-23  Eric Blake  <ebb9@byu.net>
1079         Start 1.4.9a.
1080         * configure.ac (AC_INIT): Bump version number.
1081         * NEWS: Start changes since 1.4.9.
1083 2007-03-23  Eric Blake  <ebb9@byu.net>
1085         Release 1.4.9:
1086         * configure.ac (AC_INIT): Bump version number.
1087         * NEWS: Describe changes since 1.4.8b.
1089 2007-03-16  Eric Blake  <ebb9@byu.net>
1091         * doc/m4.texinfo (Mkstemp): Tweak wording.
1092         * src/output.c (output_init): Adjust to latest gnulib.
1094 2007-03-15  Eric Blake  <ebb9@byu.net>
1096         Avoid Tandem/NSK's broken long long (without a symmetric unsigned
1097         long long, it confuses gnulib).
1098         * configure.ac (AC_TYPE_LONG_LONG_INT): Declare long long broken
1099         if unsigned long long doesn't work.
1100         * THANKS: Update.
1101         Reported by Matthew Woehlke.
1103 2007-03-07  Eric Blake  <ebb9@byu.net>
1105         * AUTHORS: Update.
1106         * doc/m4.texinfo: Minor tweaks, avoid makeinfo warning.
1108 2007-03-01  Eric Blake  <ebb9@byu.net>
1110         * doc/m4.texinfo: Pick up more index entries from head.  Follow
1111         more texinfo recommendations.
1112         (Sysval): Improve tests.
1114         Avoid overfull \vbox warning from texinfo, due to indices that
1115         weren't quite big enough to split across page boundaries.
1116         * doc/m4.texinfo: Add lots of concept index entries.
1117         (Concept Index): Move to be last, as recommended by texinfo
1118         manual.
1119         (Define, Arguments, Pseudo Arguments): Add more function entries.
1121 2007-02-28  Eric Blake  <ebb9@byu.net>
1123         * doc/m4.texinfo (Eval): Clean up wording to reflext POSIX XCU ERN
1124         137.
1125         (Pseudo Arguments): Add useful example.
1127         * doc/m4.texinfo (Pushdef, Incompatibilities): Clean up wording to
1128         reflect POSIX XCU ERN 118.
1130         * src/m4.h (DEFAULT_MACRO_SEQUENCE): Factor out from...
1131         * src/m4.c (usage): ...here,...
1132         * src/builtin.c (set_macro_sequence): ...and here.
1133         (define_user_macro): Fix typo.
1134         * doc/m4.texinfo (Preprocessor features, Arguments): Fix minor
1135         inaccuracies.
1136         (Shift): Document composite macro argn for portably getting at
1137         positional parameters beyond 9.
1138         * configure.ac (AC_INIT): Bump version number.
1139         * NEWS: Start changes of 1.4.8c.
1141 2007-02-24  Eric Blake  <ebb9@byu.net>
1143         Beta Release 1.4.8b:
1144         * configure.ac (AC_INIT): Bump version number.
1145         * NEWS: Describe changes since 1.4.8.
1147         Reserve all uses of raw ${} in macro definitions, not just
1148         ${<digit>}.
1149         * src/builtin.c (set_macro_sequence): Change default macro
1150         sequence.
1151         * doc/m4.texinfo (Operation modes): Update to match.
1152         * src/m4.c (usage): Likewise.
1153         * NEWS: Likewise.
1155 2007-02-23  Eric Blake  <ebb9@byu.net>
1157         * src/m4.h (includes): Update to latest gnulib.
1159 2007-02-08  Eric Blake  <ebb9@byu.net>
1161         Rename --warn-syntax to --warn-macro-sequence[=regex], to make it
1162         more flexible, and so that autoconf can use it.
1163         * src/m4.h (set_macro_sequence, free_macro_sequence): New
1164         prototypes.
1165         * src/builtin.c (macro_sequence_buf, macro_sequence_regs)
1166         (macro_sequence_inuse, set_macro_sequence, free_macro_sequence):
1167         New variables and functions.
1168         (define_user_macro): Allow flexibility in regular expression used
1169         to trigger warning.
1170         * src/m4.c (warn_syntax): Delete.
1171         (usage, WARN_MACRO_SEQUENCE_OPTION, main): Implement changed
1172         spelling of option, along with optional argument.
1173         * doc/m4.texinfo (Operation modes, Arguments): Document this
1174         change.
1175         * NEWS: Document this change.
1177 2007-02-05  Eric Blake  <ebb9@byu.net>
1179         * m4/gnulib-cache.m4: Module strstr no longer exists.
1181         Avoid bool bitfields, as they don't work on AIX.
1182         * src/m4.h (bool_bitfield): New typedef.
1183         (struct symbol, struct builtin): Use it.
1184         * src/input.c (struct input_block): Likewise.
1185         Reported by Albert Chin.
1187         * doc/m4.texinfo (Sysval): Avoid SIGPIPE in test as unreliable.
1188         Reported by Albert Chin.
1189         * THANKS: Update.
1191 2006-06-18  Bruno Haible  <bruno@clisp.org>  (tiny change)
1193         * doc/m4.texinfo (Input processing): Further clarifications.
1195 2007-02-03  Eric Blake  <ebb9@byu.net>
1197         * doc/m4.texinfo (Input processing, Quoting Arguments): Beef up
1198         the examples.
1199         Reported by Bruno Haible.
1201 2007-02-01  Eric Blake  <ebb9@byu.net>
1203         * src/m4.c (fatal_warnings): New variable.
1204         (usage): Document new -E behavior.
1205         (main): Make -E an additive option.
1206         (m4_error, m4_error_at_line): Change exit status when required.
1207         * NEWS: Document this change.
1208         * doc/m4.texinfo (Operation modes): Likewise.
1209         Reported by Ralf Wildenhues.
1211 2007-01-27  Eric Blake  <ebb9@byu.net>
1213         * src/m4.h (warn_syntax): Declare.
1214         (init_pattern_buffer): Export.
1215         * src/m4.c (warn_syntax, usage, WARN_SYNTAX_OPTIONS)
1216         (long_options, main): Implement new option.
1217         * src/builtin.c (init_pattern_buffer): Allow NULL regs argument.
1218         (define_user_macro): Warn on $11 and ${1} if requested.
1219         * src/input.c (init_pattern_buffer): Delete duplicate method.
1220         * doc/m4.texinfo (Operation modes): Document it.
1221         (Arguments): Document future direction of ${11} vs. $11.
1222         (Incompatibilities): Fix wording on POSIX limitations.
1223         * checks/get-them: Parse @{ and @} correctly.
1224         * NEWS: Document this change.
1226 2007-01-26  Eric Blake  <ebb9@byu.net>
1228         * src/builtin.c (includes): Adjust to gnulib changes.
1230 2007-01-15  Eric Blake  <ebb9@byu.net>
1232         * doc/m4.texinfo: Pull in various improvements from head.
1233         * src/builtin.c (include): Alter exit status on failure.
1234         * NEWS: Document this fix.
1236 2007-01-13  Eric Blake  <ebb9@byu.net>
1238         * configure.ac (AC_CHECK_MEMBERS): Check for stack_t.ss_sp, and
1239         assume the fallback of ss_base for BSDI 4.0.1.
1240         * src/stackovf.c (setup_stackovf_trap) [HAVE_SIGALTSTACK &&
1241         ! HAVE_STACK_T_SS_SP]: Use this check.
1242         Reported by Chris McGuire.
1243         * THANKS: Update.
1244         * NEWS: Document the improvement.
1246 2007-01-09  Eric Blake  <ebb9@byu.net>
1248         * src/eval.c (ASSIGN): New enumerator.
1249         (eval_lex): Recognize '='.
1250         (equality_term): Treat '=' like '==', but warn that it is
1251         deprecated.
1252         * doc/m4.texinfo (Eval): Document and test this.
1253         (Incompatibilities): Document the POSIX incompatibility.
1254         * NEWS: Document this change.
1256 2007-01-06  Eric Blake  <ebb9@byu.net>
1258         * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import stdint'.
1259         * checks/check-them: Record expected exit status.
1260         * checks/get-them: Check exit status.
1261         * src/m4.h (eval_t, unsigned_eval_t): Delete, use POSIX int32_t
1262         instead.
1263         * src/builtin.c: All users changed.
1264         * src/eval.c: Likewise.  Also document where we are triggering
1265         undefined or implementation-defined behavior.
1266         (BADOP, NEGATIVE_EXPONENT, INVALID_OPERATOR, eval_lex, evaluate)
1267         (logical_or_term, logical_and_term, logical_not_term, not_term)
1268         (equality_term, unary_term): Port from head to follow POSIX
1269         semantics.
1270         (exp_term): Reject 0**0 as undefined.
1271         * doc/m4.texinfo (History): Mention 1.4.9.
1272         (Format, Incompatibilities): Update to document POSIX compliance.
1273         * NEWS: Document this change.
1275 2007-01-04  Eric Blake  <ebb9@byu.net>
1277         * NEWS: Document previous fix.
1278         * THANKS: Update.
1280 2007-01-04  Sami Liedes  <sliedes@cc.hut.fi>  (tiny change)
1282         Fix Debian bug 405594, introduced 2006-11-01 from a bad
1283         copy-n-paste from head.
1284         * src/m4.c (main): Use correct file name after --.
1286 2007-01-04  Eric Blake  <ebb9@byu.net>
1288         Fix regression from 1.4.7 in large file handling on some
1289         platforms, introduced on 2006-10-13.
1290         * configure.ac (AC_LARGE_SYSFILE): Guarantee that large files
1291         will be handled.
1292         * NEWS: Document this fix.
1294 2007-01-03  Eric Blake  <ebb9@byu.net>
1296         * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
1297         version-etc-fsf'.
1298         * src/m4.c (AUTHORS, main): Use FSF wording for --version (plus
1299         it bumps the copyright year).
1301 2006-12-27  Eric Blake  <ebb9@byu.net>
1303         * doc/m4.texinfo (Patsubst): Fix typo.
1305 2006-12-16  Eric Blake  <ebb9@byu.net>
1307         * src/m4.c (main): Check for errors when closing stdin.
1309 2006-12-09  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1311         * doc/m4.texinfo: Fix some typos.
1313 2006-12-09  Eric Blake  <ebb9@byu.net>
1315         * configure.ac (AC_INIT): Bump version number.
1316         * NEWS: Start changes of 1.4.8a.
1318 2006-11-20  Eric Blake  <ebb9@byu.net>
1320         Release 1.4.8:
1321         * configure.ac (AC_INIT): Bump version number.
1322         * NEWS: Describe changes since 1.4.7.
1324 2006-11-16  Eric Blake  <ebb9@byu.net>
1326         * doc/m4.texinfo (Include, Search Path, Diversions, Divert):
1327         Minor tweaks noticed while porting to head.
1329 2006-11-14  Eric Blake  <ebb9@byu.net>
1331         * src/output.c (cleanup_tmpfile, freeze_diversions): Clean up
1332         spent iterators.
1333         (m4_tmpname): Avoid memory leak.
1335 2006-11-13  Eric Blake  <ebb9@byu.net>
1337         * src/output.c (cleanup_tmpfile): Avoid double error message when
1338         umask is prohibitive.
1339         (m4_tmpname, m4_tmpopen, m4_tmpclose, m4_tmpremove): New
1340         functions.
1341         (m4_tmpfile): Add parameter, move cloexec action here.
1342         (make_room_for): Adjust caller.  Don't keep too many files open.
1343         (insert_diversion_helper): Unlink emptied temp files.
1344         (make_diversion): Don't keep too many files open.
1345         * doc/m4.texinfo (Diversions): Tweak wording, now that open file
1346         descriptors are no longer a limiting factor.
1347         * NEWS: Document this change.
1349         Backport sparse diversion handling from head.
1350         * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
1351         avltree-oset'.
1352         * src/output.c (struct m4_diversion): Rename from struct
1353         diversion, and update members.  All users changed.
1354         (diversion_table): Change to an ordered set, instead of an array.
1355         (div0): New storage for diversion 0.
1356         (diversions): No longer needed.
1357         (free_list): New list to allow recycling diversion storage.
1358         (diversion_storage): New storage to reduce malloc overhead.
1359         (cmp_diversion_CB, threshold_diversion_CB): New callbacks.
1360         (output_init, output_exit, cleanup_tmpfile, make_room_for)
1361         (make_diversion): Handle new diversion storage scheme.
1362         (insert_diversion_helper): New function.
1363         (insert_diversion, undivert_all, freeze_diversions): Use it.
1364         * doc/m4.texinfo (Divert, Diversions): Move hidden test of memory
1365         exhaustion to visible test of large diversion numbers.
1366         * NEWS: Document this fix.
1368 2006-11-11  Eric Blake  <ebb9@byu.net>
1370         * src/builtin.c (m4_translit): Slight optimization.
1372         * src/m4.h (to_uchar): Depend on HAVE_INLINE.
1374         * src/builtin.c: Remove unnecessary casts.
1375         (expand_ranges): Make 8-bit clean.
1376         * doc/m4.texinfo (Translit): Add tests and wording.
1377         * NEWS: Document this fix.
1379 2006-11-07  Eric Blake  <ebb9@byu.net>
1381         * src/m4.h (output_exit): New prototype.
1382         * src/m4.c (main): Use it.
1383         * src/output.c (cleanup_tmpfile): Close files before removing
1384         directory.
1385         (insert_diversion): Check for failure.
1386         (output_exit): Avoid memory leak.
1387         * doc/m4.texinfo (Diversions): Test this bug.
1389         * doc/m4.texinfo (Esyscmd, Errprint): Minor touchups.
1391 2006-11-01  Eric Blake  <ebb9@byu.net>
1393         Allow C++ compilation on Linux, as a safety measure in type
1394         checking.
1395         * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
1396         stdbool'.
1397         * src/m4.h (hack_symbol, hack_all_symbols): Use full prototype.
1398         (boolean): Kill this, and use stdbool.h instead.
1399         * src/debug.c, src/eval.c, src/input.c, src/macro.c, src/m4.c:
1400         * src/output.c, src/symtab.c: All users changed.
1401         * src/symtab.c (hack_all_symbols): Update prototype.
1402         * src/builtin.c (dump_symbol, set_trace): Update signature.
1403         (m4_dumpdef, m4_traceon, m4_traceoff): Update callers.
1404         (mkstemp_helper, m4_m4wrap, expand_ranges, m4_translit): Allow
1405         C++ compilation.
1406         * src/debug.c (trace_flush): Likewise.
1407         * src/freeze.c (reload_frozen_state): Likewise.
1408         * src/input.c (push_file, push_string_finish, push_wrapup):
1409         (token_bottom, next_token): Likewise.
1410         * src/m4.c (main): Likewise.
1412         * doc/m4.texinfo (Invoking m4): Update according to POSIX 200x
1413         draft wording.
1414         * src/m4.h (m4_path_search): Tweak signature.
1415         * src/path.c (m4_path_search): Likewise.
1416         * src/builtin.c (include): Update caller.
1417         * src/m4.c (main): Allow -D, -U, -t, and -s to be interspersed
1418         with file names.  Don't write to **argv.
1419         (process_file): New helper method.
1420         * NEWS: Document this fix.
1422 2006-10-31  Eric Blake  <ebb9@byu.net>
1424         * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import strstr'.
1425         * doc/m4.texinfo (Translit): Improve the documentation.
1426         * src/builtin.c (m4_translit): Optimize to O(n) instead of O(n^2)
1427         algorithm.
1428         (m4_index): Simplify, and speed up slightly.
1429         * NEWS: Document this fix.
1431 2006-10-28  Eric Blake  <ebb9@byu.net>
1433         * src/input.c (set_quotes): Don't allow empty end-quote with
1434         non-empty start-quote.
1435         (set_comment): Likewise for end-comment.
1436         * src/builtin.c (m4_changecom): Adjust caller.
1437         * doc/m4.texinfo (Changequote, Changecom): Update documentation to
1438         match behavior.
1439         (Incompatibilities): Document another POSIX bug.
1440         * NEWS: Mention this change.
1442 2006-10-27  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1444         * examples/Makefile.am (EXTRA_DIST): Distribute recently-added
1445         files.
1447 2006-10-26  Eric Blake  <ebb9@byu.net>
1449         Silence -Wwrite-strings -Wpointer-arith warnings.
1450         * src/builtin.c (define_user_macro): Allow NULL argument.
1451         (m4_builtin, m4_indir): Cast away const of "".
1452         * src/format.c (format): Likewise.
1453         * src/macro.c (collect_arguments): Likewise.
1454         (expand_macro): Avoid math on void*.
1455         * src/m4.c (main): Adjust caller.
1456         * src/output.c (freeze_diversions): Detect off_t overflow.
1458         * src/input.c (pop_input): Remove unnecessary code.
1460 2006-10-25  Eric Blake  <ebb9@byu.net>
1462         * src/symtab.c (symtab_init): Avoid size_t overflow.
1463         * src/output.c (make_diversion): Avoid size_t overflow.
1464         * doc/m4.texinfo (Diversions): Test this fix.
1465         * src/input.c (input_block): Remove unused member.  Reduce size
1466         of struct.
1467         (push_file, pop_input): Avoid useless assignment.
1468         * NEWS: Document the bug fix.
1470         Redo location tracking.  Instead of having just files track the
1471         line to return to when popping input, now all input blocks track
1472         their current line.
1473         * src/input.c (INPUT_STRING_WRAP, INPUT_FILE_INIT): No longer
1474         needed.
1475         (input_block): Have line and file storage for all input types, and
1476         rename some members.
1477         (input_change): New global flag.
1478         (push_file, push_macro, push_string_init, push_wrapup): Store
1479         location.
1480         (push_string_finish, pop_input, pop_wrapup): Notice changes in
1481         input blocks.
1482         (peek_input): Adjust to new member names.
1483         (next_char, next_char1): Adjust location if needed.
1484         (skip_line): Simplify restoring location.
1485         * doc/m4.texinfo (Location): Augment the test to catch line
1486         location of expansion of multi-line arguments.
1487         Reported by Stepan Kasal.
1489 2006-10-23  Eric Blake  <ebb9@byu.net>
1491         * doc/m4.texinfo (Macro Arguments): Document that leading space
1492         in argument collection stops at macro expansion.
1493         (Incompatibilities): Document POSIX whitespace wording issue.
1495 2006-10-20  Eric Blake  <ebb9@byu.net>
1497         * doc/m4.texinfo: Trailing '@comment' doesn't format nicely in
1498         TeX, so recognize '@w{ }' instead.  Likewise, @code{_name} at the
1499         end of a TeX line splits incorrectly.
1500         (Foreach, Improved foreach): Write these sections, borrowing ideas
1501         from CVS head and from m4sugar.
1502         * checks/get-them: Accomodate new way to show trailing space in
1503         examples.
1504         * examples/foreach.m4: Make usable in documentation.
1505         * examples/foreachq.m4: New file.
1506         * examples/foreachq2.m4: New file.
1507         * examples/foreach2.m4: New file.
1508         * NEWS: Document the documentation updates.
1510 2006-10-19  Eric Blake  <ebb9@byu.net>
1512         * src/builtin.c (mkstemp_helper, m4_mkstemp): New functions.
1513         (m4_maketemp): Provide traditional behavior.
1514         * doc/m4.texinfo (Mkstemp): Rename from Maketemp.  Document the
1515         new `mkstemp' macro and the flaws of the old `maketemp'.
1516         (Incompatibilities): Move maketemp discussion to...
1517         (Extensions): ...here, since -G now supresses the GNU extension.
1518         * NEWS: Document this.
1520         * examples/forloop.m4: Simplify.
1521         * examples/forloop2.m4: New file.
1522         * examples/quote.m4: New file.
1523         * doc/m4.texinfo (Loops): Rename to...
1524         (Shift): ...this node.
1525         (Forloop, Foreach, Improved forloop, Improved foreach): New
1526         nodes.
1528 2006-10-17  Eric Blake  <ebb9@byu.net>
1530         * m4/gnulib-cache.m4: Update with 'gnulib-tool --import
1531         config-h'.
1532         * configure.ac (AC_CONFIG_HEADERS): Create config.h alongside
1533         gnulib headers, rather than in top directory.
1534         * src/Makefile.am (AUTOMAKE_OPTIONS): Add nostdinc, to reduce make
1535         output clutter.
1537 2006-10-16  Eric Blake  <ebb9@byu.net>
1539         * doc/m4.texinfo: Backport some minor cleanups from head.
1540         (Cleardivert): Rename from cleardiv.
1542         * doc/m4.texinfo (Invoking m4): Promote to a chapter, instead of
1543         a section of Preliminaries.
1544         (Operation modes, Preprocessor features, Limits control)
1545         (Frozen state, Debugging options, Command line files): Subdivide
1546         into new sections.
1547         (Input processing, Quoting Arguments, Define, Arguments)
1548         (Cleardiv, Format, M4exit): Fix grammar of references.
1549         (Inhibiting Invocation, Macro Arguments, Builtin, Trace)
1550         (Debug Levels, Debug Output, Include, Search Path, Divert)
1551         (Platform macros, Syscmd, Location, Extensions): Point to new
1552         sections.
1553         (Top, Loops, Include, Undivert, Location, Incompatibilities):
1554         Improve file references.
1556 2006-10-14  Eric Blake  <ebb9@byu.net>
1558         * m4/input.c (file_clean): Don't close stdin twice, POSIX says it
1559         is not portable.
1560         Reported by Ralf Wildenhues.
1562         * src/builtin.c (m4_undivert): Check for read error.
1564 2006-10-13  Eric Blake  <ebb9@byu.net>
1566         * src/m4.h (UNIX, W32_NATIVE, OS2): Move platform checks after
1567         header files are included, since <unistd.h> can affect the tests.
1568         * THANKS: Updated.
1569         Reported by Martin Koeppe.
1571         Backport head's usage of clean-temp module, as it is cleaner than
1572         using tmpfile-safer.
1573         * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
1574         clean-temp closeout', and remove tmpfile-safer.
1575         * src/m4.h (includes): Adjust.
1576         (m4_path_search): Rename from path_search, to avoid collision
1577         with gnulib.
1578         * src/m4.c (main): Install closeout handler.  Adjust caller.
1579         (usage): Now done by closeout module.
1580         * src/builtin.c (m4_m4exit): Likewise.
1581         (m4_undivert, include): Adjust callers.
1582         * src/freeze.c (reload_frozen_state): Likewise.
1583         * src/path.c (m4_path_search): Rename from path_search.
1584         * src/output.c (output_temp_dir): New variable.
1585         (cleanup_tmpfile, m4_tmpfile): New functions, from head.
1586         (insert_diversion, make_room_for): Use them.
1587         * doc/m4.texinfo (Diversions): Document this, and add a test.
1588         (Improved fatal_error): Fix typo.
1589         (Maketemp): Port test to mingw, and no longer hide from
1590         documentation.
1591         * NEWS: Document the change in TMPDIR behavior.
1593         * configure.ac (m4_pattern_forbid): Narrow the range of forbidden
1594         macros, to work with recent gnulib-tool update.
1596         * src/builtin.c (m4_builtin, m4_indir): Allow transparent
1597         handling of defn results.
1598         * doc/m4.texinfo (Builtin, Indir): Add test cases.
1599         * NEWS: Document this.
1601 2006-10-12  Eric Blake  <ebb9@byu.net>
1603         * doc/m4.texinfo (Location): Fix typo in previous commit.
1604         (Changeword): Catch one more case.
1605         * src/input.c (skip_line): Fix case when outer file used macro to
1606         supply the \n.
1608 2006-10-11  Eric Blake  <ebb9@byu.net>
1610         * src/input.c (enum input_type): Add additional types, to shave
1611         time off the common case.
1612         (push_wrapup): Wrapped strings remember location.
1613         (push_string_finish): Normal strings carry no location.
1614         (push_file): Start new files uninitialized.
1615         (peek_input, next_char_1): Optimize common cases by updating
1616         location only on new input types.
1617         (pop_input): Update to honor new input types.
1618         (skip_line, push_string_finish): Fix regression in previous patch
1619         when dnl is not followed by newline in included file.
1620         (push_string_init): Initialize all fields of INPUT_STRING sooner.
1621         (peek_token): Simplify.
1622         (peek_input): Don't pop input files on peek, so that __file__ and
1623         __line__ as last token of include file work correctly.
1624         * doc/m4.texinfo (History): Mention 1.4.8.
1625         (Answers): Split into sections, one per answer.
1626         (Improved exch, Improved cleardivert, Improved fatal_error): New
1627         nodes.
1628         (Dnl, M4wrap, Location, M4exit, Improved fatal_error): Update to
1629         new m4wrap location semantics.
1630         (Changeword): Add test that caught the regression.
1631         * NEWS: Document this.
1633         * src/macro.c (expand_macro): In macro expansion errors, report
1634         line number at open parenthesis.
1635         * src/input.c (next_token): Fix off-by-one bug in reporting end
1636         of file in unterminated comment and string.
1637         (file_names): New obstack, necessary since expand_macro now hangs
1638         on to file names longer than the files remain open.
1639         (input_init): Initialize new obstack.
1640         (push_file): Use new obstack.  Delay updates to current_file
1641         until after expand_macro has restored state.
1642         (peek_input, next_char_1): Update current_file if necessary.
1643         (pop_wrapup): Release memory.
1644         * doc/m4.texinfo (Macro Arguments, Changequote, Changecom): Catch
1645         the off-by-one bug.
1646         (Dnl): Update to the new location reporting rules.
1647         * NEWS: Document these changes.
1649 2006-10-10  Eric Blake  <ebb9@byu.net>
1651         * src/macro.c (argc_stack, argv_stack): New variables for sharing
1652         obstacks across multiple macro calls.
1653         (expand_input): Initialize and tear down stack once per input
1654         file, instead of once per macro.
1655         (expand_macro): Reuse existing stacks when possible.
1656         (collect_arguments): Simplify slightly.
1658         * src/path.c (include_env_init): Fix botched patch application.
1659         Reported by Ralf Wildenhues.
1661 2006-10-09  Eric Blake  <ebb9@byu.net>
1663         * src/m4.c (usage, main): Detect write failures to stderr.
1664         * src/builtin.c (m4_m4exit): Likewise.
1665         * NEWS: Document this.
1667         * src/macro.c (expand_macro): Allow --nesting-limit=0 to remove
1668         the limit.
1669         * NEWS: Document this.
1670         * doc/m4.texinfo (Invoking m4): Likewise.
1672 2006-10-09  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1674         * src/path.c (include_env_init): Copy the string returned
1675         by getenv before overwriting it; POSIX disallows this.
1677 2006-10-09  Eric Blake  <ebb9@byu.net>
1679         * src/m4.c (main): Defer debugfile until after --help.
1680         * configure.ac (AC_INIT): Bump version number.
1681         * NEWS: Start changes of 1.4.7a.
1683 2006-09-25  Eric Blake  <ebb9@byu.net>
1685         Release 1.4.7:
1686         * configure.ac (AC_INIT): Bump version number.
1687         * NEWS: Describe changes since 1.4.6.
1689 2006-09-21  Eric Blake  <ebb9@byu.net>
1691         * doc/m4.texinfo (Invoking m4): Add clarification on option
1692         processing behavior.
1693         * THANKS: Update.
1694         Reported by Mikhail Teterin.
1696         * bootstrap: Add --force option, based on idea from coreutils.
1697         * README: Document that ./bootstrap and autoreconf are for
1698         developers, and not lightly done in tarballs.
1700 2006-09-20  Eric Blake  <ebb9@byu.net>
1702         * src/m4.c (usage, OPTSTRING, main): Rename -e to -i, and give
1703         deprecation warning on -e.
1704         * doc/m4.texinfo (Invoking m4, Extensions): Document this.
1705         * NEWS: Document this.
1707 2006-09-19  Eric Blake  <ebb9@byu.net>
1709         * src/m4.c (usage, long_options, main, DEBUGFILE_OPTION): Rename
1710         -o/--error-output to --debugfile, and deprecate the former.  This
1711         will allow a future release to be more consistent with other GNU
1712         tools, with -o/--output affecting stdout, not debug.
1713         * doc/m4.texinfo (Invoking m4, Debug Output): Document this.
1714         * NEWS: Document this.
1716 2006-09-14  Eric Blake  <ebb9@byu.net>
1718         * src/m4.c (main): Warn on deprecated options -B, -S, -T, -N,
1719         --diversions. `m4 --help --version' now displays help, not
1720         version.
1721         (interactive, frozen_file_to_read, frozen_file_to_write): Move to
1722         smaller scope.
1723         (show_help, show_version): No longer needed.
1724         (long_options, DIVERSIONS_OPTION): Backport patch from head to
1725         distinguish between -N and --diversions in warning.
1726         * doc/m4.texinfo (Invoking m4): Document this.
1727         * NEWS: Likewise.
1729 2006-09-11  Eric Blake  <ebb9@byu.net>
1731         * src/Makefile.am (m4_LDADD): Add any gnulib dependent libraries.
1732         * src/debug.c (debug_flush_files) [UNIX]: Flush stdin if it is
1733         seekable.
1734         (debug_set_file): Use STDOUT_FILENO.
1735         * src/builtin.c (m4_m4exit): Flush stdin before exiting, to comply
1736         with POSIX in regards to unread input.
1737         * NEWS: Document this fix.
1738         * doc/m4.texinfo (Syscmd, Esyscmd, M4exit): Likewise.
1740 2006-09-07  Eric Blake  <ebb9@byu.net>
1742         * m4/gnulib-cache.m4: Update to newer gnulib-tool.
1743         * src/m4.h (push_file): Change prototype.
1744         * src/input.c (push_file, peek_input, next_char_1): Only call getc
1745         once at EOF, to avoid double ^D on terminal stdin; regression from
1746         2006-09-04.
1747         (push_file, pop_file): Allow reading stdin twice.
1748         * src/m4.c (main): Likewise.
1749         * src/builtin.c (include): Update caller.
1750         * NEWS: Document this change.
1751         * doc/m4.texinfo (Invoking m4, Incompatibilities): Likewise.
1752         (Syscmd): Add a test that failed before this patch.
1754 2006-09-07  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1756         * checks/check-them: Quote $pwd.
1758 2006-09-05  Eric Blake  <ebb9@byu.net>
1760         * src/builtin.c (define_macro): Warn on invalid macro name.
1761         * NEWS: Document this change.
1762         * doc/m4.texinfo: Fix typos.
1763         (Invoking m4, Macro Arguments, Pseudo Arguments, Defn, Indir)
1764         (Ifelse): Backport some improvements from head.
1766 2006-09-04  Eric Blake  <ebb9@byu.net>
1768         * doc/m4.texinfo (Changeword): Skip test on mingw, where the
1769         native echo is braindead.
1770         * checks/check-them (strip_needed): Ignore \r in output.  Now the
1771         testsuite will pass when cross-compiling from cygwin to mingw.
1773         * src/input.c (peek_input): Fix regression in handling macro
1774         without arguments as last token in file; debian bug 385720.
1775         (next_token): Always consume an input character.
1776         Reported by Andreas Schultz.
1777         * configure.ac (AC_INIT): Bump version number.
1778         * NEWS: Document this fix.
1779         * doc/m4.texinfo (History): Mention next version.
1780         (Changeword): Add example that exposes this bug.
1781         * THANKS: Update.
1783 2006-08-25  Eric Blake  <ebb9@byu.net>
1785         Release 1.4.6:
1786         * configure.ac (AC_INIT): Bump version number.
1787         * NEWS: Describe changes since 1.4.5.
1789         * Makefile.maint (web-manual): Give up on VPATH build during
1790         distribution.  But distributions are made so infrequently that
1791         this is not too much of a hardship.
1792         * Makefile.am (MAINTAINERCLEANFILES): Avoid error if lib/CVS/
1793         exists.
1795 2006-08-24  Eric Blake  <ebb9@byu.net>
1797         * src/builtin.c (m4_index, m4_substr, m4_translit): Similar to
1798         Solaris, produce output on just one argument.
1799         (m4_regexp, m4_patsubst): For consistency, do likewise.
1800         (m4_patsubst): Allow zero-length match at end of string.
1801         * doc/m4.texinfo (Sysval): Fix overfull hbox.
1802         (Bugs, Macro Arguments): Minor fixes.
1803         (Other tokens): Rearrange node order.
1804         (Index macro, Substr, Translit, Regexp, Patsubst): Add tests.
1805         * NEWS: Document these fixes.
1807 2006-08-22  Eric Blake  <ebb9@byu.net>
1809         * src/input.c (pop_input): Avoid empty filename with -di option.
1810         * src/debug.c (debug_message_prefix): Put space before message.
1812         * m4/gnulib-cache.m4: We don't explicitly use alloca module.
1814         * m4/gnulib-cache.m4: Augment with gnulib-tool --import gnupload.
1815         * Makefile.maint (fetch): Simplify, now that we can use gnupload.
1817         * checks/check-them: State why a test is skipped.
1818         * doc/m4.texinfo (Changeword, Sysval, Maketemp): Likewise.
1820         * ChangeLog: Add copyright.
1821         * AUTHORS: Likewise.
1822         * BACKLOG: Likewise.
1823         * README: Likewise.
1824         * THANKS: Likewise.
1825         * TODO: Likewise.
1826         * examples/COPYING: New file, add copyright for all the examples.
1827         * checks/get-them: Put copyright on testsuite files.
1829 2006-08-18  Eric Blake  <ebb9@byu.net>
1831         Don't let unrelated child processes see too many files.
1832         * m4/gnulib-cache.m4: Augment with gnulib-tool --import cloexec.
1833         * src/builtin.c (m4_esyscmd, m4_regexp, m4_patsubst): Fix
1834         spelling in error message.
1835         * src/debug.c [!__STDC__]: Assume C89, and nuke old varargs.h.
1836         (debug_set_output): Close debug file on exec.
1837         * src/m4.h (includes): Add cloexec.h.
1838         * src/output.c (make_room_for): Close diversions on exec.
1839         * src/path.c (path_search): Close include files on exec.
1840         * NEWS: Document this.
1842         Regular expressions were leaking memory.
1843         * src/builtin.c (init_pattern_buffer, free_pattern_buffer): New
1844         helper methods.
1845         (m4_regexp, m4_patsubst): Avoid memory leak.
1846         * src/input.c (init_pattern_buffer) [ENABLE_CHANGEWORD]: Make
1847         static.
1848         (set_word_regexp) [ENABLE_CHANGEWORD]: Avoid memory leak.  Change
1849         from O(n^2) to O(n) for calculating word_start.
1850         (next_token, peek_token) [ENABLE_CHANGEWORD]: Treat word_start as
1851         O(1) bitmap, not O(n) search string.
1852         * NEWS: Document this fix.
1854 2006-08-17  Eric Blake  <ebb9@byu.net>
1856         * NEWS: Document previous checkin.
1858         * src/builtin.c (substitute): Avoid core dump when accessing
1859         beyond bound of regular expression.
1860         Reported by Karl Nelson.
1861         * doc/m4.texinfo (Regexp): Add example that causes core dump on
1862         some architectures prior to this patch.
1863         * THANKS: Updated.
1865 2006-08-16  Eric Blake  <ebb9@byu.net>
1867         * doc/m4.texinfo (Invoking m4, Debug Output): Fix wording to be
1868         clear that dumpdef does not always go to stderr.
1870         * src/builtin.c (m4_errprint): Flush buffers before printing to
1871         stderr.
1872         * THANKS: Updated.
1874 2006-08-15  Eric Blake  <ebb9@byu.net>
1876         * src/builtin.c (m4_m4wrap, m4_errprint, m4_shift): Make blind,
1877         per debian bug 96075.
1878         * doc/m4.texinfo (Loops, M4wrap, Errprint): Document this change.
1879         (Changeword): Don't use shift as an example of a swallowed word.
1880         (Divert): Discuss fact that divert is an English word.
1881         Reported by Richard A Nelson.
1883 2006-08-14  Eric Blake  <ebb9@byu.net>
1885         * doc/m4.texinfo (Invoking m4): Minor fixes.
1887 2006-08-12  Eric Blake  <ebb9@byu.net>
1889         * doc/m4.texinfo (Arguments): Hint at better exch macro.
1890         (Answers): Provide a better definition.
1892 2006-08-09  Eric Blake  <ebb9@byu.net>
1894         * doc/m4.texinfo (Incompatibilities): Document that m4 does not
1895         yet understand locales.
1896         * NEWS: Fix wording of a few items.
1898 2006-08-08  Eric Blake  <ebb9@byu.net>
1900         Avoid printing `NONE:0:' in error messages.
1901         * src/m4.h (m4_error_at_line): New function.
1902         * src/m4.c (m4_error_at_line): Implement.
1903         * src/input.c (skip_line, input_init, next_token): Use "", not
1904         "NONE", for no file, since NONE can be a real file name.
1905         * src/macro.c (expand_argument): Likewise.
1906         * src/debug.c (debug_message_prefix, trace_header): Check for
1907         current file.
1908         * doc/m4.texinfo (Dnl, M4wrap): Adjust accordingly.
1909         (Location): Document that synclines and internal message format
1910         are not impacted by redefining these macros.
1911         (M4exit): Hint at bug in fatal_error.
1912         (Answers): Provide workaround to match m4 output.
1914         * m4/gnulib-cache.m4: Augment with gnulib-tool --import verror.
1915         * src/m4.h (m4_error): New function.
1916         (M4ERROR, M4ERROR_AT_LINE): Reimplement without hacking around
1917         error module deficiencies.
1918         (reference_error, suppress_line): No longer needed.
1919         * src/m4.c (m4_error): Implement.
1920         (main): No longer need to install error callback.
1922 2006-08-04  Eric Blake  <ebb9@byu.net>
1924         * src/m4.h (program_name): Declare.
1925         (suppress_line): New variable.
1926         (M4ERROR_AT_LINE): New macro.
1927         * src/m4.c (reference_error, main): Follow GNU Coding Standards
1928         for error message format.
1929         * src/input.c (skip_line, next_token): Use M4ERROR_AT_LINE.
1930         * src/macro.c (expand_argument): Likewise.
1931         * checks/check-them (examples): Adjust to new message format.
1932         * src/builtin.c (m4___program__): New builtin.
1933         * doc/m4.texinfo (Location): Split from Errprint into new node,
1934         and document __program__.
1935         (Builtin, Ifdef, Ifelse, Dumpdef, Trace, Debug Output, Dnl)
1936         (Include, Regexp, Patsubst, Incr, Eval): Adjust error message
1937         format.
1938         (Extensions): Document __program__.
1939         * NEWS: Document this change.
1941 2006-08-03  Eric Blake  <ebb9@byu.net>
1943         Don't confuse leading `(' in comment or quote with start of
1944         argument collection.
1945         * src/m4.h (enum token_type): Add TOKEN_OPEN, TOKEN_COMMA,
1946         TOKEN_CLOSE.
1947         (peek_input): Make private to input.c.
1948         (peek_token): New prototype.
1949         * src/input.c (default_word_regexp): Reduce ifdefs.
1950         (peek_input): Make static.
1951         (next_token): Return new token types.
1952         (match_input, MATCH): Add argument consume, which controls
1953         whether match should be pushed back.
1954         (peek_token): New function.
1955         (token_type_string) [DEBUG_INPUT]: New function.
1956         * src/macro.c (expand_token, expand_argument, collect_arguments):
1957         Handle new token types.
1958         * doc/m4.texinfo (Changequote, Changecom): Document this.
1959         * NEWS: Document this.
1961         * src/stackovf.c (setup_stackovf_trap): Free memory on failure.
1963         * src/stackovf.c (setup_stackovf_trap): Gracefully avoid stack
1964         overflow detection when sigstack exists but is not implemented.
1965         Fixes debian bug 154053.
1966         * THANKS: Updated.
1967         Reported by David Perlin.
1969 2006-08-02  Eric Blake  <ebb9@byu.net>
1971         * src/input.c (MATCH): Fix EOF detection on multi-byte comment
1972         close.
1974 2006-08-01  Eric Blake  <ebb9@byu.net>
1976         * src/input.c (skip_line, next_token): Remember current file in
1977         case input file ends abruptly.  Addresses debian bug 175365.
1978         (pop_input): Defer freeing storage that holds previous file
1979         name...
1980         (pop_wrapup): to here, after error message is issued.
1981         * src/macro.c (expand_argument): Remember current file in case
1982         input file ends abruptly.
1983         * doc/m4.texinfo (Macro Arguments, Dnl, Changequote, Changecom)
1984         (M4wrap): Adjust testsuite accordingly.
1985         (Errprint): Document line number limitation of m4wrap.
1986         * NEWS: Document this fix.
1987         * THANKS: Update.
1989 2006-07-31  Eric Blake  <ebb9@byu.net>
1991         * src/input.c (peek_input, next_char, match_input): Be eight-bit
1992         clean; fixes debian bug 311378.
1993         * doc/m4.texinfo (Syntax): Describe eight-bit handling.
1994         (Changequote, Changecom): Add examples to test this.
1995         * NEWS: Document this fix.
1996         * THANKS: Update.
1997         Reported by Steven Augart.
1999         * doc/m4.texinfo: Whitespace fix.
2000         * checks/get-them: Avoid exceeding 14-char file name limit.
2001         * THANKS: Update.
2003 2006-07-30  Eric Blake  <ebb9@byu.net>
2005         * src/path.c (path_search): Detect allocation failure.
2007         Use native free when it is good enough.
2008         * m4/gnulib-cache.m4: Augment with gnulib-tool --import free.
2009         * src/builtin.c (define_user_macro, m4_regexp, m4_patsubst):
2010         Adjust calls.
2011         * src/symtab.c (free_symbol): Likewise.
2012         * src/m4.c (xfree, main): Likewise.
2013         * src/m4.h (obstack_chunk_free): Likewise.
2014         * src/path.c (path_search): Likewise.
2015         * src/input.c (pop_wrapup, set_quotes, set_comment): Likewise.
2017         * doc/m4.texinfo (Errprint): Add example for last patch.
2018         * checks/check-them: Account for VPATH in latest example.
2020 2006-07-29  Eric Blake  <ebb9@byu.net>
2022         * src/path.c (path_search): Add result parameter, so that
2023         -I can be accounted for.  Debian bug 53685.
2024         * src/m4.h (path_search): Update prototype.
2025         * src/m4.c (main): Adjust callers.
2026         * src/freeze.c (reload_frozen_state): Likewise.
2027         * src/builtin.c (include, m4_undivert): Likewise.
2028         * NEWS: Document this change.
2029         Reported by Nicolas Lichtmaier.
2031 2006-07-28  Eric Blake  <ebb9@byu.net>
2033         * Makefile.am (MAINTAINERCLEANFILES): Fix typo that tripped up
2034         several non-GNU makes.
2035         * src/stackovf.c (setup_stackovf_trap): Missed _ from yesterday.
2036         * src/m4.h: Likewise.
2037         * src/input.c (push_wrapup): Avoid compiler warning with Solaris
2038         /usr/ccs/bin/ucbcc.
2040 2006-07-27  Eric Blake  <ebb9@byu.net>
2042         * doc/m4.texinfo: Use @acronym{GNU} throughout.
2043         (History): Update for 1.4.6.
2045         * src/m4.h (_): Remove K&R cruft.
2046         * src/builtin.c: Likewise.
2047         * src/debug.c: Likewise.
2048         * src/eval.c: Likewise.
2049         * src/macro.c: Likewise.
2050         * src/stackovf.c: Likewise.
2052         * doc/Makefile.am (m4.1): Improve man page.
2053         * src/m4.c (usage): Improve --help output, including adding the
2054         bug reporting address.
2055         (main): Follow GNU Coding Standards for --version output.
2057 2006-07-26  Eric Blake  <ebb9@byu.net>
2059         * doc/m4.texinfo: Use begin-quote, end-quote, begin-comment, and
2060         end-comment consistently, to match POSIX.
2062         * doc/m4.texinfo (Macro Arguments, Changequote, Changecom)
2063         (Dnl, M4wrap, Include): Document EOF issues, and add examples.
2064         (Incompatibilities): Document incompatibility of changecom
2065         vs. macro names, and of EOF in include.
2066         * src/input.c (next_token): Reject unterminated comments at EOF.
2067         (skip_line): Warn on unterminated dnl at EOF.
2068         * NEWS: Document these changes.
2070 2006-07-25  Eric Blake  <ebb9@byu.net>
2072         * m4/gnulib-cache.m4: Update to reflect gnulib's split of
2073         stdio-safer into fopen-safer and tmpfile-safer.
2074         * src/m4.c: Remove redundant include.
2076 2006-07-24  Eric Blake  <ebb9@byu.net>
2078         Fix bugs related to stream handling.
2079         * m4/gnulib-cache.m4: Augment with gnulib-tool --import
2080         unlocked-io stdio-safer stdlib-safer close-stream.
2081         * configure.ac (AC_CHECK_FUNCS_ONCE): Assume tmpfile; it can be
2082         provided by gnulib if needed.
2083         * src/output.c [! HAVE_TMPFILE]: Likewise.
2084         * src/m4.h (includes): Replace unistd, stdio, and stdlib with
2085         their safer counterparts.
2086         (retcode): New global variable.
2087         * src/input.c (pop_input): Check for read failure.
2088         * src/freeze.c (reload_frozen_state): Likewise.
2089         (produce_frozen_state): Check for write failure.
2090         * src/debug.c (debug_set_file): Likewise.
2091         * src/m4.c (usage, main): Likewise.
2092         (retcode): Make global.
2093         * src/builtin.c (m4_m4exit): Likewise.  Ensure that the exit
2094         status is non-zero except when everything succeeds.
2095         * doc/m4.texinfo (M4exit): Document these changes.
2096         (Incompatibilities): Remove documentation of bug now fixed.
2097         * NEWS: Document these fixes.
2099 2006-07-22  Eric Blake  <ebb9@byu.net>
2101         * src/format.c (format): Avoid compiler warning that str may be
2102         used uninitialized.
2104 2006-07-21  Eric Blake  <ebb9@byu.net>
2106         * src/m4.h [UNIX]: Add more platforms that are close enough to
2107         categorize as UNIX, but which don't predefine __unix__.
2108         Reported by Nelson H. F. Beebe.
2110 2006-07-20  Eric Blake  <ebb9@byu.net>
2112         * m4/gnulib-cache.m4: gnulib-tool has changed again.  Regenerate
2113         to explicitly ask for --assume-autoconf=2.60.
2115 2006-07-19  Eric Blake  <ebb9@byu.net>
2117         * doc/m4.texinfo (Sysval): Avoid kill -1, since ksh traps SIGHUP
2118         and exits normally with 129.
2119         Reported by Nelson H. F. Beebe.
2120         * THANKS: Update.
2122         * src/m4.h (EXIT_MISMATCH): Define.
2123         * src/freeze.c (reload_frozen_state): Detect version mismatch, by
2124         exiting with status 63.
2125         * src/m4.c (usage): Document this.
2126         * doc/m4.texinfo (Invoking m4, Using frozen files): Likewise.
2127         * NEWS: Likewise.
2129         * doc/m4.texinfo (copying): Relax restriction on front-cover and
2130         back-cover texts.
2132 2006-07-17  Eric Blake  <ebb9@byu.net>
2134         * src/format.c (format): Support F, g, and G specifiers.
2135         * doc/m4.texinfo (Format): Document this.
2136         * NEWS: Document this addition.
2138         * doc/m4.texinfo (Builtin): Delete redundant text.
2140         * configure.ac (AC_INIT): Bump version number.
2141         * src/builtin.c (substitute): Bah.  Fix buffer overrun.
2142         * NEWS: Document this fix.
2144 2006-07-15  Eric Blake  <ebb9@byu.net>
2146         Release 1.4.5:
2147         * configure.ac (AC_INIT): Bump version number.
2148         * NEWS: Describe changes since 1.4.4.
2150         * src/m4.c (usage): Document exit status.
2151         * doc/m4.texinfo: Use `exit status', not `exit code'.
2152         (Invoking m4): Document exit status.
2154         * bootstrap: Backport --help, --version from head.
2155         (func_update): New function, for easily grabbing up-to-date files
2156         from gnulib.
2157         * Makefile.maint (web-manual): Fix for VPATH builds.
2159 2006-07-14  Eric Blake  <ebb9@byu.net>
2161         * doc/m4.texinfo: Global cleanup.  Avoid @code{...}'d, as it
2162         looks bad in info.  Use @deffn rather than @example for
2163         describing prototypes.  Fix awkward wording and grammar.
2165         * src/builtin.c (substitute): Warn on bad escape sequences.
2166         Ignore trailing backslash.
2167         * doc/m4.texinfo (Regexp): Add documentation for this.
2168         * NEWS: Document this change.
2170         * src/builtin.c (m4_format, m4_indir): Warn on too few arguments.
2171         * doc/m4.texinfo (Defn, Builtin, Debug Levels, Debug Output): Add
2172         more examples.
2173         (Dnl): Update example to show side effects.
2174         * checks/get-them: Generate three digit test names.
2175         * checks/Makefile.in (CHECKS): Accomodate 100+ tests.
2177 2006-07-13  Eric Blake  <ebb9@byu.net>
2179         * src/input.c (input_init): Simplify.
2180         (set_word_regexp): Treat empty string as default, since empty
2181         regexp would disable word parsing.
2182         * src/m4.c (user_word_regexp): Default to empty string.
2183         * src/builtin.c (builtin_tab): Make changeword blind.
2184         * doc/m4.texinfo (Changeword): Document this.
2185         * NEWS: Document this.
2186         * TODO: Knock off completed items.
2188         * src/builtin.c (m4_undefine, m4_popdef): Visit all arguments, not
2189         just the first.
2190         * doc/m4.texinfo (Undefine, Pushdef): Test this.
2191         * NEWS: Document this change.
2193         * src/builtin.c (numeric_arg): Treat empty string as 0, with a
2194         warning.  Detect quoted leading space and overflow as warnings.
2195         (m4_eval): Treat empty radix as 10, and allow output in radix 1.
2196         Treat width as minimum number of digits, as required by POSIX.
2197         (m4_ifdef, m4_divert, m4_m4exit, m4_translit): Ignore extra
2198         arguments.
2199         (m4_substr): Likewise.  Silently treat empty start as 0.
2200         (m4_undivert): Treat ` 1a' as file, not diversion 1.
2201         * src/eval.c (eval_lex): Parse radix 1 numbers.
2202         * doc/m4.texinfo (Invoking m4): Fix wording; there is more than
2203         one type of warning.
2204         (Manual): Document behavior of numeric parsing of empty string.
2205         (Divert, Incr): Document error handling.
2206         (Eval): Document radices better.
2207         (Incompatibilities): Document translit incompatibility.
2208         * NEWS: Document these changes.
2210         * Makefile.maint (fetch): Get gendocs from gnulib, not texinfo.
2211         (web-manual): Simplify.
2212         * m4/gnulib-cache.m4: Augment with gnulib-tool --import gendocs.
2213         * Makefile.am (EXTRA_DIST): Distribute gendocs.sh.
2214         (MAINTAINERCLEANFILES): Clean it as well.
2215         * doc/Makefile.am (EXTRA_DIST): Distribute gendocs_template.
2216         (MAINTAINERCLEANFILES): Clean it as well.
2218 2006-07-12  Eric Blake  <ebb9@byu.net>
2220         * doc/m4.texinfo (Extensions): Document how to overcome
2221         implementation difference in > 9 positional parameters.
2223         * src/m4.c (usage): Sort within sections.
2224         (nesting_limit): Raise default from 250 to 1024.
2225         * doc/m4.texinfo: Use file name, not filename, per GNU coding
2226         standard.  Use @option where appropriate.
2227         (Invoking m4): Sort to match --help output.
2228         (Debug Levels): Sort.
2229         (Frozen files): Sort and break into two nodes.
2231         * src/m4.c (nesting_limit): Raise default from 250 to 1024.
2232         * NEWS: Document raised -L limit.
2234 2006-07-11  Eric Blake  <ebb9@byu.net>
2236         * Makefile.am (DISTCHECK_CONFIGURE_FLAGS): New macro, to
2237         stress-test changeword before a release.
2238         * doc/m4.texinfo: More doc cleanups.
2239         (Copying This Manual): New node; actually include the FDL in the
2240         documentation.
2241         * doc/Makefile.am (m4_TEXINFOS): Mention dependence on fdl.texi.
2242         * m4/gnulib-cache.m4: Augment with gnulib-tool --import fdl.
2243         * NEWS: Mention documentation improvements.
2245         * src/m4.h (OS2): New platform macro.
2246         * src/builtin.c (predefined_tab) [OS2]: Use it to give OS/2 a
2247         platform macro.
2248         * doc/m4.texinfo (Platform macros): Document it.
2249         (Sysval): Remove non-portable test of system("").
2250         * NEWS: Document this change.
2251         Reported by Andreas Buening.
2253 2006-07-09  Eric Blake  <ebb9@byu.net>
2255         * doc/m4.texinfo (Undivert): Fix typo in last commit.
2256         * src/m4.c (usage): Document M4PATH.
2257         * src/path.c (path_search): Reject empty string.
2258         * src/output.c (insert_diversion): Ignore diversion 0.
2259         * src/builtin.c (m4_undivert): Ignore empty string.
2260         * NEWS: Document this fix.
2262 2006-07-08  Eric Blake  <ebb9@byu.net>
2264         * checks/get-them: Make filtering easier.
2265         * checks/check-them: Filter non-input lines, so line counts are
2266         more realistic in the documentation, and so changeword tests work
2267         even when dnl is disabled.
2268         * doc/m4.texinfo: Adjust example line numbers.  Clean up
2269         front-matter, following autoconf's example.
2270         (Changeword): Enable tests, skipping if changeword not supported.
2271         (Define, Defn, Ifelse): Backport more examples from head.
2272         (Input processing, Answers): New nodes, backported from head.
2273         (Include): Expand test to cover empty filename.
2274         (Undivert): Add test of undivert(0).
2276 2006-07-07  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
2278         * doc/m4.texinfo: Fix spelling errors.
2280 2006-07-07  Eric Blake  <ebb9@byu.net>
2282         * THANKS: Update.
2284         * doc/Makefile.am (m4.1): No need to go through a temporary file;
2285         this also ensures timestamps are updated.
2286         * src/m4.h (includes): Require config.h.  Assume string.h,
2287         stdlib.h, errno.  Include error.h, exit.h, and xalloc.h rather
2288         than prototyping ourselves.
2289         (builtin_func): Add parameter type-checking.
2290         (voidstar): Delete, now that we assume C89.
2291         * src/builtin.c, src/m4.c, src/macro.c, src/symtab.c: All users of
2292         voidstar changed.
2293         * src/m4.c (xfree) [WITH_DMALLOC]: Avoid clash with dmalloc's
2294         xfree.
2296 2006-07-06  Eric Blake  <ebb9@byu.net>
2298         * m4/gnulib-cache.m4: Augment with gnulib-tool --import
2299         binary-io.
2300         * src/m4.h (includes): Add binary-io.h for O_BINARY.
2301         * src/freeze.c (produce_frozen_state): Use O_BINARY to remove
2302         #ifdef.  Fixes patch from 2005-02-03 for cygwin.
2303         * NEWS: Mention this fix.
2305         * configure.ac (FUNC_SYSTEM_BROKEN): New check for OS/2 bug.
2306         * src/builtin.c (m4_syscmd): Work around OS/2 bug.
2308         * Makefile.am (SUBDIRS): Build . before src, so that autoheader
2309         runs first when needed.
2310         * doc/Makefile.am (m4.1): Backport rule from CVS head: build m4.1
2311         once in srcdir rather than multiple times in VPATH builds.
2313 2006-07-03  Eric Blake  <ebb9@byu.net>
2315         * checks/check-them: Use portable = in test.
2316         * src/Makefile.am (AM_CPPFLAGS): Omit space between -I and
2317         directory, as required by Solaris cc.  Include built headers, as
2318         required by Solaris make in VPATH build.
2319         * checks/Makefile.in: Use $(srcdir) where needed.
2320         (CHECKS): Factor $(srcdir) into macro.
2321         (DISTFILES): Likewise.  Automake takes care of distributing
2322         Makefile.in.
2323         (dist): Simplify.
2324         (Makefile): Use modern syntax of config.status.
2325         * doc/m4.texinfo (Loops, Include, Undivert, Incompatibilities):
2326         Avoid overfull and underfull hboxes in dvi.
2328         Fix 'make check' in VPATH build.  All files included by testsuite
2329         now live in a single directory.  Use forloop.m4 in testsuite.
2330         * checks/incl.m4, checks/foo, checks/wrapfifo.m4: Move from
2331         here...
2332         * examples/incl.m4, examples/foo, examples/wrapfifo.m4: ...to
2333         here.
2334         * checks/Makefile.in (DISTFILES): Don't distribute moved files.
2335         * examples/Makefile.am (EXTRA_DIST): Distribute new files.
2336         * checks/check-them: Avoid s/// when filename is in pattern.
2337         * examples/forloop.m4: Fix to match documentation.
2338         * doc/m4.texinfo (Include, Undivert, Incompatibilities): Reflect
2339         new locations.
2340         (Loops, Format): Actually use forloop.m4 in tests.
2342 2006-07-02  Eric Blake  <ebb9@byu.net>
2344         * checks/Makefile.in (exec_prefix, prefix): New macros, so that
2345         $(bindir) works in installcheck.
2346         (check, installcheck): No longer change directory, so that
2347         distcheck works with a read-only builddir.
2348         * checks/check-them: Work when pwd is no longer builddir.
2350 2006-07-01  Eric Blake  <ebb9@byu.net>
2352         * GNUmakefile: New file, borrowed from coreutils.
2353         * Makefile.am (EXTRA_DIST): Distribute GNUmakefile.
2354         * Makefile.maint (Makefile): Delete this rule, now that
2355         GNUmakefile includes Makefile.
2357 2006-06-30  Eric Blake  <ebb9@byu.net>
2359         For compatibility with other m4 implementations, sysval returns
2360         signal<<8 rather than 0 if syscmd is terminated by a signal.
2361         * configure.ac (AC_CHECK_HEADERS_ONCE): Check for sys/wait.h.
2362         * src/builtin.c (include): Include sys/wait.h when stdlib.h does
2363         not provide wait macros.
2364         (WTERMSIG, WIFSIGNALED, WIFEXITED): More fallback macros.
2365         (M4SYSVAL_EXITBITS, M4SYSVAL_TERMSIGBITS): New helper macros.
2366         (m4_esyscmd): Set sysval to -1 on failure.
2367         (m4_sysval): Print 127 on failure, and accomodate signals if they
2368         are detectable.
2369         * NEWS: Document this change.
2370         * doc/m4.texinfo (Platform macros, Esyscmd, Sysval): Fix typos in
2371         last commit.
2372         * checks/check-them: Likewise.
2373         * src/debug.c (debug_set_file): Work around mingw fstat bug.
2375         * src/m4.h (UNIX, W32_NATIVE): Improve platform detection macros.
2376         * src/freeze.c (produce_frozen_state): Use new spelling of
2377         platform macro.
2378         * src/builtin.c (predefined_tab): Add __windows__ on non-unix
2379         platforms.
2380         (m4_syscmd, m4_esyscmd): The empty command is successful.
2381         * doc/m4.texinfo (Shell commands): Rename from UNIX commands.
2382         Document platform-dependence of system().
2383         (Syscmd): Add example.
2384         (Esyscmd): Make example more robust, and actually demonstrate
2385         rescanning.
2386         (Sysval): Expand test to cover esyscmd code path, and to check
2387         that empty command is successful.  Add conditional check for
2388         signal behavior.
2389         (Other Incompatibilities): Move platform macros from here...
2390         (Platform macros): ...to this new node.  Add windows macro.
2391         Check that exactly one platform macro is provided.
2392         * checks/check-them: Improve trap cleanup.  Tolerate dirname and
2393         .exe in error messages.  Allow for skipping checks.
2394         * configure.ac (HAVE_EFGCVT): Kill dead configure check.
2395         * NEWS: Document platform macros.
2397 2006-06-29  Eric Blake  <ebb9@byu.net>
2399         Fix buffer overrun bug.
2400         * m4/gnulib-cache.m4: Augment with gnulib-tool --import
2401         xvasprintf.
2402         * src/format.c [HAVE_EFGCVT]: Delete this code, and use *printf
2403         variant instead, since [efg]cvt are obsolete and our use of them
2404         was buggy (savannah sr #104303).
2405         (format): Fix buffer overflow by using xasprintf.
2406         * doc/m4.texinfo (Format): Expand format test to catch both bugs.
2407         * NEWS: Document this fix.
2409         * configure.ac (AC_CANONICAL_HOST, AC_CANONICAL_BUILD): Allow
2410         cross-compilation.
2411         (AC_CACHE_CHECK): Cache search for ecvt.
2413 2006-06-27  Eric Blake  <ebb9@byu.net>
2415         * doc/m4.texinfo (Eval): Document 32-bit signed limitations
2416         required by POSIX, and add example that exposed core dump on x86
2417         architectures.
2418         (Incompatibilities): Document incompatibility in eval precedence.
2419         * src/eval.c (shift_term): Explicitly mask, to avoid undefined
2420         behavior.
2421         (mult_term): Explicitly check for -1, to avoid SIGFPE on x86.
2422         * NEWS: Document this change.
2424         * doc/m4.texinfo: Use @noindent consistently.
2425         (Quoting Arguments): Document that unquoted parentheses group
2426         arguments.
2427         (Pseudo Arguments): Expand tests to show this.
2428         (Incompatibilities): Contrast traditional behavior of
2429         changequote.
2431 2006-06-24  Eric Blake  <ebb9@byu.net>
2433         * configure.ac (AC_PREREQ): Autoconf 2.60 is now released.
2434         (AC_CHECK_HEADERS_ONCE): Use this new feature.
2435         (AC_CHECK_FUNCS_ONCE): Likewise.
2437 2006-06-23  Eric Blake  <ebb9@byu.net>
2439         * doc/m4.texinfo: Quoting cleanup throughout - follow
2440         autoconf-recommended style of one level of quote per parenthesis
2441         in the normal case.  Adjust error messages to match GNU coding
2442         standards (and to allow 'make check' to pass again).
2443         (Quoted strings, Inhibiting Invocation): Turn more examples into
2444         tests.
2445         (Comments): Resolve FIXME by adding example.
2446         (Define): Add example about underquoting.
2447         (Defn): Add example about use of $0.
2448         (Indir, Format): Resolve FIXME done in last commit.
2449         (Ifelse): Add example about creating blind macro.
2450         (Debugging): Fix grammar.
2451         (Dnl): Add example about dnl with arguments.
2452         (M4wrap): Be explicit that LIFO order is non compliant, and will
2453         change in m4 2.0.
2454         (Undivert): Resolve FIXME by adding example.
2455         (Frozen files): Document that m4wrap and sysval will not work
2456         consistently until m4 2.0.
2457         (Incompatibilities): Document another POSIX compliance bug, this
2458         time with changequote.  Document a traditional incompatibility
2459         with partial input spanning file boundaries.
2461         Make error messages more consistent with GNU coding standards -
2462         start with lower case, and don't end sentence with punctuation.
2463         * src/debug.c (trace_pre): Update message wording.
2464         * src/eval.c (evaluate, cmp_term, shift_term, mult_term):
2465         Likewise.
2466         * src/freeze.c (produce_frozen_state, issue_expect_message),
2467         (reload_frozen_state): Likewise.
2468         * src/input.c (push_string_init, pop_init, init_macro_token),
2469         (peek_input, next_char_1, set_word_regexp, next_token): Likewise.
2470         * src/m4.c (stackovf_handler, main): Likewise.
2471         * src/macro.c (expand_token, expand_argument, call_macro),
2472         (expand_macro): Likewise.
2473         * src/output.c (make_room_for, output_text, insert_file),
2474         (freeze_diversions): Likewise.
2475         * src/symtab.c (symtab_init, lookup_symbol): Likewise.
2477         * src/builtin.c (builtin_tab): Make format and indir blind.
2478         (substitute): Prefer "Warning:" vs. "ERROR:" in messages.
2479         * NEWS: Mention the change to builtins.
2481 2006-06-22  Eric Blake  <ebb9@byu.net>
2483         Robustify frozen file format.
2484         * src/freeze.c (reload_frozen_state): Add GET_DIRECTIVE helper
2485         macro.  Require V first, and only accept it once.  For F, use
2486         placeholder if builtin is not found, rather than warning.
2487         * src/m4.h (m4_placeholder): New prototype.
2488         * src/builtin.c: Unify error message style.
2489         (m4_placeholder): New function, warn if invoked.
2490         (builtin_tab): Add m4_placeholder.
2491         (m4_defn): Warn if placeholder is encountered.
2492         (find_builtin_by_addr): Handle placeholder.
2493         (find_builtin_by_name): Return placeholder on failure.
2494         (m4_builtin): Treat placeholder as undefined.
2495         * doc/m4.texinfo (Frozen files): Document changes in V and F.
2496         * NEWS: Document this change.
2497         Reported by Bruno Haible.
2499         * doc/m4.texinfo: Whitespace cleanup.  TABs are evil in texinfo.
2500         (tabchar): New macro, so that 'make check' still works.
2501         (Invoking m4): Document that ignored compatibility options -B, -S,
2502         and -T each consume an argument.
2503         * checks/get-them: Honor @tabchar{}.
2505         Avoid compiler warnings during -DDEBUG.
2506         * src/m4.h (M4_GNUC_ATTRIBUTE, M4_GNUC_UNUSED): New macros.
2507         [DEBUG]: Also imply DEBUG_OUTPUT and DEBUG_STKOVF.
2508         * src/input.c (print_token) [DEBUG_INPUT]: Use correct format.
2509         (lex_debug) [DEBUG_INPUT]: Fix to compile.  Mark unused.
2510         (next_token) [DEBUG_INPUT]: Print before returning.
2511         * src/path.c (include_dump) [DEBUG_INCL]: Mark unused.
2512         * src/symtab.c (symtab_debug) [DEBUG_SYM]: Mark unused.
2514         Avoid mkstemp bugs on various platforms.
2515         * m4/gnulib-cache.c: Augment with gnulib-tool --import mkstemp.
2516         * src/output.c [! HAVE_MKSTEMP]: Delete.
2517         * configure.ac (AC_CHECK_FUNCS): Don't check for mkstemp.
2518         * src/m4.h (mkstemp) [! HAVE_MKSTEMP]: Prototype, if needed.
2519         * NEWS: Document this.
2521         * Makefile.am (EXTRA_DIST): Distribute gnulib-cache.m4.
2522         Reported by Bruno Haible.
2524 2006-06-21  Eric Blake  <ebb9@byu.net>
2526         Avoid obsolete sigstack when POSIX sigaltstack is available.
2527         * src/m4.c: Blindly assume signal.h, since stackovf.c and gnulib
2528         do likewise.
2529         * configure.ac (AC_CHECK_HEADERS): Likewise.
2530         (AC_CHECK_TYPES): New check for siginfo_t, since siginfo.h is
2531         obsolete and most hosts now have it in signal.h.
2532         (AC_CHECK_MEMBERS): New check for sigaction.sa_sigaction.
2533         (AC_CACHE_CHECK): Cache decision to use stackovf.
2534         (AC_EGREP_HEADER): Switch to AC_CHECK_TYPES.
2535         * src/stackovf.c (DEBUG_STACKOVF): Remove unused define.
2536         (SA_RESETHAND, SA_SIGINFO): Provide fallback definitions, to
2537         simplify later code.
2538         (PARAM_STACKOVF, PARAM_NOSTACKOVF): Move further away from NULL,
2539         in case of dereferencing a member of a NULL pointer.
2540         (sigsegv_handler) [HAVE_STRUCT_SIGACTION_SA_SIGACTION]: Define a
2541         POSIX handler.
2542         (setup_stackovf_trap): Use NULL instead of 0 for pointers, use
2543         EXIT_FAILURE in error, indent preprocessor directives.
2544         [HAVE_SIGALTSTACK && HAVE_SIGINFO_T]: Depend on siginfo_t, not
2545         siginfo.h.
2546         [HAVE_SIGACTION && defined SA_ONSTACK]: Prefer POSIX handler.
2547         Reported by Santiago Vila.
2549 2006-06-19  Eric Blake  <ebb9@byu.net>
2551         * THANKS: Update.
2553 2006-06-18  Andreas Buening  <andreas.buening@nexgo.de>  (tiny change)
2555         * checks/Makefile.in (PATH_SEPARATOR): New macro.
2556         (check, installcheck): Use it, for OS/2.
2558 2006-06-18  Eric Blake  <ebb9@byu.net>
2560         Consistently use "GNU M4" as package name, "m4" as executable
2561         name.
2562         * NEWS: Document previous fix.
2563         * THANKS: Update.
2564         * README: Fix grammar.  Document that --enable-changeword is on
2565         its last leg.
2566         * doc/m4.texinfo (Top, Changeword): Likewise.
2567         (Sysval): Enhance this test.
2568         (History): Backport this section from CVS head, and update.
2570 2006-06-18  Bruno Haible  <bruno@clisp.org>  (tiny change)
2571             Eric Blake  <ebb9@byu.net>
2573         * src/builtin.c (WEXITSTATUS): Provide fallback definition.
2574         (m4_esyscmd): Set sysval to 0xffff, to accomodate both
2575         big-endian and little-endian wait status definitions.
2576         (m4_sysval): Use WEXITSTATUS.
2577         Reported by Andreas Buening.
2579 2006-06-18  Eric Blake  <ebb9@byu.net>
2581         * configure.ac (AC_INIT): Bump version number.
2582         * NEWS: Describe changes in 1.4.4c.
2584 2006-06-17  Eric Blake  <ebb9@byu.net>
2586         Beta Release 1.4.4b:
2587         * configure.ac (AC_INIT): Bump version number.
2588         * NEWS: Describe changes since 1.4.4.
2589         * Makefile.maint (cvs-news): Accomodate copyright line wrapping.
2591         * Makefile.am (MAINTAINERCLEANFILES): Clean files added by
2592         bootstrap.
2593         * checks/Makefile.in (maintainer-clean): Add missing target.
2594         * COPYING: Remove generated file from CVS.
2596 2006-06-16  Eric Blake  <ebb9@byu.net>
2598         * checks/Makefile.in (DISTFILES): Distribute wrapfifo.m4.
2600 2006-06-15  Eric Blake  <ebb9@byu.net>
2602         * checks/wrapfifo.m4: New file.  Use it...
2603         * doc/m4.texinfo (Incompatibilities): here, in a new test case to
2604         demonstrate how to get POSIX behavior of m4wrap prior to m4 2.0.
2606         * src/m4.h (to_uchar): New function.
2607         * src/eval.c (eval_lex): Use it to avoid passing signed char to
2608         isdigit, isalpha, isupper, islower, isspace, isalnum.
2609         * src/builtin.c (expand_user_macro): Likewise.
2610         * src/format.c (format): Likewise.
2611         * src/macro.c (expand_argument): Likewise.
2612         * NEWS: Document this security fix.
2614         Message cleanup.
2615         * src/symtab.c (lookup_symbol): Use invalid, not illegal.
2616         * src/freeze.c (reload_frozen_state): Fix typo in message.
2617         (produce_frozen_state): Standardize on builtin, not built-in.
2618         * src/builtin.c (numeric_arg, bad_argc): Likewise.
2620         * configure.ac (M4_EARLY, M4_INIT): Use gnulib.
2621         (AC_PROG_RANLIB, AC_AIX, AC_MINIX, AC_CHECK_HEADERS),
2622         (AC_FUNC_ALLOCA, AC_REPLACE_FUNCS): Avoid checks now done by
2623         gnulib.
2624         * Makefile.am (ACLOCAL_AMFLAGS): New entry, for gnulib.
2625         * m4/gnulib-cache.m4: New file, from gnulib.
2626         * bootstrap: Invoke gnulib-tool --update.
2627         * src/m4.c (main): Cast away const.
2628         * NEWS: Document that regex is updated.
2629         * THANKS: Update.
2631 2006-06-08  Eric Blake  <ebb9@byu.net>
2633         * configure.ac (changeword): Work even when changeword is not a
2634         macro.
2635         (AC_PROG_AWK, AC_PROG_INSTALL, AC_PROG_MAKE_SET, AC_HEADER_STDC):
2636         Delete; now done by automake.
2637         (AC_ISC_POSIX, AC_C_CONST): Delete; now obsolete.
2639 2006-06-07  Eric Blake  <ebb9@byu.net>
2641         * lib/regex.c (bcmp_translate): Canonicalize type name.
2642         * doc/Makefile.am (MAINTAINERCLEANFILES): Fix typo.
2643         * configure.ac (changeword): Disable changeword for the creation
2644         of configure, in case of bootstrapping with an m4 configured with
2645         --enable-changeword.
2647         Distribute a rudimentary man page.
2648         * Makefile.am (SUBDIRS): Move doc after src so that 'm4 --help'
2649         can feed help2man.
2650         * doc/Makefile.am (man_MANS, EXTRA_DIST, MAINTAINERDISTCLEAN),
2651         (SUFFIXES, m4.1): New macros and rules to build m4.1.
2653 2006-06-06  Eric Blake  <ebb9@byu.net>
2655         * lib/regex.c (re_match_2_internal, bcmp_translate): Avoid
2656         compiler warnings at -O2.
2657         * lib/getopt.c (_getopt_internal): Likewise.
2659         Cleanup of previous patches.
2660         * src/input.c (struct input_block): Remove traced member.
2661         (push_macro, init_macro_token): Don't pass trace status around.
2662         * src/m4.h (struct token_data): Remove traced member.
2663         (struct symbol, struct builtin): Reduce unused space.
2664         (TOKEN_DATA_FUNC): Simplify.
2665         (TOKEN_DATA_FUNC_TRACED): Remove unused macro.
2666         (push_macro, define_builtin): Remove unused parameter.
2667         * src/builtin.c (define_builtin, builtin_init, define_macro),
2668         (m4_defn): Don't pass trace status around.
2669         * src/macro.c (expand_argument): Likewise.
2670         * src/freeze.c (reload_frozen_state): Likewise.
2671         * src/symtab.c: Whitespace cleanup.
2672         * NEWS: Clean up wording.
2673         * doc/m4.texinfo (Undefine, Dumpdef, Trace): Cleanup wording;
2674         ensure tests actually expose bugs prior to today's patches.
2676         Trace status of builtins is no longer inherited across
2677         define(...,defn(...)).  Fixes bug that autom4te had been working
2678         around.
2679         * src/builtin.c (define_builtin): Don't override trace status.
2680         * doc/m4.texinfo (Trace): Add test for this.
2681         * NEWS: Document this.
2683         When changing macro definitions inside the arguments to the macro,
2684         consistently preserve the old definition that was in effect before
2685         argument collection, similar to the C pre-processor.
2686         Reported by John Brzustowski.
2687         * NEWS: Document this change.
2688         * doc/m4.texinfo (Macro Arguments, Undefine, Dumpdef): Document
2689         this policy, and add tests that expose core dumps prior to this
2690         patch.
2691         * src/m4.h (struct symbol): New members to track when a symbol is
2692         still in use after removal from the symbol table.
2693         (SYMBOL_PENDING_EXPANSIONS, SYMBOL_DELETED): Define.
2694         (free_symbol): Prototype.
2695         * src/macro.c (expand_macro): Track pending expansions of a
2696         symbol.  On completion, if a symbol is deleted and no longer
2697         pending, free its memory.
2698         * src/symtab.c (free_symbol): Export.  Don't free memory if symbol
2699         is still in use.
2700         (lookup_symbol) <SYMBOL_INSERT>: Create new entry when old entry
2701         is still in use.
2702         (lookup_symbol) <SYMBOL_DELETE, SYMBOL_POPDEF>: Mark entries still
2703         in use as deleted and remove from the table without freeing
2704         memory.
2705         (symtab_print_list) [DEBUG_SYM]: More debug output.
2707         * src/symtab.c (hack_all_symbols): Allow certain modifications of
2708         the symbol table during traversal.
2709         * src/builtin.c (set_trace): Replace SYMBOL_DELETE with
2710         SYMBOL_POPDEF, since only the latter is safe with
2711         hack_all_symbols.
2713         Solve crash when passing "indir(`foo')" to "m4 -tfoo".
2714         * src/symtab.c (lookup_symbol) <SYMBOL_DELETE, SYMBOL_POPDEF>:
2715         Preserve placeholder when macro is being traced.
2716         * src/builtin.c (m4_ifdef, m4_indir): A traced but undefined
2717         symbol is not defined.
2718         (set_trace): Remove placeholder when no longer traced.
2719         (m4_traceon): On named traces, always reserve a slot in the
2720         symbol table.
2721         (m4_traceoff): Don't warn about untracing a nonexistent symbol.
2722         * NEWS: Document new trace behavior.
2723         * doc/m4.texinfo (Trace): Tracing by name now consistently works
2724         no matter whether that macro is currently defined.
2725         (Incompatibilities): Document differences between traditional and
2726         GNU trace.
2728 2006-06-04  Paul Eggert  <eggert@cs.ucla.edu>  (tiny change)
2729             Eric Blake  <ebb9@byu.net>
2731         * src/m4.h (hash_table_size): Now size_t instead of int.
2732         * src/m4.c (hash_table_size): Likewise.
2733         (main): Adjust to this; use atol rather than atoi.
2734         * src/symtab.c: Include <limits.h>, for CHAR_BIT.
2735         (symtab_init, lookup_symbol, hack_all_symbols):
2736         Use size_t for sizes and indexes, not int.
2737         (symtab_print_list) [DEBUG_SYM]: Likewise.
2738         (hash): Likewise.  Don't case-fold in the hash function.
2739         Shift by 7, not 3, for consistency with gnulib/lib/hash.c.
2740         Don't assume hash word is 32 bits.
2741         * NEWS: Document this change.
2743 2006-06-04  Eric Blake  <ebb9@byu.net>
2745         * src/symtab.c (symtab_debug, symtab_print_list) [DEBUG_SYM]: Fix
2746         to allow compilation, for use in debugger.
2747         (profiles, current_mode) [DEBUG_SYM]: New variables.
2748         (show_profile, profile_strcmp) [DEBUG_SYM]: New methods for
2749         determining hash table performance.
2751 2006-05-31  Eric Blake  <ebb9@byu.net>
2752             John Brzustowski  <jbrzusto@fastmail.fm>
2754         * src/input.c (input_stack): Delete; use current_input instead.
2755         (wrapup_stack): Dynamically allocate, so that recursion is handled
2756         properly.
2757         (push_wrapup): Use current wrapup stack.
2758         (pop_wrapup): Rotate wrapup stack to current, and create new
2759         wrapup stack.
2760         (input_init): Dynamically allocate stacks.
2761         * NEWS: Update, now that recursive m4wrap can no longer cause
2762         core dump.
2764 2006-05-31  Eric Blake  <ebb9@byu.net>
2766         * lib/getopt.c: Fix copyright year.
2767         * lib/obstack.c: Ditto.
2768         * src/builtin.c: Ditto.
2770 2006-05-30  Eric Blake  <ebb9@byu.net>
2772         * doc/m4.texinfo (M4wrap): Add test to expose m4wrap bug.
2773         Reported by John Brzustowski.
2774         (Incompatibilities): Document known POSIX incompatibilities.
2775         * THANKS: Update.
2777 2006-05-29  Eric Blake  <ebb9@byu.net>
2779         * doc/m4.texinfo (Maketemp): Work even when running 'make check'
2780         in read-only dir.
2782         Use automake.
2783         * Makefile.am: New file.
2784         * doc/Makefile.am: Ditto.
2785         * examples/Makefile.am: Ditto.
2786         * lib/Makefile.am: Ditto.
2787         * src/Makefile.am: Ditto.
2788         * acinclude.m4: New file, renamed from aclocal.m4.
2789         * configure.ac (AM_INIT_AUTOMAKE): Invoke new macro.
2790         (AC_ARG_PROGRAM): Now redundant.
2791         (STACKOVF): Turn into automake conditional.
2792         (AC_CONFIG_COMMANDS): stamp-h is a command, not a file.
2793         * checks/Makefile.in: Converting this dir to automake was not
2794         trivial; for now, just add missing targets demanded by top-level.
2795         * INSTALL: Remove files that are now generated from CVS.
2796         * Makefile.in: Ditto.
2797         * aclocal.m4: Ditto.
2798         * install-sh: Ditto.
2799         * mkinstalldirs: Ditto.
2800         * doc/Makefile.in: Ditto.
2801         * doc/texinfo.tex: Ditto.
2802         * examples/Makefile.in: Ditto.
2803         * lib/Makefile.in: Ditto.
2804         * src/Makefile.in: Ditto.
2806         * AUTHORS: Backport from CVS head, and update.
2807         * doc/m4.texinfo (Changeword): Fix examples to match behavior.
2809 2006-05-27  Eric Blake  <ebb9@byu.net>
2811         * lib/regex.c (regex_compile): Kill compiler warnings.
2812         * lib/getopt.c: Likewise.
2813         * lib/obstack.c: Likewise.
2814         * src/builtin.c (builtin_init): Likewise.
2815         * src/path.c (path_search): Likewise.
2817         * doc/m4.texinfo: Fix usage of a vs. an.
2818         (Loops, Include, Cleardiv, Patsubst, Format, M4exit): Kill
2819         overfull hbox warnings.
2820         (Inhibiting Invocation, Divert, Maketemp, M4exit): Add new tests.
2822         * configure.ac: Update to autoconf 2.59.  Forbid ^M4_.  Fix
2823         quoting.
2824         * aclocal.m4 (fp_PROG_CC_STDC): Delete; now covered by autoconf.
2825         (fp_C_PROTOTYPES): Delete, GNU Coding Standards state we can now
2826         assume C89.
2827         (M4_WITH_DMALLOC): Rename from fp_WITH_DMALLOC. Fix quoting.
2828         * src/m4.h (_): PROTOTYPES is no longer provided, assume C89.
2829         * src/Makefile.in: Delete remains of ansi2knr.
2830         * src/ansi2knr.1: Delete.
2831         * src/ansi2knr.c: Delete.
2833 2006-05-25  Eric Blake  <ebb9@byu.net>
2835         * doc/m4.texinfo: Fix spelling errors.  Use `invalid' instead of
2836         `illegal'.
2838         * doc/m4.texinfo (Francois): No longer needed as a tex variable.
2839         Reported by Karl Berry.
2841 2006-05-24  Eric Blake  <ebb9@byu.net>
2843         * Makefile.in (html): New target.
2844         * doc/Makefile.in (html, m4.html): Likewise.
2845         (MAKEINFOHTML): New macro.
2846         * doc/m4.texinfo (Francois) [ifnottex]: Use newer texinfo
2847         rendering.
2848         (Regexp) [ifhtml]: Make cross-reference to emacs manual an
2849         absolute URL.
2850         Reported by Bob Badour.
2852         * THANKS: Update.  Move reporter's email addresses here, instead
2853         of in ChangeLog.
2855 2006-05-11  Eric Blake  <ebb9@byu.net>
2857         * THANKS: Update.
2858         * doc/m4.texinfo (Changequote): Give testsuite exposure to bug
2859         patched on 2005-12-04.
2860         Reported by Ilya N. Golubev.
2862         * bootstrap: New file, so that generated files need not be stored
2863         in CVS.
2864         * Makefile.in (DISTFILES): Add bootstrap.
2866         Make testsuite less sensitive to doc changes.
2867         * doc/m4.texinfo: Use m4.input instead of filename.
2868         * checks/check-them (xerr): Turn m4.input into filename.
2869         * checks/Makefile.in (dist): Depend on stamp-checks.
2871         Portability updates for OS/2.
2872         * src/Makefile.in (EXEEXT, OBJEXT): Define.
2873         (LINK): Use CFLAGS.
2874         (.c.obj): Define.
2875         * lib/Makefile.in (OBJEXT): Define.
2876         (.c.obj): Define.
2877         * doc/Makefile.in (install, uninstall): Install info files into
2878         the dir listing.
2879         Reported by Andreas Buening.
2881 2006-05-09  Eric Blake  <ebb9@byu.net>
2883         * install-sh: Update to newer upstream version.
2884         * mkinstalldirs: Likewise.
2885         Reported by Andreas Buening.
2887         * src/m4.c (main): Bump copyright year.
2888         * Makefile.in (datarootdir): Define, for autoconf 2.59c.
2889         * doc/Makefile.in (datarootdir): Likewise.
2891 2006-05-08  Eric Blake  <ebb9@byu.net>
2893         * THANKS: Update.
2894         * doc/m4.texinfo (Bugs): Backport bug email address from head.
2895         Reported by Stepan Kasal.
2897 2005-12-04  Ilya N. Golubev  <gin@mo.msk.ru>  (tiny change)
2899         * input.c (match_input): Do not pass expression with side effect
2900         to `obstack_grow'.  Fix <INTERNAL ERROR: Recursive push_string!>.
2901         * NEWS: Updated.
2903 2005-12-04  Gary V. Vaughan  <gary@gnu.org>  (tiny change)
2905         * doc/m4.texinfo (How to debug macros and input): s/woould/would/
2906         Reported by Damian Menscher.
2908 2005-10-19  Gary V. Vaughan  <gary@gnu.org>  (tiny change)
2910         * configure.ac (AC_INIT): Bump to 1.4.4a.
2912 2005-10-19  Gary V. Vaughan  <gary@gnu.org>  (tiny change)
2914         Release 1.4.4:
2915         * configure.ac (AC_INIT): Bump to 1.4.4.
2916         * NEWS: Describe 1.4.4's changes.
2917         * INSTALL, install-sh, doc/texinfo.tex: Updated from upstream.
2919 2005-10-17  John Gatewood Ham  <zappaman@buraphalinux.org>  (tiny change)
2921         * src/m4.c: fix return code when non-existent files are processed
2923 2005-10-17  John Gatewood Ham  <zappaman@buraphalinux.org>  (tiny change)
2925         * README: update email address for bug reports.
2927 2005-10-17  Gary V. Vaughan  <gary@gnu.org>
2929         * doc/m4.info: Generated files are not kept in the repository.
2931 2005-05-01  Gary V. Vaughan  <gary@gnu.org>
2933         The FSF are moving offices today.  Changed their contact address
2934         in all files from `59 Temple Place, Suite 330, MA 02111-1307' to
2935         `51 Franklin Street, Fifth Floor, MA 02110-1301'.
2937         Also, some of the files here were never updated from the previous
2938         '675 Mass Ave, Cambridge, MA 02139', so changed those to the
2939         '51 Franklin Street, Fifth Floor, MA 02110-1301' address too.
2941 2005-03-31  Mike Frysinger  <vapier@gentoo.org>
2943         * Makefile.in (bindir, infodir): Substitute from configure rather
2944         than hardcode.
2945         * doc/Makefile.in (infodir): Ditto.
2946         * src/Makefile.in (bindir): Ditto.
2947         * NEWS: Updated.
2949 2005-03-31  Gary V. Vaughan  <gary@gnu.org>
2951         Changes needed to automate the release process for 1.4.3:
2953         * Makefile.in (dist): Make .tar.bz2 tarball too.
2954         * Makefile.maint (TSDEPS_DIST): Remove m4/libtool.m4.
2955         (cvs-news): Look 1 line further down for NEWS release number.
2956         (cvs-dist): We don't use automake, so make dist is fine.
2957         Remove double . before suffixes.
2958         (cvs-release): Don't mention manual.html.
2959         (fetch): Get latest gendocs files.
2960         (web-manual): Rewritten to use gendoc for multiformat manuals.
2961         * doc/gendocs.sh: Don't save an old version in m4 CVS!
2962         * doc/m4.texinfo (Index): HFS+ (the file system on my Mac) is case
2963         preserving, but case insensitive, so generating html docs per node
2964         clashes between Index.html, the node file, and index.html, the
2965         top-level of the document tree...
2966         (Index macro): ...so renamed to this.  Changed all references.
2968 2005-03-31  Gary V. Vaughan  <gary@gnu.org>  (tiny change)
2970         * configure.ac (AC_INIT): Bump to 1.4.3a.
2972 2005-03-31  Gary V. Vaughan  <gary@gnu.org>  (tiny change)
2974         Release 1.4.3:
2975         * configure.in (AC_INIT): Bump to 1.4.3.
2976         * NEWS: Describe 1.4.3's changes.
2978 2005-03-31  Gary V. Vaughan  <gary@gnu.org>
2980         * Makefile.maint: New file with release rules, from CVS libtool.
2981         * Makefile.in (DISTFILES): Add Makefile.maint.
2982         * INSTALL, install-sh, doc/texinfo.tex: Updated to latest
2983         canonical versions.
2985 2005-03-31  Eric Blake  <ebb9@byu.net>  (tiny change)
2987         * doc/m4.texinfo (Patsubst): Re-add trailing space required by
2988         checks/47.patsubst, with a redundant @comment to prevent emacs
2989         from removing it accidentally again.
2990         * checks/get-them: Allow for trailing spaces tucked behind
2991         @comment marks.
2993 2005-03-31  Eric Blake  <ebb9@byu.net>  (tiny change)
2995         * doc/Makefile.in (install, uninstall): Accomodate DESTDIR.
2996         * src/Makefile.in (install, uninstall): Likewise.
2998 2005-02-07  Gary V. Vaughan  <gary@gnu.org>
3000         * lib/regex.c, lib/regex.h:  Reverted gnulib update, which broke
3001         on Cygwin.
3002         Reported by Eric Blake.
3004 2005-02-04  Gary V. Vaughan  <gary@gnu.org>
3006         * lib/regex.c, lib/regex.h: Updated from gnulib.
3007         * src/input.c (set_word_regexp):  Don't change the word_regexp
3008         unless it compiles correctly.
3009         * NEWS: Updated.
3010         Reported by Frank Schwidom.
3012         * Makefile.in (stamp-h): Regenerate config.h properly.
3014 2005-02-03  Gary V. Vaughan  <gary@gnu.org>
3016         * configure.ac (AC_DEFINE): Fix overquoting of description
3017         argument.
3019         * src/m4.h (__CYGWIN__, WIN32): Canonicalise Windows and Cygwin
3020         recognition macros.
3021         * src/freeze.c (produce_frozen_state): Use \n line-endings even
3022         on Windows, so that the frozen file reader will work.
3023         Reported by Josef T. Burger.
3025         * src/m4.c (main): Modernise the --version output.
3027 2005-02-03  Gary V. Vaughan  <gary@gnu.org>
3029         Modernise the configury a little to prevent spurious errors from
3030         Autoconf-2.59's autoreconf:
3032         * config.h.in: Renamed to...
3033         * config-h.in: ...this to better support DOS 8.3 file systems.
3034         * acconfig.h: Removed.
3035         * configure.in: Renamed to...
3036         * configure.ac: ...this, and AC_DEFINE used to declare config.h
3037         entry comments.  Slight reorganisation and reformatting.
3038         * aclocal.m4: Use third argument to AC_DEFINE to declare config.h
3039         entry comments.
3040         (AC_INIT): Use a modern 3 argument call.
3041         * Makefile.in, checks/Makefile.in, doc/Makefile.in,
3042         examples/Makefile.in, lib/Makefile.in, src/Makefile.in:
3043         s/PRODUCT/PACKAGE/g.
3044         * Makefile.in (DISTFILES): Removed acconfig.h, configure.in,
3045         config.h.in.  Added configure.ac, config-h.in.
3046         (stamp-h.in): Removed acconfig.h from dependencies.
3047         (configure): Depends on configure.ac, not configure.in.
3048         * doc/Makefile.in (stamp-vti): Ditto.
3049         * src/freeze.c (produce_frozen_state), src/m4.c (main): Adjust for
3050         difference between PRODUCT="m4" and PACKAGE="GNU M4".
3051         * configure: Regenerated.
3053 2005-02-03  Noah Misch  <noah@cs.caltech.edu>
3055         * src/output.c (mkstemp): Make non-static, and build regardless of
3056         HAVE_TMPFILE; src/builtin.c also needs this replacement.
3057         * NEWS: Update.
3059 2004-09-09  Vincent Lonngren  <Vincent.lonngren.759@student.lu.se>
3061         * configure.in (AC_CHECK_HEADERS): Commit works best when you save
3062         changes from your editor buffer first.
3064         * configure.in (AC_CHECK_HEADERS):  Add signal.h, sys/signal.h.
3065         * src/m4.c: And include them as appropriate.
3066         * NEWS: Updated.
3068 2004-09-09  Andreas Schwab  <schwab@suse.de>
3070         Refactoring of the string read case in next_char provides about a
3071         20% speedup of M4 as typically used by autoconf:
3073         * src/input.c (next_char_1): Renamed from next_char.
3074         (next_char): New macro.
3075         * NEWS: Updated.
3077 2004-08-21  Gary V. Vaughan  <gary@gnu.org>
3079         * configure.in (VERSION): Bump to 1.4.2a.
3081 2004-08-19  Paul Eggert  <eggert@twinsun.com>
3083         Release 1.4.2.
3084         * configure.in (VERSION): Bump to 1.4.2.
3085         * News: Describe 1.4.2's changes.
3087         * src/m4.c (reference_error): Preserve errno, since M4ERROR
3088         relies on this.
3089         * src/builtin.c (m4_esyscmd): Clear errno before calling popen.
3090         (m4_maketemp): Clear errno before calling mkstemp.
3091         * src/path.c (path_search): Don't let "free" trash errno when
3092         returning NULL.
3093         * src/output.c (insert_file): Don't assume errno has a valid
3094         value simply because fread returns zero.  This fixes a
3095         portability bug reported by Marion Hakanson in
3096         <http://lists.gnu.org/archive/html/bug-m4/2004-07/msg00029.html>.
3098 2004-06-09  Gary V. Vaughan  <gary@gnu.org>
3100         * configure.in (VERSION): Bump to 1.4.1a.
3101         * NEWS: Place holder for next stable release.
3103 2004-06-03  Paul Eggert  <eggert@cs.ucla.edu>
3105         Release 1.4.1.
3106         * configure.in (VERSION): Bump to 1.4.1.
3107         * NEWS: Describe 1.4.1's changes.
3109         * aclocal.m4 (fp_PROG_CC_STDC): Use AC_DEFUN, not define, to
3110         pacify Autoconf 2.59.
3112         * doc/m4.texinfo: Insert commas after @xref's that lack them,
3113         to pacify Texinfo 4.7.
3114         * doc/Makefile.in (info): Remove info-1, info-2, info-3.
3116         * src/m4.h, src/debug.c: Use #ifdef __STDC__, not #if __STDC__, to
3117         pacify Sun C compilers.
3119 2003-09-28  Akim Demaille  <akim@epita.fr>
3121         * src/symtab.c (lookup_symbol): Fix an uninitialized-variable
3122         botch.
3124 2003-09-03  Santiago Vila  <sanvila@debian.org>
3126         * examples/stackovf.sh: Use tempfile if available.
3128 2001-04-02  Robert Bihlmeyer  <robbe@orcus.priv.at>
3130         http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=92629
3131         * src/output.c (m4_insert_file): Do not mix buffered and
3132         unbuffered I/O, as this breaks on the Hurd.  (trivial change)
3134 2001-02-01  Santiago Vila  <sanvila@debian.org>
3136         http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=84451
3137         * src/m4.c (main): Fix format vulnerabilities.  (trivial change)
3139 2001-02-01  Matt Kraai  <kraai@debian.org>
3141         http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=84416
3142         * doc/m4.texinfo (Maketemp): Change maketemp to refer to a new,
3143         empty file rather than to a nonexistent file.  This closes a common
3144         security hole.
3145         * src/builtin.c (m4_maketemp): Implement the above, by using
3146         mkstemp rather than mktemp.  (trivial change)
3148 2000-01-09  Akim Demaille  <demaille@inf.enst.fr>
3150         * src/builtin.c (expand_ranges): Added break after trailing dash.
3151         This caused misbehaviors on some systems.
3153 Sat Nov  5 15:52:47 1994  Francois Pinard  (pinard@icule)
3155         Release 1.4.
3156         * doc/Makefile.in (realclean): Also remove stamp-vti.
3157         Reported by Eric Backus.
3159 Wed Nov  2 00:47:53 1994  Francois Pinard  (pinard@icule)
3161         * src/freeze.c (produce_frozen_state): If the frozen file cannot
3162         be opened, return immediately after producing the error message.
3163         Reported by Andreas Schwab.
3165         * configure.in: Check for const only after having found possible
3166         ANSIfying compiler flags, this is of no use to check it before.
3167         Reported by Alexander Lehmann.
3169 Tue Nov  1 22:02:37 1994  Francois Pinard  (pinard@icule)
3171         * src/macro.c (collect_arguments): Cast obstack arguments to
3172         (voidstar), so avoiding compiler warnings.
3173         Reported by Joseph E. Sacco.
3175         * src/freeze.c (produce_frozen_state): Cast printed lengths to
3176         (int) so they correspond to %d format items.
3177         Reported by Joseph E. Sacco.
3179         * src/m4.c (main): Cast the argument to xfree to (voidstar).
3180         * src/symtab.c (free_symbol): Idem.
3181         Reported by Karl Vogel.
3183 Mon Oct 31 02:11:19 1994  Francois Pinard  (pinard@icule)
3185         * Makefile.in (DISTFILES): Distribute BACKLOG.
3187         * configure.in: Define PRODUCT and VERSION.
3188         * acconfig.h: Document PRODUCT and VERSION.
3189         * src/m4.c, src/freeze.c: Use PRODUCT and VERSION instead of the
3190         constant string m4 and variable or parameter named version.
3192 Sun Oct 30 08:13:03 1994  Francois Pinard  (pinard@icule)
3194         * src/m4.h, src/debug.c: Replace all #ifdef __STDC__ by #if
3195         __STDC__.  Alliant FX/2800 Concentrix 2.2 (i860-BSD4.3) compiler
3196         defines __STDC__ to 0, for indicating it is *not* ANSI!
3197         Reported by Kaveh R. Ghazi.
3199         * configure.in: Added obsolescent tests for AIX and Minix.
3201         * doc/Makefile.in (mostlyclean): Remove texclean in dependencies,
3202         which texclean does not exist anymore.
3203         Reported by Eric Backus, Jim Meyering, John David Anglin and
3204         Joseph E. Sacco.
3206 Sat Oct 29 05:10:03 1994  Francois Pinard  (pinard@icule)
3208         * aclocal.m4 (fp_C_PROTOTYPES): Force -D_HPUX_SOURCE with -Aa.
3209         Reported by John David Anglin.
3211         * src/ansi2knr.c: New version, sent by Peter Deutsch.
3212         * aclocal.m4 (fp_C_PROTOTYPES): Substitute empty or ansi2knr for
3213         ANSI2KNR, depending on the fact the compiler is ANSI or not.
3214         * src/Makefile.in: Use -Ovarargs=convert on ansi2knr calls.
3215         Remove the sed filter after ansi2knr for debug.c.  Use $O instead
3216         of $U, put underline in extensions rather than in basenames.  Use
3217         implicit rules, now that regularity makes this possible.
3218         Have $(OBJECTS) depend on $(ANSI2KNR), so to trigger compilation
3219         of ansi2knr whenever it is needed.
3220         * configure.in: Adjusted for correct STACKOVF substitution.
3221         * src/debug.c (trace_format): When not __STDC__, use (...) as a
3222         parameter list, so ansi2knr will convert it to (va_alist) va_dcl.
3223         Reported by David MacKenzie.
3225         * Makefile.in: Remove binprefix.  Use transform_name instead.
3226         Reported by David MacKenzie.
3228         * doc/Makefile.in: Create version.texi, use it, clean it.
3229         Reported by Jim Meyering.
3231 Fri Oct 28 20:33:55 1994  Francois Pinard  (pinard@icule)
3233         * Makefile.in (all, install, uninstall): Depend on Makefile.
3235         * Makefile.in: For actions invoking $(MAKE) from within compound
3236         sh statements, exit non-zero if the sub-make fails.  Otherwise,
3237         the top-level make may exit successfully when it should fail.
3238         Reported by Jim Kingdon.
3240         * {,/*}Makefile.in: Use && after all cd, in case they fail.
3242         * {,*/}Makefile.in: Declare PRODUCT and VERSION macros.
3243         (dist): Use PRODUCT and VERSION instead of tricks on .fname.
3244         * configure.in: Substitute PRODUCT and VERSION.
3246         * {,*/}Makefile.in (dist): Always try a hard link before a copy.
3248 Thu Oct 27 22:32:58 1994  Francois Pinard  (pinard@icule)
3250         * Makefile.in (mostlyclean-local): Do not remove *~.
3251         * */Makefile.in (mostlyclean): Idem.
3252         Reported by Robert E. Brown and Richard Stallman.
3254 Sun Oct  9 08:30:13 1994  Francois Pinard  (pinard@icule)
3256         * src/m4.h: Get rid of CONFIG_BROKETS.
3258 Sun Oct  2 16:48:10 1994  Francois Pinard  (pinard@icule)
3260         * configure.in: Use AC_ARG_PROGRAM.
3261         * aclocal.m4 (fp_C_PROTOTYPES): Substitute @kr@ by kr or empty.
3262         Reported by David MacKenzie.
3264 Sat Oct  1 11:22:42 1994  Francois Pinard  (pinard@icule)
3266         * configure.in: Do not add -O to CFLAGS for GNU C, now that
3267         configure does it automatically.
3268         Reported by Jim Meyering.
3270 Fri Sep 23 08:16:58 1994  Francois Pinard  (pinard@icule)
3272         * src/stackovf.c: Declare the handler_t typedef earlier in the
3273         code, use it for stackovf_handler.
3274         (setup_stackovf_trap): Use RETSIGTYPE instead of void while
3275         casting sigsegv_handler.
3276         Reported by Robert Bernstein.
3278         * src/m4.c (main): Initialize program_name to argv[0] without
3279         basename'ing it.
3280         Reported by Karl Berry.
3282 Sun Sep 18 11:42:50 1994  Francois Pinard  (pinard@icule)
3284         * src/Makefile.in (TAGS): Include a ../lib/TAGS reference.
3285         Reported by Karl Berry.
3287 Wed Sep 14 10:00:22 1994  Francois Pinard  (pinard@icule)
3289         * lib/Makefile.in (mostlyclean): Added.
3290         (TAGS): Make in $(srcdir).
3292         * configure.in: Use `choke me' in test, like everywhere!
3294         * {doc,examples,lib,src}/Makefile.in (check): Deleted, as
3295         unreacheable and useless.
3297         * doc/Makefile.in (texclean): Deleted, merged in mostlyclean.
3299         * lib/Makefile.in (DISTFILES): Distribute TAGS.
3300         (distclean): Do not remove TAGS.
3301         (realclean): Remove it.
3302         * Makefile.in: Make TAGS in lib also, not just in src.
3303         Reported by Karl Berry.
3305         * Makefile.in (distclean, realclean): Instead of recursively
3306         calling $(MAKE) for the -local part, allow parallel execution of
3307         -recursive and -local, only delay the removal of config.status,
3308         which is repeated in both goals.
3310 Tue Sep 13 19:21:05 1994  Francois Pinard  (pinard@icule)
3312         Release 1.3.
3313         * Makefile.in: Group all *clean-recursive goals in one, using sed
3314         to remove `-recursive' while calling make recursively.  Also, use
3315         a subshell for each recursive $(MAKE).
3316         Reported by Jim Meyering.
3318         * src/m4.h (memcpy): Define with bcopy for BSD systems.
3319         Reported by Kaveh R. Ghazi.
3321         * src/Makefile.in (ansi2knr): Use $(LIBS) while linking, for SunOS
3322         4.1.3 requires -ldl to link even ansik2nr, and we need a way to
3323         specify it.
3325         * configure.in: Use date instead of touch for stamp-h.
3326         * Makefile.in (stamp-h.in): Idem.
3328         * Makefile.in (distclean, realclean): Force serial execution of
3329         both goals, in case parallel makes are being used.
3330         Reported by Jim Meyering.
3332         * src/Makefile.in (DISTFILES): Distribute TAGS.
3333         (distclean): Do not remove TAGS.
3334         (realclean): Remove it.
3335         Reported by Karl Berry.
3337 Sat Sep 10 12:34:04 1994  Francois Pinard  (pinard@icule)
3339         * configure.in: Use fp_ to match aclocal.m4.  Revert _OS_ macros
3340         to old names, for following Autoconf.
3342 Thu Sep  8 15:07:27 1994  Francois Pinard  (pinard@icule)
3344         * Makefile.in (MDEFINES): Remove INSTALL substitutions, for
3345         ./install.sh will not be correctly referred to in sub-Makefiles.
3346         Reported by John David Anglin.
3348         * doc/Makefile.in (texclean): Remove *.cps and *.fns too.
3349         Reported by Eric Backus.
3351         * Makefile.in, checks/Makefile.in, doc/Makefile.in,
3352         examples/Makefile.in, lib/Makefile.in, src/Makefile.in: Limit
3353         config.status into remaking this directory's Makefile only.
3354         * Makefile.in (stamp-h): Do not check nor touch stamp-h.
3355         * configure.in (AC_OUTPUT): Touch stamp-h if CONFIG_HEADERS.
3356         Reported by Jim Meyering.
3358 Tue Sep  6 12:07:33 1994  Francois Pinard  (pinard@icule)
3360         * configure.in: Correct stack overflow detection logic, taking
3361         care of systems having only incomplete implementations (like for
3362         Pyramid 9820 OSx 5.0d).
3363         Reported by Kaveh R. Ghazi.
3365         * src/Makefile.in (TAGS): Remote -t from etags call.
3367 Fri Sep  2 10:37:10 1994  Francois Pinard  (pinard@icule)
3369         * lib/Makefile.in (install): Depend on all.
3371 Wed Aug 31 11:17:21 1994  Francois Pinard  (pinard@icule)
3373         * examples/Makefile.in (mostlyclean): Do not depend on texclean.
3374         Reported by Jim Meyering and John David Anglin.
3376         * Makefile.in (distclean-local): Delete config.log.
3377         Reported by Jim Meyering.
3379         Solidify frozen files with respect to -P:
3380         * src/m4.c: Have -P set prefix_all_buitins variable instead of
3381         calling a function by that name.  Declare the variable.
3382         * src/m4.h: Adjust declaration for prefix_all_buitins.
3383         * src/builtin.c (builtin_init): Merge in functionality from
3384         previous prefix_all_buitins function, while making entries in the
3385         symbol table, but not modifying the builtin description itself.
3387         * src/freeze.c (reload_frozen_state): Add a useless `break;',
3388         because *many* compilers do not accept an empty `default:'.
3389         Reported by Akiko Matsushita, Eric Backus, John David Anglin,
3390         Joseph E. Sacco, Kaveh R. Ghazi, Tom McConnell and Ulrich Drepper.
3392         * configure.in: Use AC_TYPE_SIGNAL.
3393         * src/stackovf.c (setup_stackovf_trap): Use RETSIGTYPE.
3394         Reported by Robert Bernstein.
3396         * checks/Makefile.in (check): Modify PATH so check-them will find
3397         m4 in the src directory.
3398         * Makefile.in (check): Don't.
3399         Reported by Akiko Matsushita and Jim Meyering.
3401         * src/output.c (make_room_for, output_character_helper): New
3402         functions, for implementing a global MAXIMUM_TOTAL_SIZE instead of
3403         a per buffer MAXIMUM_BUFFER_SIZE.
3405         * src/output.c (output_text): New function, for optimizing the
3406         output of strings of characters.  Use it.
3408 Tue Aug 30 01:44:29 1994  Francois Pinard  (pinard@icule)
3410         * doc, src: New directories reorganizing the distribution.
3411         * doc/Makefile.in, src/Makefile.in, examples/Makefile.in: New
3412         files.
3413         * Makefile.in: Adjusted.
3414         * configure.in: Configure new Makefiles.
3416         * m4.h: Declare STRING typedef.  Use it for comment and quote
3417         strings, adjusting all references.  (This is the rudiments of a
3418         beginning for the eventual withdrawal of NUL terminated strings.)
3419         * output.c (shipout_text): Accept a length parameter, and use it.
3420         All callers adjusted.
3422 Mon Aug 29 12:27:19 1994  Francois Pinard  (pinard@icule)
3424         * m4.h: Include <unistd.h> if it exists.
3425         * stackovf.c: Don't.
3427         Clean up for current_diversion variable:
3428         * output.c: Move current_diversion from builtin.c.
3429         * m4.h: Declare current_diversion so builtin.c can access it.
3430         * output.c (output_init, make_diversion): Initialize or update
3431         current_diversion.
3432         * builtin.c (builtin_init, m4_divert): Leave current_diversion
3433         alone.
3435         Remove limit on number of diversions:
3436         * output.c: Replace ndiversion by diversions, declare it.
3437         (output_init): Allocate only diversion 0.
3438         (make_diversion): Allocate new diversions as needed.
3439         * m4.h, m4.c: Remove NDIVERSIONS and ndiversion related stuff.
3440         * m4.c: Still accept -N, but do nothing with it.
3441         Reported by David MacKenzie.
3443         Freeze diversions:
3444         * output.c (freeze_diversions): New function.
3445         * m4.h: Declare freeze_diversions.
3446         * freeze.c: Document frozen file format, revise it, call
3447         freeze_diversions to add diversions to frozen format, and code to
3448         reload them properly.
3449         * m4.c: Do not undivert automatically at end when status being
3450         frozen.  Do not call builtin_init when reloading frozen state.
3452         Speed up diversion processing:
3453         * output.c: Add INITIAL_BUFFER_SIZE, MAXIMUM_BUFFER_SIZE,
3454         COPY_BUFFER_SIZE, in-memory diversion buffers, struct diversion
3455         structure and variables, cached variables out of output_diversion,
3456         reallocate_diversion_for and OUTPUT_CHARACTER.
3457         (shipout_text, make_diversion, insert_diversion): Adapted to new
3458         structures.
3459         (insert_file): Use better buffering.
3460         Reported by David MacKenzie.
3462 Sun Aug 28 05:20:02 1994  Francois Pinard  (pinard@icule)
3464         * Makefile.in, lib/Makefile.in, checks/Makefile.in: Arrange so
3465         dist works from another build directory.
3467 Sat Aug 27 14:32:45 1994  Francois Pinard  (pinard@icule)
3469         * symtab.c (hack_all_symbols): Use hash_table_size instead of
3470         constant HASHMAX, for -H option to work better.
3472         * builtin.c (DECLARE): Simplify by using _ ().
3474         * freeze.c: New file.
3475         * Makefile.in: Compile it, distribute it.
3476         * m4.c: Recognize, document and process --freeze-state (-F) and
3477         --reload-state (-R) options.  Pass a true flag to builtin_init
3478         only if no reloading some state.
3479         * builtin.c (define_builtin): Remove static specifier.
3480         (find_builtin_by_name): Remove static specifier.
3481         (builtin_init): Accept and obey a flag argument.
3482         * m4.h: Add declarations for freeze.c, changes for builtin.c.
3484 Wed Aug 24 16:14:19 1994  Francois Pinard  (pinard@icule)
3486         * builtin.c (dumpdef_cmp): Rewrite so the cast protect the const
3487         specifier.
3489         * configure.in: Implement --with-dmalloc.
3490         * acconfig.h: Document WITH_DMALLOC.
3491         * m4.h: Add code for when WITH_DMALLOC.
3493 Mon Aug 15 12:38:05 1994  Francois Pinard  (pinard@icule)
3495         * m4.c (long_options): Use "error-output", the dash was missing.
3496         Reported by Akiko Matsushita.
3498 Fri Aug 12 16:38:01 1994  Francois Pinard  (pinard@icule)
3500         * m4.h: Include <sys/types.h>.
3501         * builtin.c, debug.c, m4.c, output.c, stackovf.c: Don't.
3502         * m4.h: Declare len_lquote and len_rquote as size_t, not int.
3503         int.
3504         * input.c: Declare len_lquote, len_rquote, len_bcomm and len_ecomm
3505         as size_t, not int.
3506         * builtin.c (dump_args): Declare len as size_t, not int.
3508         * debug.c: Prototype the forward declaration of debug_set_file.
3510         * builtin.c (m4_undivert):  Replace div by file, for avoiding the
3511         shadowing of this variable.
3512         * output.c (insert_diversion): Idem.
3514         * input.c: Delete def_rquote, def_lquote, def_bcomm and def_ecomm.
3515         (input_init): Duplicate default quote and comment strings.
3516         (set_quotes): Free previous quote strings in all cases.  Duplicate
3517         even default quote strings.
3518         (set_comment): Free previous comment strings in all cases.
3519         Duplicate even default comment strings.
3521         * configure.in: Updated for Autoconf 2.0.
3522         * Makefile.in (distclean-local): Also delete config.cache.
3524         * m4.c (usage): Reorganize the --help output by topic.  Include a
3525         description for debugging flags.
3527 Fri Jul 29 10:15:52 1994  Francois Pinard  (pinard@icule)
3529         * configure.in: If sigaction is available and SA_ONSTACK defined,
3530         use sigaction.  Otherwise, if sigvec is available and SV_ONSTACK
3531         defined, use sigvec.  Else don't compile stackovf.c.
3532         * stackovf.c (setup_stackovf_trap): Idem.
3533         Reported by Jim Avera, Karl Berry, Kaveh R. Ghazi, Matthias Rabe
3534         and Simon Leinen.
3536 Thu Jul 21 22:43:17 1994  Francois Pinard  (pinard@icule)
3538         * m4.c (usage): Replace printf par fputs.
3540 Mon Jul 18 23:48:23 1994  Francois Pinard  (pinard@icule)
3542         * Release 1.2
3544 Sun Jul 17 08:08:25 1994  Francois Pinard  (pinard@icule)
3546         * configure.in: Check for sigaction and sigvec.  Add a new delayed
3547         check for RLIMIT_STACK, combine in the checking for getrlimit.
3548         All those things are not universally available.
3549         * stackovf.c: Split setting up the trap handler and catching
3550         signals, for better taking care of various configure outcomes.
3551         * examples/stackovf.sh: Correct a typo.
3552         Reported by Eric Backus, Jim Avera and Jim Meyering.
3554 Sat Jul 16 20:36:19 1994  Francois Pinard  (pinard@icule)
3556         * ansi2knr.c: New version sent by its author, Peter Deutsch.
3558 Fri Jul 15 14:36:21 1994  Francois Pinard  (pinard@icule)
3560         * Makefile.in: Modify so parallel make will not try making
3561         lib/libm4.a twice simultaneously.
3562         Reported by Jim Meyering.
3564 Thu Jul 14 17:23:17 1994  Francois Pinard  (pinard@icule)
3566         * stackovf.c (setup_stackovf_trap): Replace "Don't" by "Do not" in
3567         error message, for when no code possibility exists.  Even if this
3568         line is completely #ifdef'ed out, it brings a syntax error.
3569         Reported by Andreas Schwab, Jim Meyering and Joseph E. Sacco.
3571         * Makefile.in (install): Have install depend on all too, for lib
3572         to be remade as needed.
3574         * examples/stackovf.sh: Try ksh, bsh and bash for shells
3575         providing ulimit, instead of using only ksh.
3576         Reported by Jim Avera and Joseph E. Sacco.
3578 Tue Jul 12 06:54:31 1994  Francois Pinard  (pinard@icule)
3580         * Makefile.in (check): Have it depend on all instead of m4.  In
3581         this way, a change in lib will be detected and processed.
3583         * builtin.c (numeric_arg): Use strtol and verify the conversion,
3584         instead of using sscanf which stops as soon as there is a
3585         non-digit in the input.  Previously, incr(1xyzzy), eval(1,2xyzzy)
3586         and divert(1xyzzy) were all accepted without any warning or error
3587         messages.
3588         * m4.h: Declare strtol as long if not including stdlib.h.
3589         * configure.in: Check for limits.h, and replace strtol if missing.
3590         * lib/Makefile.in: Substitute LIBOBJS.  Distribute strtol.c.
3591         * lib/strtol.c: New file, from elsewhere.
3592         Reported by Andreas Schwab.
3594 Thu Jul  7 22:38:10 1994  Francois Pinard  (pinard@icule)
3596         * macro.c (expand_macro): Cast value to (boolean) prior to
3597         assigning it to traced.
3598         Reported by Tom McConnell.
3600         * Makefile.in (m4): Always make all in lib first.
3601         Reported by Jim Meyering.
3603 Wed Jul  6 13:16:31 1994  Jim Avera (jima@netcom.com)
3605         * stackovf.c: Isolated OS-dependent sections; Improved portability,
3606         adding support for SunOS/BSD (sigvec, sigstack, and 4-parameter signal
3607         handlers), and a default error message if the fault address is not
3608         available (when neither siginfo.h nor BSD sigcontext are supported).
3609         * configure.in: Changes for stackovf.h: Check for sigcontext,
3610         sigaction, sigstack, and define rlim_t as int if necessary.
3611         * acconfig.h: Added HAVE_SIGCONTEXT and rlim_t.
3612         * examples/stackovf.sh: Run m4 -L99999999 to allow stack overflow.
3613         * ansi2knr.c: Fix for func-ptr args; convert "..." to varargs syntax.
3615 Tue Jul  5 19:13:54 1994  Francois Pinard  (pinard@icule)
3617         * configure.in: Use AC_SET_MAKE.
3618         * Makefile.in: Use @SET_MAKE@.
3619         Reported by Jim Meyering.
3621         * checks/check-them: Do not trap on SIGQUIT or SIGALRM.
3622         Reported by Ian Taylor.
3624 Sat Jul  2 00:58:47 1994  Francois Pinard  (pinard@icule)
3626         * configure.in: Remove dependency of USE_STACKOVF on STDC_HEADERS,
3627         because siginfo.h is unrelated to standard headers, and siginfo.h
3628         is already checked for.
3629         Reported by Joseph E. Sacco.
3631         * acconfig.h, aclocal.m4, m4.h: Replace HAVE_PROTOTYPES by
3632         PROTOTYPES.
3633         * aclocal.m4, configure.in: Replace AC_HAVE_PROTOTYPES by
3634         AC_PROTOTYPES.
3636 Wed Jun 29 22:41:53 1994  Francois Pinard  (pinard@icule)
3638         * builtin.c (substitute): Use \& to represent this part of the
3639         string which was matched by the whole regexp, instead of
3640         representing the whole string.  Any usage of \0 issues a warning
3641         and acts like \&, it will disappear in some subsequent release.
3643 Mon Jun 27 14:24:23 1994  Francois Pinard  (pinard@icule)
3645         * m4.c: Complete prototype for forwarded declaration of usage.
3647         * input.c (init_macro_token): Correct own reference in error
3648         message.  Previous name get_macro_func was referred to instead.
3649         (next_char):  Correct own reference in error message.  Previous
3650         name advance_input was referred to instead.
3652         * m4.h: Declare eval_t and unsigned_eval_t typedefs to 32 bits.
3653         * eval.c (logical_or_term, logical_and_term, or_term, xor_term,
3654         and_term, not_term, logical_not_term, cmp_term, shift_term,
3655         add_term, mult_term, exp_term, unary_term, simple_term): Add
3656         prototype to forwarded declarations.  Declare parameter v1 as
3657         eval_t * instead of int *.  Same for local variable v2 in dyadic
3658         functions.  Same for result in exp_term.
3659         * builtin.c (m4_eval): Declare value as eval_t instead of int.
3660         (ntoa): Declare value as eval_t instead of int.  Declare uvalue as
3661         unsigned_eval_t instead of unsigned int.  Change casts accordingly.
3662         (shipout_int): Cast first argument of ntoa to eval_t.
3663         Reported by Thorsten Ohl.
3665         * macro.c: Complete the prototypes of forwarded expand_macro and
3666         expand_token.
3667         Reported by Thorsten Ohl.
3669         * m4.h: Define voidstar as void * or char * depending on __STDC__.
3670         The Ultrix 3.1 compiler cannot do much with void pointers.
3672         * builtin.c (dumpdef_cmp): Replace void * by voidstar.
3673         * m4.c (xfree):  Replace void * by voidstar.
3674         Reported by Tom McConnell.
3676         * ansi2knr.1: New, from elsewhere.
3677         * Makefile.in (DISTFILES): Distribute ansi2knr.1
3679         * Makefile.in (stamp-h.in): Avoid running ./config.status if
3680         stamp-h does not exist yet.  This avoids running it a second time
3681         just after the initial ./configure.
3682         Reported by David MacKenzie and Tom McConnell.
3684         * m4.h: Replace the enum debug_info declaration with a series of
3685         #define's.  The Ultrix 3.1 compiler would otherwise need casting
3686         (int) to most references, when used in expressions.
3687         Reported by Tom McConnell.
3689 Sat Jun 25 00:10:05 1994  Francois Pinard  (pinard@icule)
3691         * aclocal.m4: Replace FP_PROTOTYPES by AC_HAVE_PROTOTYPES,
3692         following an idea from Brook G. Milligan.  AC_HAVE_PROTOTYPES
3693         calls the compiler.  Previously, FP_PROTOTYPES was only calling
3694         the preprocessor; by not being subject to CFLAGS, this was
3695         discouraging those flags asking for ANSI compilation.
3696         * acconfig.h: Document HAVE_PROTOTYPES.
3697         * configure.in: Use AC_HAVE_PROTOTYPES instead of FP_PROTOTYPES.
3698         * m4.h: Define _() according to HAVE_PROTOTYPES, not __STDC__.
3699         Reported by Eric Backus.
3701         * configure.in: Substitute CFLAGS and LDFLAGS, taking their value
3702         from the environment.  Default CFLAGS to -g if not set.
3703         * Makefile.in: Have CFLAGS and LDFLAGS substituted from configure.
3704         * lib/Makefile.in: Have CFLAGS substituted from configure.
3705         Reported by Eric Backus and Tom McConnell.
3707         * configure.in: m4_undefine changeword before using AC_ENABLE.
3709         * m4.h: Declare prototypes for error (for ANSI compilers only),
3710         prefix_all_builtins and reference_error.
3711         Reported by Tom McConnell.
3713         * input.c (set_word_regexp): Do not try to initialize the array
3714         test from a string, this does not work with non-ANSI compilers.
3715         Reported by Eric Backus.
3717         * Makefile.in (dist): Clean examples/ before saving it.
3718         (distclean-local): Also remove stamp-h.
3719         Reported by Eric Backus.
3721         * Makefile.in (_stackovf.c): Goal for compiling stacokovf.c with
3722         non ANSI compilers.
3723         Reported by Tom McConnell.
3725         * checks/Makefile.in (clean): Depends on mostlyclean.
3726         (mostlyclean): New goal.
3728 Fri Jun 24 23:30:31 1994  Francois Pinard  (pinard@icule)
3730         * Makefile.in (DISTFILES): Distribute install.sh.
3731         * install.sh: New file, copied from elsewhere.
3732         Reported by Assar Westerlund and Kaveh R. Ghazi.
3734 Thu Jun 23 00:00:30 1994  Francois Pinard  (pinard@icule)
3736         * configure.in: Define ENABLE_CHANGEWORD if --enable-changeword.
3737         * acconfig.h: Explain ENABLE_CHANGEWORD.
3739         [These modifs all depend upon ENABLE_CHANGEWORD and are adapted
3740         from code provided by Pete Chown]
3741         * m4.h: Add original_text field to u_t variant of union u.
3742         Declare TOKEN_DATA_FUNC macro.
3743         * builtin.c: Declare changeword.
3744         (m4_changeword): New function.
3745         * input.c: Include "regex.h", define variables with word regexps.
3746         (input_init): Initialize the word regexp.
3747         (set_word_regexp): New.
3748         (next_token): Declare local variables, use the previous code if
3749         default_word_regexp is true.  Else, match using a new code.  Save
3750         the original text.
3751         * macro.c (expand_token): Ship out original text if not a macro
3752         name.
3753         Reported by Krste Asanovic and Pete Chown.
3755         [These modifs all depend upon ENABLE_CHANGEWORD]
3756         * m4.h: Declare external user_word_regexp.
3757         * m4.c: Declare user_word_regexp, and initialize it from
3758         --word-regexp or -W, or NULL if not specified.
3759         * input.c: Use user_word_regexp if specified, instead of
3760         DEFAULT_WORD_REGEXP.
3762         * Makefile.in (m4): Revert Jan 3 1994 change.  I'm unable to
3763         agree with it.
3765         * Makefile.in, lib/Makefile.in: Limit suffixes to .c and .o.
3766         * checks/Makefile.in: Empty the suffix list.
3767         Reported by Geoff Russell, Joel Sherrill and Roland McGrath.
3769         * m4.c: Declare nesting_limit and initialize it to 250.
3770         Implement -LNUMBER or --nesting-limit=NUMBER to change its
3771         value.
3772         * m4.h: Declare nesting_limit as external.
3773         * macro.c (expand_macro): Stop execution whenever nesting limit
3774         is exceeded.
3775         Reported by Bengt Mertensson.
3777         * eval.c (evaluate): Diagnose excess characters in eval input.
3778         Things like `eval(08)' used to return 0 with no diagnostic.
3780         * m4.h: Capitalize first letter of all macro arguments in
3781         definitions.
3783         * m4.c: Declare warning_status, initialize it to 0.  Add new
3784         option -E, or --fatal-warnings, which sets warning_status to
3785         EXIT_FAILURE instead.
3786         * m4.h: Declare external warning_status.  Define EXIT_SUCCESS and
3787         EXIT_FAILURE if not otherwise done by header files.
3788         * m4.c: Delete declarations for EXIT_SUCCESS and EXIT_FAILURE.
3789         * m4.c, input.c, output.c, symtab.c, builtin.c, macro.c, debug.c,
3790         eval.c: Replace 0 by warning_status and 1 by EXIT_FAILURE in first
3791         argument of all M4ERROR calls.
3792         Reported by Noah Friedman.
3794         * examples/incl-test.m4: Renamed from incl_test.m4.
3795         * examples/include.m4: Include incl-test.m4 instead of
3796         incl_test.m4.
3797         * examples/multiquotes.m4: Renamed from multi-quotes.m.
3799 Wed Jun 22 21:58:54 1994  Francois Pinard  (pinard@icule)
3801         * configure.in: Avoid USE_STACKOVF if <siginfo.h> not found.  Note
3802         that Jim developped stackovf.c on a 486 running SVR4.0 (ESIX), and
3803         also tested it on a Sun Sparc workstation running SunOS 4.x.
3805         * format.c (format): When not HAVE_EFGCVT, m4 was failing the
3806         49.format check, abusing a `union values' argument with sprintf
3807         without selecting the proper field.  Now, save the formatting type
3808         first, delaying the fetch of the corresponding argument.
3809         Reported by Joseph E. Sacco and Tom Quinn.
3811         * format.c (format): Remove const from char *fmt declaration when
3812         not HAVE_EFGCVT, because a NUL may be forced into it.
3814         * m4.h: Declare atof() when not STDC_HEADERS.
3815         Reported by Joseph E. Sacco.
3817         * Regenerate configure using Autoconf 1.11, this corrects a
3818         problem about an incorrect cpp seting on NeXT 3.1.
3819         Reported by Alexander Lehmann.
3821 Sun Jun  5 16:25:19 1994  Francois Pinard  (pinard@icule)
3823         * m4.h (_): Change argument from `x' to `Args'.
3825 Wed May  4 23:59:39 1994  Francois Pinard  (pinard@icule)
3827         * Makefile.in: Remove all occurrences of $(MFLAGS), which were
3828         bringing more evil than good on a few systems.
3829         Reported by Greg A. Woods.
3831 Fri Apr 22 15:59:35 1994  Francois Pinard  (pinard@icule)
3833         * m4.h: Rename Args() to _().
3834         * m4.h: Remove extern specifier from all function declarations.
3836 Fri Apr 22 15:51:21 1994  Jim Avera (jima@netcom.com)
3838         * stackovf.c: New file implementing stack-overflow detection.
3839         * configure.in: Check for getrlimit, sigaction.  If all of
3840         standard headers, getrlimit and sigaction, define USE_STACKOVF and
3841         substitute ${U}stackovf.o for STACKOVF.
3842         * acconfig.h: Declare USE_STACKOVF.
3843         * Makefile.in: Distribute stackovf.c, link with $(STACKOVF).
3844         * m4.h: Declare setup_stackovf_trap().
3845         * m4.c: Call setup_stackovf_trap().
3846         * tests/stackovf_test.sh: New file.
3848 Wed Apr 13 14:10:30 1994  Francois Pinard  (pinard@icule)
3850         * checks/Makefile.in: Rename .all-stamp to stamp-checks.
3852         * Makefile.in (Makefile, etc.): Adapt for Autoconf 1.8.
3854 Sun Jan 30 14:24:19 1994    (pinard at icule)
3856         * m4.h: Remove definition of volatile, not used anymore.
3857         Reported by Jim Meyering and Joseph E. Sacco.
3859         * m4.h: Consistently use `do { ... } while (0)' in macros, instead
3860         of `if ... else /* nothing */' for if macros.
3861         Reported by Jim Meyering.
3863         * builtin.c (m4_regexp): Reorganize the code for avoiding a
3864         warning from gcc about `repl' possibly used before defined.
3865         Reported by Jim Meyering.
3867         * m4.h: Avoid a pre-ANSI <memory.h> together with <string.h>.
3868         Reported by Jim Meyering.
3870 Tue Jan 25 18:39:37 1994  Francois Pinard  (pinard at icule)
3872         * m4.h: Move the conditional definition of volatile after the
3873         inclusion of system files, because they may define it first.
3875 Tue Jan  4 19:46:50 1994  Francois Pinard  (pinard@icule)
3877         * checks/Makefile.in (CHECKS): Add a useless `*' before `[', to
3878         get around a problem with Alpha make seeing a syntax error, there.
3879         Reported by Vern Paxson.
3881 Mon Jan  3 00:21:45 1994  Francois Pinard  (pinard@icule)
3883         * Makefile.in: Do not define LDFLAGS, use CFLAGS on link calls.
3884         Reported by Richard Stallman.
3886 Sat Dec 25 08:06:05 1993  Francois Pinard  (pinard@icule)
3888         * configure.in: Correct test for strerror, AC_FUNC_CHECK was used
3889         instead of AC_HAVE_FUNCS.
3890         Reported by Noah Friedman.
3892 Wed Dec  1 09:37:53 1993  Francois Pinard  (pinard@icule)
3894         * m4.c: Initialize show_help and show_version to zero.
3896         * m4.c: Ensure EXIT_SUCCESS and EXIT_FAILURE are defined.
3897         Use them in exit() and usage() calls.
3899 Sat Nov 27 10:43:24 1993  Francois Pinard  (pinard@icule)
3901         * m4.h: Delete extern sys_nerr, sys_errlist declarations, and
3902         syserr() macro.  Delete errref, add reference_error and M4ERROR.
3903         * m4.c: Replace errref, which was returning an input reference
3904         string, with reference_error, which prints it on standard error.
3905         * builtin.c, output.c: Use errno as second parameter to error,
3906         instead of using syserr() with %s.
3907         * *.c: Use M4ERROR instead of error: no more errref() with %s.
3908         Doing so, the program name appears after the input reference
3909         instead of before, which eases M-x next-error processing.
3911 Wed Nov 24 22:16:15 1993  Francois Pinard  (pinard@icule)
3913         * checks/get-them: Escape braces with backslashes in patterns,
3914         because HPUX-9.01 awk needs this.
3915         Reported by Jim Meyering.
3917 Mon Nov 22 10:55:52 1993  Francois Pinard  (pinard@icule)
3919         * builtin.c: Declare "FILE *popen ();".
3921         * m4.h: Remove MESSAGE{,1,2}, WARNING1, FATAL{,1}, INTERNAL_ERROR
3922         macros, replace error_message_prefix() declaration by errref()'s.
3923         Declare xrealloc, for use in errref().
3924         * m4.c: Delete error_message_prefix() function, add errref().
3925         * *.c: Use error() systematically in place of all error macros,
3926         now that error() flushes stdout first.  Make needed adjustments.
3928         * m4.h: Remove const in sys_errlist[] declaration, it creates
3929         conflicts on SGI and Alpha.
3930         Reported by Kaveh R. Ghazi.
3932 Sat Nov 20 08:26:15 1993  Francois Pinard  (pinard@icule)
3934         * m4.c: Include <getopt.h> instead of "getopt.h".
3936         * configure.in: Output to config.h.  Use HAVE_FUNCS preferably.
3937         * acconfig.h: New, for documenting HAVE_EFGCVT.
3938         * Makefile.in: Distribute acconfig.h, .stamp-h.in and config.h.in,
3939         use them wherever appropriate.  Also use -I. for compilations.
3940         * lib/Makefile.in: Use -I.. for compilations.
3941         * *.c: Include <config.h> or "config.h".
3943         * m4.h: Test for HAVE_MEMORY_H instead of NEED_MEMORY_H.
3944         * configure.in: Use AC_HAVE_HEADERS(memory.h), delete AC_MEMORY_H.
3946 Wed Nov 17 09:34:55 1993  Francois Pinard  (pinard@icule)
3948         * builtin.c (m4_eval): Cast strlen to (int) before comparing.
3950         * input.c (input_init): Initialize quote and comment strings
3951         explicitely instead of calling set_quotes and set_comment: by
3952         doing so, we ensure we do not free uninitialized variables.
3954         * checks/check-them: Reverse arguments to both diff, so the
3955         expected is on the left and the obtained on the right.
3957         * m4.h: Add MESSAGE{,1,2}, WARNING1, FATAL{,1} and INTERNAL_ERROR
3958         macros. Delete declarations for m4error, warning, fatal and
3959         internal_error, add declaration for error_message_prefix.
3960         * m4.c:  Delete m4error, warning, fatal and internal_error
3961         routines, add error_message_prefix routine.
3962         * *.c: Replace m4error routine calls with MESSAGE* macro calls,
3963         warning with WARNING*, fatal with FATAL* and internal_error with
3964         INTERNAL_ERROR*.
3965         * Makefile.in (_m4.c): Do not adjust ansi2knr output for va_alist,
3966         this is not needed anymore.
3968         * m4.h: Declare extern FILE *debug.  Add DEBUG_PRINT{1,3} and
3969         DEBUG_MESSAGE{,1,2} macros.  Delete declarations for debug_print
3970         and debug_message, add declaration for debug_message_prefix.
3971         * debug.c: Remove static specifier for FILE *debug declaration.
3972         Delete debug_print and debug_message routines, add
3973         debug_message_prefix routine.
3974         * builtin.c, debug.c: Replace debug_print routine calls with
3975         DEBUG_PRINT* macro calls.
3976         * input.c, path.c: Replace debug_message routine calls with
3977         DEBUG_MESSAGE* macro calls.
3979         * m4.h: Remove inclusion of <varargs.h>.
3980         * debug.c: Include <stdarg.h> or <varargs.h>.
3981         (trace_format): Use stdarg instead of varargs if __STDC__.
3983         * configure.in: Remove checks for vfprintf and _doprnt.  These
3984         implementations use varargs tricks which are not portable enough.
3985         * lib/vfprintf.c: Deleted.
3986         * lib/_doprnt.c: Deleted.
3987         * lib/Makefile.in: Adjusted accordingly.  Remove LIBOBJS.
3988         Reported by Joel Sherrill.
3990         * path.c (add_include_directory): Use xstrdup.
3992         * builtin.c (find_builtin_by_name): Declare static.
3994         * *.[ch]: Add const to a few "char *" declarations.
3996         * configure.in: Remove commented tests for fileno() and fstat().
3997         * debug.c: Remove comments about HAVE_FILENO and HAVE_FSTAT.
3999         * debug.c (debug_flush_files): New.
4000         * m4.h: Declares it.
4001         * builtin.c (m4_syscmd, m4_esyscmd): Use it.
4002         Reported by Nicolas Pioch.
4004 Fri Nov 12 10:02:26 1993  Francois Pinard  (pinard@icule)
4006         * Makefile.in (m4.dvi): Use m4.texinfo instead of m4.texi.
4007         Reported by Joel Sherrill.
4009         * builtin.c (prefix_all_builtins): Instead of the table size, use
4010         the null entry at end for stopping the loop.  It was overwritten.
4011         Reported by Andreas Schwab and Jim Meyering.
4013         * builtin.c (prefix_all_builtins): Cast xmalloc to (char *).
4014         Reported by Kaveh R. Ghazi.
4016         * macro.c (call_macro): Add * in (*SYMBOL_FUNC (sym)) (...).
4017         Reported by Karl Vogel.
4019 Tue Nov  9 09:31:47 1993  Francois Pinard  (pinard@icule)
4021         * m4.h: Do not define volatile if already defined.
4022         Reported by Rene' Seindal.
4024         * lib/Makefile.in: Add a forgotten ALLOCA=@ALLOCA@.  Grrr!
4026         Reported by Bernhard Daeubler, Eric Backus, Hal Peterson, Hoang
4027         Uong, Ian Taylor, Kaveh R. Ghazi, Tom McConnell and Walter Wong.
4029 Mon Nov  8 21:11:44 1993  Francois Pinard  (pinard@icule)
4031         * m4.h: Define strchr and strrchr in terms of index and rindex,
4032         instead of the other way around.
4033         * builtin.c, m4.c, path.c: Use strchr instead of index.
4035         * input.c (next_char): Remove a "break;" after a "return ...;".
4036         Reported by Tom McConnell.
4038 Mon Nov  8 12:45:34 1993  Francois Pinard  (pinard@icule)
4040         * Release 1.1
4042         * configure.in: Do not copy check files in the build hierarchy.
4043         * checks/check-them: Identify the m4 version being checked.  For
4044         finding m4, look in $PATH instead of in the parent directory.
4045         * Makefile.in (check): Prepend `pwd` to $PATH before checking.
4046         * checks/Makefile.in (.all-stamp): Always create check files in
4047         the source hierarchy, not anymore in the build hierarchy.
4048         (check): cd to the source hierarchy before performing checks.
4049         Do not copy nor clean COPYING anymore, take it from `..'.
4050         Reported by Tom McConnell.
4052         * Makefile.in (Makefile): Use $(SHELL).
4053         (config.status): Use $(SHELL).  Use "config.status --recheck"
4054         instead of "configure --no-create", which is obsolete.
4055         Reported by Tom McConnell.
4057 Fri Nov  5 09:49:30 1993  Francois Pinard  (pinard@compy.IRO.UMontreal.CA)
4059         * m4.c (usage): Use "%s" instead of "m4" in format string.
4060         Reported by Jim Meyering.
4062         * Makefile.in: Distribute mkinstalldirs.
4063         Reported by Pierre Gaumond.
4064         Reported by Jim Meyering.
4065         Reported by Tom McConnell.
4066         Reported by Andreas Gustafsson.
4068         * checks/check-them: Renamed from checks/check_them.
4069         * checks/get-them: Renamed from checks/get_them.
4070         * checks/.all-stamp: Renamed from checks/.all_stamp.
4071         * checks/Makefile.in: Changed accordingly.
4072         Reported by Jim Meyering.
4074 Thu Nov  4 13:50:52 1993  Francois Pinard  (pinard@lagrande.IRO.UMontreal.CA)
4076         * lib/Makefile.in (dist): Correct permissions on files.
4078         * output.c: Declare tmpfile, some systems don't.
4080 Wed Nov  3 09:09:16 1993  Francois Pinard  (pinard@icule)
4082         * checks/Makefile.in (dist): Correct permissions on files.
4084         * Makefile.in (dist): Ensure recursive linking for subdirectory
4085         `examples', also set read/write permissions on all its files.
4087         * mkinstalldirs: New, from elsewhere.
4088         * Makefile.in: Use it.
4090         * debug.c: Synchronize debug messages and regular output when
4091         the debug file and stdout are redirected to the same file.
4092         * configure.in: Add (commented) checks for fileno and fstat.
4093         Reported by Jim Avera.
4095         * builtin.c (m4_ifelse): Diagnose excess arguments if 5, 8, 11,
4096         etc., arguments, then ignore the superfluous one.  m4 used to
4097         diagnose missing arguments and return the empty string.
4098         Reported by Nick S. Kanakakorn.
4100 Tue Nov  2 00:55:41 1993  Francois Pinard  (pinard@icule)
4102         * m4.c (main): At end of all input, ensure all undiverted text
4103         goes to the main output stream.
4104         Reported by Andreas Gustafsson.
4106         * m4.c (main): exit (0), instead of return 0.
4108         * m4.c: Implement -P and --prefix-builtins.
4109         * builtin.c: Delete const specifier on builtin_tab.
4110         (prefix_all_builtins): New.
4111         Reported by Noah Friedman.
4112         Reported by Scott Bartram.
4114         * c-boxes.el: New, from elsewhere.
4115         * Makefile.in: Distribute it.
4117         * m4.h: Do not define bcopy if <string.h> defines it.
4118         Reported by Stephen Perkins.
4120         * builtin.c (define_macro): Allow a missing second argument, in
4121         which case it is implied empty.  Affects define and pushdef.
4122         Reported by Eric Allman.
4124 Mon Nov  1 07:45:24 1993  Francois Pinard  (pinard@icule)
4126         * m4.h: Add blind_if_no_args in struct builtin, blind_no_args in
4127         struct symbol adn SYMBOL_BLIND_NO_ARGS macro.
4128         * builtin.c: Initialize all the blindness fields in builtin_tab.
4129         (define_builtin): Copy the blindness of a builtin into its symbol.
4130         * macro.c (expand_token): Avoid processing a blind builtin if the
4131         next character is not an opening parenthesis.
4132         Reported by David MacKenzie.
4133         Reported by Noah Friedman.
4135         * configure.in: Ensure an exit status of 0 on completion.
4136         Reported by Vivek P. Singhal.
4138         * eval.c (eval_lex): Admit both lower and upper case letters for
4139         bases greater than 10.  Only lower case letters were accepted.
4141         * eval.c (eval_lex): Recognize 0bDIGITS and 0rRADIX:DIGITS syntax.
4142         Reported by Krste Asanovic.
4144         * eval.c:  Rename NOT to LNOT.  Add XOR, NOT, LSHIFT and RSHIFT.
4145         * eval.c (logical_not_term): New name for not_term.
4146         * eval.c (xor_term): New, between or_term and and_term.
4147         * eval.c (not_term): New, between and_term and logical_not_term.
4148         * eval.c (shift_term): New, between cmp_term and add_term.
4149         Reported by Krste Asanovic: ~, ^, <<, >>.
4150         Reported by Ben A. Mesander: ** vs ^.
4152         * m4.c: Delete xmalloc.c, xrealloc.c, xstrdup.c.
4153         * m4.h: Delete xrealloc.c.
4154         * lib/xmalloc.c: New, from elsewhere.
4155         * lib/xstrdup.c: New, from elsewhere.
4156         * lib/Makefile.in: Distribute and compile them.
4158         * m4.c: Change progname to program_name.
4159         * builtin.c, eval.c, m4.c, m4.h: Rename error to m4error.
4160         * lib/error.c: New, from elsewhere.
4161         * lib/Makefile.in: Distribute and compile error.c.
4162         * configure.in: Check AC_VPRINTF and for strerror.
4163         * m4.c: Delete cmd_error.  Use error instead.
4164         * m4.c: Change label capitalisation to "ERROR", "Warning", etc.
4166         * m4.h: Delete #define const, let Autoconf takes care of this.
4168         * m4.c: Remove all code conditionalized by IMPLEMENT_M4OPTS.
4169         Merge parse_args into main.  Declare argv to be `char *const *',
4170         then remove superfluous casts.
4172         * m4.c: Rename --no-gnu-extensions to --traditional.
4173         Reported by Ben A. Mesander.
4175         * m4.c (usage): Add a status parameter.  Supply one in various
4176         calls.  Add --help processing.  Remove -V for --version.
4178         * lib/Makefile.in: Put $(CFLAGS) last in .c.o rule.
4180         * lib/Makefile.in: Have an AR=ar declaration.
4181         Reported by Eric Backus.
4182         Reported by Bjorn R. Bjornsson.
4183         Reported by Tom Tromey.
4184         Reported by Kristine Lund.
4185         Reported by Marion Hakanson.
4187 Sat Oct 30 12:51:47 1993  Francois Pinard  (pinard@icule)
4189         * Makefile.in (m4.info): Use -I$(srcdir) on $(MAKEINFO).
4190         Reported by Noah Friedman.
4192 Mon Oct 25 14:58:48 1993  Francois Pinard  (pinard@icule)
4194         * Makefile.in: Remove MDEFINES and cleanup.
4196 Wed Jun  9 14:59:46 1993  Francois Pinard  (pinard@icule)
4198         * Makefile.in (dist): Replace "echo `pwd`" by a mere "pwd".
4199         Create a gzip file.
4201 Sat Feb  6 14:59:22 1993  Francois Pinard  (pinard@icule)
4203         * Makefile.in, lib/Makefile.in, check/Makefile.in: In dist goals,
4204         ensure 777 mode for directories, so older tar's will restore file
4205         modes properly.
4207 Sun Jan 17 15:38:05 1993  Francois Pinard  (pinard@icule)
4209         * Makefile.in, lib/Makefile.in: Put $(CFLAGS) after $(CPPFLAGS),
4210         so the installer can override automatically configured choices.
4211         Reported by Karl Berry.
4213 Fri Jan 15 16:07:00 1993  Francois Pinard  (pinard@icule)
4215         * lib/vfprintf.c: Stolen from Oleo distribution and adapted.  The
4216         previous version was not working properly on m68k-hp-bsd4.3.
4217         Reported by Roland McGrath.
4219         * lib/_doprnt.c: Stolen from Oleo distribution.
4220         * configure.in: Check for _doprnt.c if vfprintf.c selected.
4221         * lib/Makefile.in: Distribute _doprnt.c.
4222         Do not distribute regex.[ch].old anymore.
4224 Fri Jan  1 19:42:23 1993  Francois Pinard  (pinard at icule)
4226         * Makefile.in, lib/Makefile.in: Reinstate $(CPPFLAGS), use it.
4227         Richard wants it there.
4229 Sun Dec 27 07:01:54 1992  Francois Pinard  (pinard at icule)
4231         * Makefile.in: Add DEFS to MDEFINES.
4232         * lib/Makefile.in (.c.o): Remove $(CPPFLAGS).
4233         (libm4.a): Remove the library before creating it.
4234         (distclean): Remove tags and TAGS too.
4236 Wed Dec 23 12:46:55 1992  Francois Pinard  (pinard at icule)
4238         * Makefile.in (dvi, m4.dvi): New goals.
4240         * builtin.c, eval.c, format.c, input.c, m4.[ch], m4.texinfo,
4241         macro.c, output.c, path.c, symtab.c: Change Copyright from
4242         1989-1992 to the explicit enumeration 1989, 1990, 1991, 1992.
4244         * examples/divert.m4: Deleted, this bug has been corrected.
4246         * Makefile.in (texclean, mostlyclean): New goals.
4248         * Makefile.in (clean): Remove clutter from ansi2knr.
4249         Reported by Pierre Gaumond.
4250         Reported by Greg A. Woods.
4252 Sun Dec 20 10:40:20 1992  Francois Pinard  (pinard at icule)
4254         * Makefile.in: Remove $(CPPFLAGS) from the .c.o rule.  The user
4255         might well use CFLAGS is s/he needs it.
4257         * Makefile.in: Allow installation of info files from a separate
4258         build directory.
4259         Reported by Jason Merrill.
4260         Reported by David MacKenzie.
4261         Reported by Skip Montanaro.
4262         Reported by Erez Zadok.
4263         Reported by Assar Westerlund.
4265 Sat Dec 19 08:21:34 1992  Francois Pinard  (pinard at icule)
4267         * Release 1.0.3
4268         This is still a beta release for the future GNU m4 version 1.1.
4270         * lib/alloca.c: New, from elsewhere.
4271         * lib/Makefile.in: Distribute it.  Define and use $(ALLOCA).
4273         * m4.h: Do not define index/rindex if already defined.  If
4274         FALSE/TRUE are already defined, do not redefine them, but merely
4275         define boolean typedef to int.
4277         * Makefile.in: Use $(DEFS) while compiling ansi2knr.
4278         * ansi2knr.c: Rewrite #ifdef HAVE_STRING_H || STDC_HEADERS,
4279         because some C compilers do not like connectives with #ifdef.
4280         * m4.h: Define `volatile' only if __GNUC__, instead of once for
4281         __GNUC__ and once for __STDC__.
4282         * lib/regex.h: Leave const alone, AC_CONST will take care of it.
4284         * checks/Makefile.in: Use .all_stamp instead of $(CHECKS) for
4285         Makefile dependencies.  Without it, make keeps destroying and
4286         remaking $(CHECKS) in a loop (why?).  Distribute .all_stamp.
4288         * m4.h, m4.c, builtin.c, output.c: Change all divertion/DIVERTION
4289         to diversion/DIVERSION, this was a spelling error.
4291         * m4.c: Declare version[], remove #include "version.h".
4292         * version.h: Deleted.
4293         * Makefile.in: Remove references to version.h.
4295         * output.c (shipout_text): Centralize all `#line NUM ["FILE"]'
4296         production, by using a simpler and more robust algorithm.  This
4297         solves the problem of synclines sometimes written in the middle of
4298         an output line.  Delete sync_line() and output_lines variable.
4299         * m4.h: Remove sync_line prototype and output_lines declaration.
4300         * input.c (next_char), output.c (shipout_text): Remove references
4301         to output_lines.
4302         * input.c (push_file, pop_file): Merely put the value -1 in
4303         output_current_line instead of calling sync_line, for delaying a
4304         single `#line NUM FILE' before next output line.  Do not test
4305         for sync_output, because this is unnecessary clutter.
4306         * output.c (make_divertion, insert_divertion): Idem.
4307         * input.c: Rename must_advance_line to start_of_input_line, for
4308         consistency.
4310         * debug.c (trace_header): Select a new debug line format, which
4311         better complies with GNU standards for formatting error messages.
4312         With option `-dfl', M-x next-error might be used on the output.
4313         * m4.c (vmesg): Adjust format of error output to GNU standards.
4314         * m4.texinfo: Adjust examples for `make check' to work.
4316         * m4.h, builtin.c, debug.c, input.c, macro.c, path.c: Use upper
4317         case for enum debug_info constants, which were all lower case.
4319         * builtin.c (m4_regexp, m4_patsubst): Use re_search instead of
4320         re_search_2.
4321         * lib/regex.[ch]: Use new version from textutils 1.3.6, with some
4322         collected patches.  I tried a few times using newer regex.[ch], it
4323         mysteriously stopped aborting with this one.  Insecure feeling...
4324         * lib/Makefile.in: Distribute regex.[ch].old, just in case!
4326 Fri Dec 18 11:08:03 1992  Francois Pinard  (pinard at icule)
4328         * m4.c: Change `--no-warnings' to `--silent'.
4329         Reported by David MacKenzie.
4331         * m4.c: Put all M4OPTS code upon IMPLEMENT_M4OPTS control, and
4332         leave it off for now.  See comment in m4.c for justification.
4333         Reported by David MacKenzie.
4335         * configure.in: Replace AC_USG by AC_HAVE_HEADERS(string.h).
4336         * m4.h, ansi2knr.c, lib/regex.h: Replace USG by HAVE_STRING_H.
4338         * Makefile.in: Add a new `info' goal.  Use macro MAKEINFO.
4340         * Makefile.in: Ensure recursive cleaning is done before local
4341         cleaning for all clean goals.
4343         * builtin.c (ntoa): Ensure the value is always interpreted as a
4344         signed quantity, whatever the radix is.
4346 Wed Nov 18 07:57:19 1992  Jim Meyering  (meyering@idefix)
4348         * builtin.c, format.c, input.c: Split long lines.
4349         * m4.c: Use typedef macro_definition instead of struct
4350         macro_definition.
4351         * symtab.c: Use typedef symbol instead of struct symbol.
4353 Tue Nov 17 01:58:40 1992  Francois Pinard  (pinard at icule)
4355         * *.[ch]: Remove all trailing whitespace, in code and comments.
4357         * configure.in: Find some awk.
4358         * Makefile.in: Add $(AWK) to MDEFINES.
4359         * checks/Makefile.in: Transmit $(AWK) to get_them.
4360         * checks/get_them: Use $AWK instead of gawk.  Add a close in the
4361         awk script when switching files, because without this, mawk runs
4362         out of file descriptors.
4364 Mon Nov 16 20:42:56 1992  Francois Pinard  (pinard at icule)
4366         * Makefile.in (realclean): Delete m4.info*.
4367         Reported by Jim Meyering.
4369         * Makefile.in: Adjust and link with checks/Makefile.
4370         * checks/Makefile.in: New.
4371         * configure.in: Output checks/Makefile.
4373         * checks/get_them: Have the dnl header of each test more
4374         recognizable by next-error, also use a better message.
4376 Mon Nov 16 07:48:52 1992  Jim Meyering  (meyering@idefix)
4378         * m4.h [__GNUC__]: Use __volatile__ instead of `volatile.'
4379         And use that only if __GNUC__ since we're using it's GCC-specific
4380         semantics that tell the compiler the associated function doesn't
4381         return.
4383         * builtin.c (substitute): Don't use character as an array index.
4384         (dumpdef_cmp): Make formal arguments `const void *' to avoid
4385         warnings with gcc -W -Wall on systems with qsort prototype.
4386         (m4_errprint): Cast obstack_finish to `char *' to avoid warnings
4387         from gcc -W -Wall.
4389         * eval.c (most functions): Add parentheses to assignments used
4390         as truth values go avoid warnings from gcc -Wall.
4392         * input.c, m4.c, output.c, path.c, symtab.c: Declare static
4393         any functions that don't need external scope.
4395         * builtin.c, debug.c, format.c, m4.c, m4.h, macro.c, symtab.c
4396         (many functions and arrays): Declare `const'.
4398 Sun Nov 15 09:42:09 1992  Francois Pinard  (pinard at icule)
4400         * *.[ch]: Rename nil to NULL, using the declaration from <stdio.h>,
4401         removing the declaration from m4.h.  Also rename false to FALSE
4402         and true to TRUE.
4404         * lib/Makefile.in (Makefile): New goal.
4406         * Makefile.in, lib/Makefile.in: Add a .c.o rule, so CFLAGS is not
4407         so heavily loaded.  It gets more easily overridable, calling make.
4408         Reported by Jim Meyering.
4410         * Makefile.in (dist): Get .fname from the current directory name,
4411         instead of from version.h.  I need updating many files manually,
4412         when the version changes, version.h is just one of them.
4414 Sat Nov 14 11:01:20 1992  Francois Pinard  (pinard at icule)
4416         * m4.h: Remove the tag `boolean' on the enum introducing typedef
4417         `boolean'.  This tag conflicts with <sys/types.h> on SVR4.
4418         Reported by Tom McConnell.
4420 Fri Nov 13 00:12:50 1992  Francois Pinard  (pinard at icule)
4422         * m4.texinfo: Correct the examples for 33.divert, 38.divnum,
4423         39.cleardiv, which were describing missing or spurious newlines.
4424         Modify examples 52.eval, 53.esyscmd and 54.sysval so the results
4425         do not depend on machine word size, `/bin/false' implementation,
4426         or `wc' output format.  `make check' is more dependable, now.
4428         * checks/check_them: Summarize the failed tests by listing their
4429         name, at end.  If none, issue `All checks successful'.  Output
4430         `Checking' instead of `Input file:'.
4432         * checks/get_them, checks/check_them: Reindented.
4434         * Makefile.in (dist): chmod a+r before making the tar file.
4436 Thu Nov 12 14:42:57 1992  Francois Pinard  (pinard at icule)
4438         * builtin.c (m4_dnl): Diagnose any parameter to `dnl'.
4440         * input.c (next_token): Reinitialize token_buttom just after using
4441         it as a watermark with obstack_free.  Or else, a future token, big
4442         enough for triggering reallocation of the obstack chunk, could
4443         void the initialized value of token_buttom, later causing panic in
4444         obstack_free.  Rename token_buttom to token_bottom everywhere.
4446         * m4.h: Before declaring errno, first include <errno.h> and
4447         ensure that it does not define errno.
4448         Reported by Richard Stallman.
4450 Wed Nov 11 17:40:35 1992  Francois Pinard  (pinard at icule)
4452         * builtin.c: Define and use DECLARE macro for builtins.
4454         * builtin.c (m4_ifelse): Avoid any diagnostic when exactly one
4455         argument, this is a common idiom for introducing long comments.
4457         * builtin.c (m4_ifelse): If 3n + 2 arguments, diagnose missing
4458         arguments.  The last argument was silently ignored.
4460         * m4.c (cmd_error): Add a missing semicolon before va_end().
4462 Tue Nov 10 08:57:05 1992  Francois Pinard  (pinard at icule)
4464         * Makefile.in: Now handle protoized sources.  Define and use U.
4465         Compile and use ansi2knr with old compilers.  Update DISTFILES.
4466         Add `aclocal.m4' to `configure' dependencies.
4467         * ansi2knr.c: New, from Ghostscript distribution.
4468         * configure.in: Define U through FP_PROTOTYPES for old compilers.
4469         Add AC_ISC_POSIX, AC_CONST, AC_SIZE_T.
4470         * aclocal.m4: New, provide FP_PROTOTYPES.
4471         * m4.h: Conditionnaly protoized through Args, save for varags.
4472         * builtin.c: Protoized.  Then:
4473         Include <sys/types.h> if size_t is not defined, before "regex.h".
4474         (m4_ifelse): Fetch built-in name properly for diagnostic.
4475         (m4_dumpdef): Remove wrong (char *) cast calling dump_symbol.
4476         (m4_regexp): Add const to `msg' declaration.
4477         (m4_patsubst): Add const to `msg' declaration.
4478         * debug.c: Protoized, save for varargs.
4479         * eval.c: Protoized.
4480         * format.c: Protoized.
4481         * input.c: Protoized.
4482         * m4.c: Protoized, save for varargs.  Then:
4483         (xfree): Accept void * instead of char *.
4484         (xmalloc): Return void * instead of char *.
4485         (xrealloc): Accept and return void * instead of char *.
4486         * macro.c: Protoized.
4487         * output.c: Protoized.
4488         * path.c: Protoized.  Then cast some (char *) over xmalloc's.
4489         * symtab.c: Protoized.
4491 Fri Nov  6 02:05:21 1992  Francois Pinard  (pinard at icule)
4493         * m4.texinfo: Remove directory from diagnostics in 30.include,
4494         51.eval, 56.errprint and 57.m4exit tests.
4496         * m4.h: Remove declarations for int or void system functions, they
4497         cause more conflicting trouble than they make good.
4499         * configure.in: Avoid configuration header file.  Add some tests.
4500         * m4.h: Remove #include "config.h".
4501         * Makefile.in, lib/Makefile.in: Implement Autoconf interface.
4502         Then, rewritten for better compliance with GNU standards.
4504 Thu Nov  5 12:37:13 1992  Francois Pinard  (pinard at icule)
4506         * format.c (format): Avoid syntax error if not HAVE_EFGCVT,
4507         because of a misplaced #endif.
4509         * Many *.[hc] files: Correct intra-line spacing here and there,
4510         according to GNU indent 1.6 advice.
4512         * configure.in: New, using Autoconf 1.2.
4513         * m4.h: Reverse NO_MEMORY_H to NEED_MEMORY_H.
4514         * Delete old configure.in, configure, etc/configure.in,
4515         etc/configure, lib/configure.in, lib/configure and config/*.
4516         Reported by Jason Merrill.
4518         * symtab.c (hash): Change (char) NULL to '\0'.
4519         Reported by Jason Merrill.
4521         * Delete .vers, etc/newdist.sh, etc/newvers.sh and
4522         etc/nextvers.sh.  Release numbers will be edited `by hand'.
4523         * version.h: De-automatize, force value in.
4525         * m4.c: Changes in order to use a newer getopt.h.
4526         Reported by David MacKenzie.
4528         * checks/: New name for examples/.
4529         * checks/get_them: New location for etc/get_examples.
4530         * checks/check_them: New location for etc/check_examples.
4531         * Makefile.in, checks/get_them, checks/check_them: Adjust.
4532         * lib/vfprintf.c: New location for etc/vfprintf.c.
4533         * Delete empty etc/.
4534         * examples/: New name for test/.
4536 Tue Mar 10 00:29:46 1992  Francois Pinard  (pinard at icule)
4538         * Makefile.in (check): Add m4 as dependency.
4540         * m4.c: Accept --no-warnings instead of --no_warnings, and
4541         --no-gnu-extensions instead of --no_gnu_extensions.  Make the
4542         usage message more informative.
4543         Reported by David MacKenzie.
4545 Mon Mar  9 14:53:40 1992  Francois Pinard  (pinard at icule)
4547         * etc/check_examples: New name for check_examples.sh.
4548         * etc/get_examples: New name for get_examples.sh.
4549         * Makefile.in, etc/Makefile.in: Use new names.
4551         * Makefile.in: Transmit $(CC) while making in lib.
4553         * Many *.[hc] files: GNU indent'ed, with further fine tuning of
4554         code disposition by hand.
4556 Sun Mar  8 11:01:55 1992  Francois Pinard  (pinard at icule)
4558         * m4.h: Delete definitions for abort() and exit().
4559         Reported by Richard Stallman.
4561         * config/hmake-unicos, config/s-unicos.h: New files.
4562         Reported by Hal Peterson.
4564         * eval.c (exp_term): Have N^0 return 1.
4565         Reported by Michael Fetterman.
4567         * eval.c, input.c, m4.h: Remove last comma in enums.
4568         Reported by Mike Lijewski.
4570         * Transfer of maintenance duties from Rene' to Franc,ois.
4572 Thu Oct 24 15:18:46 1991  Rene' Seindal (seindal at diku.dk)
4574         * Release 1.0.  Many thanks to those, who provided me with bug
4575         reports and feedback.
4577         * Uses GNU configure, taken from the gdb distribution.
4579         * Uses GNU getopt(), with long option names.
4581         * The -Q/+quiet option is added, which suppresses warnings about
4582         missing or superflous arguments to built-in macros.
4584         * Added default options via the M4OPTS environment variable.
4586         * The built-in format can now be configured to use sprintf as
4587         the formatting engine, for systems without [efg]cvt(3).
4589         * GNU library code is moved to the ./lib subdirectory; other
4590         utility files are now in ./etc.
4592         * Several minor bugs have been fixed.
4594 Fri Jul 26 15:28:42 1991  Rene' Seindal (seindal at diku.dk)
4596         * Fixed various bugs.  Release 0.99, manual 0.09.  Many thanks to
4597         Francois Pinard and Roland H. Pesch for providing me with reports.
4599         * The builtins incr and decr are now implemented without use of
4600         eval.
4602         * The builtin indir is added, to allow for indirect macro calls
4603         (allows use of "illegal" macro names).
4605         * The debugging and tracing facilities has been enhanced
4606         considerably.  See the manual for details.
4608         * The -tMACRO option is added, marks MACRO for tracing as soon
4609         as it is defined.
4611         * Builtins are traced after renaming iff they were before.
4613         * Named files can now be undiverted.
4615         * The -Nnum option can be used to increase the number of
4616         divertions available.
4618         * Calling changecom without arguments now disables all comment
4619         handling.
4621         * The function m4_patsubst() is now consistently declared
4622         static.
4624         * A bug in dnl is fixed.
4626         * A bug in the multi-character quoting code is fixed.
4628         * Several typos in the manual has been corrected.  More probably
4629         persist.
4631         * The m4.info file is now installed along with the program.
4633 Thu Nov 15 21:51:06 1990  Rene' Seindal (seindal at diku.dk)
4635         * Updated and enhanced version.  Release 0.75, manual 0.07.
4637         * Implemented search path for include files (-I option and
4638         M4PATH envronment variable).
4640         * Implemented builtin "format" for printf-like formatting.
4642         * Implemented builtin "regexp" for searching for regular
4643         expressions.
4645         * Implemented builtin "patsubst" for substitution with regular
4646         expressions.
4648         * Implemented builtin "esyscmd", which expands to a shell
4649         commands output.
4651         * Implemented "__file__" and "__line__" for use in error
4652         messages.
4654         * Implemented character ranges in "translit".
4656         * Implemented control over debugging output.
4658         * Implemented multi-character quotes.
4660         * Implemented multi-character comment delimiters.
4662         * Changed predefined macro "gnu" to "__gnu__".
4664         * Changed predefined macro "unix" to "__unix__", when the -G
4665         option is not used.  With -G, "unix" is still defined.
4667         * Changed "shift", "$@" and "$*" to not insert spaces afters
4668         commas.
4670         * Added program name to error messages.
4672         * Fixed two missing null bytes bugs.
4674 Mon Jan 22 21:08:52 1990  Rene' Seindal (seindal at diku.dk)
4676         * Initial beta release.  Release 0.50, manual 0.05.
4678         -----
4680         $Revision$ $Date$
4682         Local Variables:
4683         coding: utf-8
4684         End:
4686         Copyright (C) 1990, 1991, 1992, 1993, 1994, 2000, 2001, 2003,
4687         2005, 2006, 2007, 2008 Free Software Foundation, Inc.
4689         Copying and distribution of this file, with or without
4690         modification, are permitted provided the copyright notice
4691         and this notice are preserved.