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