1 2008-02-13 Eric Blake <ebb9@byu.net>
4 * doc/m4.texinfo (Incompatibilities): Use @. after capital.
5 (History): Use @: after abbreviations.
6 (M4exit): Use correct Latin abbreviation.
8 2008-02-11 Eric Blake <ebb9@byu.net>
10 Document behavior of __gnu__().
11 * doc/m4.texinfo (Platform macros): Enhance test.
12 (Macro expansion): New test.
14 Use gnulib's git-merge-changelog driver when available.
15 * .gitattributes: New file.
16 * bootstrap: Install driver, if not already present.
18 2008-02-06 Eric Blake <ebb9@byu.net>
20 Fix security hole introduced 2007-11-22.
21 * src/m4.h (includes): Add quotearg.h.
22 * src/m4.c (m4_verror_at_line): Properly escape macro names.
23 (main): Manage quoteargs defaults.
24 * doc/m4.texinfo (Indir): Document and test this.
26 2008-02-05 Eric Blake <ebb9@byu.net>
28 * m4/gnulib-cache.m4: Import the strtod module.
30 2008-02-02 Eric Blake <ebb9@byu.net>
32 Stage 14: allow pushing argv references.
33 Push a $@ reference to the input engine in one go, rather than
34 pushing each element. For now, argument collection still gets one
35 argument of a $@ at a time; but the penalties of this patch make
36 it easier to manage $@ efficiently in future patches.
37 Memory impact: noticeable penalty, due to larger struct and O(n)
38 to O(n^2) on unboxed recursion.
39 Speed impact: noticeable penalty, due to more bookkeeping.
40 * src/m4.h (struct token_chain): Add comma and quotes fields.
41 (arg_adjust_refcount, arg_print, push_arg_quote): New prototypes.
42 * src/input.c (push_token, pop_input, input_print, peek_input)
43 (next_char_1): Support $@ references.
44 * src/macro.c (struct macro_arguments): Add level field. Match
45 type of arraylen to argc.
46 (collect_arguments): Populate new field.
47 (expand_macro, make_argv_ref, push_arg): Factor...
48 (arg_adjust_refcount, make_argv_ref_token, push_arg_quote):
49 ...into these new methods.
50 (arg_token): Add new parameter.
51 (arg_print): New function.
52 (arg_mark, arg_type, arg_text, arg_equal, arg_empty, arg_len)
53 (arg_func, push_args): Adjust callers.
54 * doc/m4.texinfo (Ifelse): Augment test.
56 2008-01-31 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
58 * checks/Makefile.in: Use @SET_MAKE@, and use @SHELL@ rather
59 than hard-coding /bin/sh.
61 Reported by Lawson Chan.
63 2008-01-27 Eric Blake <ebb9@byu.net>
65 Stage 13: push composite text tokens.
66 Support pushing composite tokens, allowing back-references to be
67 reused through multiple macro expansions. Add hueristic that
68 avoids creating new reference when pushing existing references.
69 Memory impact: noticeable improvement due to better reference
70 reuse, except for O(n) to O(n^2) copying in boxed recursion.
71 Speed impact: slight penalty, due to more bookkeeping.
72 * src/m4.h (push_token): Adjust prototype.
73 * src/input.c (push_token): Add parameter, and handle composite
75 (append_quote_token): Inline short strings.
76 * src/macro.c (push_arg, push_args): Adjust callers.
78 2008-01-26 Eric Blake <ebb9@byu.net>
80 Stage 12: make token_chain a union, add string_pair.
81 Shrink size of symbol chains by using a union. Make passing quote
82 delimiters around more efficient. Other code cleanups.
83 Memory impact: slight improvement, due to smaller struct.
84 Speed impact: slight penalty, due to more bookkeeping.
85 * src/m4.h (STRING): Delete typedef.
86 (struct string_pair, enum token_chain_type): New types.
87 (struct token_chain): Reduce size via a union.
90 * src/builtin.c (ARG): ...from here.
91 (dump_args, define_macro, m4_dumpdef, m4_builtin, m4_indir)
92 (m4_defn, mkstemp_helper, m4_maketemp, m4_mkstemp, m4___file__)
93 (m4___program__, m4_m4wrap, m4_len, m4_index, m4_substr)
94 (m4_regexp, m4_patsubst): Adjust callers.
95 * src/input.c (rquote, lquote, bcomm, ecomm): Delete...
96 (curr_quote, curr_comm): ...replaced by these.
97 (make_text_link, push_token, pop_input, input_print, peek_input)
98 (next_char_1, input_init, set_quotes, set_comment, set_quote_age)
99 (next_token, peek_token): Adjust callers.
100 * src/macro.c (expand_macro, arg_token, arg_mark, arg_text)
101 (arg_equal, arg_len, make_argv_ref, push_arg, push_args):
103 * src/format.c (ARG_INT, ARG_LONG, ARG_STR, ARG_DOUBLE, format):
105 * src/freeze.c (produce_frozen_state): Likewise.
106 * src/debug.c (trace_format, trace_pre): Likewise.
107 (debug_decode): Don't lose partial traces prior to reducing
110 2008-01-22 Eric Blake <ebb9@byu.net>
112 Stage 11: full circle for single argument references.
113 Pass quoted strings through to argument collection in a single
114 action, so that an argument can be reused throughout macro
115 recursion if it remains unchanged.
116 Memory impact: noticeable improvement, due to more reuse in
117 argument collection stacks; O(n^2) to O(n) on boxed recursion.
118 Speed impact: noticeable improvement, due to less copying.
119 * src/m4.h (struct token_chain): Add quote_age member.
120 (struct token_data): Add end member to chain alternate.
121 (make_text_link): New prototype.
122 * src/input.c (CHAR_QUOTE): New macro.
123 (word_start): Pre-allocate.
124 (set_word_regexp): Simplify.
125 (make_text_link): Export, and handle new fields.
126 (next_char, next_char_1): Add parameter.
127 (append_quote_token): New function.
128 (match_input, next_token): Adjust callers to handle quoted input
130 * src/macro.c (struct macro_arguments): Add wrapper member.
131 (expand_argument): Accept composite blocks from input engine.
132 (expand_macro): Reduce refcounts of composite arguments.
133 (collect_arguments, arg_token, arg_mark, make_argv_ref): Update to
135 (arg_type, arg_text, arg_equal, arg_len): Treat composite
137 (push_arg, push_args): Handle composites.
139 2008-01-17 Eric Blake <ebb9@byu.net>
141 Stage 10: avoid extra copying of strings and comments.
142 When collecting tokens that are immune to further expansion, avoid
143 copying data from one obstack to another by outputting it into the
144 destination obstack to begin with. Also reduce copying done in
146 Memory impact: slight improvement, due to better obstack usage.
147 Speed impact: noticeable improvement, due less data copying.
148 * m4/gnulib-cache.m4: Import the intprops and vasnprintf-posix
150 * src/m4.h (includes): Use new gnulib modules.
151 (next_token): Adjust prototype.
152 (bad_argc): New prototype.
153 * src/format.c (arg_int, arg_long, arg_double): New helper
155 (ARG_INT, ARG_LONG, ARG_STR, ARG_DOUBLE): Track missing
157 (format): Improve warnings, and avoid copying into obstack in the
159 * src/input.c (next_token): Add new parameter.
160 (lex_debug): Adjust caller.
161 * src/symtab.c (symtab_debug): Likewise.
162 * src/macro.c (expand_input, expand_token, expand_argument)
163 (collect_arguments): Likewise.
164 * src/output.c (m4_tmpname): Guarantee correct buffer size.
165 * src/builtin.c (builtin_init): Improve efficiency.
167 (ntoa): Tighten buffer allocation.
168 * doc/m4.texinfo (Format): Test the improvements.
169 * NEWS: Document the improvement.
171 2008-01-14 Eric Blake <ebb9@byu.net>
173 Fix --warn-macro-sequence regression from 2007-11-29.
174 * src/builtin.c (define_user_macro): Use correct length.
175 * doc/m4.texinfo (Arguments): Test the fix.
176 (History): Reword to account for new year and eventual result of
179 2008-01-08 Eric Blake <ebb9@byu.net>
182 * NEWS: Update year. Mention effect of my recent memmem
183 contributions to gnulib.
185 2007-12-21 Eric Blake <ebb9@byu.net>
187 Stage 9: share rather than copy single-arg refs.
188 Use hooks of previous patch to create back-references to arguments
189 in the input engine, and inline short text rather than always
190 creating a FIFO link. Also start testing embedded NUL behavior.
191 Until the argument collection engine also shares references, the
192 memory usage increases.
193 Memory impact: noticeable penalty, due to longer life of argv
194 changing O(n) to O(n^2) on boxed recursion.
195 Speed impact: slight improvement, due less data copying.
196 * m4/gnulib-cache.m4: Import quote and memmem modules.
197 * src/m4.h (arg_scratch): New prototype.
198 * src/input.c (INPUT_INLINE_THRESHOLD): New define.
199 (push_token): Use it to inline short text, and save references to
201 (input_init, next_token): Simplify obstack handling.
202 * src/macro.c (expand_argument): Likewise.
203 (expand_macro): Track scratch space.
204 (arg_scratch): New function.
205 (make_argv_ref): Use it.
206 (push_args): Likewise, and simplify comma handling, since most
207 separators are short enough to be inlined.
208 * src/builtin.c (builtin_init): Avoid cast.
209 (m4_errprint, m4_index): Transparently support NUL.
210 (m4_translit): Use scratch space, rather than leaking memory on
212 * doc/m4.texinfo (Syntax): Add new test of embedded NUL.
213 * checks/get-them: Extract test that uses external files.
214 * checks/check-them: Run the new test. Use unified diff if
215 possible, and force text mode when debugging NUL handling.
216 * examples/null.m4: New file.
217 * examples/null.out: Likewise.
218 * examples/null.err: Likewise.
219 * examples/Makefile.am (EXTRA_FILES): Distribute these files.
220 * .gitattributes: Treat new files as text, in spite of embedded
223 2007-12-18 Eric Blake <ebb9@byu.net>
225 Stage 8: extend life of references into argv.
226 Add hooks to lengthen the lifetime of arguments reused in a macro
227 expansion, rather than always discarding arguments at the end of
228 expand_macro. Rework the expand_macro obstacks to handle longer
229 lifetimes. For now, the hooks remain unused.
230 Memory impact: slight penalty, due to larger structs.
231 Speed impact: slight penalty, due to more bookkeeping.
232 * src/m4.h (obstack_regrow): Delete, now that it is unused.
233 (struct token_chain): Add level field.
234 (push_token): Adjust prototype.
235 (adjust_refcount): New prototype.
236 * src/macro.c [DEBUG_MACRO]: Add debugging hooks for $@ reference
238 (argc_stack, argv_stack): Delete, replaced by...
239 (struct macro_arg_stacks, stacks, stacks_count): ...these new
240 structure for tracking $@ references.
241 (expand_input): Initialize new structure.
242 (collect_arguments): Alter signature.
243 (expand_macro): Rework obstack handling, in order to keep $@
244 references alive until they have been rescanned.
245 (adjust_refcount, arg_mark): New functions.
246 (make_argv_ref): Use new field.
247 (push_arg, push_args): Update callers.
248 * src/input.c (make_text_link): Use new field.
249 (push_token): Change signature.
250 (pop_input, next_char_1): Call new function.
251 * doc/m4.texinfo: Clean up some examples of -d option usage.
252 (Ifelse): Add some stress tests.
254 2007-12-13 Eric Blake <ebb9@byu.net>
257 * doc/m4.texinfo (Inhibiting Invocation): Missed one instance in
262 2007-12-13 Paolo Bonzini <bonzini@gnu.org> (tiny change)
264 * doc/m4.texinfo (Inhibiting Invocation): Fix quoting of a quoting
266 Reported by Giovanni Toffetti.
268 2007-12-11 Eric Blake <ebb9@byu.net>
270 Stage 7: add chained token support to input parser.
271 Allow the LIFO input engine to rescan a macro expansion composed
272 of smaller chunks of FIFO data, rather than the old approach of a
273 monolithic string. For now, all chunks are still copied.
274 Memory impact: slight penalty, due to FIFO chain overhead.
275 Speed impact: noticeable penalty, due to extra bookkeeping.
276 * src/m4.h (struct token_chain): Add const safety.
277 (push_token): New prototype.
278 * src/input.c (INPUT_CHAIN): New enumerator.
279 (struct input_block): Add new input type u_c, and change u_s to
280 length-based processing.
281 (make_text_link): New helper function.
282 (push_token): New function.
283 (push_string_finish): Use it.
284 (pop_input, input_print, peek_input, next_char, next_char_1):
285 Adjust to handle new input type.
286 * src/macro.c (push_arg, push_args): Use new function.
288 2007-12-10 Eric Blake <ebb9@byu.net>
290 Stage 6: convert builtins to push arg at a time.
291 Add new methods to factor all builtins whose expansion includes an
292 argument, making back-reference creation easier in future patches.
293 Factor out length-limited printing to obstacks, and use -1 rather
294 than 0 for unlimited length.
296 Speed impact: slight improvement, due to better code sharing.
297 * src/m4.h (includes): Include <limits.h> here, instead of in
299 (input_block): New typedef.
300 (trace_pre, trace_post, push_string_finish): Update prototypes.
301 (obstack_print, input_print, push_arg, push_args): New
303 * src/input.c (push_string_finish): Change return type.
304 (input_print): New function.
305 * src/debug.c (trace_format): Add %B specifier, and use new
307 (trace_pre): Remove redundant argc parameter.
308 (trace_post): Likewise, and change signature.
309 (obstack_print): New function.
310 * src/macro.c (expand_macro): Update caller.
311 (push_arg, push_args): New functions.
312 * src/builtin.c (m4_ifdef, m4_ifelse, m4_shift, m4_substr)
313 (m4_patsubst, expand_user_macro): Use new functions.
314 (mkstemp_helper, m4_maketemp): Avoid extra trailing NULs.
315 * src/m4.c (max_debug_argument_length, main): Set to INT_MAX, not
317 * src/output.c: Update includes.
318 * src/symtab.c: Likewise.
320 2007-12-07 Eric Blake <ebb9@byu.net>
322 Minor security fix: Quote output of mkstemp.
323 * src/builtin.c (mkstemp_helper): Produce quoted output.
324 * doc/m4.texinfo (Mkstemp): Update the documentation and tests.
325 * NEWS: Document this change.
327 Stage 5: add notion of quote age.
328 Cache the quoting rules that were in effect when a string was
329 parsed, to avoid reparsing that string if no changequote or other
330 quote age change took place in the meantime. A quote_age of 0 is
331 always safe, but does not benefit from caching.
332 Memory impact: slight penalty, due to larger struct.
333 Speed impact: slight penalty, due to more bookkeeping.
334 * src/input.c: Comment cleanups.
335 (current_quote_age): New global variable.
336 (set_quote_age): New helper function.
337 (input_init, set_word_regexp): Use it.
338 (set_quotes, set_comment): Likewise, and detect no-op changes.
339 (quote_age, safe_quotes): New functions.
340 (next_token): Track quote age.
341 * src/m4.h (struct token_data): Add quote_age member.
342 (TOKEN_DATA_QUOTE_AGE, quote_age, safe_quotes): New prototypes.
343 * src/macro.c (struct macro_arguments): Add quote_age member.
344 (expand_token): Alter signature and track quote age.
345 (expand_input, expand_argument): All callers changed.
346 (collect_arguments, make_argv_ref): Track quote age.
347 (arg_text, arg_len, arg_func): Detect type mismatch.
348 * doc/m4.texinfo (Ifelse, Changequote): Add more tests.
349 (Incompatibilities): Fix typo.
350 * examples/wraplifo.m4: New file.
351 * examples/Makefile.am (EXTRA_DIST): Distribute it.
353 2007-12-04 Eric Blake <ebb9@byu.net>
355 Fix builds with OpenBSD make.
356 * doc/Makefile.am (HELP2MAN): New macro.
357 (man_MANS, m4.1): Fix rules for building m4.1 into srcdir.
358 * README: Update copyright.
359 * HACKING: Mention help2man and makeinfo dependencies.
361 2007-11-29 Eric Blake <ebb9@byu.net>
363 Stage 4: route indir, builtin through ref; make argv opaque.
364 Finish making struct opaque to all but the input engine, by
365 reworking obstack usage in expand_macro to better support creation
366 of a $@ reference. Canonicalize the empty argument, to allow
367 pointer comparison optimizations.
368 Memory impact: slight penalty, due to larger struct.
369 Speed impact: slight improvement, due to fewer function calls.
370 * src/m4.h (obstack_regrow): Borrow definition from head.
371 (struct token_chain): Add flatten and len members.
372 (arg_equal, arg_empty, make_argv_ref): New prototypes.
373 (struct macro_arguments): Move...
374 * src/macro.c (struct macro_arguments): ...here, making it
375 opaque. Add has_ref member.
376 (empty_token): New placeholder, for optimizing comparison with
378 (collect_arguments): Change signature, and populate new fields.
379 (expand_macro): Alter handling of obstacks.
380 (arg_token): New helper method.
381 (arg_equal, arg_empty, make_argv_ref): New methods.
382 (arg_type, arg_text, arg_len, arg_func): Use new methods.
383 * src/builtin.c (m4_ifelse, m4_builtin, m4_indir, m4_eval):
385 * src/format.c (format): Likewise.
387 Stage 3: cache length, rather than computing it.
388 Cache the length of a token, to avoid repeating lots of strlen
389 calls. Additionally, by using obstack length rather than strlen,
390 the input engine can now support embedded NUL.
391 Memory impact: slight penalty, due to larger struct.
392 Speed impact: noticeable improvement, due to fewer function
394 * src/input.c (next_token): Grab length from obstack rather than
396 * src/m4.h (token_data, macro_arguments): Add length field.
397 (TOKEN_DATA_LEN): New accessor.
398 (define_user_macro): Add parameter.
399 * src/builtin.c (define_user_macro, mkstemp_helper): Use
401 (builtin_init, define_macro, m4_maketemp, m4_mkstemp): Adjust
403 (dump_args, m4_ifdef, m4_ifelse, m4_builtin, m4_indir, m4_eval)
404 (m4_len, m4_substr, m4_translit, m4_regexp, m4_patsubst)
405 (expand_user_macro): Use cached lengths.
406 * src/freeze.c (reload_frozen_state): Adjust callers.
407 * src/m4.c (main): Likewise.
408 * src/macro.c (expand_token, expand_argument, collect_arguments)
409 (arg_len): Use cached length.
410 * doc/m4.texinfo (Mkstemp): Ensure mkstemp does not produce NUL.
412 2007-11-27 Eric Blake <ebb9@byu.net>
414 Stage 2: use accessors, not direct reference, into argv.
415 Outside of macro.c, use accessor methods rather than direct access
416 into the argv struct.
418 Speed impact: slight penalty, due to increased function calls.
419 * src/m4.h (TOKEN_EOF): Alter value, to ease debugging.
420 (arg_argc, arg_type, arg_text, arg_len, arg_func): New
422 * src/macro.c (arg_argc, arg_type, arg_text, arg_len, arg_func):
423 New accessor functions.
424 * src/builtin.c (ARG, dump_args, define_macro, m4_builtin)
425 (m4_indir): Use new accessors.
426 * src/debug.c (trace_pre): Likewise.
427 * src/format.c (ARG_INT, ARG_LONG, ARG_STR, ARG_DOUBLE):
430 2007-11-24 Eric Blake <ebb9@byu.net>
432 Stage 1: convert token_data** into new object.
433 Pass a variable-size wrapper structure instead of an array to
434 builtins, so that subsequent optimizations in the structure need
435 not impact every builtin client.
436 Memory impact: slight penalty, since struct is larger than array.
437 Speed impact: slight penalty, due to increased bookkeeping.
438 * m4/gnulib-cache.m4: Import flexmember module.
439 * src/m4.h (struct macro_arguments, struct token_chain): New
441 (builtin_func): Alter signature.
442 (token_data): Add new TOKEN_COMP alternative.
443 * src/builtin.c: All builtins changed.
444 (ARG, dump_args, define_macro, expand_user_macro): Update to use
446 * src/debug.c (trace_pre, trace_post): Likewise.
447 * src/format.c (ARG_INT, ARG_LONG, ARG_STR, ARG_DOUBLE, format):
449 * src/macro.c (collect_arguments): Build new struct.
450 (call_macro, expand_macro): Update to use new struct.
452 2007-11-22 Eric Blake <ebb9@byu.net>
454 More error messages tied to macro names.
455 * src/input.c (set_word_regexp): Take additional parameter.
456 (input_init): Adjust caller.
457 * src/debug.c (debug_set_file, debug_set_output): Take additional
459 (debug_init): Adjust caller.
460 (expansion_level): Move declaration...
461 * src/m4.h (expansion_level): ...here.
462 (debug_set_output, set_word_regexp): Adjust prototypes.
463 * src/builtin.c (m4_changeword, m4_m4exit, m4_debugfile): Adjust
465 * src/m4.c (main): Likewise.
467 Refactor error messages to avoid macros.
468 * src/m4.h (_): Define, as a placeholder for now.
469 (M4ERROR, M4ERROR_AT_LINE): Delete.
470 (m4_error, m4_error_at_line): Change prototype.
471 (m4_warn, m4_warn_at_line): New prototypes.
472 * src/m4.c (m4_verror_at_line): New helper function.
473 (m4_error, m4_error_at_line): Use new function, and properly call
475 (m4_warn, m4_warn_at_line): New functions.
476 (stackovf_handler, main): All callers changed.
477 * src/builtin.c: Likewise.
478 * src/debug.c: Likewise.
479 * src/eval.c: Likewise.
480 * src/format.c: Likewise.
481 * src/freeze.c: Likewise.
482 * src/input.c: Likewise.
483 * src/macro.c: Likewise.
484 * doc/m4.texinfo (Indir, Builtin, Dumpdef, Incr, Eval, Substr)
485 (Improved forloop): Adjust tests accordingly.
487 Security fix: avoid arbitrary code execution with 'm4 -F'.
488 * src/freeze.c (produce_frozen_state): Never pass raw file name as
490 * NEWS: Document this fix.
492 2007-11-21 Eric Blake <ebb9@byu.net>
494 Consistently report macro name first in messages.
495 * src/m4.h (evaluate): Adjust prototype.
496 * src/builtin.c (bad_argc, numeric_arg, m4_placeholder): Alter
497 wording to match head.
498 (mkstemp_helper, substitute): Adjust signature. All callers
500 (m4_dumpdef, m4_builtin, m4_indir, m4_defn, m4_esyscmd, m4_eval)
501 (m4_undivert, m4_maketemp, m4_m4exit, m4_debugmode)
502 (m4_debugfile, m4_regexp, m4_patsubst): Mention macro name in
504 (m4_format): Adjust call.
505 * src/format.c (format): No longer skip argv[0].
506 * src/eval.c (evaluate): Mention macro name in message.
507 (logical_or_term, logical_and_term, or_term, xor_term, and_term)
508 (equality_term, cmp_term, shift_term, add_term, mult_term)
509 (exp_term, unary_term, simple_term): Adjust signature.
510 * src/macro.c (warn_builtin_concat): Likewise.
511 (expand_argument): Adjust caller.
512 * doc/m4.texinfo (Macro Arguments, Ifdef, Ifelse, Debug Output)
513 (Dnl, Improved fatal_error, Defn, Builtin, Index macro, Regexp)
514 (Substr, Translit, Patsubst, Format, Eval, Dumpdef, Include)
515 (Improved forloop, Indir, Trace, Incr): Adjust tests to match.
517 Make argument checking a bit more sane.
518 * src/builtin.c (bad_argc): Adjust signature, and don't force
519 callers to add 1. Adjust all callers.
520 (numeric_arg): Adjust signature. Adjust all callers.
522 Make dnl diagnostic print macro name.
523 * src/m4.h (skip_line): Adjust prototype.
524 * src/input.c (skip_line): Report error on behalf of caller.
525 * src/builtin.c (m4_dnl): Adjust caller.
526 (dump_args, m4_dumpdef, m4_changequote, m4_changecom)
527 (m4_changeword, m4_traceon, m4_traceoff, expand_user_macro): Use
528 ARG macro instead of open-coding.
529 * doc/m4.texinfo (Dnl): Adjust test.
531 2007-11-20 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
533 * Makefile.am (EXTRA_DIST): gendocs.sh is gone here.
535 2007-11-14 Eric Blake <ebb9@byu.net>
537 Avoid builtin concatenation in macro arguments.
538 * doc/m4.texinfo (Defn): Add tests.
539 * src/macro.c (warn_builtin_concat): New function.
540 (expand_argument): Use it to warn on more corner cases.
541 * NEWS: Mention new warning.
543 2007-11-13 Eric Blake <ebb9@byu.net>
545 Simplify previous patch.
546 * src/input.c (pop_input): Change signature.
547 (push_string_init, next_char_1): Adjust callers.
549 Note: Patches titled Stage 0 through N form a series of patches
550 which decreases the algorithmic complexity of tail recursion in
551 macro expansions from O(n^2) to O(n) in both time and memory, then
552 performs cleanups, such as handling of embedded NUL, made easier
553 by the code refactoring.
555 Stage 0: Fix memory leak in tail recursion.
556 Free expansion text in the input engine as soon as it is parsed,
557 rather than when the recursive expansion completes.
558 Memory impact: noticeable improvement, due to reduction from
559 O(n^2) to O(n) on recursion.
560 Speed impact: minor improvement, due to better memory usage.
561 * src/input.c (push_string_init): Let go of memory earlier.
562 (next_char_1): Make end of string detection reliable.
563 (match_input): Simplify use of push_string_init.
564 * NEWS: Document this fix.
566 2007-11-07 Eric Blake <ebb9@byu.net>
568 * doc/m4.texinfo (Pseudo Arguments): Test more corner cases.
570 2007-11-05 Eric Blake <ebb9@byu.net>
572 Use assert, rather than INTERNAL ERROR.
573 * src/m4.h: Include <assert.h>.
574 * src/builtin.c (m4_dumpdef, define_macro, m4_defn): Use assert.
575 * src/debug.c (trace_pre): Likewise.
576 * src/eval.c (evaluate, cmp_term, shift_term, mult_term):
578 * src/freeze.c (produce_frozen_state): Likewise.
579 * src/input.c (push_string_init, pop_input, init_macro_token)
580 (peek_input, next_char_1, set_word_regexp): Likewise.
581 * src/m4.c (main): Likewise.
582 * src/macro.c (expand_token, expand_argument, call_macro):
584 * src/output.c (make_diversion): Likewise.
585 * src/symtab.c (symtab_init): Likewise.
587 Use build-aux directory.
588 * configure.ac (PACKAGE, VERSION): Delete, since Automake does
590 (AC_CONFIG_AUX_DIR): Add, with auxiliary files in build-aux
591 instead of the top level.
592 * bootstrap: Adjust accordingly.
593 * m4/gnulib-cache.m4: Add --aux-dir option.
594 * doc/Makefile.am (m4.1): Rewrite rule to use build-aux/missing.
596 2007-11-02 Eric Blake <ebb9@byu.net>
598 Update some documentation about version control.
599 * NEWS: M4 is now stored in git.
602 * bootstrap: Likewise.
603 * commit: Delete, now that CVS commits are no longer necessary.
605 Adjust to recent gnulib change.
606 * m4/gnulib-cache.m4: Drop vasprintf-posix and xvasprintf, and use
607 xvasprintf-posix instead.
609 2007-11-01 Eric Blake <ebb9@byu.net>
611 Improve error message when early end of file occurs.
612 * doc/m4.texinfo (Macro Arguments, Changequote, Changecom)
613 (M4wrap): Adjust to new messages.
614 (Improved capitalize): Enhance test.
615 * src/m4.h (next_token): Adjust prototype.
616 * src/input.c (next_token): Add new parameter, and improve error
618 (lex_debug): Adjust callers.
619 * src/symtab.c (symtab_debug): Likewise.
620 * src/macro.c (expand_input, collect_arguments): Likewise.
621 (expand_argument): Likewise, and add parameter.
623 2007-10-31 Eric Blake <ebb9@byu.net>
625 Test more corner cases.
626 * doc/m4.texinfo (Changecom, Pseudo Arguments): Beef up tests.
627 (Improved foreach): Document alternate foreachq style.
628 * examples/foreachq3.m4: New file.
629 * examples/loop.m4: New file.
630 * examples/Makefile.am (EXTRA_DIST): Distribute them.
632 2007-10-28 Eric Blake <ebb9@byu.net>
634 More test coverage for autoconf usage patterns.
635 * doc/m4.texinfo (Inhibiting Invocation, Pseudo Arguments)
636 (Builtin): Add new undocumented tests.
637 (Shift): Document cond macro, and add new test.
639 2007-10-27 Eric Blake <ebb9@byu.net>
641 Document one use of changequote(`(',`)').
642 * doc/m4.texinfo (Changequote): Add new test, based on recent
643 autoconf addition of m4_expand.
645 2007-10-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
647 * examples/Makefile.am (EXTRA_DIST): Add capitalize2.m4.
649 2007-10-24 Eric Blake <ebb9@byu.net>
651 Reduce number of mingw testsuite failures.
652 * doc/m4.texinfo (Using frozen files): Skip test on mingw.
654 2007-10-22 Eric Blake <ebb9@byu.net>
656 Add DEBUG_REGEX debugging information.
657 * src/m4.h (DEBUG_REGEX): New debug macro.
658 * src/m4.c (main) [DEBUG_REGEX]: Open regex trace file when
660 * src/builtin.c (m4_patsubst, m4_regexp, compile_pattern)
661 [DEBUG_REGEX]: Trace regex usage.
663 Never let printf failures go undetected.
664 * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
666 * src/m4.h: Include xprintf.h.
667 * src/format.c (format): Warn on format failures.
668 * src/builtin.c (ntoa): Export.
669 (m4_errprint): Adjust all *printf callers.
670 * src/debug.c (debug_message_prefix, trace_format): Likewise.
671 * src/freeze.c (produce_frozen_state): Likewise.
672 * src/input.c [DEBUG_INPUT]: Likewise.
673 * src/m4.c (usage): Likewise.
674 * src/m4.h (DEBUG_PRINT1, DEBUG_PRINT3, DEBUG_MESSAGE)
675 (DEBUG_MESSAGE1, DEBUG_MESSAGE2): Likewise.
676 * src/output.c (m4_tmpname, shipout_text, freeze_diversione):
678 * src/path.c [DEBUG_INCL]: Likewise.
679 * src/stackovf.c (process_sigsegv) [DEBUG_STKOVF]: Likewise.
680 * src/symtab.c [DEBUG_SYM]: Likewise.
682 2007-10-17 Eric Blake <ebb9@byu.net>
684 Fix 'm4 -F file -t undefined'.
685 * src/freeze.c (produce_frozen_state): Avoid core dump.
686 * doc/m4.texinfo (Using frozen files): Test for the bug.
687 * NEWS: Mention the fix.
689 2007-10-09 Eric Blake <ebb9@byu.net>
691 * NEWS: Document recent speedups.
693 Fix regexp regression of 2007-09-29.
694 * src/builtin.c (substitute): Allow NULL regs when no
695 subexpressions were present.
696 (m4_regexp): Handle \ escapes even with empty regex.
697 * doc/m4.texinfo (Regexp, Patsubst): Catch this bug.
699 Cache regex compilation for another autoconf speedup.
700 * src/m4.h (free_macro_sequence): Rename...
701 (free_regex): ...to this.
702 * src/m4.c (main): Update caller.
703 * src/builtin.c (REGEX_CACHE_SIZE, m4_regex, regex_cache): New
705 (compile_pattern): New function; cache recent regexes.
706 (free_regex): Rename, and clean up additional memory.
707 (m4_regexp, m4_patsubst): Use new function.
709 2007-10-02 Eric Blake <ebb9@byu.net>
711 Document quoting pitfalls in capitalize.
712 * doc/m4.texinfo (Patsubst): Use the examples directory. Also
714 (Improved capitalize): New node.
715 * examples/capitalize.m4: Update to match manual.
716 * examples/capitalize2.m4: New file.
718 2007-10-01 Eric Blake <ebb9@byu.net>
720 Another Autoconf usage pattern optimization.
721 * src/builtin.c (m4_index): Optimize search for one byte.
722 * doc/m4.texinfo (Index macro, Regexp, Patsubst): Test the new
725 2007-09-29 Eric Blake <ebb9@byu.net>
727 Optimize for Autoconf usage pattern.
728 * src/builtin.c (m4_regexp, m4_patsubst): Handle empty regex
731 2007-09-24 Eric Blake <ebb9@byu.net>
733 Create .gitignore alongside .cvsignore.
734 * bootstrap (LC_ALL): Set up front.
735 (version control) Borrow idea from head, to avoid churn in
736 m4/.*ignore files modified by gnulib-tool.
738 2007-09-13 Eric Blake <ebb9@byu.net>
742 2007-09-07 Eric Blake <ebb9@byu.net>
744 * AUTHORS: Simplify, to match libtool and autoconf layout.
745 * THANKS: Sync with head.
747 2007-08-10 Eric Blake <ebb9@byu.net>
749 * doc/m4.texinfo (Compatibility): Sync with head.
751 2007-08-10 Konrad Schwarz <konrad.schwarz@siemens.com> (tiny change)
752 and Eric Blake <ebb9@byu.net>
754 * doc/m4.texinfo (Defn): Update wording.
756 2007-08-09 Eric Blake <ebb9@byu.net>
758 POSIX requires defn(`a',`b') to concatenate definitions.
759 * src/builtin.c (m4_defn): Allow multiple arguments, but warn if
760 trying to mix a builtin with anything else.
761 * doc/m4.texinfo (Defn): Document a use for this POSIX
763 (Incompatibilities): Update to match current status.
764 * NEWS: Document this change.
766 Reported by Konrad Schwarz.
768 2007-08-04 Eric Blake <ebb9@byu.net>
770 Normalize all GPL license notices.
771 * GNUmakefile: Update license wording.
772 * Makefile.am: Likewise.
773 * Makefile.maint: Likewise.
774 * bootstrap: Likewise.
776 * configure.ac: Likewise.
777 * checks/Makefile.in: Likewise.
778 * doc/Makefile.am: Likewise.
779 * examples/Makefile.am: Likewise.
780 * src/Makefile.am: Likewise.
781 * src/builtin.c: Likewise.
782 * src/debug.c: Likewise.
783 * src/eval.c: Likewise.
784 * src/format.c: Likewise.
785 * src/freeze.c: Likewise.
786 * src/input.c: Likewise.
787 * src/m4.c: Likewise.
788 * src/m4.h: Likewise.
789 * src/macro.c: Likewise.
790 * src/output.c: Likewise.
791 * src/path.c: Likewise.
792 * src/stackovf.c: Likewise.
793 * src/symtab.c: Likewise.
795 2007-07-21 Eric Blake <ebb9@byu.net>
797 Fix regression on NetBSD from 2007-05-28.
798 * src/output.c (m4_tmpopen): Explicitly reset append-mode stream
800 * NEWS: Document this fix.
802 Reported by Thomas Klausner.
804 2007-07-20 Eric Blake <ebb9@byu.net>
806 Fix 'make distcheck' issues.
807 * Makefile.am (EXTRA_DIST): No need to distribute
808 gpl-3.0.texi.diff anymore.
809 * m4/gnulib-cache.m4: Update to latest gnulib.
811 2007-07-14 Eric Blake <ebb9@byu.net>
813 Reflect upstream license .texi changes.
814 * doc/m4.texinfo (Copying): Rename node...
815 (GNU General Public License): ...to this.
816 (GNU Free Documentation License): Adjust node location.
817 * local/doc/gpl-3.0.texi.diff: Remove file.
819 2007-07-10 Eric Blake <ebb9@byu.net>
822 * configure.ac (AC_INIT): Bump version number.
823 * NEWS: Start changes since 1.4.10.
824 * doc/m4.texinfo (History): Mention 1.4.11.
825 (Copying This Package, Copying This Manual): Add index entries.
826 * local/lib/version-etc.c.diff: Delete, now that gnulib has been
828 * Makefile.am (EXTRA_DIST): Remove dead file.
830 2007-07-09 Eric Blake <ebb9@byu.net>
833 * doc/Makefile.am (m4_TEXINFOS): Distribute gpl-3.0.texi.
834 * Makefile.am (EXTRA_DIST): Distribute gnulib diffs.
835 * configure.ac (AC_INIT): Bump version number.
836 * NEWS: Describe changes since 1.4.9.
838 * src/format.c: Missed a GPLv3 conversion.
840 Avoid undefined behavior of %.*c in printf.
841 * src/format.c (format): Special case %c.
842 * TODO: Document that more remains to be done.
843 * NEWS: Document the fix.
845 2007-07-05 Eric Blake <ebb9@byu.net>
847 Fix up gnulib-tool usage.
848 * m4/gnulib-cache.m4: Change local-dir to local, not `.'.
849 * version-etc.c.diff: Move to...
850 * local/lib/version-etc.c.diff: ...here.
851 * gpl-3.0.texi.diff: Move to...
852 * local/doc/gpl-3.0.texi.diff: ...here.
854 2007-07-04 Eric Blake <ebb9@byu.net>
856 Upgrade to GPL version 3 or later.
857 * bootstrap: Pick up GPLv3.
858 * m4/gnulib-cache.m4: Augment with 'gnulib-tool
859 --local-dir=. --import gpl-3.0'.
860 * doc/m4.texinfo (Copying This Package): New appendix.
861 * NEWS: Mention this change.
862 * README: Mention why some files still claim to be version 2.
863 * version-etc.c.diff: New file, to make sure --version claims
864 correct GPL version. Temporary until gnulib makes move.
865 * gpl-3.0.texi.diff: New file, to allow inclusion of GPLv3 as
866 appendix, rather than section, of the manual.
867 * GNUmakefile: Update to new license.
868 * Makefile.am: Likewise.
869 * Makefile.maint: Likewise.
871 * configure.ac: Likewise.
872 * checks/Makefile.in: Likewise.
873 * doc/Makefile.am: Likewise.
874 * examples/Makefile.am: Likewise.
875 * src/Makefile.am: Likewise.
876 * src/builtin.c: Likewise.
877 * src/debug.c: Likewise.
878 * src/eval.c: Likewise.
879 * src/freeze.c: Likewise.
880 * src/input.c: Likewise.
881 * src/m4.c: Likewise.
882 * src/m4.h: Likewise.
883 * src/macro.c: Likewise.
884 * src/output.c: Likewise.
885 * src/path.c: Likewise.
886 * src/stackovf.c: Likewise.
887 * src/symtab.c: Likewise.
889 2007-06-26 Eric Blake <ebb9@byu.net>
891 * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import assert'.
893 2007-06-26 Karl Berry <karl@freefriends.org> (tiny change)
895 Match Free Software Directory categories.
896 * doc/m4.texinfo (dircategory): Update.
898 2007-05-31 Eric Blake <ebb9@byu.net>
900 * src/output.c (output_text): Fix regression from 2007-05-28.
901 * doc/m4.texinfo (History): Mention 1.4.10.
902 (Format): Make testsuite output easier to debug.
904 2007-05-29 Eric Blake <ebb9@byu.net>
907 * configure.ac (AC_INIT): Bump version number.
908 * NEWS: Start changes since 1.4.9b, and fix typo.
911 * configure.ac (AC_INIT): Bump version number.
912 * NEWS: Describe changes since 1.4.9.
914 Improve format support.
915 * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
917 * src/format.c (format): Parse %'hhd, %a, %A. Avoid calling
918 printf with too few arguments, as in format(%*.*d,-1,-1,1).
919 * doc/m4.texinfo (Format): Expand tests, and improve
921 * NEWS: Document this change.
923 2007-05-28 Eric Blake <ebb9@byu.net>
925 Fix large diversion corner cases, including 1.4.8 regression.
926 * src/output.c (m4_tmpfile, m4_tmpopen): Simplify use of errno.
927 (make_room_for): Use NULL, not 0, for pointers.
928 (insert_diversion_helper): Avoid using rewind.
929 (freeze_diversions): Allow freezing large diversions.
930 * NEWS: Document this fix.
932 Also run gnulib unit tests during make check.
933 * m4/gnulib-cache.m4: Augment with 'gnulib-tool
934 --tests-base=tests --with-tests'.
935 * configure.ac (AC_CONFIG_FILES): Build gnulib testdir.
936 * Makefile.am (SUBDIRS): Run gnulib tests before ours.
938 2007-05-25 Eric Blake <ebb9@byu.net>
940 Backport prompts in examples from head.
941 * src/macro.c (expand_macro): Shorten message.
942 * doc/m4.texinfo (Manual, Command line files, Comments)
943 (Inhibiting Invocation, Macro Arguments, Macro expansion, Indir)
944 (Builtin, Shift, Forloop, Foreach, Dumpdef, Trace, Debug Levels)
945 (Debug Output, Include, Format, Syscmd, Mkstemp, Location)
946 (Using frozen files, Improved forloop, Improved foreach): Add
948 * checks/get-them: Ignore prompts in examples.
950 Fix sync line interaction with multiline comments.
951 * doc/m4.texinfo (Other Incompatibilities): Add example, and
952 document bug in --syncline/divert interaction.
953 (Preprocessor features): Augment test.
954 * src/m4.h (output_text): Export.
955 (shipout_text, next_token): Add parameter.
956 * src/freeze.c (reload_frozen_state): Don't interfere with
957 synclines when reloading state.
958 * src/output.c (output_text): Export.
959 (shipout_text): Take new parameter for start line of token.
960 Output at most one syncline per token.
961 * src/input.c (next_token): Report line where multiline tokens
963 * src/macro.c (expand_input, expand_token, expand_argument):
964 Adjust callers so that line is passed from input to output.
965 * NEWS: Document this fix.
966 Reported by Sergey Poznyakoff.
968 Test -s in testsuite.
969 * doc/m4.texinfo (Preprocessor features): Add a test.
970 * checks/get-them: Support extra options in testsuite.
971 * checks/check-them (examples): Use extra options.
973 Reported by Sergey Poznyakoff.
975 2007-05-24 Eric Blake <ebb9@byu.net>
977 Support POSIX flush semantics on all platforms.
978 * m4/gnulib-cache.m4: Remove closeout, and augment with
979 'gnulib-tool --import closein fflush'.
980 * src/m4.h (includes): Use closein, not closeout.
981 * src/m4.c (main): Ensure stdin is flushed when not all input is
983 (process_file): No return needed.
984 * src/debug.c (debug_flush_files): Rely on gnulib module, rather
985 than excluding mingw.
986 * NEWS: Document this change.
988 Work around cygwin and mingw fseeko bugs.
989 * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import fseeko'.
990 * src/debug.c (debug_flush_files): Prefer fseeko over fseek.
992 2007-04-25 Eric Blake <ebb9@byu.net>
994 Fix negative division within eval, regression of 2007-01-06.
995 * doc/m4.texinfo (Eval): Catch this bug.
996 * src/eval.c (mult_term): Fix it.
997 * NEWS: Document this.
999 Reported by Cesar Strauss.
1001 2007-04-23 Eric Blake <ebb9@byu.net>
1004 * configure.ac (AC_INIT): Bump version number.
1005 * NEWS: Start changes since 1.4.9.
1007 2007-03-23 Eric Blake <ebb9@byu.net>
1010 * configure.ac (AC_INIT): Bump version number.
1011 * NEWS: Describe changes since 1.4.8b.
1013 2007-03-16 Eric Blake <ebb9@byu.net>
1015 * doc/m4.texinfo (Mkstemp): Tweak wording.
1016 * src/output.c (output_init): Adjust to latest gnulib.
1018 2007-03-15 Eric Blake <ebb9@byu.net>
1020 Avoid Tandem/NSK's broken long long (without a symmetric unsigned
1021 long long, it confuses gnulib).
1022 * configure.ac (AC_TYPE_LONG_LONG_INT): Declare long long broken
1023 if unsigned long long doesn't work.
1025 Reported by Matthew Woehlke.
1027 2007-03-07 Eric Blake <ebb9@byu.net>
1030 * doc/m4.texinfo: Minor tweaks, avoid makeinfo warning.
1032 2007-03-01 Eric Blake <ebb9@byu.net>
1034 * doc/m4.texinfo: Pick up more index entries from head. Follow
1035 more texinfo recommendations.
1036 (Sysval): Improve tests.
1038 Avoid overfull \vbox warning from texinfo, due to indices that
1039 weren't quite big enough to split across page boundaries.
1040 * doc/m4.texinfo: Add lots of concept index entries.
1041 (Concept Index): Move to be last, as recommended by texinfo
1043 (Define, Arguments, Pseudo Arguments): Add more function entries.
1045 2007-02-28 Eric Blake <ebb9@byu.net>
1047 * doc/m4.texinfo (Eval): Clean up wording to reflext POSIX XCU ERN
1049 (Pseudo Arguments): Add useful example.
1051 * doc/m4.texinfo (Pushdef, Incompatibilities): Clean up wording to
1052 reflect POSIX XCU ERN 118.
1054 * src/m4.h (DEFAULT_MACRO_SEQUENCE): Factor out from...
1055 * src/m4.c (usage): ...here,...
1056 * src/builtin.c (set_macro_sequence): ...and here.
1057 (define_user_macro): Fix typo.
1058 * doc/m4.texinfo (Preprocessor features, Arguments): Fix minor
1060 (Shift): Document composite macro argn for portably getting at
1061 positional parameters beyond 9.
1062 * configure.ac (AC_INIT): Bump version number.
1063 * NEWS: Start changes of 1.4.8c.
1065 2007-02-24 Eric Blake <ebb9@byu.net>
1067 Beta Release 1.4.8b:
1068 * configure.ac (AC_INIT): Bump version number.
1069 * NEWS: Describe changes since 1.4.8.
1071 Reserve all uses of raw ${} in macro definitions, not just
1073 * src/builtin.c (set_macro_sequence): Change default macro
1075 * doc/m4.texinfo (Operation modes): Update to match.
1076 * src/m4.c (usage): Likewise.
1079 2007-02-23 Eric Blake <ebb9@byu.net>
1081 * src/m4.h (includes): Update to latest gnulib.
1083 2007-02-08 Eric Blake <ebb9@byu.net>
1085 Rename --warn-syntax to --warn-macro-sequence[=regex], to make it
1086 more flexible, and so that autoconf can use it.
1087 * src/m4.h (set_macro_sequence, free_macro_sequence): New
1089 * src/builtin.c (macro_sequence_buf, macro_sequence_regs)
1090 (macro_sequence_inuse, set_macro_sequence, free_macro_sequence):
1091 New variables and functions.
1092 (define_user_macro): Allow flexibility in regular expression used
1094 * src/m4.c (warn_syntax): Delete.
1095 (usage, WARN_MACRO_SEQUENCE_OPTION, main): Implement changed
1096 spelling of option, along with optional argument.
1097 * doc/m4.texinfo (Operation modes, Arguments): Document this
1099 * NEWS: Document this change.
1101 2007-02-05 Eric Blake <ebb9@byu.net>
1103 * m4/gnulib-cache.m4: Module strstr no longer exists.
1105 Avoid bool bitfields, as they don't work on AIX.
1106 * src/m4.h (bool_bitfield): New typedef.
1107 (struct symbol, struct builtin): Use it.
1108 * src/input.c (struct input_block): Likewise.
1109 Reported by Albert Chin.
1111 * doc/m4.texinfo (Sysval): Avoid SIGPIPE in test as unreliable.
1112 Reported by Albert Chin.
1115 2006-06-18 Bruno Haible <bruno@clisp.org> (tiny change)
1117 * doc/m4.texinfo (Input processing): Further clarifications.
1119 2007-02-03 Eric Blake <ebb9@byu.net>
1121 * doc/m4.texinfo (Input processing, Quoting Arguments): Beef up
1123 Reported by Bruno Haible.
1125 2007-02-01 Eric Blake <ebb9@byu.net>
1127 * src/m4.c (fatal_warnings): New variable.
1128 (usage): Document new -E behavior.
1129 (main): Make -E an additive option.
1130 (m4_error, m4_error_at_line): Change exit status when required.
1131 * NEWS: Document this change.
1132 * doc/m4.texinfo (Operation modes): Likewise.
1133 Reported by Ralf Wildenhues.
1135 2007-01-27 Eric Blake <ebb9@byu.net>
1137 * src/m4.h (warn_syntax): Declare.
1138 (init_pattern_buffer): Export.
1139 * src/m4.c (warn_syntax, usage, WARN_SYNTAX_OPTIONS)
1140 (long_options, main): Implement new option.
1141 * src/builtin.c (init_pattern_buffer): Allow NULL regs argument.
1142 (define_user_macro): Warn on $11 and ${1} if requested.
1143 * src/input.c (init_pattern_buffer): Delete duplicate method.
1144 * doc/m4.texinfo (Operation modes): Document it.
1145 (Arguments): Document future direction of ${11} vs. $11.
1146 (Incompatibilities): Fix wording on POSIX limitations.
1147 * checks/get-them: Parse @{ and @} correctly.
1148 * NEWS: Document this change.
1150 2007-01-26 Eric Blake <ebb9@byu.net>
1152 * src/builtin.c (includes): Adjust to gnulib changes.
1154 2007-01-15 Eric Blake <ebb9@byu.net>
1156 * doc/m4.texinfo: Pull in various improvements from head.
1157 * src/builtin.c (include): Alter exit status on failure.
1158 * NEWS: Document this fix.
1160 2007-01-13 Eric Blake <ebb9@byu.net>
1162 * configure.ac (AC_CHECK_MEMBERS): Check for stack_t.ss_sp, and
1163 assume the fallback of ss_base for BSDI 4.0.1.
1164 * src/stackovf.c (setup_stackovf_trap) [HAVE_SIGALTSTACK &&
1165 ! HAVE_STACK_T_SS_SP]: Use this check.
1166 Reported by Chris McGuire.
1168 * NEWS: Document the improvement.
1170 2007-01-09 Eric Blake <ebb9@byu.net>
1172 * src/eval.c (ASSIGN): New enumerator.
1173 (eval_lex): Recognize '='.
1174 (equality_term): Treat '=' like '==', but warn that it is
1176 * doc/m4.texinfo (Eval): Document and test this.
1177 (Incompatibilities): Document the POSIX incompatibility.
1178 * NEWS: Document this change.
1180 2007-01-06 Eric Blake <ebb9@byu.net>
1182 * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import stdint'.
1183 * checks/check-them: Record expected exit status.
1184 * checks/get-them: Check exit status.
1185 * src/m4.h (eval_t, unsigned_eval_t): Delete, use POSIX int32_t
1187 * src/builtin.c: All users changed.
1188 * src/eval.c: Likewise. Also document where we are triggering
1189 undefined or implementation-defined behavior.
1190 (BADOP, NEGATIVE_EXPONENT, INVALID_OPERATOR, eval_lex, evaluate)
1191 (logical_or_term, logical_and_term, logical_not_term, not_term)
1192 (equality_term, unary_term): Port from head to follow POSIX
1194 (exp_term): Reject 0**0 as undefined.
1195 * doc/m4.texinfo (History): Mention 1.4.9.
1196 (Format, Incompatibilities): Update to document POSIX compliance.
1197 * NEWS: Document this change.
1199 2007-01-04 Eric Blake <ebb9@byu.net>
1201 * NEWS: Document previous fix.
1204 2007-01-04 Sami Liedes <sliedes@cc.hut.fi> (tiny change)
1206 Fix Debian bug 405594, introduced 2006-11-01 from a bad
1207 copy-n-paste from head.
1208 * src/m4.c (main): Use correct file name after --.
1210 2007-01-04 Eric Blake <ebb9@byu.net>
1212 Fix regression from 1.4.7 in large file handling on some
1213 platforms, introduced on 2006-10-13.
1214 * configure.ac (AC_LARGE_SYSFILE): Guarantee that large files
1216 * NEWS: Document this fix.
1218 2007-01-03 Eric Blake <ebb9@byu.net>
1220 * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
1222 * src/m4.c (AUTHORS, main): Use FSF wording for --version (plus
1223 it bumps the copyright year).
1225 2006-12-27 Eric Blake <ebb9@byu.net>
1227 * doc/m4.texinfo (Patsubst): Fix typo.
1229 2006-12-16 Eric Blake <ebb9@byu.net>
1231 * src/m4.c (main): Check for errors when closing stdin.
1233 2006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1235 * doc/m4.texinfo: Fix some typos.
1237 2006-12-09 Eric Blake <ebb9@byu.net>
1239 * configure.ac (AC_INIT): Bump version number.
1240 * NEWS: Start changes of 1.4.8a.
1242 2006-11-20 Eric Blake <ebb9@byu.net>
1245 * configure.ac (AC_INIT): Bump version number.
1246 * NEWS: Describe changes since 1.4.7.
1248 2006-11-16 Eric Blake <ebb9@byu.net>
1250 * doc/m4.texinfo (Include, Search Path, Diversions, Divert):
1251 Minor tweaks noticed while porting to head.
1253 2006-11-14 Eric Blake <ebb9@byu.net>
1255 * src/output.c (cleanup_tmpfile, freeze_diversions): Clean up
1257 (m4_tmpname): Avoid memory leak.
1259 2006-11-13 Eric Blake <ebb9@byu.net>
1261 * src/output.c (cleanup_tmpfile): Avoid double error message when
1262 umask is prohibitive.
1263 (m4_tmpname, m4_tmpopen, m4_tmpclose, m4_tmpremove): New
1265 (m4_tmpfile): Add parameter, move cloexec action here.
1266 (make_room_for): Adjust caller. Don't keep too many files open.
1267 (insert_diversion_helper): Unlink emptied temp files.
1268 (make_diversion): Don't keep too many files open.
1269 * doc/m4.texinfo (Diversions): Tweak wording, now that open file
1270 descriptors are no longer a limiting factor.
1271 * NEWS: Document this change.
1273 Backport sparse diversion handling from head.
1274 * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
1276 * src/output.c (struct m4_diversion): Rename from struct
1277 diversion, and update members. All users changed.
1278 (diversion_table): Change to an ordered set, instead of an array.
1279 (div0): New storage for diversion 0.
1280 (diversions): No longer needed.
1281 (free_list): New list to allow recycling diversion storage.
1282 (diversion_storage): New storage to reduce malloc overhead.
1283 (cmp_diversion_CB, threshold_diversion_CB): New callbacks.
1284 (output_init, output_exit, cleanup_tmpfile, make_room_for)
1285 (make_diversion): Handle new diversion storage scheme.
1286 (insert_diversion_helper): New function.
1287 (insert_diversion, undivert_all, freeze_diversions): Use it.
1288 * doc/m4.texinfo (Divert, Diversions): Move hidden test of memory
1289 exhaustion to visible test of large diversion numbers.
1290 * NEWS: Document this fix.
1292 2006-11-11 Eric Blake <ebb9@byu.net>
1294 * src/builtin.c (m4_translit): Slight optimization.
1296 * src/m4.h (to_uchar): Depend on HAVE_INLINE.
1298 * src/builtin.c: Remove unnecessary casts.
1299 (expand_ranges): Make 8-bit clean.
1300 * doc/m4.texinfo (Translit): Add tests and wording.
1301 * NEWS: Document this fix.
1303 2006-11-07 Eric Blake <ebb9@byu.net>
1305 * src/m4.h (output_exit): New prototype.
1306 * src/m4.c (main): Use it.
1307 * src/output.c (cleanup_tmpfile): Close files before removing
1309 (insert_diversion): Check for failure.
1310 (output_exit): Avoid memory leak.
1311 * doc/m4.texinfo (Diversions): Test this bug.
1313 * doc/m4.texinfo (Esyscmd, Errprint): Minor touchups.
1315 2006-11-01 Eric Blake <ebb9@byu.net>
1317 Allow C++ compilation on Linux, as a safety measure in type
1319 * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
1321 * src/m4.h (hack_symbol, hack_all_symbols): Use full prototype.
1322 (boolean): Kill this, and use stdbool.h instead.
1323 * src/debug.c, src/eval.c, src/input.c, src/macro.c, src/m4.c:
1324 * src/output.c, src/symtab.c: All users changed.
1325 * src/symtab.c (hack_all_symbols): Update prototype.
1326 * src/builtin.c (dump_symbol, set_trace): Update signature.
1327 (m4_dumpdef, m4_traceon, m4_traceoff): Update callers.
1328 (mkstemp_helper, m4_m4wrap, expand_ranges, m4_translit): Allow
1330 * src/debug.c (trace_flush): Likewise.
1331 * src/freeze.c (reload_frozen_state): Likewise.
1332 * src/input.c (push_file, push_string_finish, push_wrapup):
1333 (token_bottom, next_token): Likewise.
1334 * src/m4.c (main): Likewise.
1336 * doc/m4.texinfo (Invoking m4): Update according to POSIX 200x
1338 * src/m4.h (m4_path_search): Tweak signature.
1339 * src/path.c (m4_path_search): Likewise.
1340 * src/builtin.c (include): Update caller.
1341 * src/m4.c (main): Allow -D, -U, -t, and -s to be interspersed
1342 with file names. Don't write to **argv.
1343 (process_file): New helper method.
1344 * NEWS: Document this fix.
1346 2006-10-31 Eric Blake <ebb9@byu.net>
1348 * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import strstr'.
1349 * doc/m4.texinfo (Translit): Improve the documentation.
1350 * src/builtin.c (m4_translit): Optimize to O(n) instead of O(n^2)
1352 (m4_index): Simplify, and speed up slightly.
1353 * NEWS: Document this fix.
1355 2006-10-28 Eric Blake <ebb9@byu.net>
1357 * src/input.c (set_quotes): Don't allow empty end-quote with
1358 non-empty start-quote.
1359 (set_comment): Likewise for end-comment.
1360 * src/builtin.c (m4_changecom): Adjust caller.
1361 * doc/m4.texinfo (Changequote, Changecom): Update documentation to
1363 (Incompatibilities): Document another POSIX bug.
1364 * NEWS: Mention this change.
1366 2006-10-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1368 * examples/Makefile.am (EXTRA_DIST): Distribute recently-added
1371 2006-10-26 Eric Blake <ebb9@byu.net>
1373 Silence -Wwrite-strings -Wpointer-arith warnings.
1374 * src/builtin.c (define_user_macro): Allow NULL argument.
1375 (m4_builtin, m4_indir): Cast away const of "".
1376 * src/format.c (format): Likewise.
1377 * src/macro.c (collect_arguments): Likewise.
1378 (expand_macro): Avoid math on void*.
1379 * src/m4.c (main): Adjust caller.
1380 * src/output.c (freeze_diversions): Detect off_t overflow.
1382 * src/input.c (pop_input): Remove unnecessary code.
1384 2006-10-25 Eric Blake <ebb9@byu.net>
1386 * src/symtab.c (symtab_init): Avoid size_t overflow.
1387 * src/output.c (make_diversion): Avoid size_t overflow.
1388 * doc/m4.texinfo (Diversions): Test this fix.
1389 * src/input.c (input_block): Remove unused member. Reduce size
1391 (push_file, pop_input): Avoid useless assignment.
1392 * NEWS: Document the bug fix.
1394 Redo location tracking. Instead of having just files track the
1395 line to return to when popping input, now all input blocks track
1397 * src/input.c (INPUT_STRING_WRAP, INPUT_FILE_INIT): No longer
1399 (input_block): Have line and file storage for all input types, and
1400 rename some members.
1401 (input_change): New global flag.
1402 (push_file, push_macro, push_string_init, push_wrapup): Store
1404 (push_string_finish, pop_input, pop_wrapup): Notice changes in
1406 (peek_input): Adjust to new member names.
1407 (next_char, next_char1): Adjust location if needed.
1408 (skip_line): Simplify restoring location.
1409 * doc/m4.texinfo (Location): Augment the test to catch line
1410 location of expansion of multi-line arguments.
1411 Reported by Stepan Kasal.
1413 2006-10-23 Eric Blake <ebb9@byu.net>
1415 * doc/m4.texinfo (Macro Arguments): Document that leading space
1416 in argument collection stops at macro expansion.
1417 (Incompatibilities): Document POSIX whitespace wording issue.
1419 2006-10-20 Eric Blake <ebb9@byu.net>
1421 * doc/m4.texinfo: Trailing '@comment' doesn't format nicely in
1422 TeX, so recognize '@w{ }' instead. Likewise, @code{_name} at the
1423 end of a TeX line splits incorrectly.
1424 (Foreach, Improved foreach): Write these sections, borrowing ideas
1425 from CVS head and from m4sugar.
1426 * checks/get-them: Accomodate new way to show trailing space in
1428 * examples/foreach.m4: Make usable in documentation.
1429 * examples/foreachq.m4: New file.
1430 * examples/foreachq2.m4: New file.
1431 * examples/foreach2.m4: New file.
1432 * NEWS: Document the documentation updates.
1434 2006-10-19 Eric Blake <ebb9@byu.net>
1436 * src/builtin.c (mkstemp_helper, m4_mkstemp): New functions.
1437 (m4_maketemp): Provide traditional behavior.
1438 * doc/m4.texinfo (Mkstemp): Rename from Maketemp. Document the
1439 new `mkstemp' macro and the flaws of the old `maketemp'.
1440 (Incompatibilities): Move maketemp discussion to...
1441 (Extensions): ...here, since -G now supresses the GNU extension.
1442 * NEWS: Document this.
1444 * examples/forloop.m4: Simplify.
1445 * examples/forloop2.m4: New file.
1446 * examples/quote.m4: New file.
1447 * doc/m4.texinfo (Loops): Rename to...
1448 (Shift): ...this node.
1449 (Forloop, Foreach, Improved forloop, Improved foreach): New
1452 2006-10-17 Eric Blake <ebb9@byu.net>
1454 * m4/gnulib-cache.m4: Update with 'gnulib-tool --import
1456 * configure.ac (AC_CONFIG_HEADERS): Create config.h alongside
1457 gnulib headers, rather than in top directory.
1458 * src/Makefile.am (AUTOMAKE_OPTIONS): Add nostdinc, to reduce make
1461 2006-10-16 Eric Blake <ebb9@byu.net>
1463 * doc/m4.texinfo: Backport some minor cleanups from head.
1464 (Cleardivert): Rename from cleardiv.
1466 * doc/m4.texinfo (Invoking m4): Promote to a chapter, instead of
1467 a section of Preliminaries.
1468 (Operation modes, Preprocessor features, Limits control)
1469 (Frozen state, Debugging options, Command line files): Subdivide
1471 (Input processing, Quoting Arguments, Define, Arguments)
1472 (Cleardiv, Format, M4exit): Fix grammar of references.
1473 (Inhibiting Invocation, Macro Arguments, Builtin, Trace)
1474 (Debug Levels, Debug Output, Include, Search Path, Divert)
1475 (Platform macros, Syscmd, Location, Extensions): Point to new
1477 (Top, Loops, Include, Undivert, Location, Incompatibilities):
1478 Improve file references.
1480 2006-10-14 Eric Blake <ebb9@byu.net>
1482 * m4/input.c (file_clean): Don't close stdin twice, POSIX says it
1484 Reported by Ralf Wildenhues.
1486 * src/builtin.c (m4_undivert): Check for read error.
1488 2006-10-13 Eric Blake <ebb9@byu.net>
1490 * src/m4.h (UNIX, W32_NATIVE, OS2): Move platform checks after
1491 header files are included, since <unistd.h> can affect the tests.
1493 Reported by Martin Koeppe.
1495 Backport head's usage of clean-temp module, as it is cleaner than
1496 using tmpfile-safer.
1497 * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
1498 clean-temp closeout', and remove tmpfile-safer.
1499 * src/m4.h (includes): Adjust.
1500 (m4_path_search): Rename from path_search, to avoid collision
1502 * src/m4.c (main): Install closeout handler. Adjust caller.
1503 (usage): Now done by closeout module.
1504 * src/builtin.c (m4_m4exit): Likewise.
1505 (m4_undivert, include): Adjust callers.
1506 * src/freeze.c (reload_frozen_state): Likewise.
1507 * src/path.c (m4_path_search): Rename from path_search.
1508 * src/output.c (output_temp_dir): New variable.
1509 (cleanup_tmpfile, m4_tmpfile): New functions, from head.
1510 (insert_diversion, make_room_for): Use them.
1511 * doc/m4.texinfo (Diversions): Document this, and add a test.
1512 (Improved fatal_error): Fix typo.
1513 (Maketemp): Port test to mingw, and no longer hide from
1515 * NEWS: Document the change in TMPDIR behavior.
1517 * configure.ac (m4_pattern_forbid): Narrow the range of forbidden
1518 macros, to work with recent gnulib-tool update.
1520 * src/builtin.c (m4_builtin, m4_indir): Allow transparent
1521 handling of defn results.
1522 * doc/m4.texinfo (Builtin, Indir): Add test cases.
1523 * NEWS: Document this.
1525 2006-10-12 Eric Blake <ebb9@byu.net>
1527 * doc/m4.texinfo (Location): Fix typo in previous commit.
1528 (Changeword): Catch one more case.
1529 * src/input.c (skip_line): Fix case when outer file used macro to
1532 2006-10-11 Eric Blake <ebb9@byu.net>
1534 * src/input.c (enum input_type): Add additional types, to shave
1535 time off the common case.
1536 (push_wrapup): Wrapped strings remember location.
1537 (push_string_finish): Normal strings carry no location.
1538 (push_file): Start new files uninitialized.
1539 (peek_input, next_char_1): Optimize common cases by updating
1540 location only on new input types.
1541 (pop_input): Update to honor new input types.
1542 (skip_line, push_string_finish): Fix regression in previous patch
1543 when dnl is not followed by newline in included file.
1544 (push_string_init): Initialize all fields of INPUT_STRING sooner.
1545 (peek_token): Simplify.
1546 (peek_input): Don't pop input files on peek, so that __file__ and
1547 __line__ as last token of include file work correctly.
1548 * doc/m4.texinfo (History): Mention 1.4.8.
1549 (Answers): Split into sections, one per answer.
1550 (Improved exch, Improved cleardivert, Improved fatal_error): New
1552 (Dnl, M4wrap, Location, M4exit, Improved fatal_error): Update to
1553 new m4wrap location semantics.
1554 (Changeword): Add test that caught the regression.
1555 * NEWS: Document this.
1557 * src/macro.c (expand_macro): In macro expansion errors, report
1558 line number at open parenthesis.
1559 * src/input.c (next_token): Fix off-by-one bug in reporting end
1560 of file in unterminated comment and string.
1561 (file_names): New obstack, necessary since expand_macro now hangs
1562 on to file names longer than the files remain open.
1563 (input_init): Initialize new obstack.
1564 (push_file): Use new obstack. Delay updates to current_file
1565 until after expand_macro has restored state.
1566 (peek_input, next_char_1): Update current_file if necessary.
1567 (pop_wrapup): Release memory.
1568 * doc/m4.texinfo (Macro Arguments, Changequote, Changecom): Catch
1570 (Dnl): Update to the new location reporting rules.
1571 * NEWS: Document these changes.
1573 2006-10-10 Eric Blake <ebb9@byu.net>
1575 * src/macro.c (argc_stack, argv_stack): New variables for sharing
1576 obstacks across multiple macro calls.
1577 (expand_input): Initialize and tear down stack once per input
1578 file, instead of once per macro.
1579 (expand_macro): Reuse existing stacks when possible.
1580 (collect_arguments): Simplify slightly.
1582 * src/path.c (include_env_init): Fix botched patch application.
1583 Reported by Ralf Wildenhues.
1585 2006-10-09 Eric Blake <ebb9@byu.net>
1587 * src/m4.c (usage, main): Detect write failures to stderr.
1588 * src/builtin.c (m4_m4exit): Likewise.
1589 * NEWS: Document this.
1591 * src/macro.c (expand_macro): Allow --nesting-limit=0 to remove
1593 * NEWS: Document this.
1594 * doc/m4.texinfo (Invoking m4): Likewise.
1596 2006-10-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1598 * src/path.c (include_env_init): Copy the string returned
1599 by getenv before overwriting it; POSIX disallows this.
1601 2006-10-09 Eric Blake <ebb9@byu.net>
1603 * src/m4.c (main): Defer debugfile until after --help.
1604 * configure.ac (AC_INIT): Bump version number.
1605 * NEWS: Start changes of 1.4.7a.
1607 2006-09-25 Eric Blake <ebb9@byu.net>
1610 * configure.ac (AC_INIT): Bump version number.
1611 * NEWS: Describe changes since 1.4.6.
1613 2006-09-21 Eric Blake <ebb9@byu.net>
1615 * doc/m4.texinfo (Invoking m4): Add clarification on option
1616 processing behavior.
1618 Reported by Mikhail Teterin.
1620 * bootstrap: Add --force option, based on idea from coreutils.
1621 * README: Document that ./bootstrap and autoreconf are for
1622 developers, and not lightly done in tarballs.
1624 2006-09-20 Eric Blake <ebb9@byu.net>
1626 * src/m4.c (usage, OPTSTRING, main): Rename -e to -i, and give
1627 deprecation warning on -e.
1628 * doc/m4.texinfo (Invoking m4, Extensions): Document this.
1629 * NEWS: Document this.
1631 2006-09-19 Eric Blake <ebb9@byu.net>
1633 * src/m4.c (usage, long_options, main, DEBUGFILE_OPTION): Rename
1634 -o/--error-output to --debugfile, and deprecate the former. This
1635 will allow a future release to be more consistent with other GNU
1636 tools, with -o/--output affecting stdout, not debug.
1637 * doc/m4.texinfo (Invoking m4, Debug Output): Document this.
1638 * NEWS: Document this.
1640 2006-09-14 Eric Blake <ebb9@byu.net>
1642 * src/m4.c (main): Warn on deprecated options -B, -S, -T, -N,
1643 --diversions. `m4 --help --version' now displays help, not
1645 (interactive, frozen_file_to_read, frozen_file_to_write): Move to
1647 (show_help, show_version): No longer needed.
1648 (long_options, DIVERSIONS_OPTION): Backport patch from head to
1649 distinguish between -N and --diversions in warning.
1650 * doc/m4.texinfo (Invoking m4): Document this.
1653 2006-09-11 Eric Blake <ebb9@byu.net>
1655 * src/Makefile.am (m4_LDADD): Add any gnulib dependent libraries.
1656 * src/debug.c (debug_flush_files) [UNIX]: Flush stdin if it is
1658 (debug_set_file): Use STDOUT_FILENO.
1659 * src/builtin.c (m4_m4exit): Flush stdin before exiting, to comply
1660 with POSIX in regards to unread input.
1661 * NEWS: Document this fix.
1662 * doc/m4.texinfo (Syscmd, Esyscmd, M4exit): Likewise.
1664 2006-09-07 Eric Blake <ebb9@byu.net>
1666 * m4/gnulib-cache.m4: Update to newer gnulib-tool.
1667 * src/m4.h (push_file): Change prototype.
1668 * src/input.c (push_file, peek_input, next_char_1): Only call getc
1669 once at EOF, to avoid double ^D on terminal stdin; regression from
1671 (push_file, pop_file): Allow reading stdin twice.
1672 * src/m4.c (main): Likewise.
1673 * src/builtin.c (include): Update caller.
1674 * NEWS: Document this change.
1675 * doc/m4.texinfo (Invoking m4, Incompatibilities): Likewise.
1676 (Syscmd): Add a test that failed before this patch.
1678 2006-09-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1680 * checks/check-them: Quote $pwd.
1682 2006-09-05 Eric Blake <ebb9@byu.net>
1684 * src/builtin.c (define_macro): Warn on invalid macro name.
1685 * NEWS: Document this change.
1686 * doc/m4.texinfo: Fix typos.
1687 (Invoking m4, Macro Arguments, Pseudo Arguments, Defn, Indir)
1688 (Ifelse): Backport some improvements from head.
1690 2006-09-04 Eric Blake <ebb9@byu.net>
1692 * doc/m4.texinfo (Changeword): Skip test on mingw, where the
1693 native echo is braindead.
1694 * checks/check-them (strip_needed): Ignore \r in output. Now the
1695 testsuite will pass when cross-compiling from cygwin to mingw.
1697 * src/input.c (peek_input): Fix regression in handling macro
1698 without arguments as last token in file; debian bug 385720.
1699 (next_token): Always consume an input character.
1700 Reported by Andreas Schultz.
1701 * configure.ac (AC_INIT): Bump version number.
1702 * NEWS: Document this fix.
1703 * doc/m4.texinfo (History): Mention next version.
1704 (Changeword): Add example that exposes this bug.
1707 2006-08-25 Eric Blake <ebb9@byu.net>
1710 * configure.ac (AC_INIT): Bump version number.
1711 * NEWS: Describe changes since 1.4.5.
1713 * Makefile.maint (web-manual): Give up on VPATH build during
1714 distribution. But distributions are made so infrequently that
1715 this is not too much of a hardship.
1716 * Makefile.am (MAINTAINERCLEANFILES): Avoid error if lib/CVS/
1719 2006-08-24 Eric Blake <ebb9@byu.net>
1721 * src/builtin.c (m4_index, m4_substr, m4_translit): Similar to
1722 Solaris, produce output on just one argument.
1723 (m4_regexp, m4_patsubst): For consistency, do likewise.
1724 (m4_patsubst): Allow zero-length match at end of string.
1725 * doc/m4.texinfo (Sysval): Fix overfull hbox.
1726 (Bugs, Macro Arguments): Minor fixes.
1727 (Other tokens): Rearrange node order.
1728 (Index macro, Substr, Translit, Regexp, Patsubst): Add tests.
1729 * NEWS: Document these fixes.
1731 2006-08-22 Eric Blake <ebb9@byu.net>
1733 * src/input.c (pop_input): Avoid empty filename with -di option.
1734 * src/debug.c (debug_message_prefix): Put space before message.
1736 * m4/gnulib-cache.m4: We don't explicitly use alloca module.
1738 * m4/gnulib-cache.m4: Augment with gnulib-tool --import gnupload.
1739 * Makefile.maint (fetch): Simplify, now that we can use gnupload.
1741 * checks/check-them: State why a test is skipped.
1742 * doc/m4.texinfo (Changeword, Sysval, Maketemp): Likewise.
1744 * ChangeLog: Add copyright.
1745 * AUTHORS: Likewise.
1746 * BACKLOG: Likewise.
1750 * examples/COPYING: New file, add copyright for all the examples.
1751 * checks/get-them: Put copyright on testsuite files.
1753 2006-08-18 Eric Blake <ebb9@byu.net>
1755 Don't let unrelated child processes see too many files.
1756 * m4/gnulib-cache.m4: Augment with gnulib-tool --import cloexec.
1757 * src/builtin.c (m4_esyscmd, m4_regexp, m4_patsubst): Fix
1758 spelling in error message.
1759 * src/debug.c [!__STDC__]: Assume C89, and nuke old varargs.h.
1760 (debug_set_output): Close debug file on exec.
1761 * src/m4.h (includes): Add cloexec.h.
1762 * src/output.c (make_room_for): Close diversions on exec.
1763 * src/path.c (path_search): Close include files on exec.
1764 * NEWS: Document this.
1766 Regular expressions were leaking memory.
1767 * src/builtin.c (init_pattern_buffer, free_pattern_buffer): New
1769 (m4_regexp, m4_patsubst): Avoid memory leak.
1770 * src/input.c (init_pattern_buffer) [ENABLE_CHANGEWORD]: Make
1772 (set_word_regexp) [ENABLE_CHANGEWORD]: Avoid memory leak. Change
1773 from O(n^2) to O(n) for calculating word_start.
1774 (next_token, peek_token) [ENABLE_CHANGEWORD]: Treat word_start as
1775 O(1) bitmap, not O(n) search string.
1776 * NEWS: Document this fix.
1778 2006-08-17 Eric Blake <ebb9@byu.net>
1780 * NEWS: Document previous checkin.
1782 * src/builtin.c (substitute): Avoid core dump when accessing
1783 beyond bound of regular expression.
1784 Reported by Karl Nelson.
1785 * doc/m4.texinfo (Regexp): Add example that causes core dump on
1786 some architectures prior to this patch.
1789 2006-08-16 Eric Blake <ebb9@byu.net>
1791 * doc/m4.texinfo (Invoking m4, Debug Output): Fix wording to be
1792 clear that dumpdef does not always go to stderr.
1794 * src/builtin.c (m4_errprint): Flush buffers before printing to
1798 2006-08-15 Eric Blake <ebb9@byu.net>
1800 * src/builtin.c (m4_m4wrap, m4_errprint, m4_shift): Make blind,
1801 per debian bug 96075.
1802 * doc/m4.texinfo (Loops, M4wrap, Errprint): Document this change.
1803 (Changeword): Don't use shift as an example of a swallowed word.
1804 (Divert): Discuss fact that divert is an English word.
1805 Reported by Richard A Nelson.
1807 2006-08-14 Eric Blake <ebb9@byu.net>
1809 * doc/m4.texinfo (Invoking m4): Minor fixes.
1811 2006-08-12 Eric Blake <ebb9@byu.net>
1813 * doc/m4.texinfo (Arguments): Hint at better exch macro.
1814 (Answers): Provide a better definition.
1816 2006-08-09 Eric Blake <ebb9@byu.net>
1818 * doc/m4.texinfo (Incompatibilities): Document that m4 does not
1819 yet understand locales.
1820 * NEWS: Fix wording of a few items.
1822 2006-08-08 Eric Blake <ebb9@byu.net>
1824 Avoid printing `NONE:0:' in error messages.
1825 * src/m4.h (m4_error_at_line): New function.
1826 * src/m4.c (m4_error_at_line): Implement.
1827 * src/input.c (skip_line, input_init, next_token): Use "", not
1828 "NONE", for no file, since NONE can be a real file name.
1829 * src/macro.c (expand_argument): Likewise.
1830 * src/debug.c (debug_message_prefix, trace_header): Check for
1832 * doc/m4.texinfo (Dnl, M4wrap): Adjust accordingly.
1833 (Location): Document that synclines and internal message format
1834 are not impacted by redefining these macros.
1835 (M4exit): Hint at bug in fatal_error.
1836 (Answers): Provide workaround to match m4 output.
1838 * m4/gnulib-cache.m4: Augment with gnulib-tool --import verror.
1839 * src/m4.h (m4_error): New function.
1840 (M4ERROR, M4ERROR_AT_LINE): Reimplement without hacking around
1841 error module deficiencies.
1842 (reference_error, suppress_line): No longer needed.
1843 * src/m4.c (m4_error): Implement.
1844 (main): No longer need to install error callback.
1846 2006-08-04 Eric Blake <ebb9@byu.net>
1848 * src/m4.h (program_name): Declare.
1849 (suppress_line): New variable.
1850 (M4ERROR_AT_LINE): New macro.
1851 * src/m4.c (reference_error, main): Follow GNU Coding Standards
1852 for error message format.
1853 * src/input.c (skip_line, next_token): Use M4ERROR_AT_LINE.
1854 * src/macro.c (expand_argument): Likewise.
1855 * checks/check-them (examples): Adjust to new message format.
1856 * src/builtin.c (m4___program__): New builtin.
1857 * doc/m4.texinfo (Location): Split from Errprint into new node,
1858 and document __program__.
1859 (Builtin, Ifdef, Ifelse, Dumpdef, Trace, Debug Output, Dnl)
1860 (Include, Regexp, Patsubst, Incr, Eval): Adjust error message
1862 (Extensions): Document __program__.
1863 * NEWS: Document this change.
1865 2006-08-03 Eric Blake <ebb9@byu.net>
1867 Don't confuse leading `(' in comment or quote with start of
1868 argument collection.
1869 * src/m4.h (enum token_type): Add TOKEN_OPEN, TOKEN_COMMA,
1871 (peek_input): Make private to input.c.
1872 (peek_token): New prototype.
1873 * src/input.c (default_word_regexp): Reduce ifdefs.
1874 (peek_input): Make static.
1875 (next_token): Return new token types.
1876 (match_input, MATCH): Add argument consume, which controls
1877 whether match should be pushed back.
1878 (peek_token): New function.
1879 (token_type_string) [DEBUG_INPUT]: New function.
1880 * src/macro.c (expand_token, expand_argument, collect_arguments):
1881 Handle new token types.
1882 * doc/m4.texinfo (Changequote, Changecom): Document this.
1883 * NEWS: Document this.
1885 * src/stackovf.c (setup_stackovf_trap): Free memory on failure.
1887 * src/stackovf.c (setup_stackovf_trap): Gracefully avoid stack
1888 overflow detection when sigstack exists but is not implemented.
1889 Fixes debian bug 154053.
1891 Reported by David Perlin.
1893 2006-08-02 Eric Blake <ebb9@byu.net>
1895 * src/input.c (MATCH): Fix EOF detection on multi-byte comment
1898 2006-08-01 Eric Blake <ebb9@byu.net>
1900 * src/input.c (skip_line, next_token): Remember current file in
1901 case input file ends abruptly. Addresses debian bug 175365.
1902 (pop_input): Defer freeing storage that holds previous file
1904 (pop_wrapup): to here, after error message is issued.
1905 * src/macro.c (expand_argument): Remember current file in case
1906 input file ends abruptly.
1907 * doc/m4.texinfo (Macro Arguments, Dnl, Changequote, Changecom)
1908 (M4wrap): Adjust testsuite accordingly.
1909 (Errprint): Document line number limitation of m4wrap.
1910 * NEWS: Document this fix.
1913 2006-07-31 Eric Blake <ebb9@byu.net>
1915 * src/input.c (peek_input, next_char, match_input): Be eight-bit
1916 clean; fixes debian bug 311378.
1917 * doc/m4.texinfo (Syntax): Describe eight-bit handling.
1918 (Changequote, Changecom): Add examples to test this.
1919 * NEWS: Document this fix.
1921 Reported by Steven Augart.
1923 * doc/m4.texinfo: Whitespace fix.
1924 * checks/get-them: Avoid exceeding 14-char file name limit.
1927 2006-07-30 Eric Blake <ebb9@byu.net>
1929 * src/path.c (path_search): Detect allocation failure.
1931 Use native free when it is good enough.
1932 * m4/gnulib-cache.m4: Augment with gnulib-tool --import free.
1933 * src/builtin.c (define_user_macro, m4_regexp, m4_patsubst):
1935 * src/symtab.c (free_symbol): Likewise.
1936 * src/m4.c (xfree, main): Likewise.
1937 * src/m4.h (obstack_chunk_free): Likewise.
1938 * src/path.c (path_search): Likewise.
1939 * src/input.c (pop_wrapup, set_quotes, set_comment): Likewise.
1941 * doc/m4.texinfo (Errprint): Add example for last patch.
1942 * checks/check-them: Account for VPATH in latest example.
1944 2006-07-29 Eric Blake <ebb9@byu.net>
1946 * src/path.c (path_search): Add result parameter, so that
1947 -I can be accounted for. Debian bug 53685.
1948 * src/m4.h (path_search): Update prototype.
1949 * src/m4.c (main): Adjust callers.
1950 * src/freeze.c (reload_frozen_state): Likewise.
1951 * src/builtin.c (include, m4_undivert): Likewise.
1952 * NEWS: Document this change.
1953 Reported by Nicolas Lichtmaier.
1955 2006-07-28 Eric Blake <ebb9@byu.net>
1957 * Makefile.am (MAINTAINERCLEANFILES): Fix typo that tripped up
1958 several non-GNU makes.
1959 * src/stackovf.c (setup_stackovf_trap): Missed _ from yesterday.
1960 * src/m4.h: Likewise.
1961 * src/input.c (push_wrapup): Avoid compiler warning with Solaris
1964 2006-07-27 Eric Blake <ebb9@byu.net>
1966 * doc/m4.texinfo: Use @acronym{GNU} throughout.
1967 (History): Update for 1.4.6.
1969 * src/m4.h (_): Remove K&R cruft.
1970 * src/builtin.c: Likewise.
1971 * src/debug.c: Likewise.
1972 * src/eval.c: Likewise.
1973 * src/macro.c: Likewise.
1974 * src/stackovf.c: Likewise.
1976 * doc/Makefile.am (m4.1): Improve man page.
1977 * src/m4.c (usage): Improve --help output, including adding the
1978 bug reporting address.
1979 (main): Follow GNU Coding Standards for --version output.
1981 2006-07-26 Eric Blake <ebb9@byu.net>
1983 * doc/m4.texinfo: Use begin-quote, end-quote, begin-comment, and
1984 end-comment consistently, to match POSIX.
1986 * doc/m4.texinfo (Macro Arguments, Changequote, Changecom)
1987 (Dnl, M4wrap, Include): Document EOF issues, and add examples.
1988 (Incompatibilities): Document incompatibility of changecom
1989 vs. macro names, and of EOF in include.
1990 * src/input.c (next_token): Reject unterminated comments at EOF.
1991 (skip_line): Warn on unterminated dnl at EOF.
1992 * NEWS: Document these changes.
1994 2006-07-25 Eric Blake <ebb9@byu.net>
1996 * m4/gnulib-cache.m4: Update to reflect gnulib's split of
1997 stdio-safer into fopen-safer and tmpfile-safer.
1998 * src/m4.c: Remove redundant include.
2000 2006-07-24 Eric Blake <ebb9@byu.net>
2002 Fix bugs related to stream handling.
2003 * m4/gnulib-cache.m4: Augment with gnulib-tool --import
2004 unlocked-io stdio-safer stdlib-safer close-stream.
2005 * configure.ac (AC_CHECK_FUNCS_ONCE): Assume tmpfile; it can be
2006 provided by gnulib if needed.
2007 * src/output.c [! HAVE_TMPFILE]: Likewise.
2008 * src/m4.h (includes): Replace unistd, stdio, and stdlib with
2009 their safer counterparts.
2010 (retcode): New global variable.
2011 * src/input.c (pop_input): Check for read failure.
2012 * src/freeze.c (reload_frozen_state): Likewise.
2013 (produce_frozen_state): Check for write failure.
2014 * src/debug.c (debug_set_file): Likewise.
2015 * src/m4.c (usage, main): Likewise.
2016 (retcode): Make global.
2017 * src/builtin.c (m4_m4exit): Likewise. Ensure that the exit
2018 status is non-zero except when everything succeeds.
2019 * doc/m4.texinfo (M4exit): Document these changes.
2020 (Incompatibilities): Remove documentation of bug now fixed.
2021 * NEWS: Document these fixes.
2023 2006-07-22 Eric Blake <ebb9@byu.net>
2025 * src/format.c (format): Avoid compiler warning that str may be
2028 2006-07-21 Eric Blake <ebb9@byu.net>
2030 * src/m4.h [UNIX]: Add more platforms that are close enough to
2031 categorize as UNIX, but which don't predefine __unix__.
2032 Reported by Nelson H. F. Beebe.
2034 2006-07-20 Eric Blake <ebb9@byu.net>
2036 * m4/gnulib-cache.m4: gnulib-tool has changed again. Regenerate
2037 to explicitly ask for --assume-autoconf=2.60.
2039 2006-07-19 Eric Blake <ebb9@byu.net>
2041 * doc/m4.texinfo (Sysval): Avoid kill -1, since ksh traps SIGHUP
2042 and exits normally with 129.
2043 Reported by Nelson H. F. Beebe.
2046 * src/m4.h (EXIT_MISMATCH): Define.
2047 * src/freeze.c (reload_frozen_state): Detect version mismatch, by
2048 exiting with status 63.
2049 * src/m4.c (usage): Document this.
2050 * doc/m4.texinfo (Invoking m4, Using frozen files): Likewise.
2053 * doc/m4.texinfo (copying): Relax restriction on front-cover and
2056 2006-07-17 Eric Blake <ebb9@byu.net>
2058 * src/format.c (format): Support F, g, and G specifiers.
2059 * doc/m4.texinfo (Format): Document this.
2060 * NEWS: Document this addition.
2062 * doc/m4.texinfo (Builtin): Delete redundant text.
2064 * configure.ac (AC_INIT): Bump version number.
2065 * src/builtin.c (substitute): Bah. Fix buffer overrun.
2066 * NEWS: Document this fix.
2068 2006-07-15 Eric Blake <ebb9@byu.net>
2071 * configure.ac (AC_INIT): Bump version number.
2072 * NEWS: Describe changes since 1.4.4.
2074 * src/m4.c (usage): Document exit status.
2075 * doc/m4.texinfo: Use `exit status', not `exit code'.
2076 (Invoking m4): Document exit status.
2078 * bootstrap: Backport --help, --version from head.
2079 (func_update): New function, for easily grabbing up-to-date files
2081 * Makefile.maint (web-manual): Fix for VPATH builds.
2083 2006-07-14 Eric Blake <ebb9@byu.net>
2085 * doc/m4.texinfo: Global cleanup. Avoid @code{...}'d, as it
2086 looks bad in info. Use @deffn rather than @example for
2087 describing prototypes. Fix awkward wording and grammar.
2089 * src/builtin.c (substitute): Warn on bad escape sequences.
2090 Ignore trailing backslash.
2091 * doc/m4.texinfo (Regexp): Add documentation for this.
2092 * NEWS: Document this change.
2094 * src/builtin.c (m4_format, m4_indir): Warn on too few arguments.
2095 * doc/m4.texinfo (Defn, Builtin, Debug Levels, Debug Output): Add
2097 (Dnl): Update example to show side effects.
2098 * checks/get-them: Generate three digit test names.
2099 * checks/Makefile.in (CHECKS): Accomodate 100+ tests.
2101 2006-07-13 Eric Blake <ebb9@byu.net>
2103 * src/input.c (input_init): Simplify.
2104 (set_word_regexp): Treat empty string as default, since empty
2105 regexp would disable word parsing.
2106 * src/m4.c (user_word_regexp): Default to empty string.
2107 * src/builtin.c (builtin_tab): Make changeword blind.
2108 * doc/m4.texinfo (Changeword): Document this.
2109 * NEWS: Document this.
2110 * TODO: Knock off completed items.
2112 * src/builtin.c (m4_undefine, m4_popdef): Visit all arguments, not
2114 * doc/m4.texinfo (Undefine, Pushdef): Test this.
2115 * NEWS: Document this change.
2117 * src/builtin.c (numeric_arg): Treat empty string as 0, with a
2118 warning. Detect quoted leading space and overflow as warnings.
2119 (m4_eval): Treat empty radix as 10, and allow output in radix 1.
2120 Treat width as minimum number of digits, as required by POSIX.
2121 (m4_ifdef, m4_divert, m4_m4exit, m4_translit): Ignore extra
2123 (m4_substr): Likewise. Silently treat empty start as 0.
2124 (m4_undivert): Treat ` 1a' as file, not diversion 1.
2125 * src/eval.c (eval_lex): Parse radix 1 numbers.
2126 * doc/m4.texinfo (Invoking m4): Fix wording; there is more than
2127 one type of warning.
2128 (Manual): Document behavior of numeric parsing of empty string.
2129 (Divert, Incr): Document error handling.
2130 (Eval): Document radices better.
2131 (Incompatibilities): Document translit incompatibility.
2132 * NEWS: Document these changes.
2134 * Makefile.maint (fetch): Get gendocs from gnulib, not texinfo.
2135 (web-manual): Simplify.
2136 * m4/gnulib-cache.m4: Augment with gnulib-tool --import gendocs.
2137 * Makefile.am (EXTRA_DIST): Distribute gendocs.sh.
2138 (MAINTAINERCLEANFILES): Clean it as well.
2139 * doc/Makefile.am (EXTRA_DIST): Distribute gendocs_template.
2140 (MAINTAINERCLEANFILES): Clean it as well.
2142 2006-07-12 Eric Blake <ebb9@byu.net>
2144 * doc/m4.texinfo (Extensions): Document how to overcome
2145 implementation difference in > 9 positional parameters.
2147 * src/m4.c (usage): Sort within sections.
2148 (nesting_limit): Raise default from 250 to 1024.
2149 * doc/m4.texinfo: Use file name, not filename, per GNU coding
2150 standard. Use @option where appropriate.
2151 (Invoking m4): Sort to match --help output.
2152 (Debug Levels): Sort.
2153 (Frozen files): Sort and break into two nodes.
2155 * src/m4.c (nesting_limit): Raise default from 250 to 1024.
2156 * NEWS: Document raised -L limit.
2158 2006-07-11 Eric Blake <ebb9@byu.net>
2160 * Makefile.am (DISTCHECK_CONFIGURE_FLAGS): New macro, to
2161 stress-test changeword before a release.
2162 * doc/m4.texinfo: More doc cleanups.
2163 (Copying This Manual): New node; actually include the FDL in the
2165 * doc/Makefile.am (m4_TEXINFOS): Mention dependence on fdl.texi.
2166 * m4/gnulib-cache.m4: Augment with gnulib-tool --import fdl.
2167 * NEWS: Mention documentation improvements.
2169 * src/m4.h (OS2): New platform macro.
2170 * src/builtin.c (predefined_tab) [OS2]: Use it to give OS/2 a
2172 * doc/m4.texinfo (Platform macros): Document it.
2173 (Sysval): Remove non-portable test of system("").
2174 * NEWS: Document this change.
2175 Reported by Andreas Buening.
2177 2006-07-09 Eric Blake <ebb9@byu.net>
2179 * doc/m4.texinfo (Undivert): Fix typo in last commit.
2180 * src/m4.c (usage): Document M4PATH.
2181 * src/path.c (path_search): Reject empty string.
2182 * src/output.c (insert_diversion): Ignore diversion 0.
2183 * src/builtin.c (m4_undivert): Ignore empty string.
2184 * NEWS: Document this fix.
2186 2006-07-08 Eric Blake <ebb9@byu.net>
2188 * checks/get-them: Make filtering easier.
2189 * checks/check-them: Filter non-input lines, so line counts are
2190 more realistic in the documentation, and so changeword tests work
2191 even when dnl is disabled.
2192 * doc/m4.texinfo: Adjust example line numbers. Clean up
2193 front-matter, following autoconf's example.
2194 (Changeword): Enable tests, skipping if changeword not supported.
2195 (Define, Defn, Ifelse): Backport more examples from head.
2196 (Input processing, Answers): New nodes, backported from head.
2197 (Include): Expand test to cover empty filename.
2198 (Undivert): Add test of undivert(0).
2200 2006-07-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2202 * doc/m4.texinfo: Fix spelling errors.
2204 2006-07-07 Eric Blake <ebb9@byu.net>
2208 * doc/Makefile.am (m4.1): No need to go through a temporary file;
2209 this also ensures timestamps are updated.
2210 * src/m4.h (includes): Require config.h. Assume string.h,
2211 stdlib.h, errno. Include error.h, exit.h, and xalloc.h rather
2212 than prototyping ourselves.
2213 (builtin_func): Add parameter type-checking.
2214 (voidstar): Delete, now that we assume C89.
2215 * src/builtin.c, src/m4.c, src/macro.c, src/symtab.c: All users of
2217 * src/m4.c (xfree) [WITH_DMALLOC]: Avoid clash with dmalloc's
2220 2006-07-06 Eric Blake <ebb9@byu.net>
2222 * m4/gnulib-cache.m4: Augment with gnulib-tool --import
2224 * src/m4.h (includes): Add binary-io.h for O_BINARY.
2225 * src/freeze.c (produce_frozen_state): Use O_BINARY to remove
2226 #ifdef. Fixes patch from 2005-02-03 for cygwin.
2227 * NEWS: Mention this fix.
2229 * configure.ac (FUNC_SYSTEM_BROKEN): New check for OS/2 bug.
2230 * src/builtin.c (m4_syscmd): Work around OS/2 bug.
2232 * Makefile.am (SUBDIRS): Build . before src, so that autoheader
2233 runs first when needed.
2234 * doc/Makefile.am (m4.1): Backport rule from CVS head: build m4.1
2235 once in srcdir rather than multiple times in VPATH builds.
2237 2006-07-03 Eric Blake <ebb9@byu.net>
2239 * checks/check-them: Use portable = in test.
2240 * src/Makefile.am (AM_CPPFLAGS): Omit space between -I and
2241 directory, as required by Solaris cc. Include built headers, as
2242 required by Solaris make in VPATH build.
2243 * checks/Makefile.in: Use $(srcdir) where needed.
2244 (CHECKS): Factor $(srcdir) into macro.
2245 (DISTFILES): Likewise. Automake takes care of distributing
2248 (Makefile): Use modern syntax of config.status.
2249 * doc/m4.texinfo (Loops, Include, Undivert, Incompatibilities):
2250 Avoid overfull and underfull hboxes in dvi.
2252 Fix 'make check' in VPATH build. All files included by testsuite
2253 now live in a single directory. Use forloop.m4 in testsuite.
2254 * checks/incl.m4, checks/foo, checks/wrapfifo.m4: Move from
2256 * examples/incl.m4, examples/foo, examples/wrapfifo.m4: ...to
2258 * checks/Makefile.in (DISTFILES): Don't distribute moved files.
2259 * examples/Makefile.am (EXTRA_DIST): Distribute new files.
2260 * checks/check-them: Avoid s/// when filename is in pattern.
2261 * examples/forloop.m4: Fix to match documentation.
2262 * doc/m4.texinfo (Include, Undivert, Incompatibilities): Reflect
2264 (Loops, Format): Actually use forloop.m4 in tests.
2266 2006-07-02 Eric Blake <ebb9@byu.net>
2268 * checks/Makefile.in (exec_prefix, prefix): New macros, so that
2269 $(bindir) works in installcheck.
2270 (check, installcheck): No longer change directory, so that
2271 distcheck works with a read-only builddir.
2272 * checks/check-them: Work when pwd is no longer builddir.
2274 2006-07-01 Eric Blake <ebb9@byu.net>
2276 * GNUmakefile: New file, borrowed from coreutils.
2277 * Makefile.am (EXTRA_DIST): Distribute GNUmakefile.
2278 * Makefile.maint (Makefile): Delete this rule, now that
2279 GNUmakefile includes Makefile.
2281 2006-06-30 Eric Blake <ebb9@byu.net>
2283 For compatibility with other m4 implementations, sysval returns
2284 signal<<8 rather than 0 if syscmd is terminated by a signal.
2285 * configure.ac (AC_CHECK_HEADERS_ONCE): Check for sys/wait.h.
2286 * src/builtin.c (include): Include sys/wait.h when stdlib.h does
2287 not provide wait macros.
2288 (WTERMSIG, WIFSIGNALED, WIFEXITED): More fallback macros.
2289 (M4SYSVAL_EXITBITS, M4SYSVAL_TERMSIGBITS): New helper macros.
2290 (m4_esyscmd): Set sysval to -1 on failure.
2291 (m4_sysval): Print 127 on failure, and accomodate signals if they
2293 * NEWS: Document this change.
2294 * doc/m4.texinfo (Platform macros, Esyscmd, Sysval): Fix typos in
2296 * checks/check-them: Likewise.
2297 * src/debug.c (debug_set_file): Work around mingw fstat bug.
2299 * src/m4.h (UNIX, W32_NATIVE): Improve platform detection macros.
2300 * src/freeze.c (produce_frozen_state): Use new spelling of
2302 * src/builtin.c (predefined_tab): Add __windows__ on non-unix
2304 (m4_syscmd, m4_esyscmd): The empty command is successful.
2305 * doc/m4.texinfo (Shell commands): Rename from UNIX commands.
2306 Document platform-dependence of system().
2307 (Syscmd): Add example.
2308 (Esyscmd): Make example more robust, and actually demonstrate
2310 (Sysval): Expand test to cover esyscmd code path, and to check
2311 that empty command is successful. Add conditional check for
2313 (Other Incompatibilities): Move platform macros from here...
2314 (Platform macros): ...to this new node. Add windows macro.
2315 Check that exactly one platform macro is provided.
2316 * checks/check-them: Improve trap cleanup. Tolerate dirname and
2317 .exe in error messages. Allow for skipping checks.
2318 * configure.ac (HAVE_EFGCVT): Kill dead configure check.
2319 * NEWS: Document platform macros.
2321 2006-06-29 Eric Blake <ebb9@byu.net>
2323 Fix buffer overrun bug.
2324 * m4/gnulib-cache.m4: Augment with gnulib-tool --import
2326 * src/format.c [HAVE_EFGCVT]: Delete this code, and use *printf
2327 variant instead, since [efg]cvt are obsolete and our use of them
2328 was buggy (savannah sr #104303).
2329 (format): Fix buffer overflow by using xasprintf.
2330 * doc/m4.texinfo (Format): Expand format test to catch both bugs.
2331 * NEWS: Document this fix.
2333 * configure.ac (AC_CANONICAL_HOST, AC_CANONICAL_BUILD): Allow
2335 (AC_CACHE_CHECK): Cache search for ecvt.
2337 2006-06-27 Eric Blake <ebb9@byu.net>
2339 * doc/m4.texinfo (Eval): Document 32-bit signed limitations
2340 required by POSIX, and add example that exposed core dump on x86
2342 (Incompatibilities): Document incompatibility in eval precedence.
2343 * src/eval.c (shift_term): Explicitly mask, to avoid undefined
2345 (mult_term): Explicitly check for -1, to avoid SIGFPE on x86.
2346 * NEWS: Document this change.
2348 * doc/m4.texinfo: Use @noindent consistently.
2349 (Quoting Arguments): Document that unquoted parentheses group
2351 (Pseudo Arguments): Expand tests to show this.
2352 (Incompatibilities): Contrast traditional behavior of
2355 2006-06-24 Eric Blake <ebb9@byu.net>
2357 * configure.ac (AC_PREREQ): Autoconf 2.60 is now released.
2358 (AC_CHECK_HEADERS_ONCE): Use this new feature.
2359 (AC_CHECK_FUNCS_ONCE): Likewise.
2361 2006-06-23 Eric Blake <ebb9@byu.net>
2363 * doc/m4.texinfo: Quoting cleanup throughout - follow
2364 autoconf-recommended style of one level of quote per parenthesis
2365 in the normal case. Adjust error messages to match GNU coding
2366 standards (and to allow 'make check' to pass again).
2367 (Quoted strings, Inhibiting Invocation): Turn more examples into
2369 (Comments): Resolve FIXME by adding example.
2370 (Define): Add example about underquoting.
2371 (Defn): Add example about use of $0.
2372 (Indir, Format): Resolve FIXME done in last commit.
2373 (Ifelse): Add example about creating blind macro.
2374 (Debugging): Fix grammar.
2375 (Dnl): Add example about dnl with arguments.
2376 (M4wrap): Be explicit that LIFO order is non compliant, and will
2378 (Undivert): Resolve FIXME by adding example.
2379 (Frozen files): Document that m4wrap and sysval will not work
2380 consistently until m4 2.0.
2381 (Incompatibilities): Document another POSIX compliance bug, this
2382 time with changequote. Document a traditional incompatibility
2383 with partial input spanning file boundaries.
2385 Make error messages more consistent with GNU coding standards -
2386 start with lower case, and don't end sentence with punctuation.
2387 * src/debug.c (trace_pre): Update message wording.
2388 * src/eval.c (evaluate, cmp_term, shift_term, mult_term):
2390 * src/freeze.c (produce_frozen_state, issue_expect_message),
2391 (reload_frozen_state): Likewise.
2392 * src/input.c (push_string_init, pop_init, init_macro_token),
2393 (peek_input, next_char_1, set_word_regexp, next_token): Likewise.
2394 * src/m4.c (stackovf_handler, main): Likewise.
2395 * src/macro.c (expand_token, expand_argument, call_macro),
2396 (expand_macro): Likewise.
2397 * src/output.c (make_room_for, output_text, insert_file),
2398 (freeze_diversions): Likewise.
2399 * src/symtab.c (symtab_init, lookup_symbol): Likewise.
2401 * src/builtin.c (builtin_tab): Make format and indir blind.
2402 (substitute): Prefer "Warning:" vs. "ERROR:" in messages.
2403 * NEWS: Mention the change to builtins.
2405 2006-06-22 Eric Blake <ebb9@byu.net>
2407 Robustify frozen file format.
2408 * src/freeze.c (reload_frozen_state): Add GET_DIRECTIVE helper
2409 macro. Require V first, and only accept it once. For F, use
2410 placeholder if builtin is not found, rather than warning.
2411 * src/m4.h (m4_placeholder): New prototype.
2412 * src/builtin.c: Unify error message style.
2413 (m4_placeholder): New function, warn if invoked.
2414 (builtin_tab): Add m4_placeholder.
2415 (m4_defn): Warn if placeholder is encountered.
2416 (find_builtin_by_addr): Handle placeholder.
2417 (find_builtin_by_name): Return placeholder on failure.
2418 (m4_builtin): Treat placeholder as undefined.
2419 * doc/m4.texinfo (Frozen files): Document changes in V and F.
2420 * NEWS: Document this change.
2421 Reported by Bruno Haible.
2423 * doc/m4.texinfo: Whitespace cleanup. TABs are evil in texinfo.
2424 (tabchar): New macro, so that 'make check' still works.
2425 (Invoking m4): Document that ignored compatibility options -B, -S,
2426 and -T each consume an argument.
2427 * checks/get-them: Honor @tabchar{}.
2429 Avoid compiler warnings during -DDEBUG.
2430 * src/m4.h (M4_GNUC_ATTRIBUTE, M4_GNUC_UNUSED): New macros.
2431 [DEBUG]: Also imply DEBUG_OUTPUT and DEBUG_STKOVF.
2432 * src/input.c (print_token) [DEBUG_INPUT]: Use correct format.
2433 (lex_debug) [DEBUG_INPUT]: Fix to compile. Mark unused.
2434 (next_token) [DEBUG_INPUT]: Print before returning.
2435 * src/path.c (include_dump) [DEBUG_INCL]: Mark unused.
2436 * src/symtab.c (symtab_debug) [DEBUG_SYM]: Mark unused.
2438 Avoid mkstemp bugs on various platforms.
2439 * m4/gnulib-cache.c: Augment with gnulib-tool --import mkstemp.
2440 * src/output.c [! HAVE_MKSTEMP]: Delete.
2441 * configure.ac (AC_CHECK_FUNCS): Don't check for mkstemp.
2442 * src/m4.h (mkstemp) [! HAVE_MKSTEMP]: Prototype, if needed.
2443 * NEWS: Document this.
2445 * Makefile.am (EXTRA_DIST): Distribute gnulib-cache.m4.
2446 Reported by Bruno Haible.
2448 2006-06-21 Eric Blake <ebb9@byu.net>
2450 Avoid obsolete sigstack when POSIX sigaltstack is available.
2451 * src/m4.c: Blindly assume signal.h, since stackovf.c and gnulib
2453 * configure.ac (AC_CHECK_HEADERS): Likewise.
2454 (AC_CHECK_TYPES): New check for siginfo_t, since siginfo.h is
2455 obsolete and most hosts now have it in signal.h.
2456 (AC_CHECK_MEMBERS): New check for sigaction.sa_sigaction.
2457 (AC_CACHE_CHECK): Cache decision to use stackovf.
2458 (AC_EGREP_HEADER): Switch to AC_CHECK_TYPES.
2459 * src/stackovf.c (DEBUG_STACKOVF): Remove unused define.
2460 (SA_RESETHAND, SA_SIGINFO): Provide fallback definitions, to
2461 simplify later code.
2462 (PARAM_STACKOVF, PARAM_NOSTACKOVF): Move further away from NULL,
2463 in case of dereferencing a member of a NULL pointer.
2464 (sigsegv_handler) [HAVE_STRUCT_SIGACTION_SA_SIGACTION]: Define a
2466 (setup_stackovf_trap): Use NULL instead of 0 for pointers, use
2467 EXIT_FAILURE in error, indent preprocessor directives.
2468 [HAVE_SIGALTSTACK && HAVE_SIGINFO_T]: Depend on siginfo_t, not
2470 [HAVE_SIGACTION && defined SA_ONSTACK]: Prefer POSIX handler.
2471 Reported by Santiago Vila.
2473 2006-06-19 Eric Blake <ebb9@byu.net>
2477 2006-06-18 Andreas Buening <andreas.buening@nexgo.de> (tiny change)
2479 * checks/Makefile.in (PATH_SEPARATOR): New macro.
2480 (check, installcheck): Use it, for OS/2.
2482 2006-06-18 Eric Blake <ebb9@byu.net>
2484 Consistently use "GNU M4" as package name, "m4" as executable
2486 * NEWS: Document previous fix.
2488 * README: Fix grammar. Document that --enable-changeword is on
2490 * doc/m4.texinfo (Top, Changeword): Likewise.
2491 (Sysval): Enhance this test.
2492 (History): Backport this section from CVS head, and update.
2494 2006-06-18 Bruno Haible <bruno@clisp.org> (tiny change)
2495 Eric Blake <ebb9@byu.net>
2497 * src/builtin.c (WEXITSTATUS): Provide fallback definition.
2498 (m4_esyscmd): Set sysval to 0xffff, to accomodate both
2499 big-endian and little-endian wait status definitions.
2500 (m4_sysval): Use WEXITSTATUS.
2501 Reported by Andreas Buening.
2503 2006-06-18 Eric Blake <ebb9@byu.net>
2505 * configure.ac (AC_INIT): Bump version number.
2506 * NEWS: Describe changes in 1.4.4c.
2508 2006-06-17 Eric Blake <ebb9@byu.net>
2510 Beta Release 1.4.4b:
2511 * configure.ac (AC_INIT): Bump version number.
2512 * NEWS: Describe changes since 1.4.4.
2513 * Makefile.maint (cvs-news): Accomodate copyright line wrapping.
2515 * Makefile.am (MAINTAINERCLEANFILES): Clean files added by
2517 * checks/Makefile.in (maintainer-clean): Add missing target.
2518 * COPYING: Remove generated file from CVS.
2520 2006-06-16 Eric Blake <ebb9@byu.net>
2522 * checks/Makefile.in (DISTFILES): Distribute wrapfifo.m4.
2524 2006-06-15 Eric Blake <ebb9@byu.net>
2526 * checks/wrapfifo.m4: New file. Use it...
2527 * doc/m4.texinfo (Incompatibilities): here, in a new test case to
2528 demonstrate how to get POSIX behavior of m4wrap prior to m4 2.0.
2530 * src/m4.h (to_uchar): New function.
2531 * src/eval.c (eval_lex): Use it to avoid passing signed char to
2532 isdigit, isalpha, isupper, islower, isspace, isalnum.
2533 * src/builtin.c (expand_user_macro): Likewise.
2534 * src/format.c (format): Likewise.
2535 * src/macro.c (expand_argument): Likewise.
2536 * NEWS: Document this security fix.
2539 * src/symtab.c (lookup_symbol): Use invalid, not illegal.
2540 * src/freeze.c (reload_frozen_state): Fix typo in message.
2541 (produce_frozen_state): Standardize on builtin, not built-in.
2542 * src/builtin.c (numeric_arg, bad_argc): Likewise.
2544 * configure.ac (M4_EARLY, M4_INIT): Use gnulib.
2545 (AC_PROG_RANLIB, AC_AIX, AC_MINIX, AC_CHECK_HEADERS),
2546 (AC_FUNC_ALLOCA, AC_REPLACE_FUNCS): Avoid checks now done by
2548 * Makefile.am (ACLOCAL_AMFLAGS): New entry, for gnulib.
2549 * m4/gnulib-cache.m4: New file, from gnulib.
2550 * bootstrap: Invoke gnulib-tool --update.
2551 * src/m4.c (main): Cast away const.
2552 * NEWS: Document that regex is updated.
2555 2006-06-08 Eric Blake <ebb9@byu.net>
2557 * configure.ac (changeword): Work even when changeword is not a
2559 (AC_PROG_AWK, AC_PROG_INSTALL, AC_PROG_MAKE_SET, AC_HEADER_STDC):
2560 Delete; now done by automake.
2561 (AC_ISC_POSIX, AC_C_CONST): Delete; now obsolete.
2563 2006-06-07 Eric Blake <ebb9@byu.net>
2565 * lib/regex.c (bcmp_translate): Canonicalize type name.
2566 * doc/Makefile.am (MAINTAINERCLEANFILES): Fix typo.
2567 * configure.ac (changeword): Disable changeword for the creation
2568 of configure, in case of bootstrapping with an m4 configured with
2569 --enable-changeword.
2571 Distribute a rudimentary man page.
2572 * Makefile.am (SUBDIRS): Move doc after src so that 'm4 --help'
2574 * doc/Makefile.am (man_MANS, EXTRA_DIST, MAINTAINERDISTCLEAN),
2575 (SUFFIXES, m4.1): New macros and rules to build m4.1.
2577 2006-06-06 Eric Blake <ebb9@byu.net>
2579 * lib/regex.c (re_match_2_internal, bcmp_translate): Avoid
2580 compiler warnings at -O2.
2581 * lib/getopt.c (_getopt_internal): Likewise.
2583 Cleanup of previous patches.
2584 * src/input.c (struct input_block): Remove traced member.
2585 (push_macro, init_macro_token): Don't pass trace status around.
2586 * src/m4.h (struct token_data): Remove traced member.
2587 (struct symbol, struct builtin): Reduce unused space.
2588 (TOKEN_DATA_FUNC): Simplify.
2589 (TOKEN_DATA_FUNC_TRACED): Remove unused macro.
2590 (push_macro, define_builtin): Remove unused parameter.
2591 * src/builtin.c (define_builtin, builtin_init, define_macro),
2592 (m4_defn): Don't pass trace status around.
2593 * src/macro.c (expand_argument): Likewise.
2594 * src/freeze.c (reload_frozen_state): Likewise.
2595 * src/symtab.c: Whitespace cleanup.
2596 * NEWS: Clean up wording.
2597 * doc/m4.texinfo (Undefine, Dumpdef, Trace): Cleanup wording;
2598 ensure tests actually expose bugs prior to today's patches.
2600 Trace status of builtins is no longer inherited across
2601 define(...,defn(...)). Fixes bug that autom4te had been working
2603 * src/builtin.c (define_builtin): Don't override trace status.
2604 * doc/m4.texinfo (Trace): Add test for this.
2605 * NEWS: Document this.
2607 When changing macro definitions inside the arguments to the macro,
2608 consistently preserve the old definition that was in effect before
2609 argument collection, similar to the C pre-processor.
2610 Reported by John Brzustowski.
2611 * NEWS: Document this change.
2612 * doc/m4.texinfo (Macro Arguments, Undefine, Dumpdef): Document
2613 this policy, and add tests that expose core dumps prior to this
2615 * src/m4.h (struct symbol): New members to track when a symbol is
2616 still in use after removal from the symbol table.
2617 (SYMBOL_PENDING_EXPANSIONS, SYMBOL_DELETED): Define.
2618 (free_symbol): Prototype.
2619 * src/macro.c (expand_macro): Track pending expansions of a
2620 symbol. On completion, if a symbol is deleted and no longer
2621 pending, free its memory.
2622 * src/symtab.c (free_symbol): Export. Don't free memory if symbol
2624 (lookup_symbol) <SYMBOL_INSERT>: Create new entry when old entry
2626 (lookup_symbol) <SYMBOL_DELETE, SYMBOL_POPDEF>: Mark entries still
2627 in use as deleted and remove from the table without freeing
2629 (symtab_print_list) [DEBUG_SYM]: More debug output.
2631 * src/symtab.c (hack_all_symbols): Allow certain modifications of
2632 the symbol table during traversal.
2633 * src/builtin.c (set_trace): Replace SYMBOL_DELETE with
2634 SYMBOL_POPDEF, since only the latter is safe with
2637 Solve crash when passing "indir(`foo')" to "m4 -tfoo".
2638 * src/symtab.c (lookup_symbol) <SYMBOL_DELETE, SYMBOL_POPDEF>:
2639 Preserve placeholder when macro is being traced.
2640 * src/builtin.c (m4_ifdef, m4_indir): A traced but undefined
2641 symbol is not defined.
2642 (set_trace): Remove placeholder when no longer traced.
2643 (m4_traceon): On named traces, always reserve a slot in the
2645 (m4_traceoff): Don't warn about untracing a nonexistent symbol.
2646 * NEWS: Document new trace behavior.
2647 * doc/m4.texinfo (Trace): Tracing by name now consistently works
2648 no matter whether that macro is currently defined.
2649 (Incompatibilities): Document differences between traditional and
2652 2006-06-04 Paul Eggert <eggert@cs.ucla.edu> (tiny change)
2653 Eric Blake <ebb9@byu.net>
2655 * src/m4.h (hash_table_size): Now size_t instead of int.
2656 * src/m4.c (hash_table_size): Likewise.
2657 (main): Adjust to this; use atol rather than atoi.
2658 * src/symtab.c: Include <limits.h>, for CHAR_BIT.
2659 (symtab_init, lookup_symbol, hack_all_symbols):
2660 Use size_t for sizes and indexes, not int.
2661 (symtab_print_list) [DEBUG_SYM]: Likewise.
2662 (hash): Likewise. Don't case-fold in the hash function.
2663 Shift by 7, not 3, for consistency with gnulib/lib/hash.c.
2664 Don't assume hash word is 32 bits.
2665 * NEWS: Document this change.
2667 2006-06-04 Eric Blake <ebb9@byu.net>
2669 * src/symtab.c (symtab_debug, symtab_print_list) [DEBUG_SYM]: Fix
2670 to allow compilation, for use in debugger.
2671 (profiles, current_mode) [DEBUG_SYM]: New variables.
2672 (show_profile, profile_strcmp) [DEBUG_SYM]: New methods for
2673 determining hash table performance.
2675 2006-05-31 Eric Blake <ebb9@byu.net>
2676 John Brzustowski <jbrzusto@fastmail.fm>
2678 * src/input.c (input_stack): Delete; use current_input instead.
2679 (wrapup_stack): Dynamically allocate, so that recursion is handled
2681 (push_wrapup): Use current wrapup stack.
2682 (pop_wrapup): Rotate wrapup stack to current, and create new
2684 (input_init): Dynamically allocate stacks.
2685 * NEWS: Update, now that recursive m4wrap can no longer cause
2688 2006-05-31 Eric Blake <ebb9@byu.net>
2690 * lib/getopt.c: Fix copyright year.
2691 * lib/obstack.c: Ditto.
2692 * src/builtin.c: Ditto.
2694 2006-05-30 Eric Blake <ebb9@byu.net>
2696 * doc/m4.texinfo (M4wrap): Add test to expose m4wrap bug.
2697 Reported by John Brzustowski.
2698 (Incompatibilities): Document known POSIX incompatibilities.
2701 2006-05-29 Eric Blake <ebb9@byu.net>
2703 * doc/m4.texinfo (Maketemp): Work even when running 'make check'
2707 * Makefile.am: New file.
2708 * doc/Makefile.am: Ditto.
2709 * examples/Makefile.am: Ditto.
2710 * lib/Makefile.am: Ditto.
2711 * src/Makefile.am: Ditto.
2712 * acinclude.m4: New file, renamed from aclocal.m4.
2713 * configure.ac (AM_INIT_AUTOMAKE): Invoke new macro.
2714 (AC_ARG_PROGRAM): Now redundant.
2715 (STACKOVF): Turn into automake conditional.
2716 (AC_CONFIG_COMMANDS): stamp-h is a command, not a file.
2717 * checks/Makefile.in: Converting this dir to automake was not
2718 trivial; for now, just add missing targets demanded by top-level.
2719 * INSTALL: Remove files that are now generated from CVS.
2720 * Makefile.in: Ditto.
2721 * aclocal.m4: Ditto.
2722 * install-sh: Ditto.
2723 * mkinstalldirs: Ditto.
2724 * doc/Makefile.in: Ditto.
2725 * doc/texinfo.tex: Ditto.
2726 * examples/Makefile.in: Ditto.
2727 * lib/Makefile.in: Ditto.
2728 * src/Makefile.in: Ditto.
2730 * AUTHORS: Backport from CVS head, and update.
2731 * doc/m4.texinfo (Changeword): Fix examples to match behavior.
2733 2006-05-27 Eric Blake <ebb9@byu.net>
2735 * lib/regex.c (regex_compile): Kill compiler warnings.
2736 * lib/getopt.c: Likewise.
2737 * lib/obstack.c: Likewise.
2738 * src/builtin.c (builtin_init): Likewise.
2739 * src/path.c (path_search): Likewise.
2741 * doc/m4.texinfo: Fix usage of a vs. an.
2742 (Loops, Include, Cleardiv, Patsubst, Format, M4exit): Kill
2743 overfull hbox warnings.
2744 (Inhibiting Invocation, Divert, Maketemp, M4exit): Add new tests.
2746 * configure.ac: Update to autoconf 2.59. Forbid ^M4_. Fix
2748 * aclocal.m4 (fp_PROG_CC_STDC): Delete; now covered by autoconf.
2749 (fp_C_PROTOTYPES): Delete, GNU Coding Standards state we can now
2751 (M4_WITH_DMALLOC): Rename from fp_WITH_DMALLOC. Fix quoting.
2752 * src/m4.h (_): PROTOTYPES is no longer provided, assume C89.
2753 * src/Makefile.in: Delete remains of ansi2knr.
2754 * src/ansi2knr.1: Delete.
2755 * src/ansi2knr.c: Delete.
2757 2006-05-25 Eric Blake <ebb9@byu.net>
2759 * doc/m4.texinfo: Fix spelling errors. Use `invalid' instead of
2762 * doc/m4.texinfo (Francois): No longer needed as a tex variable.
2763 Reported by Karl Berry.
2765 2006-05-24 Eric Blake <ebb9@byu.net>
2767 * Makefile.in (html): New target.
2768 * doc/Makefile.in (html, m4.html): Likewise.
2769 (MAKEINFOHTML): New macro.
2770 * doc/m4.texinfo (Francois) [ifnottex]: Use newer texinfo
2772 (Regexp) [ifhtml]: Make cross-reference to emacs manual an
2774 Reported by Bob Badour.
2776 * THANKS: Update. Move reporter's email addresses here, instead
2779 2006-05-11 Eric Blake <ebb9@byu.net>
2782 * doc/m4.texinfo (Changequote): Give testsuite exposure to bug
2783 patched on 2005-12-04.
2784 Reported by Ilya N. Golubev.
2786 * bootstrap: New file, so that generated files need not be stored
2788 * Makefile.in (DISTFILES): Add bootstrap.
2790 Make testsuite less sensitive to doc changes.
2791 * doc/m4.texinfo: Use m4.input instead of filename.
2792 * checks/check-them (xerr): Turn m4.input into filename.
2793 * checks/Makefile.in (dist): Depend on stamp-checks.
2795 Portability updates for OS/2.
2796 * src/Makefile.in (EXEEXT, OBJEXT): Define.
2799 * lib/Makefile.in (OBJEXT): Define.
2801 * doc/Makefile.in (install, uninstall): Install info files into
2803 Reported by Andreas Buening.
2805 2006-05-09 Eric Blake <ebb9@byu.net>
2807 * install-sh: Update to newer upstream version.
2808 * mkinstalldirs: Likewise.
2809 Reported by Andreas Buening.
2811 * src/m4.c (main): Bump copyright year.
2812 * Makefile.in (datarootdir): Define, for autoconf 2.59c.
2813 * doc/Makefile.in (datarootdir): Likewise.
2815 2006-05-08 Eric Blake <ebb9@byu.net>
2818 * doc/m4.texinfo (Bugs): Backport bug email address from head.
2819 Reported by Stepan Kasal.
2821 2005-12-04 Ilya N. Golubev <gin@mo.msk.ru> (tiny change)
2823 * input.c (match_input): Do not pass expression with side effect
2824 to `obstack_grow'. Fix <INTERNAL ERROR: Recursive push_string!>.
2827 2005-12-04 Gary V. Vaughan <gary@gnu.org> (tiny change)
2829 * doc/m4.texinfo (How to debug macros and input): s/woould/would/
2830 Reported by Damian Menscher.
2832 2005-10-19 Gary V. Vaughan <gary@gnu.org> (tiny change)
2834 * configure.ac (AC_INIT): Bump to 1.4.4a.
2836 2005-10-19 Gary V. Vaughan <gary@gnu.org> (tiny change)
2839 * configure.ac (AC_INIT): Bump to 1.4.4.
2840 * NEWS: Describe 1.4.4's changes.
2841 * INSTALL, install-sh, doc/texinfo.tex: Updated from upstream.
2843 2005-10-17 John Gatewood Ham <zappaman@buraphalinux.org> (tiny change)
2845 * src/m4.c: fix return code when non-existent files are processed
2847 2005-10-17 John Gatewood Ham <zappaman@buraphalinux.org> (tiny change)
2849 * README: update email address for bug reports.
2851 2005-10-17 Gary V. Vaughan <gary@gnu.org>
2853 * doc/m4.info: Generated files are not kept in the repository.
2855 2005-05-01 Gary V. Vaughan <gary@gnu.org>
2857 The FSF are moving offices today. Changed their contact address
2858 in all files from `59 Temple Place, Suite 330, MA 02111-1307' to
2859 `51 Franklin Street, Fifth Floor, MA 02110-1301'.
2861 Also, some of the files here were never updated from the previous
2862 '675 Mass Ave, Cambridge, MA 02139', so changed those to the
2863 '51 Franklin Street, Fifth Floor, MA 02110-1301' address too.
2865 2005-03-31 Mike Frysinger <vapier@gentoo.org>
2867 * Makefile.in (bindir, infodir): Substitute from configure rather
2869 * doc/Makefile.in (infodir): Ditto.
2870 * src/Makefile.in (bindir): Ditto.
2873 2005-03-31 Gary V. Vaughan <gary@gnu.org>
2875 Changes needed to automate the release process for 1.4.3:
2877 * Makefile.in (dist): Make .tar.bz2 tarball too.
2878 * Makefile.maint (TSDEPS_DIST): Remove m4/libtool.m4.
2879 (cvs-news): Look 1 line further down for NEWS release number.
2880 (cvs-dist): We don't use automake, so make dist is fine.
2881 Remove double . before suffixes.
2882 (cvs-release): Don't mention manual.html.
2883 (fetch): Get latest gendocs files.
2884 (web-manual): Rewritten to use gendoc for multiformat manuals.
2885 * doc/gendocs.sh: Don't save an old version in m4 CVS!
2886 * doc/m4.texinfo (Index): HFS+ (the file system on my Mac) is case
2887 preserving, but case insensitive, so generating html docs per node
2888 clashes between Index.html, the node file, and index.html, the
2889 top-level of the document tree...
2890 (Index macro): ...so renamed to this. Changed all references.
2892 2005-03-31 Gary V. Vaughan <gary@gnu.org> (tiny change)
2894 * configure.ac (AC_INIT): Bump to 1.4.3a.
2896 2005-03-31 Gary V. Vaughan <gary@gnu.org> (tiny change)
2899 * configure.in (AC_INIT): Bump to 1.4.3.
2900 * NEWS: Describe 1.4.3's changes.
2902 2005-03-31 Gary V. Vaughan <gary@gnu.org>
2904 * Makefile.maint: New file with release rules, from CVS libtool.
2905 * Makefile.in (DISTFILES): Add Makefile.maint.
2906 * INSTALL, install-sh, doc/texinfo.tex: Updated to latest
2909 2005-03-31 Eric Blake <ebb9@byu.net> (tiny change)
2911 * doc/m4.texinfo (Patsubst): Re-add trailing space required by
2912 checks/47.patsubst, with a redundant @comment to prevent emacs
2913 from removing it accidentally again.
2914 * checks/get-them: Allow for trailing spaces tucked behind
2917 2005-03-31 Eric Blake <ebb9@byu.net> (tiny change)
2919 * doc/Makefile.in (install, uninstall): Accomodate DESTDIR.
2920 * src/Makefile.in (install, uninstall): Likewise.
2922 2005-02-07 Gary V. Vaughan <gary@gnu.org>
2924 * lib/regex.c, lib/regex.h: Reverted gnulib update, which broke
2926 Reported by Eric Blake.
2928 2005-02-04 Gary V. Vaughan <gary@gnu.org>
2930 * lib/regex.c, lib/regex.h: Updated from gnulib.
2931 * src/input.c (set_word_regexp): Don't change the word_regexp
2932 unless it compiles correctly.
2934 Reported by Frank Schwidom.
2936 * Makefile.in (stamp-h): Regenerate config.h properly.
2938 2005-02-03 Gary V. Vaughan <gary@gnu.org>
2940 * configure.ac (AC_DEFINE): Fix overquoting of description
2943 * src/m4.h (__CYGWIN__, WIN32): Canonicalise Windows and Cygwin
2945 * src/freeze.c (produce_frozen_state): Use \n line-endings even
2946 on Windows, so that the frozen file reader will work.
2947 Reported by Josef T. Burger.
2949 * src/m4.c (main): Modernise the --version output.
2951 2005-02-03 Gary V. Vaughan <gary@gnu.org>
2953 Modernise the configury a little to prevent spurious errors from
2954 Autoconf-2.59's autoreconf:
2956 * config.h.in: Renamed to...
2957 * config-h.in: ...this to better support DOS 8.3 file systems.
2958 * acconfig.h: Removed.
2959 * configure.in: Renamed to...
2960 * configure.ac: ...this, and AC_DEFINE used to declare config.h
2961 entry comments. Slight reorganisation and reformatting.
2962 * aclocal.m4: Use third argument to AC_DEFINE to declare config.h
2964 (AC_INIT): Use a modern 3 argument call.
2965 * Makefile.in, checks/Makefile.in, doc/Makefile.in,
2966 examples/Makefile.in, lib/Makefile.in, src/Makefile.in:
2967 s/PRODUCT/PACKAGE/g.
2968 * Makefile.in (DISTFILES): Removed acconfig.h, configure.in,
2969 config.h.in. Added configure.ac, config-h.in.
2970 (stamp-h.in): Removed acconfig.h from dependencies.
2971 (configure): Depends on configure.ac, not configure.in.
2972 * doc/Makefile.in (stamp-vti): Ditto.
2973 * src/freeze.c (produce_frozen_state), src/m4.c (main): Adjust for
2974 difference between PRODUCT="m4" and PACKAGE="GNU M4".
2975 * configure: Regenerated.
2977 2005-02-03 Noah Misch <noah@cs.caltech.edu>
2979 * src/output.c (mkstemp): Make non-static, and build regardless of
2980 HAVE_TMPFILE; src/builtin.c also needs this replacement.
2983 2004-09-09 Vincent Lonngren <Vincent.lonngren.759@student.lu.se>
2985 * configure.in (AC_CHECK_HEADERS): Commit works best when you save
2986 changes from your editor buffer first.
2988 * configure.in (AC_CHECK_HEADERS): Add signal.h, sys/signal.h.
2989 * src/m4.c: And include them as appropriate.
2992 2004-09-09 Andreas Schwab <schwab@suse.de>
2994 Refactoring of the string read case in next_char provides about a
2995 20% speedup of M4 as typically used by autoconf:
2997 * src/input.c (next_char_1): Renamed from next_char.
2998 (next_char): New macro.
3001 2004-08-21 Gary V. Vaughan <gary@gnu.org>
3003 * configure.in (VERSION): Bump to 1.4.2a.
3005 2004-08-19 Paul Eggert <eggert@twinsun.com>
3008 * configure.in (VERSION): Bump to 1.4.2.
3009 * News: Describe 1.4.2's changes.
3011 * src/m4.c (reference_error): Preserve errno, since M4ERROR
3013 * src/builtin.c (m4_esyscmd): Clear errno before calling popen.
3014 (m4_maketemp): Clear errno before calling mkstemp.
3015 * src/path.c (path_search): Don't let "free" trash errno when
3017 * src/output.c (insert_file): Don't assume errno has a valid
3018 value simply because fread returns zero. This fixes a
3019 portability bug reported by Marion Hakanson in
3020 <http://lists.gnu.org/archive/html/bug-m4/2004-07/msg00029.html>.
3022 2004-06-09 Gary V. Vaughan <gary@gnu.org>
3024 * configure.in (VERSION): Bump to 1.4.1a.
3025 * NEWS: Place holder for next stable release.
3027 2004-06-03 Paul Eggert <eggert@cs.ucla.edu>
3030 * configure.in (VERSION): Bump to 1.4.1.
3031 * NEWS: Describe 1.4.1's changes.
3033 * aclocal.m4 (fp_PROG_CC_STDC): Use AC_DEFUN, not define, to
3034 pacify Autoconf 2.59.
3036 * doc/m4.texinfo: Insert commas after @xref's that lack them,
3037 to pacify Texinfo 4.7.
3038 * doc/Makefile.in (info): Remove info-1, info-2, info-3.
3040 * src/m4.h, src/debug.c: Use #ifdef __STDC__, not #if __STDC__, to
3041 pacify Sun C compilers.
3043 2003-09-28 Akim Demaille <akim@epita.fr>
3045 * src/symtab.c (lookup_symbol): Fix an uninitialized-variable
3048 2003-09-03 Santiago Vila <sanvila@debian.org>
3050 * examples/stackovf.sh: Use tempfile if available.
3052 2001-04-02 Robert Bihlmeyer <robbe@orcus.priv.at>
3054 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=92629
3055 * src/output.c (m4_insert_file): Do not mix buffered and
3056 unbuffered I/O, as this breaks on the Hurd. (trivial change)
3058 2001-02-01 Santiago Vila <sanvila@debian.org>
3060 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=84451
3061 * src/m4.c (main): Fix format vulnerabilities. (trivial change)
3063 2001-02-01 Matt Kraai <kraai@debian.org>
3065 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=84416
3066 * doc/m4.texinfo (Maketemp): Change maketemp to refer to a new,
3067 empty file rather than to a nonexistent file. This closes a common
3069 * src/builtin.c (m4_maketemp): Implement the above, by using
3070 mkstemp rather than mktemp. (trivial change)
3072 2000-01-09 Akim Demaille <demaille@inf.enst.fr>
3074 * src/builtin.c (expand_ranges): Added break after trailing dash.
3075 This caused misbehaviors on some systems.
3077 Sat Nov 5 15:52:47 1994 Francois Pinard (pinard@icule)
3080 * doc/Makefile.in (realclean): Also remove stamp-vti.
3081 Reported by Eric Backus.
3083 Wed Nov 2 00:47:53 1994 Francois Pinard (pinard@icule)
3085 * src/freeze.c (produce_frozen_state): If the frozen file cannot
3086 be opened, return immediately after producing the error message.
3087 Reported by Andreas Schwab.
3089 * configure.in: Check for const only after having found possible
3090 ANSIfying compiler flags, this is of no use to check it before.
3091 Reported by Alexander Lehmann.
3093 Tue Nov 1 22:02:37 1994 Francois Pinard (pinard@icule)
3095 * src/macro.c (collect_arguments): Cast obstack arguments to
3096 (voidstar), so avoiding compiler warnings.
3097 Reported by Joseph E. Sacco.
3099 * src/freeze.c (produce_frozen_state): Cast printed lengths to
3100 (int) so they correspond to %d format items.
3101 Reported by Joseph E. Sacco.
3103 * src/m4.c (main): Cast the argument to xfree to (voidstar).
3104 * src/symtab.c (free_symbol): Idem.
3105 Reported by Karl Vogel.
3107 Mon Oct 31 02:11:19 1994 Francois Pinard (pinard@icule)
3109 * Makefile.in (DISTFILES): Distribute BACKLOG.
3111 * configure.in: Define PRODUCT and VERSION.
3112 * acconfig.h: Document PRODUCT and VERSION.
3113 * src/m4.c, src/freeze.c: Use PRODUCT and VERSION instead of the
3114 constant string m4 and variable or parameter named version.
3116 Sun Oct 30 08:13:03 1994 Francois Pinard (pinard@icule)
3118 * src/m4.h, src/debug.c: Replace all #ifdef __STDC__ by #if
3119 __STDC__. Alliant FX/2800 Concentrix 2.2 (i860-BSD4.3) compiler
3120 defines __STDC__ to 0, for indicating it is *not* ANSI!
3121 Reported by Kaveh R. Ghazi.
3123 * configure.in: Added obsolescent tests for AIX and Minix.
3125 * doc/Makefile.in (mostlyclean): Remove texclean in dependencies,
3126 which texclean does not exist anymore.
3127 Reported by Eric Backus, Jim Meyering, John David Anglin and
3130 Sat Oct 29 05:10:03 1994 Francois Pinard (pinard@icule)
3132 * aclocal.m4 (fp_C_PROTOTYPES): Force -D_HPUX_SOURCE with -Aa.
3133 Reported by John David Anglin.
3135 * src/ansi2knr.c: New version, sent by Peter Deutsch.
3136 * aclocal.m4 (fp_C_PROTOTYPES): Substitute empty or ansi2knr for
3137 ANSI2KNR, depending on the fact the compiler is ANSI or not.
3138 * src/Makefile.in: Use -Ovarargs=convert on ansi2knr calls.
3139 Remove the sed filter after ansi2knr for debug.c. Use $O instead
3140 of $U, put underline in extensions rather than in basenames. Use
3141 implicit rules, now that regularity makes this possible.
3142 Have $(OBJECTS) depend on $(ANSI2KNR), so to trigger compilation
3143 of ansi2knr whenever it is needed.
3144 * configure.in: Adjusted for correct STACKOVF substitution.
3145 * src/debug.c (trace_format): When not __STDC__, use (...) as a
3146 parameter list, so ansi2knr will convert it to (va_alist) va_dcl.
3147 Reported by David MacKenzie.
3149 * Makefile.in: Remove binprefix. Use transform_name instead.
3150 Reported by David MacKenzie.
3152 * doc/Makefile.in: Create version.texi, use it, clean it.
3153 Reported by Jim Meyering.
3155 Fri Oct 28 20:33:55 1994 Francois Pinard (pinard@icule)
3157 * Makefile.in (all, install, uninstall): Depend on Makefile.
3159 * Makefile.in: For actions invoking $(MAKE) from within compound
3160 sh statements, exit non-zero if the sub-make fails. Otherwise,
3161 the top-level make may exit successfully when it should fail.
3162 Reported by Jim Kingdon.
3164 * {,/*}Makefile.in: Use && after all cd, in case they fail.
3166 * {,*/}Makefile.in: Declare PRODUCT and VERSION macros.
3167 (dist): Use PRODUCT and VERSION instead of tricks on .fname.
3168 * configure.in: Substitute PRODUCT and VERSION.
3170 * {,*/}Makefile.in (dist): Always try a hard link before a copy.
3172 Thu Oct 27 22:32:58 1994 Francois Pinard (pinard@icule)
3174 * Makefile.in (mostlyclean-local): Do not remove *~.
3175 * */Makefile.in (mostlyclean): Idem.
3176 Reported by Robert E. Brown and Richard Stallman.
3178 Sun Oct 9 08:30:13 1994 Francois Pinard (pinard@icule)
3180 * src/m4.h: Get rid of CONFIG_BROKETS.
3182 Sun Oct 2 16:48:10 1994 Francois Pinard (pinard@icule)
3184 * configure.in: Use AC_ARG_PROGRAM.
3185 * aclocal.m4 (fp_C_PROTOTYPES): Substitute @kr@ by kr or empty.
3186 Reported by David MacKenzie.
3188 Sat Oct 1 11:22:42 1994 Francois Pinard (pinard@icule)
3190 * configure.in: Do not add -O to CFLAGS for GNU C, now that
3191 configure does it automatically.
3192 Reported by Jim Meyering.
3194 Fri Sep 23 08:16:58 1994 Francois Pinard (pinard@icule)
3196 * src/stackovf.c: Declare the handler_t typedef earlier in the
3197 code, use it for stackovf_handler.
3198 (setup_stackovf_trap): Use RETSIGTYPE instead of void while
3199 casting sigsegv_handler.
3200 Reported by Robert Bernstein.
3202 * src/m4.c (main): Initialize program_name to argv[0] without
3204 Reported by Karl Berry.
3206 Sun Sep 18 11:42:50 1994 Francois Pinard (pinard@icule)
3208 * src/Makefile.in (TAGS): Include a ../lib/TAGS reference.
3209 Reported by Karl Berry.
3211 Wed Sep 14 10:00:22 1994 Francois Pinard (pinard@icule)
3213 * lib/Makefile.in (mostlyclean): Added.
3214 (TAGS): Make in $(srcdir).
3216 * configure.in: Use `choke me' in test, like everywhere!
3218 * {doc,examples,lib,src}/Makefile.in (check): Deleted, as
3219 unreacheable and useless.
3221 * doc/Makefile.in (texclean): Deleted, merged in mostlyclean.
3223 * lib/Makefile.in (DISTFILES): Distribute TAGS.
3224 (distclean): Do not remove TAGS.
3225 (realclean): Remove it.
3226 * Makefile.in: Make TAGS in lib also, not just in src.
3227 Reported by Karl Berry.
3229 * Makefile.in (distclean, realclean): Instead of recursively
3230 calling $(MAKE) for the -local part, allow parallel execution of
3231 -recursive and -local, only delay the removal of config.status,
3232 which is repeated in both goals.
3234 Tue Sep 13 19:21:05 1994 Francois Pinard (pinard@icule)
3237 * Makefile.in: Group all *clean-recursive goals in one, using sed
3238 to remove `-recursive' while calling make recursively. Also, use
3239 a subshell for each recursive $(MAKE).
3240 Reported by Jim Meyering.
3242 * src/m4.h (memcpy): Define with bcopy for BSD systems.
3243 Reported by Kaveh R. Ghazi.
3245 * src/Makefile.in (ansi2knr): Use $(LIBS) while linking, for SunOS
3246 4.1.3 requires -ldl to link even ansik2nr, and we need a way to
3249 * configure.in: Use date instead of touch for stamp-h.
3250 * Makefile.in (stamp-h.in): Idem.
3252 * Makefile.in (distclean, realclean): Force serial execution of
3253 both goals, in case parallel makes are being used.
3254 Reported by Jim Meyering.
3256 * src/Makefile.in (DISTFILES): Distribute TAGS.
3257 (distclean): Do not remove TAGS.
3258 (realclean): Remove it.
3259 Reported by Karl Berry.
3261 Sat Sep 10 12:34:04 1994 Francois Pinard (pinard@icule)
3263 * configure.in: Use fp_ to match aclocal.m4. Revert _OS_ macros
3264 to old names, for following Autoconf.
3266 Thu Sep 8 15:07:27 1994 Francois Pinard (pinard@icule)
3268 * Makefile.in (MDEFINES): Remove INSTALL substitutions, for
3269 ./install.sh will not be correctly referred to in sub-Makefiles.
3270 Reported by John David Anglin.
3272 * doc/Makefile.in (texclean): Remove *.cps and *.fns too.
3273 Reported by Eric Backus.
3275 * Makefile.in, checks/Makefile.in, doc/Makefile.in,
3276 examples/Makefile.in, lib/Makefile.in, src/Makefile.in: Limit
3277 config.status into remaking this directory's Makefile only.
3278 * Makefile.in (stamp-h): Do not check nor touch stamp-h.
3279 * configure.in (AC_OUTPUT): Touch stamp-h if CONFIG_HEADERS.
3280 Reported by Jim Meyering.
3282 Tue Sep 6 12:07:33 1994 Francois Pinard (pinard@icule)
3284 * configure.in: Correct stack overflow detection logic, taking
3285 care of systems having only incomplete implementations (like for
3286 Pyramid 9820 OSx 5.0d).
3287 Reported by Kaveh R. Ghazi.
3289 * src/Makefile.in (TAGS): Remote -t from etags call.
3291 Fri Sep 2 10:37:10 1994 Francois Pinard (pinard@icule)
3293 * lib/Makefile.in (install): Depend on all.
3295 Wed Aug 31 11:17:21 1994 Francois Pinard (pinard@icule)
3297 * examples/Makefile.in (mostlyclean): Do not depend on texclean.
3298 Reported by Jim Meyering and John David Anglin.
3300 * Makefile.in (distclean-local): Delete config.log.
3301 Reported by Jim Meyering.
3303 Solidify frozen files with respect to -P:
3304 * src/m4.c: Have -P set prefix_all_buitins variable instead of
3305 calling a function by that name. Declare the variable.
3306 * src/m4.h: Adjust declaration for prefix_all_buitins.
3307 * src/builtin.c (builtin_init): Merge in functionality from
3308 previous prefix_all_buitins function, while making entries in the
3309 symbol table, but not modifying the builtin description itself.
3311 * src/freeze.c (reload_frozen_state): Add a useless `break;',
3312 because *many* compilers do not accept an empty `default:'.
3313 Reported by Akiko Matsushita, Eric Backus, John David Anglin,
3314 Joseph E. Sacco, Kaveh R. Ghazi, Tom McConnell and Ulrich Drepper.
3316 * configure.in: Use AC_TYPE_SIGNAL.
3317 * src/stackovf.c (setup_stackovf_trap): Use RETSIGTYPE.
3318 Reported by Robert Bernstein.
3320 * checks/Makefile.in (check): Modify PATH so check-them will find
3321 m4 in the src directory.
3322 * Makefile.in (check): Don't.
3323 Reported by Akiko Matsushita and Jim Meyering.
3325 * src/output.c (make_room_for, output_character_helper): New
3326 functions, for implementing a global MAXIMUM_TOTAL_SIZE instead of
3327 a per buffer MAXIMUM_BUFFER_SIZE.
3329 * src/output.c (output_text): New function, for optimizing the
3330 output of strings of characters. Use it.
3332 Tue Aug 30 01:44:29 1994 Francois Pinard (pinard@icule)
3334 * doc, src: New directories reorganizing the distribution.
3335 * doc/Makefile.in, src/Makefile.in, examples/Makefile.in: New
3337 * Makefile.in: Adjusted.
3338 * configure.in: Configure new Makefiles.
3340 * m4.h: Declare STRING typedef. Use it for comment and quote
3341 strings, adjusting all references. (This is the rudiments of a
3342 beginning for the eventual withdrawal of NUL terminated strings.)
3343 * output.c (shipout_text): Accept a length parameter, and use it.
3344 All callers adjusted.
3346 Mon Aug 29 12:27:19 1994 Francois Pinard (pinard@icule)
3348 * m4.h: Include <unistd.h> if it exists.
3349 * stackovf.c: Don't.
3351 Clean up for current_diversion variable:
3352 * output.c: Move current_diversion from builtin.c.
3353 * m4.h: Declare current_diversion so builtin.c can access it.
3354 * output.c (output_init, make_diversion): Initialize or update
3356 * builtin.c (builtin_init, m4_divert): Leave current_diversion
3359 Remove limit on number of diversions:
3360 * output.c: Replace ndiversion by diversions, declare it.
3361 (output_init): Allocate only diversion 0.
3362 (make_diversion): Allocate new diversions as needed.
3363 * m4.h, m4.c: Remove NDIVERSIONS and ndiversion related stuff.
3364 * m4.c: Still accept -N, but do nothing with it.
3365 Reported by David MacKenzie.
3368 * output.c (freeze_diversions): New function.
3369 * m4.h: Declare freeze_diversions.
3370 * freeze.c: Document frozen file format, revise it, call
3371 freeze_diversions to add diversions to frozen format, and code to
3372 reload them properly.
3373 * m4.c: Do not undivert automatically at end when status being
3374 frozen. Do not call builtin_init when reloading frozen state.
3376 Speed up diversion processing:
3377 * output.c: Add INITIAL_BUFFER_SIZE, MAXIMUM_BUFFER_SIZE,
3378 COPY_BUFFER_SIZE, in-memory diversion buffers, struct diversion
3379 structure and variables, cached variables out of output_diversion,
3380 reallocate_diversion_for and OUTPUT_CHARACTER.
3381 (shipout_text, make_diversion, insert_diversion): Adapted to new
3383 (insert_file): Use better buffering.
3384 Reported by David MacKenzie.
3386 Sun Aug 28 05:20:02 1994 Francois Pinard (pinard@icule)
3388 * Makefile.in, lib/Makefile.in, checks/Makefile.in: Arrange so
3389 dist works from another build directory.
3391 Sat Aug 27 14:32:45 1994 Francois Pinard (pinard@icule)
3393 * symtab.c (hack_all_symbols): Use hash_table_size instead of
3394 constant HASHMAX, for -H option to work better.
3396 * builtin.c (DECLARE): Simplify by using _ ().
3398 * freeze.c: New file.
3399 * Makefile.in: Compile it, distribute it.
3400 * m4.c: Recognize, document and process --freeze-state (-F) and
3401 --reload-state (-R) options. Pass a true flag to builtin_init
3402 only if no reloading some state.
3403 * builtin.c (define_builtin): Remove static specifier.
3404 (find_builtin_by_name): Remove static specifier.
3405 (builtin_init): Accept and obey a flag argument.
3406 * m4.h: Add declarations for freeze.c, changes for builtin.c.
3408 Wed Aug 24 16:14:19 1994 Francois Pinard (pinard@icule)
3410 * builtin.c (dumpdef_cmp): Rewrite so the cast protect the const
3413 * configure.in: Implement --with-dmalloc.
3414 * acconfig.h: Document WITH_DMALLOC.
3415 * m4.h: Add code for when WITH_DMALLOC.
3417 Mon Aug 15 12:38:05 1994 Francois Pinard (pinard@icule)
3419 * m4.c (long_options): Use "error-output", the dash was missing.
3420 Reported by Akiko Matsushita.
3422 Fri Aug 12 16:38:01 1994 Francois Pinard (pinard@icule)
3424 * m4.h: Include <sys/types.h>.
3425 * builtin.c, debug.c, m4.c, output.c, stackovf.c: Don't.
3426 * m4.h: Declare len_lquote and len_rquote as size_t, not int.
3428 * input.c: Declare len_lquote, len_rquote, len_bcomm and len_ecomm
3430 * builtin.c (dump_args): Declare len as size_t, not int.
3432 * debug.c: Prototype the forward declaration of debug_set_file.
3434 * builtin.c (m4_undivert): Replace div by file, for avoiding the
3435 shadowing of this variable.
3436 * output.c (insert_diversion): Idem.
3438 * input.c: Delete def_rquote, def_lquote, def_bcomm and def_ecomm.
3439 (input_init): Duplicate default quote and comment strings.
3440 (set_quotes): Free previous quote strings in all cases. Duplicate
3441 even default quote strings.
3442 (set_comment): Free previous comment strings in all cases.
3443 Duplicate even default comment strings.
3445 * configure.in: Updated for Autoconf 2.0.
3446 * Makefile.in (distclean-local): Also delete config.cache.
3448 * m4.c (usage): Reorganize the --help output by topic. Include a
3449 description for debugging flags.
3451 Fri Jul 29 10:15:52 1994 Francois Pinard (pinard@icule)
3453 * configure.in: If sigaction is available and SA_ONSTACK defined,
3454 use sigaction. Otherwise, if sigvec is available and SV_ONSTACK
3455 defined, use sigvec. Else don't compile stackovf.c.
3456 * stackovf.c (setup_stackovf_trap): Idem.
3457 Reported by Jim Avera, Karl Berry, Kaveh R. Ghazi, Matthias Rabe
3460 Thu Jul 21 22:43:17 1994 Francois Pinard (pinard@icule)
3462 * m4.c (usage): Replace printf par fputs.
3464 Mon Jul 18 23:48:23 1994 Francois Pinard (pinard@icule)
3468 Sun Jul 17 08:08:25 1994 Francois Pinard (pinard@icule)
3470 * configure.in: Check for sigaction and sigvec. Add a new delayed
3471 check for RLIMIT_STACK, combine in the checking for getrlimit.
3472 All those things are not universally available.
3473 * stackovf.c: Split setting up the trap handler and catching
3474 signals, for better taking care of various configure outcomes.
3475 * examples/stackovf.sh: Correct a typo.
3476 Reported by Eric Backus, Jim Avera and Jim Meyering.
3478 Sat Jul 16 20:36:19 1994 Francois Pinard (pinard@icule)
3480 * ansi2knr.c: New version sent by its author, Peter Deutsch.
3482 Fri Jul 15 14:36:21 1994 Francois Pinard (pinard@icule)
3484 * Makefile.in: Modify so parallel make will not try making
3485 lib/libm4.a twice simultaneously.
3486 Reported by Jim Meyering.
3488 Thu Jul 14 17:23:17 1994 Francois Pinard (pinard@icule)
3490 * stackovf.c (setup_stackovf_trap): Replace "Don't" by "Do not" in
3491 error message, for when no code possibility exists. Even if this
3492 line is completely #ifdef'ed out, it brings a syntax error.
3493 Reported by Andreas Schwab, Jim Meyering and Joseph E. Sacco.
3495 * Makefile.in (install): Have install depend on all too, for lib
3496 to be remade as needed.
3498 * examples/stackovf.sh: Try ksh, bsh and bash for shells
3499 providing ulimit, instead of using only ksh.
3500 Reported by Jim Avera and Joseph E. Sacco.
3502 Tue Jul 12 06:54:31 1994 Francois Pinard (pinard@icule)
3504 * Makefile.in (check): Have it depend on all instead of m4. In
3505 this way, a change in lib will be detected and processed.
3507 * builtin.c (numeric_arg): Use strtol and verify the conversion,
3508 instead of using sscanf which stops as soon as there is a
3509 non-digit in the input. Previously, incr(1xyzzy), eval(1,2xyzzy)
3510 and divert(1xyzzy) were all accepted without any warning or error
3512 * m4.h: Declare strtol as long if not including stdlib.h.
3513 * configure.in: Check for limits.h, and replace strtol if missing.
3514 * lib/Makefile.in: Substitute LIBOBJS. Distribute strtol.c.
3515 * lib/strtol.c: New file, from elsewhere.
3516 Reported by Andreas Schwab.
3518 Thu Jul 7 22:38:10 1994 Francois Pinard (pinard@icule)
3520 * macro.c (expand_macro): Cast value to (boolean) prior to
3521 assigning it to traced.
3522 Reported by Tom McConnell.
3524 * Makefile.in (m4): Always make all in lib first.
3525 Reported by Jim Meyering.
3527 Wed Jul 6 13:16:31 1994 Jim Avera (jima@netcom.com)
3529 * stackovf.c: Isolated OS-dependent sections; Improved portability,
3530 adding support for SunOS/BSD (sigvec, sigstack, and 4-parameter signal
3531 handlers), and a default error message if the fault address is not
3532 available (when neither siginfo.h nor BSD sigcontext are supported).
3533 * configure.in: Changes for stackovf.h: Check for sigcontext,
3534 sigaction, sigstack, and define rlim_t as int if necessary.
3535 * acconfig.h: Added HAVE_SIGCONTEXT and rlim_t.
3536 * examples/stackovf.sh: Run m4 -L99999999 to allow stack overflow.
3537 * ansi2knr.c: Fix for func-ptr args; convert "..." to varargs syntax.
3539 Tue Jul 5 19:13:54 1994 Francois Pinard (pinard@icule)
3541 * configure.in: Use AC_SET_MAKE.
3542 * Makefile.in: Use @SET_MAKE@.
3543 Reported by Jim Meyering.
3545 * checks/check-them: Do not trap on SIGQUIT or SIGALRM.
3546 Reported by Ian Taylor.
3548 Sat Jul 2 00:58:47 1994 Francois Pinard (pinard@icule)
3550 * configure.in: Remove dependency of USE_STACKOVF on STDC_HEADERS,
3551 because siginfo.h is unrelated to standard headers, and siginfo.h
3552 is already checked for.
3553 Reported by Joseph E. Sacco.
3555 * acconfig.h, aclocal.m4, m4.h: Replace HAVE_PROTOTYPES by
3557 * aclocal.m4, configure.in: Replace AC_HAVE_PROTOTYPES by
3560 Wed Jun 29 22:41:53 1994 Francois Pinard (pinard@icule)
3562 * builtin.c (substitute): Use \& to represent this part of the
3563 string which was matched by the whole regexp, instead of
3564 representing the whole string. Any usage of \0 issues a warning
3565 and acts like \&, it will disappear in some subsequent release.
3567 Mon Jun 27 14:24:23 1994 Francois Pinard (pinard@icule)
3569 * m4.c: Complete prototype for forwarded declaration of usage.
3571 * input.c (init_macro_token): Correct own reference in error
3572 message. Previous name get_macro_func was referred to instead.
3573 (next_char): Correct own reference in error message. Previous
3574 name advance_input was referred to instead.
3576 * m4.h: Declare eval_t and unsigned_eval_t typedefs to 32 bits.
3577 * eval.c (logical_or_term, logical_and_term, or_term, xor_term,
3578 and_term, not_term, logical_not_term, cmp_term, shift_term,
3579 add_term, mult_term, exp_term, unary_term, simple_term): Add
3580 prototype to forwarded declarations. Declare parameter v1 as
3581 eval_t * instead of int *. Same for local variable v2 in dyadic
3582 functions. Same for result in exp_term.
3583 * builtin.c (m4_eval): Declare value as eval_t instead of int.
3584 (ntoa): Declare value as eval_t instead of int. Declare uvalue as
3585 unsigned_eval_t instead of unsigned int. Change casts accordingly.
3586 (shipout_int): Cast first argument of ntoa to eval_t.
3587 Reported by Thorsten Ohl.
3589 * macro.c: Complete the prototypes of forwarded expand_macro and
3591 Reported by Thorsten Ohl.
3593 * m4.h: Define voidstar as void * or char * depending on __STDC__.
3594 The Ultrix 3.1 compiler cannot do much with void pointers.
3596 * builtin.c (dumpdef_cmp): Replace void * by voidstar.
3597 * m4.c (xfree): Replace void * by voidstar.
3598 Reported by Tom McConnell.
3600 * ansi2knr.1: New, from elsewhere.
3601 * Makefile.in (DISTFILES): Distribute ansi2knr.1
3603 * Makefile.in (stamp-h.in): Avoid running ./config.status if
3604 stamp-h does not exist yet. This avoids running it a second time
3605 just after the initial ./configure.
3606 Reported by David MacKenzie and Tom McConnell.
3608 * m4.h: Replace the enum debug_info declaration with a series of
3609 #define's. The Ultrix 3.1 compiler would otherwise need casting
3610 (int) to most references, when used in expressions.
3611 Reported by Tom McConnell.
3613 Sat Jun 25 00:10:05 1994 Francois Pinard (pinard@icule)
3615 * aclocal.m4: Replace FP_PROTOTYPES by AC_HAVE_PROTOTYPES,
3616 following an idea from Brook G. Milligan. AC_HAVE_PROTOTYPES
3617 calls the compiler. Previously, FP_PROTOTYPES was only calling
3618 the preprocessor; by not being subject to CFLAGS, this was
3619 discouraging those flags asking for ANSI compilation.
3620 * acconfig.h: Document HAVE_PROTOTYPES.
3621 * configure.in: Use AC_HAVE_PROTOTYPES instead of FP_PROTOTYPES.
3622 * m4.h: Define _() according to HAVE_PROTOTYPES, not __STDC__.
3623 Reported by Eric Backus.
3625 * configure.in: Substitute CFLAGS and LDFLAGS, taking their value
3626 from the environment. Default CFLAGS to -g if not set.
3627 * Makefile.in: Have CFLAGS and LDFLAGS substituted from configure.
3628 * lib/Makefile.in: Have CFLAGS substituted from configure.
3629 Reported by Eric Backus and Tom McConnell.
3631 * configure.in: m4_undefine changeword before using AC_ENABLE.
3633 * m4.h: Declare prototypes for error (for ANSI compilers only),
3634 prefix_all_builtins and reference_error.
3635 Reported by Tom McConnell.
3637 * input.c (set_word_regexp): Do not try to initialize the array
3638 test from a string, this does not work with non-ANSI compilers.
3639 Reported by Eric Backus.
3641 * Makefile.in (dist): Clean examples/ before saving it.
3642 (distclean-local): Also remove stamp-h.
3643 Reported by Eric Backus.
3645 * Makefile.in (_stackovf.c): Goal for compiling stacokovf.c with
3647 Reported by Tom McConnell.
3649 * checks/Makefile.in (clean): Depends on mostlyclean.
3650 (mostlyclean): New goal.
3652 Fri Jun 24 23:30:31 1994 Francois Pinard (pinard@icule)
3654 * Makefile.in (DISTFILES): Distribute install.sh.
3655 * install.sh: New file, copied from elsewhere.
3656 Reported by Assar Westerlund and Kaveh R. Ghazi.
3658 Thu Jun 23 00:00:30 1994 Francois Pinard (pinard@icule)
3660 * configure.in: Define ENABLE_CHANGEWORD if --enable-changeword.
3661 * acconfig.h: Explain ENABLE_CHANGEWORD.
3663 [These modifs all depend upon ENABLE_CHANGEWORD and are adapted
3664 from code provided by Pete Chown]
3665 * m4.h: Add original_text field to u_t variant of union u.
3666 Declare TOKEN_DATA_FUNC macro.
3667 * builtin.c: Declare changeword.
3668 (m4_changeword): New function.
3669 * input.c: Include "regex.h", define variables with word regexps.
3670 (input_init): Initialize the word regexp.
3671 (set_word_regexp): New.
3672 (next_token): Declare local variables, use the previous code if
3673 default_word_regexp is true. Else, match using a new code. Save
3675 * macro.c (expand_token): Ship out original text if not a macro
3677 Reported by Krste Asanovic and Pete Chown.
3679 [These modifs all depend upon ENABLE_CHANGEWORD]
3680 * m4.h: Declare external user_word_regexp.
3681 * m4.c: Declare user_word_regexp, and initialize it from
3682 --word-regexp or -W, or NULL if not specified.
3683 * input.c: Use user_word_regexp if specified, instead of
3684 DEFAULT_WORD_REGEXP.
3686 * Makefile.in (m4): Revert Jan 3 1994 change. I'm unable to
3689 * Makefile.in, lib/Makefile.in: Limit suffixes to .c and .o.
3690 * checks/Makefile.in: Empty the suffix list.
3691 Reported by Geoff Russell, Joel Sherrill and Roland McGrath.
3693 * m4.c: Declare nesting_limit and initialize it to 250.
3694 Implement -LNUMBER or --nesting-limit=NUMBER to change its
3696 * m4.h: Declare nesting_limit as external.
3697 * macro.c (expand_macro): Stop execution whenever nesting limit
3699 Reported by Bengt Mertensson.
3701 * eval.c (evaluate): Diagnose excess characters in eval input.
3702 Things like `eval(08)' used to return 0 with no diagnostic.
3704 * m4.h: Capitalize first letter of all macro arguments in
3707 * m4.c: Declare warning_status, initialize it to 0. Add new
3708 option -E, or --fatal-warnings, which sets warning_status to
3709 EXIT_FAILURE instead.
3710 * m4.h: Declare external warning_status. Define EXIT_SUCCESS and
3711 EXIT_FAILURE if not otherwise done by header files.
3712 * m4.c: Delete declarations for EXIT_SUCCESS and EXIT_FAILURE.
3713 * m4.c, input.c, output.c, symtab.c, builtin.c, macro.c, debug.c,
3714 eval.c: Replace 0 by warning_status and 1 by EXIT_FAILURE in first
3715 argument of all M4ERROR calls.
3716 Reported by Noah Friedman.
3718 * examples/incl-test.m4: Renamed from incl_test.m4.
3719 * examples/include.m4: Include incl-test.m4 instead of
3721 * examples/multiquotes.m4: Renamed from multi-quotes.m.
3723 Wed Jun 22 21:58:54 1994 Francois Pinard (pinard@icule)
3725 * configure.in: Avoid USE_STACKOVF if <siginfo.h> not found. Note
3726 that Jim developped stackovf.c on a 486 running SVR4.0 (ESIX), and
3727 also tested it on a Sun Sparc workstation running SunOS 4.x.
3729 * format.c (format): When not HAVE_EFGCVT, m4 was failing the
3730 49.format check, abusing a `union values' argument with sprintf
3731 without selecting the proper field. Now, save the formatting type
3732 first, delaying the fetch of the corresponding argument.
3733 Reported by Joseph E. Sacco and Tom Quinn.
3735 * format.c (format): Remove const from char *fmt declaration when
3736 not HAVE_EFGCVT, because a NUL may be forced into it.
3738 * m4.h: Declare atof() when not STDC_HEADERS.
3739 Reported by Joseph E. Sacco.
3741 * Regenerate configure using Autoconf 1.11, this corrects a
3742 problem about an incorrect cpp seting on NeXT 3.1.
3743 Reported by Alexander Lehmann.
3745 Sun Jun 5 16:25:19 1994 Francois Pinard (pinard@icule)
3747 * m4.h (_): Change argument from `x' to `Args'.
3749 Wed May 4 23:59:39 1994 Francois Pinard (pinard@icule)
3751 * Makefile.in: Remove all occurrences of $(MFLAGS), which were
3752 bringing more evil than good on a few systems.
3753 Reported by Greg A. Woods.
3755 Fri Apr 22 15:59:35 1994 Francois Pinard (pinard@icule)
3757 * m4.h: Rename Args() to _().
3758 * m4.h: Remove extern specifier from all function declarations.
3760 Fri Apr 22 15:51:21 1994 Jim Avera (jima@netcom.com)
3762 * stackovf.c: New file implementing stack-overflow detection.
3763 * configure.in: Check for getrlimit, sigaction. If all of
3764 standard headers, getrlimit and sigaction, define USE_STACKOVF and
3765 substitute ${U}stackovf.o for STACKOVF.
3766 * acconfig.h: Declare USE_STACKOVF.
3767 * Makefile.in: Distribute stackovf.c, link with $(STACKOVF).
3768 * m4.h: Declare setup_stackovf_trap().
3769 * m4.c: Call setup_stackovf_trap().
3770 * tests/stackovf_test.sh: New file.
3772 Wed Apr 13 14:10:30 1994 Francois Pinard (pinard@icule)
3774 * checks/Makefile.in: Rename .all-stamp to stamp-checks.
3776 * Makefile.in (Makefile, etc.): Adapt for Autoconf 1.8.
3778 Sun Jan 30 14:24:19 1994 (pinard at icule)
3780 * m4.h: Remove definition of volatile, not used anymore.
3781 Reported by Jim Meyering and Joseph E. Sacco.
3783 * m4.h: Consistently use `do { ... } while (0)' in macros, instead
3784 of `if ... else /* nothing */' for if macros.
3785 Reported by Jim Meyering.
3787 * builtin.c (m4_regexp): Reorganize the code for avoiding a
3788 warning from gcc about `repl' possibly used before defined.
3789 Reported by Jim Meyering.
3791 * m4.h: Avoid a pre-ANSI <memory.h> together with <string.h>.
3792 Reported by Jim Meyering.
3794 Tue Jan 25 18:39:37 1994 Francois Pinard (pinard at icule)
3796 * m4.h: Move the conditional definition of volatile after the
3797 inclusion of system files, because they may define it first.
3799 Tue Jan 4 19:46:50 1994 Francois Pinard (pinard@icule)
3801 * checks/Makefile.in (CHECKS): Add a useless `*' before `[', to
3802 get around a problem with Alpha make seeing a syntax error, there.
3803 Reported by Vern Paxson.
3805 Mon Jan 3 00:21:45 1994 Francois Pinard (pinard@icule)
3807 * Makefile.in: Do not define LDFLAGS, use CFLAGS on link calls.
3808 Reported by Richard Stallman.
3810 Sat Dec 25 08:06:05 1993 Francois Pinard (pinard@icule)
3812 * configure.in: Correct test for strerror, AC_FUNC_CHECK was used
3813 instead of AC_HAVE_FUNCS.
3814 Reported by Noah Friedman.
3816 Wed Dec 1 09:37:53 1993 Francois Pinard (pinard@icule)
3818 * m4.c: Initialize show_help and show_version to zero.
3820 * m4.c: Ensure EXIT_SUCCESS and EXIT_FAILURE are defined.
3821 Use them in exit() and usage() calls.
3823 Sat Nov 27 10:43:24 1993 Francois Pinard (pinard@icule)
3825 * m4.h: Delete extern sys_nerr, sys_errlist declarations, and
3826 syserr() macro. Delete errref, add reference_error and M4ERROR.
3827 * m4.c: Replace errref, which was returning an input reference
3828 string, with reference_error, which prints it on standard error.
3829 * builtin.c, output.c: Use errno as second parameter to error,
3830 instead of using syserr() with %s.
3831 * *.c: Use M4ERROR instead of error: no more errref() with %s.
3832 Doing so, the program name appears after the input reference
3833 instead of before, which eases M-x next-error processing.
3835 Wed Nov 24 22:16:15 1993 Francois Pinard (pinard@icule)
3837 * checks/get-them: Escape braces with backslashes in patterns,
3838 because HPUX-9.01 awk needs this.
3839 Reported by Jim Meyering.
3841 Mon Nov 22 10:55:52 1993 Francois Pinard (pinard@icule)
3843 * builtin.c: Declare "FILE *popen ();".
3845 * m4.h: Remove MESSAGE{,1,2}, WARNING1, FATAL{,1}, INTERNAL_ERROR
3846 macros, replace error_message_prefix() declaration by errref()'s.
3847 Declare xrealloc, for use in errref().
3848 * m4.c: Delete error_message_prefix() function, add errref().
3849 * *.c: Use error() systematically in place of all error macros,
3850 now that error() flushes stdout first. Make needed adjustments.
3852 * m4.h: Remove const in sys_errlist[] declaration, it creates
3853 conflicts on SGI and Alpha.
3854 Reported by Kaveh R. Ghazi.
3856 Sat Nov 20 08:26:15 1993 Francois Pinard (pinard@icule)
3858 * m4.c: Include <getopt.h> instead of "getopt.h".
3860 * configure.in: Output to config.h. Use HAVE_FUNCS preferably.
3861 * acconfig.h: New, for documenting HAVE_EFGCVT.
3862 * Makefile.in: Distribute acconfig.h, .stamp-h.in and config.h.in,
3863 use them wherever appropriate. Also use -I. for compilations.
3864 * lib/Makefile.in: Use -I.. for compilations.
3865 * *.c: Include <config.h> or "config.h".
3867 * m4.h: Test for HAVE_MEMORY_H instead of NEED_MEMORY_H.
3868 * configure.in: Use AC_HAVE_HEADERS(memory.h), delete AC_MEMORY_H.
3870 Wed Nov 17 09:34:55 1993 Francois Pinard (pinard@icule)
3872 * builtin.c (m4_eval): Cast strlen to (int) before comparing.
3874 * input.c (input_init): Initialize quote and comment strings
3875 explicitely instead of calling set_quotes and set_comment: by
3876 doing so, we ensure we do not free uninitialized variables.
3878 * checks/check-them: Reverse arguments to both diff, so the
3879 expected is on the left and the obtained on the right.
3881 * m4.h: Add MESSAGE{,1,2}, WARNING1, FATAL{,1} and INTERNAL_ERROR
3882 macros. Delete declarations for m4error, warning, fatal and
3883 internal_error, add declaration for error_message_prefix.
3884 * m4.c: Delete m4error, warning, fatal and internal_error
3885 routines, add error_message_prefix routine.
3886 * *.c: Replace m4error routine calls with MESSAGE* macro calls,
3887 warning with WARNING*, fatal with FATAL* and internal_error with
3889 * Makefile.in (_m4.c): Do not adjust ansi2knr output for va_alist,
3890 this is not needed anymore.
3892 * m4.h: Declare extern FILE *debug. Add DEBUG_PRINT{1,3} and
3893 DEBUG_MESSAGE{,1,2} macros. Delete declarations for debug_print
3894 and debug_message, add declaration for debug_message_prefix.
3895 * debug.c: Remove static specifier for FILE *debug declaration.
3896 Delete debug_print and debug_message routines, add
3897 debug_message_prefix routine.
3898 * builtin.c, debug.c: Replace debug_print routine calls with
3899 DEBUG_PRINT* macro calls.
3900 * input.c, path.c: Replace debug_message routine calls with
3901 DEBUG_MESSAGE* macro calls.
3903 * m4.h: Remove inclusion of <varargs.h>.
3904 * debug.c: Include <stdarg.h> or <varargs.h>.
3905 (trace_format): Use stdarg instead of varargs if __STDC__.
3907 * configure.in: Remove checks for vfprintf and _doprnt. These
3908 implementations use varargs tricks which are not portable enough.
3909 * lib/vfprintf.c: Deleted.
3910 * lib/_doprnt.c: Deleted.
3911 * lib/Makefile.in: Adjusted accordingly. Remove LIBOBJS.
3912 Reported by Joel Sherrill.
3914 * path.c (add_include_directory): Use xstrdup.
3916 * builtin.c (find_builtin_by_name): Declare static.
3918 * *.[ch]: Add const to a few "char *" declarations.
3920 * configure.in: Remove commented tests for fileno() and fstat().
3921 * debug.c: Remove comments about HAVE_FILENO and HAVE_FSTAT.
3923 * debug.c (debug_flush_files): New.
3924 * m4.h: Declares it.
3925 * builtin.c (m4_syscmd, m4_esyscmd): Use it.
3926 Reported by Nicolas Pioch.
3928 Fri Nov 12 10:02:26 1993 Francois Pinard (pinard@icule)
3930 * Makefile.in (m4.dvi): Use m4.texinfo instead of m4.texi.
3931 Reported by Joel Sherrill.
3933 * builtin.c (prefix_all_builtins): Instead of the table size, use
3934 the null entry at end for stopping the loop. It was overwritten.
3935 Reported by Andreas Schwab and Jim Meyering.
3937 * builtin.c (prefix_all_builtins): Cast xmalloc to (char *).
3938 Reported by Kaveh R. Ghazi.
3940 * macro.c (call_macro): Add * in (*SYMBOL_FUNC (sym)) (...).
3941 Reported by Karl Vogel.
3943 Tue Nov 9 09:31:47 1993 Francois Pinard (pinard@icule)
3945 * m4.h: Do not define volatile if already defined.
3946 Reported by Rene' Seindal.
3948 * lib/Makefile.in: Add a forgotten ALLOCA=@ALLOCA@. Grrr!
3950 Reported by Bernhard Daeubler, Eric Backus, Hal Peterson, Hoang
3951 Uong, Ian Taylor, Kaveh R. Ghazi, Tom McConnell and Walter Wong.
3953 Mon Nov 8 21:11:44 1993 Francois Pinard (pinard@icule)
3955 * m4.h: Define strchr and strrchr in terms of index and rindex,
3956 instead of the other way around.
3957 * builtin.c, m4.c, path.c: Use strchr instead of index.
3959 * input.c (next_char): Remove a "break;" after a "return ...;".
3960 Reported by Tom McConnell.
3962 Mon Nov 8 12:45:34 1993 Francois Pinard (pinard@icule)
3966 * configure.in: Do not copy check files in the build hierarchy.
3967 * checks/check-them: Identify the m4 version being checked. For
3968 finding m4, look in $PATH instead of in the parent directory.
3969 * Makefile.in (check): Prepend `pwd` to $PATH before checking.
3970 * checks/Makefile.in (.all-stamp): Always create check files in
3971 the source hierarchy, not anymore in the build hierarchy.
3972 (check): cd to the source hierarchy before performing checks.
3973 Do not copy nor clean COPYING anymore, take it from `..'.
3974 Reported by Tom McConnell.
3976 * Makefile.in (Makefile): Use $(SHELL).
3977 (config.status): Use $(SHELL). Use "config.status --recheck"
3978 instead of "configure --no-create", which is obsolete.
3979 Reported by Tom McConnell.
3981 Fri Nov 5 09:49:30 1993 Francois Pinard (pinard@compy.IRO.UMontreal.CA)
3983 * m4.c (usage): Use "%s" instead of "m4" in format string.
3984 Reported by Jim Meyering.
3986 * Makefile.in: Distribute mkinstalldirs.
3987 Reported by Pierre Gaumond.
3988 Reported by Jim Meyering.
3989 Reported by Tom McConnell.
3990 Reported by Andreas Gustafsson.
3992 * checks/check-them: Renamed from checks/check_them.
3993 * checks/get-them: Renamed from checks/get_them.
3994 * checks/.all-stamp: Renamed from checks/.all_stamp.
3995 * checks/Makefile.in: Changed accordingly.
3996 Reported by Jim Meyering.
3998 Thu Nov 4 13:50:52 1993 Francois Pinard (pinard@lagrande.IRO.UMontreal.CA)
4000 * lib/Makefile.in (dist): Correct permissions on files.
4002 * output.c: Declare tmpfile, some systems don't.
4004 Wed Nov 3 09:09:16 1993 Francois Pinard (pinard@icule)
4006 * checks/Makefile.in (dist): Correct permissions on files.
4008 * Makefile.in (dist): Ensure recursive linking for subdirectory
4009 `examples', also set read/write permissions on all its files.
4011 * mkinstalldirs: New, from elsewhere.
4012 * Makefile.in: Use it.
4014 * debug.c: Synchronize debug messages and regular output when
4015 the debug file and stdout are redirected to the same file.
4016 * configure.in: Add (commented) checks for fileno and fstat.
4017 Reported by Jim Avera.
4019 * builtin.c (m4_ifelse): Diagnose excess arguments if 5, 8, 11,
4020 etc., arguments, then ignore the superfluous one. m4 used to
4021 diagnose missing arguments and return the empty string.
4022 Reported by Nick S. Kanakakorn.
4024 Tue Nov 2 00:55:41 1993 Francois Pinard (pinard@icule)
4026 * m4.c (main): At end of all input, ensure all undiverted text
4027 goes to the main output stream.
4028 Reported by Andreas Gustafsson.
4030 * m4.c (main): exit (0), instead of return 0.
4032 * m4.c: Implement -P and --prefix-builtins.
4033 * builtin.c: Delete const specifier on builtin_tab.
4034 (prefix_all_builtins): New.
4035 Reported by Noah Friedman.
4036 Reported by Scott Bartram.
4038 * c-boxes.el: New, from elsewhere.
4039 * Makefile.in: Distribute it.
4041 * m4.h: Do not define bcopy if <string.h> defines it.
4042 Reported by Stephen Perkins.
4044 * builtin.c (define_macro): Allow a missing second argument, in
4045 which case it is implied empty. Affects define and pushdef.
4046 Reported by Eric Allman.
4048 Mon Nov 1 07:45:24 1993 Francois Pinard (pinard@icule)
4050 * m4.h: Add blind_if_no_args in struct builtin, blind_no_args in
4051 struct symbol adn SYMBOL_BLIND_NO_ARGS macro.
4052 * builtin.c: Initialize all the blindness fields in builtin_tab.
4053 (define_builtin): Copy the blindness of a builtin into its symbol.
4054 * macro.c (expand_token): Avoid processing a blind builtin if the
4055 next character is not an opening parenthesis.
4056 Reported by David MacKenzie.
4057 Reported by Noah Friedman.
4059 * configure.in: Ensure an exit status of 0 on completion.
4060 Reported by Vivek P. Singhal.
4062 * eval.c (eval_lex): Admit both lower and upper case letters for
4063 bases greater than 10. Only lower case letters were accepted.
4065 * eval.c (eval_lex): Recognize 0bDIGITS and 0rRADIX:DIGITS syntax.
4066 Reported by Krste Asanovic.
4068 * eval.c: Rename NOT to LNOT. Add XOR, NOT, LSHIFT and RSHIFT.
4069 * eval.c (logical_not_term): New name for not_term.
4070 * eval.c (xor_term): New, between or_term and and_term.
4071 * eval.c (not_term): New, between and_term and logical_not_term.
4072 * eval.c (shift_term): New, between cmp_term and add_term.
4073 Reported by Krste Asanovic: ~, ^, <<, >>.
4074 Reported by Ben A. Mesander: ** vs ^.
4076 * m4.c: Delete xmalloc.c, xrealloc.c, xstrdup.c.
4077 * m4.h: Delete xrealloc.c.
4078 * lib/xmalloc.c: New, from elsewhere.
4079 * lib/xstrdup.c: New, from elsewhere.
4080 * lib/Makefile.in: Distribute and compile them.
4082 * m4.c: Change progname to program_name.
4083 * builtin.c, eval.c, m4.c, m4.h: Rename error to m4error.
4084 * lib/error.c: New, from elsewhere.
4085 * lib/Makefile.in: Distribute and compile error.c.
4086 * configure.in: Check AC_VPRINTF and for strerror.
4087 * m4.c: Delete cmd_error. Use error instead.
4088 * m4.c: Change label capitalisation to "ERROR", "Warning", etc.
4090 * m4.h: Delete #define const, let Autoconf takes care of this.
4092 * m4.c: Remove all code conditionalized by IMPLEMENT_M4OPTS.
4093 Merge parse_args into main. Declare argv to be `char *const *',
4094 then remove superfluous casts.
4096 * m4.c: Rename --no-gnu-extensions to --traditional.
4097 Reported by Ben A. Mesander.
4099 * m4.c (usage): Add a status parameter. Supply one in various
4100 calls. Add --help processing. Remove -V for --version.
4102 * lib/Makefile.in: Put $(CFLAGS) last in .c.o rule.
4104 * lib/Makefile.in: Have an AR=ar declaration.
4105 Reported by Eric Backus.
4106 Reported by Bjorn R. Bjornsson.
4107 Reported by Tom Tromey.
4108 Reported by Kristine Lund.
4109 Reported by Marion Hakanson.
4111 Sat Oct 30 12:51:47 1993 Francois Pinard (pinard@icule)
4113 * Makefile.in (m4.info): Use -I$(srcdir) on $(MAKEINFO).
4114 Reported by Noah Friedman.
4116 Mon Oct 25 14:58:48 1993 Francois Pinard (pinard@icule)
4118 * Makefile.in: Remove MDEFINES and cleanup.
4120 Wed Jun 9 14:59:46 1993 Francois Pinard (pinard@icule)
4122 * Makefile.in (dist): Replace "echo `pwd`" by a mere "pwd".
4125 Sat Feb 6 14:59:22 1993 Francois Pinard (pinard@icule)
4127 * Makefile.in, lib/Makefile.in, check/Makefile.in: In dist goals,
4128 ensure 777 mode for directories, so older tar's will restore file
4131 Sun Jan 17 15:38:05 1993 Francois Pinard (pinard@icule)
4133 * Makefile.in, lib/Makefile.in: Put $(CFLAGS) after $(CPPFLAGS),
4134 so the installer can override automatically configured choices.
4135 Reported by Karl Berry.
4137 Fri Jan 15 16:07:00 1993 Francois Pinard (pinard@icule)
4139 * lib/vfprintf.c: Stolen from Oleo distribution and adapted. The
4140 previous version was not working properly on m68k-hp-bsd4.3.
4141 Reported by Roland McGrath.
4143 * lib/_doprnt.c: Stolen from Oleo distribution.
4144 * configure.in: Check for _doprnt.c if vfprintf.c selected.
4145 * lib/Makefile.in: Distribute _doprnt.c.
4146 Do not distribute regex.[ch].old anymore.
4148 Fri Jan 1 19:42:23 1993 Francois Pinard (pinard at icule)
4150 * Makefile.in, lib/Makefile.in: Reinstate $(CPPFLAGS), use it.
4151 Richard wants it there.
4153 Sun Dec 27 07:01:54 1992 Francois Pinard (pinard at icule)
4155 * Makefile.in: Add DEFS to MDEFINES.
4156 * lib/Makefile.in (.c.o): Remove $(CPPFLAGS).
4157 (libm4.a): Remove the library before creating it.
4158 (distclean): Remove tags and TAGS too.
4160 Wed Dec 23 12:46:55 1992 Francois Pinard (pinard at icule)
4162 * Makefile.in (dvi, m4.dvi): New goals.
4164 * builtin.c, eval.c, format.c, input.c, m4.[ch], m4.texinfo,
4165 macro.c, output.c, path.c, symtab.c: Change Copyright from
4166 1989-1992 to the explicit enumeration 1989, 1990, 1991, 1992.
4168 * examples/divert.m4: Deleted, this bug has been corrected.
4170 * Makefile.in (texclean, mostlyclean): New goals.
4172 * Makefile.in (clean): Remove clutter from ansi2knr.
4173 Reported by Pierre Gaumond.
4174 Reported by Greg A. Woods.
4176 Sun Dec 20 10:40:20 1992 Francois Pinard (pinard at icule)
4178 * Makefile.in: Remove $(CPPFLAGS) from the .c.o rule. The user
4179 might well use CFLAGS is s/he needs it.
4181 * Makefile.in: Allow installation of info files from a separate
4183 Reported by Jason Merrill.
4184 Reported by David MacKenzie.
4185 Reported by Skip Montanaro.
4186 Reported by Erez Zadok.
4187 Reported by Assar Westerlund.
4189 Sat Dec 19 08:21:34 1992 Francois Pinard (pinard at icule)
4192 This is still a beta release for the future GNU m4 version 1.1.
4194 * lib/alloca.c: New, from elsewhere.
4195 * lib/Makefile.in: Distribute it. Define and use $(ALLOCA).
4197 * m4.h: Do not define index/rindex if already defined. If
4198 FALSE/TRUE are already defined, do not redefine them, but merely
4199 define boolean typedef to int.
4201 * Makefile.in: Use $(DEFS) while compiling ansi2knr.
4202 * ansi2knr.c: Rewrite #ifdef HAVE_STRING_H || STDC_HEADERS,
4203 because some C compilers do not like connectives with #ifdef.
4204 * m4.h: Define `volatile' only if __GNUC__, instead of once for
4205 __GNUC__ and once for __STDC__.
4206 * lib/regex.h: Leave const alone, AC_CONST will take care of it.
4208 * checks/Makefile.in: Use .all_stamp instead of $(CHECKS) for
4209 Makefile dependencies. Without it, make keeps destroying and
4210 remaking $(CHECKS) in a loop (why?). Distribute .all_stamp.
4212 * m4.h, m4.c, builtin.c, output.c: Change all divertion/DIVERTION
4213 to diversion/DIVERSION, this was a spelling error.
4215 * m4.c: Declare version[], remove #include "version.h".
4216 * version.h: Deleted.
4217 * Makefile.in: Remove references to version.h.
4219 * output.c (shipout_text): Centralize all `#line NUM ["FILE"]'
4220 production, by using a simpler and more robust algorithm. This
4221 solves the problem of synclines sometimes written in the middle of
4222 an output line. Delete sync_line() and output_lines variable.
4223 * m4.h: Remove sync_line prototype and output_lines declaration.
4224 * input.c (next_char), output.c (shipout_text): Remove references
4226 * input.c (push_file, pop_file): Merely put the value -1 in
4227 output_current_line instead of calling sync_line, for delaying a
4228 single `#line NUM FILE' before next output line. Do not test
4229 for sync_output, because this is unnecessary clutter.
4230 * output.c (make_divertion, insert_divertion): Idem.
4231 * input.c: Rename must_advance_line to start_of_input_line, for
4234 * debug.c (trace_header): Select a new debug line format, which
4235 better complies with GNU standards for formatting error messages.
4236 With option `-dfl', M-x next-error might be used on the output.
4237 * m4.c (vmesg): Adjust format of error output to GNU standards.
4238 * m4.texinfo: Adjust examples for `make check' to work.
4240 * m4.h, builtin.c, debug.c, input.c, macro.c, path.c: Use upper
4241 case for enum debug_info constants, which were all lower case.
4243 * builtin.c (m4_regexp, m4_patsubst): Use re_search instead of
4245 * lib/regex.[ch]: Use new version from textutils 1.3.6, with some
4246 collected patches. I tried a few times using newer regex.[ch], it
4247 mysteriously stopped aborting with this one. Insecure feeling...
4248 * lib/Makefile.in: Distribute regex.[ch].old, just in case!
4250 Fri Dec 18 11:08:03 1992 Francois Pinard (pinard at icule)
4252 * m4.c: Change `--no-warnings' to `--silent'.
4253 Reported by David MacKenzie.
4255 * m4.c: Put all M4OPTS code upon IMPLEMENT_M4OPTS control, and
4256 leave it off for now. See comment in m4.c for justification.
4257 Reported by David MacKenzie.
4259 * configure.in: Replace AC_USG by AC_HAVE_HEADERS(string.h).
4260 * m4.h, ansi2knr.c, lib/regex.h: Replace USG by HAVE_STRING_H.
4262 * Makefile.in: Add a new `info' goal. Use macro MAKEINFO.
4264 * Makefile.in: Ensure recursive cleaning is done before local
4265 cleaning for all clean goals.
4267 * builtin.c (ntoa): Ensure the value is always interpreted as a
4268 signed quantity, whatever the radix is.
4270 Wed Nov 18 07:57:19 1992 Jim Meyering (meyering@idefix)
4272 * builtin.c, format.c, input.c: Split long lines.
4273 * m4.c: Use typedef macro_definition instead of struct
4275 * symtab.c: Use typedef symbol instead of struct symbol.
4277 Tue Nov 17 01:58:40 1992 Francois Pinard (pinard at icule)
4279 * *.[ch]: Remove all trailing whitespace, in code and comments.
4281 * configure.in: Find some awk.
4282 * Makefile.in: Add $(AWK) to MDEFINES.
4283 * checks/Makefile.in: Transmit $(AWK) to get_them.
4284 * checks/get_them: Use $AWK instead of gawk. Add a close in the
4285 awk script when switching files, because without this, mawk runs
4286 out of file descriptors.
4288 Mon Nov 16 20:42:56 1992 Francois Pinard (pinard at icule)
4290 * Makefile.in (realclean): Delete m4.info*.
4291 Reported by Jim Meyering.
4293 * Makefile.in: Adjust and link with checks/Makefile.
4294 * checks/Makefile.in: New.
4295 * configure.in: Output checks/Makefile.
4297 * checks/get_them: Have the dnl header of each test more
4298 recognizable by next-error, also use a better message.
4300 Mon Nov 16 07:48:52 1992 Jim Meyering (meyering@idefix)
4302 * m4.h [__GNUC__]: Use __volatile__ instead of `volatile.'
4303 And use that only if __GNUC__ since we're using it's GCC-specific
4304 semantics that tell the compiler the associated function doesn't
4307 * builtin.c (substitute): Don't use character as an array index.
4308 (dumpdef_cmp): Make formal arguments `const void *' to avoid
4309 warnings with gcc -W -Wall on systems with qsort prototype.
4310 (m4_errprint): Cast obstack_finish to `char *' to avoid warnings
4313 * eval.c (most functions): Add parentheses to assignments used
4314 as truth values go avoid warnings from gcc -Wall.
4316 * input.c, m4.c, output.c, path.c, symtab.c: Declare static
4317 any functions that don't need external scope.
4319 * builtin.c, debug.c, format.c, m4.c, m4.h, macro.c, symtab.c
4320 (many functions and arrays): Declare `const'.
4322 Sun Nov 15 09:42:09 1992 Francois Pinard (pinard at icule)
4324 * *.[ch]: Rename nil to NULL, using the declaration from <stdio.h>,
4325 removing the declaration from m4.h. Also rename false to FALSE
4328 * lib/Makefile.in (Makefile): New goal.
4330 * Makefile.in, lib/Makefile.in: Add a .c.o rule, so CFLAGS is not
4331 so heavily loaded. It gets more easily overridable, calling make.
4332 Reported by Jim Meyering.
4334 * Makefile.in (dist): Get .fname from the current directory name,
4335 instead of from version.h. I need updating many files manually,
4336 when the version changes, version.h is just one of them.
4338 Sat Nov 14 11:01:20 1992 Francois Pinard (pinard at icule)
4340 * m4.h: Remove the tag `boolean' on the enum introducing typedef
4341 `boolean'. This tag conflicts with <sys/types.h> on SVR4.
4342 Reported by Tom McConnell.
4344 Fri Nov 13 00:12:50 1992 Francois Pinard (pinard at icule)
4346 * m4.texinfo: Correct the examples for 33.divert, 38.divnum,
4347 39.cleardiv, which were describing missing or spurious newlines.
4348 Modify examples 52.eval, 53.esyscmd and 54.sysval so the results
4349 do not depend on machine word size, `/bin/false' implementation,
4350 or `wc' output format. `make check' is more dependable, now.
4352 * checks/check_them: Summarize the failed tests by listing their
4353 name, at end. If none, issue `All checks successful'. Output
4354 `Checking' instead of `Input file:'.
4356 * checks/get_them, checks/check_them: Reindented.
4358 * Makefile.in (dist): chmod a+r before making the tar file.
4360 Thu Nov 12 14:42:57 1992 Francois Pinard (pinard at icule)
4362 * builtin.c (m4_dnl): Diagnose any parameter to `dnl'.
4364 * input.c (next_token): Reinitialize token_buttom just after using
4365 it as a watermark with obstack_free. Or else, a future token, big
4366 enough for triggering reallocation of the obstack chunk, could
4367 void the initialized value of token_buttom, later causing panic in
4368 obstack_free. Rename token_buttom to token_bottom everywhere.
4370 * m4.h: Before declaring errno, first include <errno.h> and
4371 ensure that it does not define errno.
4372 Reported by Richard Stallman.
4374 Wed Nov 11 17:40:35 1992 Francois Pinard (pinard at icule)
4376 * builtin.c: Define and use DECLARE macro for builtins.
4378 * builtin.c (m4_ifelse): Avoid any diagnostic when exactly one
4379 argument, this is a common idiom for introducing long comments.
4381 * builtin.c (m4_ifelse): If 3n + 2 arguments, diagnose missing
4382 arguments. The last argument was silently ignored.
4384 * m4.c (cmd_error): Add a missing semicolon before va_end().
4386 Tue Nov 10 08:57:05 1992 Francois Pinard (pinard at icule)
4388 * Makefile.in: Now handle protoized sources. Define and use U.
4389 Compile and use ansi2knr with old compilers. Update DISTFILES.
4390 Add `aclocal.m4' to `configure' dependencies.
4391 * ansi2knr.c: New, from Ghostscript distribution.
4392 * configure.in: Define U through FP_PROTOTYPES for old compilers.
4393 Add AC_ISC_POSIX, AC_CONST, AC_SIZE_T.
4394 * aclocal.m4: New, provide FP_PROTOTYPES.
4395 * m4.h: Conditionnaly protoized through Args, save for varags.
4396 * builtin.c: Protoized. Then:
4397 Include <sys/types.h> if size_t is not defined, before "regex.h".
4398 (m4_ifelse): Fetch built-in name properly for diagnostic.
4399 (m4_dumpdef): Remove wrong (char *) cast calling dump_symbol.
4400 (m4_regexp): Add const to `msg' declaration.
4401 (m4_patsubst): Add const to `msg' declaration.
4402 * debug.c: Protoized, save for varargs.
4403 * eval.c: Protoized.
4404 * format.c: Protoized.
4405 * input.c: Protoized.
4406 * m4.c: Protoized, save for varargs. Then:
4407 (xfree): Accept void * instead of char *.
4408 (xmalloc): Return void * instead of char *.
4409 (xrealloc): Accept and return void * instead of char *.
4410 * macro.c: Protoized.
4411 * output.c: Protoized.
4412 * path.c: Protoized. Then cast some (char *) over xmalloc's.
4413 * symtab.c: Protoized.
4415 Fri Nov 6 02:05:21 1992 Francois Pinard (pinard at icule)
4417 * m4.texinfo: Remove directory from diagnostics in 30.include,
4418 51.eval, 56.errprint and 57.m4exit tests.
4420 * m4.h: Remove declarations for int or void system functions, they
4421 cause more conflicting trouble than they make good.
4423 * configure.in: Avoid configuration header file. Add some tests.
4424 * m4.h: Remove #include "config.h".
4425 * Makefile.in, lib/Makefile.in: Implement Autoconf interface.
4426 Then, rewritten for better compliance with GNU standards.
4428 Thu Nov 5 12:37:13 1992 Francois Pinard (pinard at icule)
4430 * format.c (format): Avoid syntax error if not HAVE_EFGCVT,
4431 because of a misplaced #endif.
4433 * Many *.[hc] files: Correct intra-line spacing here and there,
4434 according to GNU indent 1.6 advice.
4436 * configure.in: New, using Autoconf 1.2.
4437 * m4.h: Reverse NO_MEMORY_H to NEED_MEMORY_H.
4438 * Delete old configure.in, configure, etc/configure.in,
4439 etc/configure, lib/configure.in, lib/configure and config/*.
4440 Reported by Jason Merrill.
4442 * symtab.c (hash): Change (char) NULL to '\0'.
4443 Reported by Jason Merrill.
4445 * Delete .vers, etc/newdist.sh, etc/newvers.sh and
4446 etc/nextvers.sh. Release numbers will be edited `by hand'.
4447 * version.h: De-automatize, force value in.
4449 * m4.c: Changes in order to use a newer getopt.h.
4450 Reported by David MacKenzie.
4452 * checks/: New name for examples/.
4453 * checks/get_them: New location for etc/get_examples.
4454 * checks/check_them: New location for etc/check_examples.
4455 * Makefile.in, checks/get_them, checks/check_them: Adjust.
4456 * lib/vfprintf.c: New location for etc/vfprintf.c.
4457 * Delete empty etc/.
4458 * examples/: New name for test/.
4460 Tue Mar 10 00:29:46 1992 Francois Pinard (pinard at icule)
4462 * Makefile.in (check): Add m4 as dependency.
4464 * m4.c: Accept --no-warnings instead of --no_warnings, and
4465 --no-gnu-extensions instead of --no_gnu_extensions. Make the
4466 usage message more informative.
4467 Reported by David MacKenzie.
4469 Mon Mar 9 14:53:40 1992 Francois Pinard (pinard at icule)
4471 * etc/check_examples: New name for check_examples.sh.
4472 * etc/get_examples: New name for get_examples.sh.
4473 * Makefile.in, etc/Makefile.in: Use new names.
4475 * Makefile.in: Transmit $(CC) while making in lib.
4477 * Many *.[hc] files: GNU indent'ed, with further fine tuning of
4478 code disposition by hand.
4480 Sun Mar 8 11:01:55 1992 Francois Pinard (pinard at icule)
4482 * m4.h: Delete definitions for abort() and exit().
4483 Reported by Richard Stallman.
4485 * config/hmake-unicos, config/s-unicos.h: New files.
4486 Reported by Hal Peterson.
4488 * eval.c (exp_term): Have N^0 return 1.
4489 Reported by Michael Fetterman.
4491 * eval.c, input.c, m4.h: Remove last comma in enums.
4492 Reported by Mike Lijewski.
4494 * Transfer of maintenance duties from Rene' to Franc,ois.
4496 Thu Oct 24 15:18:46 1991 Rene' Seindal (seindal at diku.dk)
4498 * Release 1.0. Many thanks to those, who provided me with bug
4499 reports and feedback.
4501 * Uses GNU configure, taken from the gdb distribution.
4503 * Uses GNU getopt(), with long option names.
4505 * The -Q/+quiet option is added, which suppresses warnings about
4506 missing or superflous arguments to built-in macros.
4508 * Added default options via the M4OPTS environment variable.
4510 * The built-in format can now be configured to use sprintf as
4511 the formatting engine, for systems without [efg]cvt(3).
4513 * GNU library code is moved to the ./lib subdirectory; other
4514 utility files are now in ./etc.
4516 * Several minor bugs have been fixed.
4518 Fri Jul 26 15:28:42 1991 Rene' Seindal (seindal at diku.dk)
4520 * Fixed various bugs. Release 0.99, manual 0.09. Many thanks to
4521 Francois Pinard and Roland H. Pesch for providing me with reports.
4523 * The builtins incr and decr are now implemented without use of
4526 * The builtin indir is added, to allow for indirect macro calls
4527 (allows use of "illegal" macro names).
4529 * The debugging and tracing facilities has been enhanced
4530 considerably. See the manual for details.
4532 * The -tMACRO option is added, marks MACRO for tracing as soon
4535 * Builtins are traced after renaming iff they were before.
4537 * Named files can now be undiverted.
4539 * The -Nnum option can be used to increase the number of
4540 divertions available.
4542 * Calling changecom without arguments now disables all comment
4545 * The function m4_patsubst() is now consistently declared
4548 * A bug in dnl is fixed.
4550 * A bug in the multi-character quoting code is fixed.
4552 * Several typos in the manual has been corrected. More probably
4555 * The m4.info file is now installed along with the program.
4557 Thu Nov 15 21:51:06 1990 Rene' Seindal (seindal at diku.dk)
4559 * Updated and enhanced version. Release 0.75, manual 0.07.
4561 * Implemented search path for include files (-I option and
4562 M4PATH envronment variable).
4564 * Implemented builtin "format" for printf-like formatting.
4566 * Implemented builtin "regexp" for searching for regular
4569 * Implemented builtin "patsubst" for substitution with regular
4572 * Implemented builtin "esyscmd", which expands to a shell
4575 * Implemented "__file__" and "__line__" for use in error
4578 * Implemented character ranges in "translit".
4580 * Implemented control over debugging output.
4582 * Implemented multi-character quotes.
4584 * Implemented multi-character comment delimiters.
4586 * Changed predefined macro "gnu" to "__gnu__".
4588 * Changed predefined macro "unix" to "__unix__", when the -G
4589 option is not used. With -G, "unix" is still defined.
4591 * Changed "shift", "$@" and "$*" to not insert spaces afters
4594 * Added program name to error messages.
4596 * Fixed two missing null bytes bugs.
4598 Mon Jan 22 21:08:52 1990 Rene' Seindal (seindal at diku.dk)
4600 * Initial beta release. Release 0.50, manual 0.05.
4610 Copyright (C) 1990, 1991, 1992, 1993, 1994, 2000, 2001, 2003,
4611 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
4613 Copying and distribution of this file, with or without
4614 modification, are permitted provided the copyright notice
4615 and this notice are preserved.