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