1 2008-02-15 Eric Blake <ebb9@byu.net>
3 Use fastmaps for better regex performance.
4 * src/builtin.c (compile_pattern): Allocate a fastmap.
5 * src/input.c (word_start): Delete.
6 (set_word_regexp): Compile a fastmap instead.
7 (peek_token, next_token): Use fastmap.
8 (pop_wrapup): Free memory on exit.
10 2008-02-13 Eric Blake <ebb9@byu.net>
13 * doc/m4.texinfo (Incompatibilities): Use @. after capital.
14 (History): Use @: after abbreviations.
15 (M4exit): Use correct Latin abbreviation.
17 2008-02-11 Eric Blake <ebb9@byu.net>
19 Document behavior of __gnu__().
20 * doc/m4.texinfo (Platform macros): Enhance test.
21 (Macro expansion): New test.
23 Use gnulib's git-merge-changelog driver when available.
24 * .gitattributes: New file.
25 * bootstrap: Install driver, if not already present.
27 2008-02-06 Eric Blake <ebb9@byu.net>
29 Fix security hole introduced 2007-11-22.
30 * src/m4.h (includes): Add quotearg.h.
31 * src/m4.c (m4_verror_at_line): Properly escape macro names.
32 (main): Manage quoteargs defaults.
33 * doc/m4.texinfo (Indir): Document and test this.
35 2008-02-05 Eric Blake <ebb9@byu.net>
37 * m4/gnulib-cache.m4: Import the strtod module.
39 2008-02-02 Eric Blake <ebb9@byu.net>
41 Stage 14: allow pushing argv references.
42 Push a $@ reference to the input engine in one go, rather than
43 pushing each element. For now, argument collection still gets one
44 argument of a $@ at a time; but the penalties of this patch make
45 it easier to manage $@ efficiently in future patches.
46 Memory impact: noticeable penalty, due to larger struct and O(n)
47 to O(n^2) on unboxed recursion.
48 Speed impact: noticeable penalty, due to more bookkeeping.
49 * src/m4.h (struct token_chain): Add comma and quotes fields.
50 (arg_adjust_refcount, arg_print, push_arg_quote): New prototypes.
51 * src/input.c (push_token, pop_input, input_print, peek_input)
52 (next_char_1): Support $@ references.
53 * src/macro.c (struct macro_arguments): Add level field. Match
54 type of arraylen to argc.
55 (collect_arguments): Populate new field.
56 (expand_macro, make_argv_ref, push_arg): Factor...
57 (arg_adjust_refcount, make_argv_ref_token, push_arg_quote):
58 ...into these new methods.
59 (arg_token): Add new parameter.
60 (arg_print): New function.
61 (arg_mark, arg_type, arg_text, arg_equal, arg_empty, arg_len)
62 (arg_func, push_args): Adjust callers.
63 * doc/m4.texinfo (Ifelse): Augment test.
65 2008-01-31 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
67 * checks/Makefile.in: Use @SET_MAKE@, and use @SHELL@ rather
68 than hard-coding /bin/sh.
70 Reported by Lawson Chan.
72 2008-01-27 Eric Blake <ebb9@byu.net>
74 Stage 13: push composite text tokens.
75 Support pushing composite tokens, allowing back-references to be
76 reused through multiple macro expansions. Add hueristic that
77 avoids creating new reference when pushing existing references.
78 Memory impact: noticeable improvement due to better reference
79 reuse, except for O(n) to O(n^2) copying in boxed recursion.
80 Speed impact: slight penalty, due to more bookkeeping.
81 * src/m4.h (push_token): Adjust prototype.
82 * src/input.c (push_token): Add parameter, and handle composite
84 (append_quote_token): Inline short strings.
85 * src/macro.c (push_arg, push_args): Adjust callers.
87 2008-01-26 Eric Blake <ebb9@byu.net>
89 Stage 12: make token_chain a union, add string_pair.
90 Shrink size of symbol chains by using a union. Make passing quote
91 delimiters around more efficient. Other code cleanups.
92 Memory impact: slight improvement, due to smaller struct.
93 Speed impact: slight penalty, due to more bookkeeping.
94 * src/m4.h (STRING): Delete typedef.
95 (struct string_pair, enum token_chain_type): New types.
96 (struct token_chain): Reduce size via a union.
99 * src/builtin.c (ARG): ...from here.
100 (dump_args, define_macro, m4_dumpdef, m4_builtin, m4_indir)
101 (m4_defn, mkstemp_helper, m4_maketemp, m4_mkstemp, m4___file__)
102 (m4___program__, m4_m4wrap, m4_len, m4_index, m4_substr)
103 (m4_regexp, m4_patsubst): Adjust callers.
104 * src/input.c (rquote, lquote, bcomm, ecomm): Delete...
105 (curr_quote, curr_comm): ...replaced by these.
106 (make_text_link, push_token, pop_input, input_print, peek_input)
107 (next_char_1, input_init, set_quotes, set_comment, set_quote_age)
108 (next_token, peek_token): Adjust callers.
109 * src/macro.c (expand_macro, arg_token, arg_mark, arg_text)
110 (arg_equal, arg_len, make_argv_ref, push_arg, push_args):
112 * src/format.c (ARG_INT, ARG_LONG, ARG_STR, ARG_DOUBLE, format):
114 * src/freeze.c (produce_frozen_state): Likewise.
115 * src/debug.c (trace_format, trace_pre): Likewise.
116 (debug_decode): Don't lose partial traces prior to reducing
119 2008-01-22 Eric Blake <ebb9@byu.net>
121 Stage 11: full circle for single argument references.
122 Pass quoted strings through to argument collection in a single
123 action, so that an argument can be reused throughout macro
124 recursion if it remains unchanged.
125 Memory impact: noticeable improvement, due to more reuse in
126 argument collection stacks; O(n^2) to O(n) on boxed recursion.
127 Speed impact: noticeable improvement, due to less copying.
128 * src/m4.h (struct token_chain): Add quote_age member.
129 (struct token_data): Add end member to chain alternate.
130 (make_text_link): New prototype.
131 * src/input.c (CHAR_QUOTE): New macro.
132 (word_start): Pre-allocate.
133 (set_word_regexp): Simplify.
134 (make_text_link): Export, and handle new fields.
135 (next_char, next_char_1): Add parameter.
136 (append_quote_token): New function.
137 (match_input, next_token): Adjust callers to handle quoted input
139 * src/macro.c (struct macro_arguments): Add wrapper member.
140 (expand_argument): Accept composite blocks from input engine.
141 (expand_macro): Reduce refcounts of composite arguments.
142 (collect_arguments, arg_token, arg_mark, make_argv_ref): Update to
144 (arg_type, arg_text, arg_equal, arg_len): Treat composite
146 (push_arg, push_args): Handle composites.
148 2008-01-17 Eric Blake <ebb9@byu.net>
150 Stage 10: avoid extra copying of strings and comments.
151 When collecting tokens that are immune to further expansion, avoid
152 copying data from one obstack to another by outputting it into the
153 destination obstack to begin with. Also reduce copying done in
155 Memory impact: slight improvement, due to better obstack usage.
156 Speed impact: noticeable improvement, due less data copying.
157 * m4/gnulib-cache.m4: Import the intprops and vasnprintf-posix
159 * src/m4.h (includes): Use new gnulib modules.
160 (next_token): Adjust prototype.
161 (bad_argc): New prototype.
162 * src/format.c (arg_int, arg_long, arg_double): New helper
164 (ARG_INT, ARG_LONG, ARG_STR, ARG_DOUBLE): Track missing
166 (format): Improve warnings, and avoid copying into obstack in the
168 * src/input.c (next_token): Add new parameter.
169 (lex_debug): Adjust caller.
170 * src/symtab.c (symtab_debug): Likewise.
171 * src/macro.c (expand_input, expand_token, expand_argument)
172 (collect_arguments): Likewise.
173 * src/output.c (m4_tmpname): Guarantee correct buffer size.
174 * src/builtin.c (builtin_init): Improve efficiency.
176 (ntoa): Tighten buffer allocation.
177 * doc/m4.texinfo (Format): Test the improvements.
178 * NEWS: Document the improvement.
180 2008-01-14 Eric Blake <ebb9@byu.net>
182 Fix --warn-macro-sequence regression from 2007-11-29.
183 * src/builtin.c (define_user_macro): Use correct length.
184 * doc/m4.texinfo (Arguments): Test the fix.
185 (History): Reword to account for new year and eventual result of
188 2008-01-08 Eric Blake <ebb9@byu.net>
191 * NEWS: Update year. Mention effect of my recent memmem
192 contributions to gnulib.
194 2007-12-21 Eric Blake <ebb9@byu.net>
196 Stage 9: share rather than copy single-arg refs.
197 Use hooks of previous patch to create back-references to arguments
198 in the input engine, and inline short text rather than always
199 creating a FIFO link. Also start testing embedded NUL behavior.
200 Until the argument collection engine also shares references, the
201 memory usage increases.
202 Memory impact: noticeable penalty, due to longer life of argv
203 changing O(n) to O(n^2) on boxed recursion.
204 Speed impact: slight improvement, due less data copying.
205 * m4/gnulib-cache.m4: Import quote and memmem modules.
206 * src/m4.h (arg_scratch): New prototype.
207 * src/input.c (INPUT_INLINE_THRESHOLD): New define.
208 (push_token): Use it to inline short text, and save references to
210 (input_init, next_token): Simplify obstack handling.
211 * src/macro.c (expand_argument): Likewise.
212 (expand_macro): Track scratch space.
213 (arg_scratch): New function.
214 (make_argv_ref): Use it.
215 (push_args): Likewise, and simplify comma handling, since most
216 separators are short enough to be inlined.
217 * src/builtin.c (builtin_init): Avoid cast.
218 (m4_errprint, m4_index): Transparently support NUL.
219 (m4_translit): Use scratch space, rather than leaking memory on
221 * doc/m4.texinfo (Syntax): Add new test of embedded NUL.
222 * checks/get-them: Extract test that uses external files.
223 * checks/check-them: Run the new test. Use unified diff if
224 possible, and force text mode when debugging NUL handling.
225 * examples/null.m4: New file.
226 * examples/null.out: Likewise.
227 * examples/null.err: Likewise.
228 * examples/Makefile.am (EXTRA_FILES): Distribute these files.
229 * .gitattributes: Treat new files as text, in spite of embedded
232 2007-12-18 Eric Blake <ebb9@byu.net>
234 Stage 8: extend life of references into argv.
235 Add hooks to lengthen the lifetime of arguments reused in a macro
236 expansion, rather than always discarding arguments at the end of
237 expand_macro. Rework the expand_macro obstacks to handle longer
238 lifetimes. For now, the hooks remain unused.
239 Memory impact: slight penalty, due to larger structs.
240 Speed impact: slight penalty, due to more bookkeeping.
241 * src/m4.h (obstack_regrow): Delete, now that it is unused.
242 (struct token_chain): Add level field.
243 (push_token): Adjust prototype.
244 (adjust_refcount): New prototype.
245 * src/macro.c [DEBUG_MACRO]: Add debugging hooks for $@ reference
247 (argc_stack, argv_stack): Delete, replaced by...
248 (struct macro_arg_stacks, stacks, stacks_count): ...these new
249 structure for tracking $@ references.
250 (expand_input): Initialize new structure.
251 (collect_arguments): Alter signature.
252 (expand_macro): Rework obstack handling, in order to keep $@
253 references alive until they have been rescanned.
254 (adjust_refcount, arg_mark): New functions.
255 (make_argv_ref): Use new field.
256 (push_arg, push_args): Update callers.
257 * src/input.c (make_text_link): Use new field.
258 (push_token): Change signature.
259 (pop_input, next_char_1): Call new function.
260 * doc/m4.texinfo: Clean up some examples of -d option usage.
261 (Ifelse): Add some stress tests.
263 2007-12-13 Eric Blake <ebb9@byu.net>
266 * doc/m4.texinfo (Inhibiting Invocation): Missed one instance in
271 2007-12-13 Paolo Bonzini <bonzini@gnu.org> (tiny change)
273 * doc/m4.texinfo (Inhibiting Invocation): Fix quoting of a quoting
275 Reported by Giovanni Toffetti.
277 2007-12-11 Eric Blake <ebb9@byu.net>
279 Stage 7: add chained token support to input parser.
280 Allow the LIFO input engine to rescan a macro expansion composed
281 of smaller chunks of FIFO data, rather than the old approach of a
282 monolithic string. For now, all chunks are still copied.
283 Memory impact: slight penalty, due to FIFO chain overhead.
284 Speed impact: noticeable penalty, due to extra bookkeeping.
285 * src/m4.h (struct token_chain): Add const safety.
286 (push_token): New prototype.
287 * src/input.c (INPUT_CHAIN): New enumerator.
288 (struct input_block): Add new input type u_c, and change u_s to
289 length-based processing.
290 (make_text_link): New helper function.
291 (push_token): New function.
292 (push_string_finish): Use it.
293 (pop_input, input_print, peek_input, next_char, next_char_1):
294 Adjust to handle new input type.
295 * src/macro.c (push_arg, push_args): Use new function.
297 2007-12-10 Eric Blake <ebb9@byu.net>
299 Stage 6: convert builtins to push arg at a time.
300 Add new methods to factor all builtins whose expansion includes an
301 argument, making back-reference creation easier in future patches.
302 Factor out length-limited printing to obstacks, and use -1 rather
303 than 0 for unlimited length.
305 Speed impact: slight improvement, due to better code sharing.
306 * src/m4.h (includes): Include <limits.h> here, instead of in
308 (input_block): New typedef.
309 (trace_pre, trace_post, push_string_finish): Update prototypes.
310 (obstack_print, input_print, push_arg, push_args): New
312 * src/input.c (push_string_finish): Change return type.
313 (input_print): New function.
314 * src/debug.c (trace_format): Add %B specifier, and use new
316 (trace_pre): Remove redundant argc parameter.
317 (trace_post): Likewise, and change signature.
318 (obstack_print): New function.
319 * src/macro.c (expand_macro): Update caller.
320 (push_arg, push_args): New functions.
321 * src/builtin.c (m4_ifdef, m4_ifelse, m4_shift, m4_substr)
322 (m4_patsubst, expand_user_macro): Use new functions.
323 (mkstemp_helper, m4_maketemp): Avoid extra trailing NULs.
324 * src/m4.c (max_debug_argument_length, main): Set to INT_MAX, not
326 * src/output.c: Update includes.
327 * src/symtab.c: Likewise.
329 2007-12-07 Eric Blake <ebb9@byu.net>
331 Minor security fix: Quote output of mkstemp.
332 * src/builtin.c (mkstemp_helper): Produce quoted output.
333 * doc/m4.texinfo (Mkstemp): Update the documentation and tests.
334 * NEWS: Document this change.
336 Stage 5: add notion of quote age.
337 Cache the quoting rules that were in effect when a string was
338 parsed, to avoid reparsing that string if no changequote or other
339 quote age change took place in the meantime. A quote_age of 0 is
340 always safe, but does not benefit from caching.
341 Memory impact: slight penalty, due to larger struct.
342 Speed impact: slight penalty, due to more bookkeeping.
343 * src/input.c: Comment cleanups.
344 (current_quote_age): New global variable.
345 (set_quote_age): New helper function.
346 (input_init, set_word_regexp): Use it.
347 (set_quotes, set_comment): Likewise, and detect no-op changes.
348 (quote_age, safe_quotes): New functions.
349 (next_token): Track quote age.
350 * src/m4.h (struct token_data): Add quote_age member.
351 (TOKEN_DATA_QUOTE_AGE, quote_age, safe_quotes): New prototypes.
352 * src/macro.c (struct macro_arguments): Add quote_age member.
353 (expand_token): Alter signature and track quote age.
354 (expand_input, expand_argument): All callers changed.
355 (collect_arguments, make_argv_ref): Track quote age.
356 (arg_text, arg_len, arg_func): Detect type mismatch.
357 * doc/m4.texinfo (Ifelse, Changequote): Add more tests.
358 (Incompatibilities): Fix typo.
359 * examples/wraplifo.m4: New file.
360 * examples/Makefile.am (EXTRA_DIST): Distribute it.
362 2007-12-04 Eric Blake <ebb9@byu.net>
364 Fix builds with OpenBSD make.
365 * doc/Makefile.am (HELP2MAN): New macro.
366 (man_MANS, m4.1): Fix rules for building m4.1 into srcdir.
367 * README: Update copyright.
368 * HACKING: Mention help2man and makeinfo dependencies.
370 2007-11-29 Eric Blake <ebb9@byu.net>
372 Stage 4: route indir, builtin through ref; make argv opaque.
373 Finish making struct opaque to all but the input engine, by
374 reworking obstack usage in expand_macro to better support creation
375 of a $@ reference. Canonicalize the empty argument, to allow
376 pointer comparison optimizations.
377 Memory impact: slight penalty, due to larger struct.
378 Speed impact: slight improvement, due to fewer function calls.
379 * src/m4.h (obstack_regrow): Borrow definition from head.
380 (struct token_chain): Add flatten and len members.
381 (arg_equal, arg_empty, make_argv_ref): New prototypes.
382 (struct macro_arguments): Move...
383 * src/macro.c (struct macro_arguments): ...here, making it
384 opaque. Add has_ref member.
385 (empty_token): New placeholder, for optimizing comparison with
387 (collect_arguments): Change signature, and populate new fields.
388 (expand_macro): Alter handling of obstacks.
389 (arg_token): New helper method.
390 (arg_equal, arg_empty, make_argv_ref): New methods.
391 (arg_type, arg_text, arg_len, arg_func): Use new methods.
392 * src/builtin.c (m4_ifelse, m4_builtin, m4_indir, m4_eval):
394 * src/format.c (format): Likewise.
396 Stage 3: cache length, rather than computing it.
397 Cache the length of a token, to avoid repeating lots of strlen
398 calls. Additionally, by using obstack length rather than strlen,
399 the input engine can now support embedded NUL.
400 Memory impact: slight penalty, due to larger struct.
401 Speed impact: noticeable improvement, due to fewer function
403 * src/input.c (next_token): Grab length from obstack rather than
405 * src/m4.h (token_data, macro_arguments): Add length field.
406 (TOKEN_DATA_LEN): New accessor.
407 (define_user_macro): Add parameter.
408 * src/builtin.c (define_user_macro, mkstemp_helper): Use
410 (builtin_init, define_macro, m4_maketemp, m4_mkstemp): Adjust
412 (dump_args, m4_ifdef, m4_ifelse, m4_builtin, m4_indir, m4_eval)
413 (m4_len, m4_substr, m4_translit, m4_regexp, m4_patsubst)
414 (expand_user_macro): Use cached lengths.
415 * src/freeze.c (reload_frozen_state): Adjust callers.
416 * src/m4.c (main): Likewise.
417 * src/macro.c (expand_token, expand_argument, collect_arguments)
418 (arg_len): Use cached length.
419 * doc/m4.texinfo (Mkstemp): Ensure mkstemp does not produce NUL.
421 2007-11-27 Eric Blake <ebb9@byu.net>
423 Stage 2: use accessors, not direct reference, into argv.
424 Outside of macro.c, use accessor methods rather than direct access
425 into the argv struct.
427 Speed impact: slight penalty, due to increased function calls.
428 * src/m4.h (TOKEN_EOF): Alter value, to ease debugging.
429 (arg_argc, arg_type, arg_text, arg_len, arg_func): New
431 * src/macro.c (arg_argc, arg_type, arg_text, arg_len, arg_func):
432 New accessor functions.
433 * src/builtin.c (ARG, dump_args, define_macro, m4_builtin)
434 (m4_indir): Use new accessors.
435 * src/debug.c (trace_pre): Likewise.
436 * src/format.c (ARG_INT, ARG_LONG, ARG_STR, ARG_DOUBLE):
439 2007-11-24 Eric Blake <ebb9@byu.net>
441 Stage 1: convert token_data** into new object.
442 Pass a variable-size wrapper structure instead of an array to
443 builtins, so that subsequent optimizations in the structure need
444 not impact every builtin client.
445 Memory impact: slight penalty, since struct is larger than array.
446 Speed impact: slight penalty, due to increased bookkeeping.
447 * m4/gnulib-cache.m4: Import flexmember module.
448 * src/m4.h (struct macro_arguments, struct token_chain): New
450 (builtin_func): Alter signature.
451 (token_data): Add new TOKEN_COMP alternative.
452 * src/builtin.c: All builtins changed.
453 (ARG, dump_args, define_macro, expand_user_macro): Update to use
455 * src/debug.c (trace_pre, trace_post): Likewise.
456 * src/format.c (ARG_INT, ARG_LONG, ARG_STR, ARG_DOUBLE, format):
458 * src/macro.c (collect_arguments): Build new struct.
459 (call_macro, expand_macro): Update to use new struct.
461 2007-11-22 Eric Blake <ebb9@byu.net>
463 More error messages tied to macro names.
464 * src/input.c (set_word_regexp): Take additional parameter.
465 (input_init): Adjust caller.
466 * src/debug.c (debug_set_file, debug_set_output): Take additional
468 (debug_init): Adjust caller.
469 (expansion_level): Move declaration...
470 * src/m4.h (expansion_level): ...here.
471 (debug_set_output, set_word_regexp): Adjust prototypes.
472 * src/builtin.c (m4_changeword, m4_m4exit, m4_debugfile): Adjust
474 * src/m4.c (main): Likewise.
476 Refactor error messages to avoid macros.
477 * src/m4.h (_): Define, as a placeholder for now.
478 (M4ERROR, M4ERROR_AT_LINE): Delete.
479 (m4_error, m4_error_at_line): Change prototype.
480 (m4_warn, m4_warn_at_line): New prototypes.
481 * src/m4.c (m4_verror_at_line): New helper function.
482 (m4_error, m4_error_at_line): Use new function, and properly call
484 (m4_warn, m4_warn_at_line): New functions.
485 (stackovf_handler, main): All callers changed.
486 * src/builtin.c: Likewise.
487 * src/debug.c: Likewise.
488 * src/eval.c: Likewise.
489 * src/format.c: Likewise.
490 * src/freeze.c: Likewise.
491 * src/input.c: Likewise.
492 * src/macro.c: Likewise.
493 * doc/m4.texinfo (Indir, Builtin, Dumpdef, Incr, Eval, Substr)
494 (Improved forloop): Adjust tests accordingly.
496 Security fix: avoid arbitrary code execution with 'm4 -F'.
497 * src/freeze.c (produce_frozen_state): Never pass raw file name as
499 * NEWS: Document this fix.
501 2007-11-21 Eric Blake <ebb9@byu.net>
503 Consistently report macro name first in messages.
504 * src/m4.h (evaluate): Adjust prototype.
505 * src/builtin.c (bad_argc, numeric_arg, m4_placeholder): Alter
506 wording to match head.
507 (mkstemp_helper, substitute): Adjust signature. All callers
509 (m4_dumpdef, m4_builtin, m4_indir, m4_defn, m4_esyscmd, m4_eval)
510 (m4_undivert, m4_maketemp, m4_m4exit, m4_debugmode)
511 (m4_debugfile, m4_regexp, m4_patsubst): Mention macro name in
513 (m4_format): Adjust call.
514 * src/format.c (format): No longer skip argv[0].
515 * src/eval.c (evaluate): Mention macro name in message.
516 (logical_or_term, logical_and_term, or_term, xor_term, and_term)
517 (equality_term, cmp_term, shift_term, add_term, mult_term)
518 (exp_term, unary_term, simple_term): Adjust signature.
519 * src/macro.c (warn_builtin_concat): Likewise.
520 (expand_argument): Adjust caller.
521 * doc/m4.texinfo (Macro Arguments, Ifdef, Ifelse, Debug Output)
522 (Dnl, Improved fatal_error, Defn, Builtin, Index macro, Regexp)
523 (Substr, Translit, Patsubst, Format, Eval, Dumpdef, Include)
524 (Improved forloop, Indir, Trace, Incr): Adjust tests to match.
526 Make argument checking a bit more sane.
527 * src/builtin.c (bad_argc): Adjust signature, and don't force
528 callers to add 1. Adjust all callers.
529 (numeric_arg): Adjust signature. Adjust all callers.
531 Make dnl diagnostic print macro name.
532 * src/m4.h (skip_line): Adjust prototype.
533 * src/input.c (skip_line): Report error on behalf of caller.
534 * src/builtin.c (m4_dnl): Adjust caller.
535 (dump_args, m4_dumpdef, m4_changequote, m4_changecom)
536 (m4_changeword, m4_traceon, m4_traceoff, expand_user_macro): Use
537 ARG macro instead of open-coding.
538 * doc/m4.texinfo (Dnl): Adjust test.
540 2007-11-20 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
542 * Makefile.am (EXTRA_DIST): gendocs.sh is gone here.
544 2007-11-14 Eric Blake <ebb9@byu.net>
546 Avoid builtin concatenation in macro arguments.
547 * doc/m4.texinfo (Defn): Add tests.
548 * src/macro.c (warn_builtin_concat): New function.
549 (expand_argument): Use it to warn on more corner cases.
550 * NEWS: Mention new warning.
552 2007-11-13 Eric Blake <ebb9@byu.net>
554 Simplify previous patch.
555 * src/input.c (pop_input): Change signature.
556 (push_string_init, next_char_1): Adjust callers.
558 Note: Patches titled Stage 0 through N form a series of patches
559 which decreases the algorithmic complexity of tail recursion in
560 macro expansions from O(n^2) to O(n) in both time and memory, then
561 performs cleanups, such as handling of embedded NUL, made easier
562 by the code refactoring.
564 Stage 0: Fix memory leak in tail recursion.
565 Free expansion text in the input engine as soon as it is parsed,
566 rather than when the recursive expansion completes.
567 Memory impact: noticeable improvement, due to reduction from
568 O(n^2) to O(n) on recursion.
569 Speed impact: minor improvement, due to better memory usage.
570 * src/input.c (push_string_init): Let go of memory earlier.
571 (next_char_1): Make end of string detection reliable.
572 (match_input): Simplify use of push_string_init.
573 * NEWS: Document this fix.
575 2007-11-07 Eric Blake <ebb9@byu.net>
577 * doc/m4.texinfo (Pseudo Arguments): Test more corner cases.
579 2007-11-05 Eric Blake <ebb9@byu.net>
581 Use assert, rather than INTERNAL ERROR.
582 * src/m4.h: Include <assert.h>.
583 * src/builtin.c (m4_dumpdef, define_macro, m4_defn): Use assert.
584 * src/debug.c (trace_pre): Likewise.
585 * src/eval.c (evaluate, cmp_term, shift_term, mult_term):
587 * src/freeze.c (produce_frozen_state): Likewise.
588 * src/input.c (push_string_init, pop_input, init_macro_token)
589 (peek_input, next_char_1, set_word_regexp): Likewise.
590 * src/m4.c (main): Likewise.
591 * src/macro.c (expand_token, expand_argument, call_macro):
593 * src/output.c (make_diversion): Likewise.
594 * src/symtab.c (symtab_init): Likewise.
596 Use build-aux directory.
597 * configure.ac (PACKAGE, VERSION): Delete, since Automake does
599 (AC_CONFIG_AUX_DIR): Add, with auxiliary files in build-aux
600 instead of the top level.
601 * bootstrap: Adjust accordingly.
602 * m4/gnulib-cache.m4: Add --aux-dir option.
603 * doc/Makefile.am (m4.1): Rewrite rule to use build-aux/missing.
605 2007-11-02 Eric Blake <ebb9@byu.net>
607 Update some documentation about version control.
608 * NEWS: M4 is now stored in git.
611 * bootstrap: Likewise.
612 * commit: Delete, now that CVS commits are no longer necessary.
614 Adjust to recent gnulib change.
615 * m4/gnulib-cache.m4: Drop vasprintf-posix and xvasprintf, and use
616 xvasprintf-posix instead.
618 2007-11-01 Eric Blake <ebb9@byu.net>
620 Improve error message when early end of file occurs.
621 * doc/m4.texinfo (Macro Arguments, Changequote, Changecom)
622 (M4wrap): Adjust to new messages.
623 (Improved capitalize): Enhance test.
624 * src/m4.h (next_token): Adjust prototype.
625 * src/input.c (next_token): Add new parameter, and improve error
627 (lex_debug): Adjust callers.
628 * src/symtab.c (symtab_debug): Likewise.
629 * src/macro.c (expand_input, collect_arguments): Likewise.
630 (expand_argument): Likewise, and add parameter.
632 2007-10-31 Eric Blake <ebb9@byu.net>
634 Test more corner cases.
635 * doc/m4.texinfo (Changecom, Pseudo Arguments): Beef up tests.
636 (Improved foreach): Document alternate foreachq style.
637 * examples/foreachq3.m4: New file.
638 * examples/loop.m4: New file.
639 * examples/Makefile.am (EXTRA_DIST): Distribute them.
641 2007-10-28 Eric Blake <ebb9@byu.net>
643 More test coverage for autoconf usage patterns.
644 * doc/m4.texinfo (Inhibiting Invocation, Pseudo Arguments)
645 (Builtin): Add new undocumented tests.
646 (Shift): Document cond macro, and add new test.
648 2007-10-27 Eric Blake <ebb9@byu.net>
650 Document one use of changequote(`(',`)').
651 * doc/m4.texinfo (Changequote): Add new test, based on recent
652 autoconf addition of m4_expand.
654 2007-10-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
656 * examples/Makefile.am (EXTRA_DIST): Add capitalize2.m4.
658 2007-10-24 Eric Blake <ebb9@byu.net>
660 Reduce number of mingw testsuite failures.
661 * doc/m4.texinfo (Using frozen files): Skip test on mingw.
663 2007-10-22 Eric Blake <ebb9@byu.net>
665 Add DEBUG_REGEX debugging information.
666 * src/m4.h (DEBUG_REGEX): New debug macro.
667 * src/m4.c (main) [DEBUG_REGEX]: Open regex trace file when
669 * src/builtin.c (m4_patsubst, m4_regexp, compile_pattern)
670 [DEBUG_REGEX]: Trace regex usage.
672 Never let printf failures go undetected.
673 * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
675 * src/m4.h: Include xprintf.h.
676 * src/format.c (format): Warn on format failures.
677 * src/builtin.c (ntoa): Export.
678 (m4_errprint): Adjust all *printf callers.
679 * src/debug.c (debug_message_prefix, trace_format): Likewise.
680 * src/freeze.c (produce_frozen_state): Likewise.
681 * src/input.c [DEBUG_INPUT]: Likewise.
682 * src/m4.c (usage): Likewise.
683 * src/m4.h (DEBUG_PRINT1, DEBUG_PRINT3, DEBUG_MESSAGE)
684 (DEBUG_MESSAGE1, DEBUG_MESSAGE2): Likewise.
685 * src/output.c (m4_tmpname, shipout_text, freeze_diversione):
687 * src/path.c [DEBUG_INCL]: Likewise.
688 * src/stackovf.c (process_sigsegv) [DEBUG_STKOVF]: Likewise.
689 * src/symtab.c [DEBUG_SYM]: Likewise.
691 2007-10-17 Eric Blake <ebb9@byu.net>
693 Fix 'm4 -F file -t undefined'.
694 * src/freeze.c (produce_frozen_state): Avoid core dump.
695 * doc/m4.texinfo (Using frozen files): Test for the bug.
696 * NEWS: Mention the fix.
698 2007-10-09 Eric Blake <ebb9@byu.net>
700 * NEWS: Document recent speedups.
702 Fix regexp regression of 2007-09-29.
703 * src/builtin.c (substitute): Allow NULL regs when no
704 subexpressions were present.
705 (m4_regexp): Handle \ escapes even with empty regex.
706 * doc/m4.texinfo (Regexp, Patsubst): Catch this bug.
708 Cache regex compilation for another autoconf speedup.
709 * src/m4.h (free_macro_sequence): Rename...
710 (free_regex): ...to this.
711 * src/m4.c (main): Update caller.
712 * src/builtin.c (REGEX_CACHE_SIZE, m4_regex, regex_cache): New
714 (compile_pattern): New function; cache recent regexes.
715 (free_regex): Rename, and clean up additional memory.
716 (m4_regexp, m4_patsubst): Use new function.
718 2007-10-02 Eric Blake <ebb9@byu.net>
720 Document quoting pitfalls in capitalize.
721 * doc/m4.texinfo (Patsubst): Use the examples directory. Also
723 (Improved capitalize): New node.
724 * examples/capitalize.m4: Update to match manual.
725 * examples/capitalize2.m4: New file.
727 2007-10-01 Eric Blake <ebb9@byu.net>
729 Another Autoconf usage pattern optimization.
730 * src/builtin.c (m4_index): Optimize search for one byte.
731 * doc/m4.texinfo (Index macro, Regexp, Patsubst): Test the new
734 2007-09-29 Eric Blake <ebb9@byu.net>
736 Optimize for Autoconf usage pattern.
737 * src/builtin.c (m4_regexp, m4_patsubst): Handle empty regex
740 2007-09-24 Eric Blake <ebb9@byu.net>
742 Create .gitignore alongside .cvsignore.
743 * bootstrap (LC_ALL): Set up front.
744 (version control) Borrow idea from head, to avoid churn in
745 m4/.*ignore files modified by gnulib-tool.
747 2007-09-13 Eric Blake <ebb9@byu.net>
751 2007-09-07 Eric Blake <ebb9@byu.net>
753 * AUTHORS: Simplify, to match libtool and autoconf layout.
754 * THANKS: Sync with head.
756 2007-08-10 Eric Blake <ebb9@byu.net>
758 * doc/m4.texinfo (Compatibility): Sync with head.
760 2007-08-10 Konrad Schwarz <konrad.schwarz@siemens.com> (tiny change)
761 and Eric Blake <ebb9@byu.net>
763 * doc/m4.texinfo (Defn): Update wording.
765 2007-08-09 Eric Blake <ebb9@byu.net>
767 POSIX requires defn(`a',`b') to concatenate definitions.
768 * src/builtin.c (m4_defn): Allow multiple arguments, but warn if
769 trying to mix a builtin with anything else.
770 * doc/m4.texinfo (Defn): Document a use for this POSIX
772 (Incompatibilities): Update to match current status.
773 * NEWS: Document this change.
775 Reported by Konrad Schwarz.
777 2007-08-04 Eric Blake <ebb9@byu.net>
779 Normalize all GPL license notices.
780 * GNUmakefile: Update license wording.
781 * Makefile.am: Likewise.
782 * Makefile.maint: Likewise.
783 * bootstrap: Likewise.
785 * configure.ac: Likewise.
786 * checks/Makefile.in: Likewise.
787 * doc/Makefile.am: Likewise.
788 * examples/Makefile.am: Likewise.
789 * src/Makefile.am: Likewise.
790 * src/builtin.c: Likewise.
791 * src/debug.c: Likewise.
792 * src/eval.c: Likewise.
793 * src/format.c: Likewise.
794 * src/freeze.c: Likewise.
795 * src/input.c: Likewise.
796 * src/m4.c: Likewise.
797 * src/m4.h: Likewise.
798 * src/macro.c: Likewise.
799 * src/output.c: Likewise.
800 * src/path.c: Likewise.
801 * src/stackovf.c: Likewise.
802 * src/symtab.c: Likewise.
804 2007-07-21 Eric Blake <ebb9@byu.net>
806 Fix regression on NetBSD from 2007-05-28.
807 * src/output.c (m4_tmpopen): Explicitly reset append-mode stream
809 * NEWS: Document this fix.
811 Reported by Thomas Klausner.
813 2007-07-20 Eric Blake <ebb9@byu.net>
815 Fix 'make distcheck' issues.
816 * Makefile.am (EXTRA_DIST): No need to distribute
817 gpl-3.0.texi.diff anymore.
818 * m4/gnulib-cache.m4: Update to latest gnulib.
820 2007-07-14 Eric Blake <ebb9@byu.net>
822 Reflect upstream license .texi changes.
823 * doc/m4.texinfo (Copying): Rename node...
824 (GNU General Public License): ...to this.
825 (GNU Free Documentation License): Adjust node location.
826 * local/doc/gpl-3.0.texi.diff: Remove file.
828 2007-07-10 Eric Blake <ebb9@byu.net>
831 * configure.ac (AC_INIT): Bump version number.
832 * NEWS: Start changes since 1.4.10.
833 * doc/m4.texinfo (History): Mention 1.4.11.
834 (Copying This Package, Copying This Manual): Add index entries.
835 * local/lib/version-etc.c.diff: Delete, now that gnulib has been
837 * Makefile.am (EXTRA_DIST): Remove dead file.
839 2007-07-09 Eric Blake <ebb9@byu.net>
842 * doc/Makefile.am (m4_TEXINFOS): Distribute gpl-3.0.texi.
843 * Makefile.am (EXTRA_DIST): Distribute gnulib diffs.
844 * configure.ac (AC_INIT): Bump version number.
845 * NEWS: Describe changes since 1.4.9.
847 * src/format.c: Missed a GPLv3 conversion.
849 Avoid undefined behavior of %.*c in printf.
850 * src/format.c (format): Special case %c.
851 * TODO: Document that more remains to be done.
852 * NEWS: Document the fix.
854 2007-07-05 Eric Blake <ebb9@byu.net>
856 Fix up gnulib-tool usage.
857 * m4/gnulib-cache.m4: Change local-dir to local, not `.'.
858 * version-etc.c.diff: Move to...
859 * local/lib/version-etc.c.diff: ...here.
860 * gpl-3.0.texi.diff: Move to...
861 * local/doc/gpl-3.0.texi.diff: ...here.
863 2007-07-04 Eric Blake <ebb9@byu.net>
865 Upgrade to GPL version 3 or later.
866 * bootstrap: Pick up GPLv3.
867 * m4/gnulib-cache.m4: Augment with 'gnulib-tool
868 --local-dir=. --import gpl-3.0'.
869 * doc/m4.texinfo (Copying This Package): New appendix.
870 * NEWS: Mention this change.
871 * README: Mention why some files still claim to be version 2.
872 * version-etc.c.diff: New file, to make sure --version claims
873 correct GPL version. Temporary until gnulib makes move.
874 * gpl-3.0.texi.diff: New file, to allow inclusion of GPLv3 as
875 appendix, rather than section, of the manual.
876 * GNUmakefile: Update to new license.
877 * Makefile.am: Likewise.
878 * Makefile.maint: Likewise.
880 * configure.ac: Likewise.
881 * checks/Makefile.in: Likewise.
882 * doc/Makefile.am: Likewise.
883 * examples/Makefile.am: Likewise.
884 * src/Makefile.am: Likewise.
885 * src/builtin.c: Likewise.
886 * src/debug.c: Likewise.
887 * src/eval.c: Likewise.
888 * src/freeze.c: Likewise.
889 * src/input.c: Likewise.
890 * src/m4.c: Likewise.
891 * src/m4.h: Likewise.
892 * src/macro.c: Likewise.
893 * src/output.c: Likewise.
894 * src/path.c: Likewise.
895 * src/stackovf.c: Likewise.
896 * src/symtab.c: Likewise.
898 2007-06-26 Eric Blake <ebb9@byu.net>
900 * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import assert'.
902 2007-06-26 Karl Berry <karl@freefriends.org> (tiny change)
904 Match Free Software Directory categories.
905 * doc/m4.texinfo (dircategory): Update.
907 2007-05-31 Eric Blake <ebb9@byu.net>
909 * src/output.c (output_text): Fix regression from 2007-05-28.
910 * doc/m4.texinfo (History): Mention 1.4.10.
911 (Format): Make testsuite output easier to debug.
913 2007-05-29 Eric Blake <ebb9@byu.net>
916 * configure.ac (AC_INIT): Bump version number.
917 * NEWS: Start changes since 1.4.9b, and fix typo.
920 * configure.ac (AC_INIT): Bump version number.
921 * NEWS: Describe changes since 1.4.9.
923 Improve format support.
924 * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
926 * src/format.c (format): Parse %'hhd, %a, %A. Avoid calling
927 printf with too few arguments, as in format(%*.*d,-1,-1,1).
928 * doc/m4.texinfo (Format): Expand tests, and improve
930 * NEWS: Document this change.
932 2007-05-28 Eric Blake <ebb9@byu.net>
934 Fix large diversion corner cases, including 1.4.8 regression.
935 * src/output.c (m4_tmpfile, m4_tmpopen): Simplify use of errno.
936 (make_room_for): Use NULL, not 0, for pointers.
937 (insert_diversion_helper): Avoid using rewind.
938 (freeze_diversions): Allow freezing large diversions.
939 * NEWS: Document this fix.
941 Also run gnulib unit tests during make check.
942 * m4/gnulib-cache.m4: Augment with 'gnulib-tool
943 --tests-base=tests --with-tests'.
944 * configure.ac (AC_CONFIG_FILES): Build gnulib testdir.
945 * Makefile.am (SUBDIRS): Run gnulib tests before ours.
947 2007-05-25 Eric Blake <ebb9@byu.net>
949 Backport prompts in examples from head.
950 * src/macro.c (expand_macro): Shorten message.
951 * doc/m4.texinfo (Manual, Command line files, Comments)
952 (Inhibiting Invocation, Macro Arguments, Macro expansion, Indir)
953 (Builtin, Shift, Forloop, Foreach, Dumpdef, Trace, Debug Levels)
954 (Debug Output, Include, Format, Syscmd, Mkstemp, Location)
955 (Using frozen files, Improved forloop, Improved foreach): Add
957 * checks/get-them: Ignore prompts in examples.
959 Fix sync line interaction with multiline comments.
960 * doc/m4.texinfo (Other Incompatibilities): Add example, and
961 document bug in --syncline/divert interaction.
962 (Preprocessor features): Augment test.
963 * src/m4.h (output_text): Export.
964 (shipout_text, next_token): Add parameter.
965 * src/freeze.c (reload_frozen_state): Don't interfere with
966 synclines when reloading state.
967 * src/output.c (output_text): Export.
968 (shipout_text): Take new parameter for start line of token.
969 Output at most one syncline per token.
970 * src/input.c (next_token): Report line where multiline tokens
972 * src/macro.c (expand_input, expand_token, expand_argument):
973 Adjust callers so that line is passed from input to output.
974 * NEWS: Document this fix.
975 Reported by Sergey Poznyakoff.
977 Test -s in testsuite.
978 * doc/m4.texinfo (Preprocessor features): Add a test.
979 * checks/get-them: Support extra options in testsuite.
980 * checks/check-them (examples): Use extra options.
982 Reported by Sergey Poznyakoff.
984 2007-05-24 Eric Blake <ebb9@byu.net>
986 Support POSIX flush semantics on all platforms.
987 * m4/gnulib-cache.m4: Remove closeout, and augment with
988 'gnulib-tool --import closein fflush'.
989 * src/m4.h (includes): Use closein, not closeout.
990 * src/m4.c (main): Ensure stdin is flushed when not all input is
992 (process_file): No return needed.
993 * src/debug.c (debug_flush_files): Rely on gnulib module, rather
994 than excluding mingw.
995 * NEWS: Document this change.
997 Work around cygwin and mingw fseeko bugs.
998 * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import fseeko'.
999 * src/debug.c (debug_flush_files): Prefer fseeko over fseek.
1001 2007-04-25 Eric Blake <ebb9@byu.net>
1003 Fix negative division within eval, regression of 2007-01-06.
1004 * doc/m4.texinfo (Eval): Catch this bug.
1005 * src/eval.c (mult_term): Fix it.
1006 * NEWS: Document this.
1008 Reported by Cesar Strauss.
1010 2007-04-23 Eric Blake <ebb9@byu.net>
1013 * configure.ac (AC_INIT): Bump version number.
1014 * NEWS: Start changes since 1.4.9.
1016 2007-03-23 Eric Blake <ebb9@byu.net>
1019 * configure.ac (AC_INIT): Bump version number.
1020 * NEWS: Describe changes since 1.4.8b.
1022 2007-03-16 Eric Blake <ebb9@byu.net>
1024 * doc/m4.texinfo (Mkstemp): Tweak wording.
1025 * src/output.c (output_init): Adjust to latest gnulib.
1027 2007-03-15 Eric Blake <ebb9@byu.net>
1029 Avoid Tandem/NSK's broken long long (without a symmetric unsigned
1030 long long, it confuses gnulib).
1031 * configure.ac (AC_TYPE_LONG_LONG_INT): Declare long long broken
1032 if unsigned long long doesn't work.
1034 Reported by Matthew Woehlke.
1036 2007-03-07 Eric Blake <ebb9@byu.net>
1039 * doc/m4.texinfo: Minor tweaks, avoid makeinfo warning.
1041 2007-03-01 Eric Blake <ebb9@byu.net>
1043 * doc/m4.texinfo: Pick up more index entries from head. Follow
1044 more texinfo recommendations.
1045 (Sysval): Improve tests.
1047 Avoid overfull \vbox warning from texinfo, due to indices that
1048 weren't quite big enough to split across page boundaries.
1049 * doc/m4.texinfo: Add lots of concept index entries.
1050 (Concept Index): Move to be last, as recommended by texinfo
1052 (Define, Arguments, Pseudo Arguments): Add more function entries.
1054 2007-02-28 Eric Blake <ebb9@byu.net>
1056 * doc/m4.texinfo (Eval): Clean up wording to reflext POSIX XCU ERN
1058 (Pseudo Arguments): Add useful example.
1060 * doc/m4.texinfo (Pushdef, Incompatibilities): Clean up wording to
1061 reflect POSIX XCU ERN 118.
1063 * src/m4.h (DEFAULT_MACRO_SEQUENCE): Factor out from...
1064 * src/m4.c (usage): ...here,...
1065 * src/builtin.c (set_macro_sequence): ...and here.
1066 (define_user_macro): Fix typo.
1067 * doc/m4.texinfo (Preprocessor features, Arguments): Fix minor
1069 (Shift): Document composite macro argn for portably getting at
1070 positional parameters beyond 9.
1071 * configure.ac (AC_INIT): Bump version number.
1072 * NEWS: Start changes of 1.4.8c.
1074 2007-02-24 Eric Blake <ebb9@byu.net>
1076 Beta Release 1.4.8b:
1077 * configure.ac (AC_INIT): Bump version number.
1078 * NEWS: Describe changes since 1.4.8.
1080 Reserve all uses of raw ${} in macro definitions, not just
1082 * src/builtin.c (set_macro_sequence): Change default macro
1084 * doc/m4.texinfo (Operation modes): Update to match.
1085 * src/m4.c (usage): Likewise.
1088 2007-02-23 Eric Blake <ebb9@byu.net>
1090 * src/m4.h (includes): Update to latest gnulib.
1092 2007-02-08 Eric Blake <ebb9@byu.net>
1094 Rename --warn-syntax to --warn-macro-sequence[=regex], to make it
1095 more flexible, and so that autoconf can use it.
1096 * src/m4.h (set_macro_sequence, free_macro_sequence): New
1098 * src/builtin.c (macro_sequence_buf, macro_sequence_regs)
1099 (macro_sequence_inuse, set_macro_sequence, free_macro_sequence):
1100 New variables and functions.
1101 (define_user_macro): Allow flexibility in regular expression used
1103 * src/m4.c (warn_syntax): Delete.
1104 (usage, WARN_MACRO_SEQUENCE_OPTION, main): Implement changed
1105 spelling of option, along with optional argument.
1106 * doc/m4.texinfo (Operation modes, Arguments): Document this
1108 * NEWS: Document this change.
1110 2007-02-05 Eric Blake <ebb9@byu.net>
1112 * m4/gnulib-cache.m4: Module strstr no longer exists.
1114 Avoid bool bitfields, as they don't work on AIX.
1115 * src/m4.h (bool_bitfield): New typedef.
1116 (struct symbol, struct builtin): Use it.
1117 * src/input.c (struct input_block): Likewise.
1118 Reported by Albert Chin.
1120 * doc/m4.texinfo (Sysval): Avoid SIGPIPE in test as unreliable.
1121 Reported by Albert Chin.
1124 2006-06-18 Bruno Haible <bruno@clisp.org> (tiny change)
1126 * doc/m4.texinfo (Input processing): Further clarifications.
1128 2007-02-03 Eric Blake <ebb9@byu.net>
1130 * doc/m4.texinfo (Input processing, Quoting Arguments): Beef up
1132 Reported by Bruno Haible.
1134 2007-02-01 Eric Blake <ebb9@byu.net>
1136 * src/m4.c (fatal_warnings): New variable.
1137 (usage): Document new -E behavior.
1138 (main): Make -E an additive option.
1139 (m4_error, m4_error_at_line): Change exit status when required.
1140 * NEWS: Document this change.
1141 * doc/m4.texinfo (Operation modes): Likewise.
1142 Reported by Ralf Wildenhues.
1144 2007-01-27 Eric Blake <ebb9@byu.net>
1146 * src/m4.h (warn_syntax): Declare.
1147 (init_pattern_buffer): Export.
1148 * src/m4.c (warn_syntax, usage, WARN_SYNTAX_OPTIONS)
1149 (long_options, main): Implement new option.
1150 * src/builtin.c (init_pattern_buffer): Allow NULL regs argument.
1151 (define_user_macro): Warn on $11 and ${1} if requested.
1152 * src/input.c (init_pattern_buffer): Delete duplicate method.
1153 * doc/m4.texinfo (Operation modes): Document it.
1154 (Arguments): Document future direction of ${11} vs. $11.
1155 (Incompatibilities): Fix wording on POSIX limitations.
1156 * checks/get-them: Parse @{ and @} correctly.
1157 * NEWS: Document this change.
1159 2007-01-26 Eric Blake <ebb9@byu.net>
1161 * src/builtin.c (includes): Adjust to gnulib changes.
1163 2007-01-15 Eric Blake <ebb9@byu.net>
1165 * doc/m4.texinfo: Pull in various improvements from head.
1166 * src/builtin.c (include): Alter exit status on failure.
1167 * NEWS: Document this fix.
1169 2007-01-13 Eric Blake <ebb9@byu.net>
1171 * configure.ac (AC_CHECK_MEMBERS): Check for stack_t.ss_sp, and
1172 assume the fallback of ss_base for BSDI 4.0.1.
1173 * src/stackovf.c (setup_stackovf_trap) [HAVE_SIGALTSTACK &&
1174 ! HAVE_STACK_T_SS_SP]: Use this check.
1175 Reported by Chris McGuire.
1177 * NEWS: Document the improvement.
1179 2007-01-09 Eric Blake <ebb9@byu.net>
1181 * src/eval.c (ASSIGN): New enumerator.
1182 (eval_lex): Recognize '='.
1183 (equality_term): Treat '=' like '==', but warn that it is
1185 * doc/m4.texinfo (Eval): Document and test this.
1186 (Incompatibilities): Document the POSIX incompatibility.
1187 * NEWS: Document this change.
1189 2007-01-06 Eric Blake <ebb9@byu.net>
1191 * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import stdint'.
1192 * checks/check-them: Record expected exit status.
1193 * checks/get-them: Check exit status.
1194 * src/m4.h (eval_t, unsigned_eval_t): Delete, use POSIX int32_t
1196 * src/builtin.c: All users changed.
1197 * src/eval.c: Likewise. Also document where we are triggering
1198 undefined or implementation-defined behavior.
1199 (BADOP, NEGATIVE_EXPONENT, INVALID_OPERATOR, eval_lex, evaluate)
1200 (logical_or_term, logical_and_term, logical_not_term, not_term)
1201 (equality_term, unary_term): Port from head to follow POSIX
1203 (exp_term): Reject 0**0 as undefined.
1204 * doc/m4.texinfo (History): Mention 1.4.9.
1205 (Format, Incompatibilities): Update to document POSIX compliance.
1206 * NEWS: Document this change.
1208 2007-01-04 Eric Blake <ebb9@byu.net>
1210 * NEWS: Document previous fix.
1213 2007-01-04 Sami Liedes <sliedes@cc.hut.fi> (tiny change)
1215 Fix Debian bug 405594, introduced 2006-11-01 from a bad
1216 copy-n-paste from head.
1217 * src/m4.c (main): Use correct file name after --.
1219 2007-01-04 Eric Blake <ebb9@byu.net>
1221 Fix regression from 1.4.7 in large file handling on some
1222 platforms, introduced on 2006-10-13.
1223 * configure.ac (AC_LARGE_SYSFILE): Guarantee that large files
1225 * NEWS: Document this fix.
1227 2007-01-03 Eric Blake <ebb9@byu.net>
1229 * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
1231 * src/m4.c (AUTHORS, main): Use FSF wording for --version (plus
1232 it bumps the copyright year).
1234 2006-12-27 Eric Blake <ebb9@byu.net>
1236 * doc/m4.texinfo (Patsubst): Fix typo.
1238 2006-12-16 Eric Blake <ebb9@byu.net>
1240 * src/m4.c (main): Check for errors when closing stdin.
1242 2006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1244 * doc/m4.texinfo: Fix some typos.
1246 2006-12-09 Eric Blake <ebb9@byu.net>
1248 * configure.ac (AC_INIT): Bump version number.
1249 * NEWS: Start changes of 1.4.8a.
1251 2006-11-20 Eric Blake <ebb9@byu.net>
1254 * configure.ac (AC_INIT): Bump version number.
1255 * NEWS: Describe changes since 1.4.7.
1257 2006-11-16 Eric Blake <ebb9@byu.net>
1259 * doc/m4.texinfo (Include, Search Path, Diversions, Divert):
1260 Minor tweaks noticed while porting to head.
1262 2006-11-14 Eric Blake <ebb9@byu.net>
1264 * src/output.c (cleanup_tmpfile, freeze_diversions): Clean up
1266 (m4_tmpname): Avoid memory leak.
1268 2006-11-13 Eric Blake <ebb9@byu.net>
1270 * src/output.c (cleanup_tmpfile): Avoid double error message when
1271 umask is prohibitive.
1272 (m4_tmpname, m4_tmpopen, m4_tmpclose, m4_tmpremove): New
1274 (m4_tmpfile): Add parameter, move cloexec action here.
1275 (make_room_for): Adjust caller. Don't keep too many files open.
1276 (insert_diversion_helper): Unlink emptied temp files.
1277 (make_diversion): Don't keep too many files open.
1278 * doc/m4.texinfo (Diversions): Tweak wording, now that open file
1279 descriptors are no longer a limiting factor.
1280 * NEWS: Document this change.
1282 Backport sparse diversion handling from head.
1283 * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
1285 * src/output.c (struct m4_diversion): Rename from struct
1286 diversion, and update members. All users changed.
1287 (diversion_table): Change to an ordered set, instead of an array.
1288 (div0): New storage for diversion 0.
1289 (diversions): No longer needed.
1290 (free_list): New list to allow recycling diversion storage.
1291 (diversion_storage): New storage to reduce malloc overhead.
1292 (cmp_diversion_CB, threshold_diversion_CB): New callbacks.
1293 (output_init, output_exit, cleanup_tmpfile, make_room_for)
1294 (make_diversion): Handle new diversion storage scheme.
1295 (insert_diversion_helper): New function.
1296 (insert_diversion, undivert_all, freeze_diversions): Use it.
1297 * doc/m4.texinfo (Divert, Diversions): Move hidden test of memory
1298 exhaustion to visible test of large diversion numbers.
1299 * NEWS: Document this fix.
1301 2006-11-11 Eric Blake <ebb9@byu.net>
1303 * src/builtin.c (m4_translit): Slight optimization.
1305 * src/m4.h (to_uchar): Depend on HAVE_INLINE.
1307 * src/builtin.c: Remove unnecessary casts.
1308 (expand_ranges): Make 8-bit clean.
1309 * doc/m4.texinfo (Translit): Add tests and wording.
1310 * NEWS: Document this fix.
1312 2006-11-07 Eric Blake <ebb9@byu.net>
1314 * src/m4.h (output_exit): New prototype.
1315 * src/m4.c (main): Use it.
1316 * src/output.c (cleanup_tmpfile): Close files before removing
1318 (insert_diversion): Check for failure.
1319 (output_exit): Avoid memory leak.
1320 * doc/m4.texinfo (Diversions): Test this bug.
1322 * doc/m4.texinfo (Esyscmd, Errprint): Minor touchups.
1324 2006-11-01 Eric Blake <ebb9@byu.net>
1326 Allow C++ compilation on Linux, as a safety measure in type
1328 * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
1330 * src/m4.h (hack_symbol, hack_all_symbols): Use full prototype.
1331 (boolean): Kill this, and use stdbool.h instead.
1332 * src/debug.c, src/eval.c, src/input.c, src/macro.c, src/m4.c:
1333 * src/output.c, src/symtab.c: All users changed.
1334 * src/symtab.c (hack_all_symbols): Update prototype.
1335 * src/builtin.c (dump_symbol, set_trace): Update signature.
1336 (m4_dumpdef, m4_traceon, m4_traceoff): Update callers.
1337 (mkstemp_helper, m4_m4wrap, expand_ranges, m4_translit): Allow
1339 * src/debug.c (trace_flush): Likewise.
1340 * src/freeze.c (reload_frozen_state): Likewise.
1341 * src/input.c (push_file, push_string_finish, push_wrapup):
1342 (token_bottom, next_token): Likewise.
1343 * src/m4.c (main): Likewise.
1345 * doc/m4.texinfo (Invoking m4): Update according to POSIX 200x
1347 * src/m4.h (m4_path_search): Tweak signature.
1348 * src/path.c (m4_path_search): Likewise.
1349 * src/builtin.c (include): Update caller.
1350 * src/m4.c (main): Allow -D, -U, -t, and -s to be interspersed
1351 with file names. Don't write to **argv.
1352 (process_file): New helper method.
1353 * NEWS: Document this fix.
1355 2006-10-31 Eric Blake <ebb9@byu.net>
1357 * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import strstr'.
1358 * doc/m4.texinfo (Translit): Improve the documentation.
1359 * src/builtin.c (m4_translit): Optimize to O(n) instead of O(n^2)
1361 (m4_index): Simplify, and speed up slightly.
1362 * NEWS: Document this fix.
1364 2006-10-28 Eric Blake <ebb9@byu.net>
1366 * src/input.c (set_quotes): Don't allow empty end-quote with
1367 non-empty start-quote.
1368 (set_comment): Likewise for end-comment.
1369 * src/builtin.c (m4_changecom): Adjust caller.
1370 * doc/m4.texinfo (Changequote, Changecom): Update documentation to
1372 (Incompatibilities): Document another POSIX bug.
1373 * NEWS: Mention this change.
1375 2006-10-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1377 * examples/Makefile.am (EXTRA_DIST): Distribute recently-added
1380 2006-10-26 Eric Blake <ebb9@byu.net>
1382 Silence -Wwrite-strings -Wpointer-arith warnings.
1383 * src/builtin.c (define_user_macro): Allow NULL argument.
1384 (m4_builtin, m4_indir): Cast away const of "".
1385 * src/format.c (format): Likewise.
1386 * src/macro.c (collect_arguments): Likewise.
1387 (expand_macro): Avoid math on void*.
1388 * src/m4.c (main): Adjust caller.
1389 * src/output.c (freeze_diversions): Detect off_t overflow.
1391 * src/input.c (pop_input): Remove unnecessary code.
1393 2006-10-25 Eric Blake <ebb9@byu.net>
1395 * src/symtab.c (symtab_init): Avoid size_t overflow.
1396 * src/output.c (make_diversion): Avoid size_t overflow.
1397 * doc/m4.texinfo (Diversions): Test this fix.
1398 * src/input.c (input_block): Remove unused member. Reduce size
1400 (push_file, pop_input): Avoid useless assignment.
1401 * NEWS: Document the bug fix.
1403 Redo location tracking. Instead of having just files track the
1404 line to return to when popping input, now all input blocks track
1406 * src/input.c (INPUT_STRING_WRAP, INPUT_FILE_INIT): No longer
1408 (input_block): Have line and file storage for all input types, and
1409 rename some members.
1410 (input_change): New global flag.
1411 (push_file, push_macro, push_string_init, push_wrapup): Store
1413 (push_string_finish, pop_input, pop_wrapup): Notice changes in
1415 (peek_input): Adjust to new member names.
1416 (next_char, next_char1): Adjust location if needed.
1417 (skip_line): Simplify restoring location.
1418 * doc/m4.texinfo (Location): Augment the test to catch line
1419 location of expansion of multi-line arguments.
1420 Reported by Stepan Kasal.
1422 2006-10-23 Eric Blake <ebb9@byu.net>
1424 * doc/m4.texinfo (Macro Arguments): Document that leading space
1425 in argument collection stops at macro expansion.
1426 (Incompatibilities): Document POSIX whitespace wording issue.
1428 2006-10-20 Eric Blake <ebb9@byu.net>
1430 * doc/m4.texinfo: Trailing '@comment' doesn't format nicely in
1431 TeX, so recognize '@w{ }' instead. Likewise, @code{_name} at the
1432 end of a TeX line splits incorrectly.
1433 (Foreach, Improved foreach): Write these sections, borrowing ideas
1434 from CVS head and from m4sugar.
1435 * checks/get-them: Accomodate new way to show trailing space in
1437 * examples/foreach.m4: Make usable in documentation.
1438 * examples/foreachq.m4: New file.
1439 * examples/foreachq2.m4: New file.
1440 * examples/foreach2.m4: New file.
1441 * NEWS: Document the documentation updates.
1443 2006-10-19 Eric Blake <ebb9@byu.net>
1445 * src/builtin.c (mkstemp_helper, m4_mkstemp): New functions.
1446 (m4_maketemp): Provide traditional behavior.
1447 * doc/m4.texinfo (Mkstemp): Rename from Maketemp. Document the
1448 new `mkstemp' macro and the flaws of the old `maketemp'.
1449 (Incompatibilities): Move maketemp discussion to...
1450 (Extensions): ...here, since -G now supresses the GNU extension.
1451 * NEWS: Document this.
1453 * examples/forloop.m4: Simplify.
1454 * examples/forloop2.m4: New file.
1455 * examples/quote.m4: New file.
1456 * doc/m4.texinfo (Loops): Rename to...
1457 (Shift): ...this node.
1458 (Forloop, Foreach, Improved forloop, Improved foreach): New
1461 2006-10-17 Eric Blake <ebb9@byu.net>
1463 * m4/gnulib-cache.m4: Update with 'gnulib-tool --import
1465 * configure.ac (AC_CONFIG_HEADERS): Create config.h alongside
1466 gnulib headers, rather than in top directory.
1467 * src/Makefile.am (AUTOMAKE_OPTIONS): Add nostdinc, to reduce make
1470 2006-10-16 Eric Blake <ebb9@byu.net>
1472 * doc/m4.texinfo: Backport some minor cleanups from head.
1473 (Cleardivert): Rename from cleardiv.
1475 * doc/m4.texinfo (Invoking m4): Promote to a chapter, instead of
1476 a section of Preliminaries.
1477 (Operation modes, Preprocessor features, Limits control)
1478 (Frozen state, Debugging options, Command line files): Subdivide
1480 (Input processing, Quoting Arguments, Define, Arguments)
1481 (Cleardiv, Format, M4exit): Fix grammar of references.
1482 (Inhibiting Invocation, Macro Arguments, Builtin, Trace)
1483 (Debug Levels, Debug Output, Include, Search Path, Divert)
1484 (Platform macros, Syscmd, Location, Extensions): Point to new
1486 (Top, Loops, Include, Undivert, Location, Incompatibilities):
1487 Improve file references.
1489 2006-10-14 Eric Blake <ebb9@byu.net>
1491 * m4/input.c (file_clean): Don't close stdin twice, POSIX says it
1493 Reported by Ralf Wildenhues.
1495 * src/builtin.c (m4_undivert): Check for read error.
1497 2006-10-13 Eric Blake <ebb9@byu.net>
1499 * src/m4.h (UNIX, W32_NATIVE, OS2): Move platform checks after
1500 header files are included, since <unistd.h> can affect the tests.
1502 Reported by Martin Koeppe.
1504 Backport head's usage of clean-temp module, as it is cleaner than
1505 using tmpfile-safer.
1506 * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
1507 clean-temp closeout', and remove tmpfile-safer.
1508 * src/m4.h (includes): Adjust.
1509 (m4_path_search): Rename from path_search, to avoid collision
1511 * src/m4.c (main): Install closeout handler. Adjust caller.
1512 (usage): Now done by closeout module.
1513 * src/builtin.c (m4_m4exit): Likewise.
1514 (m4_undivert, include): Adjust callers.
1515 * src/freeze.c (reload_frozen_state): Likewise.
1516 * src/path.c (m4_path_search): Rename from path_search.
1517 * src/output.c (output_temp_dir): New variable.
1518 (cleanup_tmpfile, m4_tmpfile): New functions, from head.
1519 (insert_diversion, make_room_for): Use them.
1520 * doc/m4.texinfo (Diversions): Document this, and add a test.
1521 (Improved fatal_error): Fix typo.
1522 (Maketemp): Port test to mingw, and no longer hide from
1524 * NEWS: Document the change in TMPDIR behavior.
1526 * configure.ac (m4_pattern_forbid): Narrow the range of forbidden
1527 macros, to work with recent gnulib-tool update.
1529 * src/builtin.c (m4_builtin, m4_indir): Allow transparent
1530 handling of defn results.
1531 * doc/m4.texinfo (Builtin, Indir): Add test cases.
1532 * NEWS: Document this.
1534 2006-10-12 Eric Blake <ebb9@byu.net>
1536 * doc/m4.texinfo (Location): Fix typo in previous commit.
1537 (Changeword): Catch one more case.
1538 * src/input.c (skip_line): Fix case when outer file used macro to
1541 2006-10-11 Eric Blake <ebb9@byu.net>
1543 * src/input.c (enum input_type): Add additional types, to shave
1544 time off the common case.
1545 (push_wrapup): Wrapped strings remember location.
1546 (push_string_finish): Normal strings carry no location.
1547 (push_file): Start new files uninitialized.
1548 (peek_input, next_char_1): Optimize common cases by updating
1549 location only on new input types.
1550 (pop_input): Update to honor new input types.
1551 (skip_line, push_string_finish): Fix regression in previous patch
1552 when dnl is not followed by newline in included file.
1553 (push_string_init): Initialize all fields of INPUT_STRING sooner.
1554 (peek_token): Simplify.
1555 (peek_input): Don't pop input files on peek, so that __file__ and
1556 __line__ as last token of include file work correctly.
1557 * doc/m4.texinfo (History): Mention 1.4.8.
1558 (Answers): Split into sections, one per answer.
1559 (Improved exch, Improved cleardivert, Improved fatal_error): New
1561 (Dnl, M4wrap, Location, M4exit, Improved fatal_error): Update to
1562 new m4wrap location semantics.
1563 (Changeword): Add test that caught the regression.
1564 * NEWS: Document this.
1566 * src/macro.c (expand_macro): In macro expansion errors, report
1567 line number at open parenthesis.
1568 * src/input.c (next_token): Fix off-by-one bug in reporting end
1569 of file in unterminated comment and string.
1570 (file_names): New obstack, necessary since expand_macro now hangs
1571 on to file names longer than the files remain open.
1572 (input_init): Initialize new obstack.
1573 (push_file): Use new obstack. Delay updates to current_file
1574 until after expand_macro has restored state.
1575 (peek_input, next_char_1): Update current_file if necessary.
1576 (pop_wrapup): Release memory.
1577 * doc/m4.texinfo (Macro Arguments, Changequote, Changecom): Catch
1579 (Dnl): Update to the new location reporting rules.
1580 * NEWS: Document these changes.
1582 2006-10-10 Eric Blake <ebb9@byu.net>
1584 * src/macro.c (argc_stack, argv_stack): New variables for sharing
1585 obstacks across multiple macro calls.
1586 (expand_input): Initialize and tear down stack once per input
1587 file, instead of once per macro.
1588 (expand_macro): Reuse existing stacks when possible.
1589 (collect_arguments): Simplify slightly.
1591 * src/path.c (include_env_init): Fix botched patch application.
1592 Reported by Ralf Wildenhues.
1594 2006-10-09 Eric Blake <ebb9@byu.net>
1596 * src/m4.c (usage, main): Detect write failures to stderr.
1597 * src/builtin.c (m4_m4exit): Likewise.
1598 * NEWS: Document this.
1600 * src/macro.c (expand_macro): Allow --nesting-limit=0 to remove
1602 * NEWS: Document this.
1603 * doc/m4.texinfo (Invoking m4): Likewise.
1605 2006-10-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1607 * src/path.c (include_env_init): Copy the string returned
1608 by getenv before overwriting it; POSIX disallows this.
1610 2006-10-09 Eric Blake <ebb9@byu.net>
1612 * src/m4.c (main): Defer debugfile until after --help.
1613 * configure.ac (AC_INIT): Bump version number.
1614 * NEWS: Start changes of 1.4.7a.
1616 2006-09-25 Eric Blake <ebb9@byu.net>
1619 * configure.ac (AC_INIT): Bump version number.
1620 * NEWS: Describe changes since 1.4.6.
1622 2006-09-21 Eric Blake <ebb9@byu.net>
1624 * doc/m4.texinfo (Invoking m4): Add clarification on option
1625 processing behavior.
1627 Reported by Mikhail Teterin.
1629 * bootstrap: Add --force option, based on idea from coreutils.
1630 * README: Document that ./bootstrap and autoreconf are for
1631 developers, and not lightly done in tarballs.
1633 2006-09-20 Eric Blake <ebb9@byu.net>
1635 * src/m4.c (usage, OPTSTRING, main): Rename -e to -i, and give
1636 deprecation warning on -e.
1637 * doc/m4.texinfo (Invoking m4, Extensions): Document this.
1638 * NEWS: Document this.
1640 2006-09-19 Eric Blake <ebb9@byu.net>
1642 * src/m4.c (usage, long_options, main, DEBUGFILE_OPTION): Rename
1643 -o/--error-output to --debugfile, and deprecate the former. This
1644 will allow a future release to be more consistent with other GNU
1645 tools, with -o/--output affecting stdout, not debug.
1646 * doc/m4.texinfo (Invoking m4, Debug Output): Document this.
1647 * NEWS: Document this.
1649 2006-09-14 Eric Blake <ebb9@byu.net>
1651 * src/m4.c (main): Warn on deprecated options -B, -S, -T, -N,
1652 --diversions. `m4 --help --version' now displays help, not
1654 (interactive, frozen_file_to_read, frozen_file_to_write): Move to
1656 (show_help, show_version): No longer needed.
1657 (long_options, DIVERSIONS_OPTION): Backport patch from head to
1658 distinguish between -N and --diversions in warning.
1659 * doc/m4.texinfo (Invoking m4): Document this.
1662 2006-09-11 Eric Blake <ebb9@byu.net>
1664 * src/Makefile.am (m4_LDADD): Add any gnulib dependent libraries.
1665 * src/debug.c (debug_flush_files) [UNIX]: Flush stdin if it is
1667 (debug_set_file): Use STDOUT_FILENO.
1668 * src/builtin.c (m4_m4exit): Flush stdin before exiting, to comply
1669 with POSIX in regards to unread input.
1670 * NEWS: Document this fix.
1671 * doc/m4.texinfo (Syscmd, Esyscmd, M4exit): Likewise.
1673 2006-09-07 Eric Blake <ebb9@byu.net>
1675 * m4/gnulib-cache.m4: Update to newer gnulib-tool.
1676 * src/m4.h (push_file): Change prototype.
1677 * src/input.c (push_file, peek_input, next_char_1): Only call getc
1678 once at EOF, to avoid double ^D on terminal stdin; regression from
1680 (push_file, pop_file): Allow reading stdin twice.
1681 * src/m4.c (main): Likewise.
1682 * src/builtin.c (include): Update caller.
1683 * NEWS: Document this change.
1684 * doc/m4.texinfo (Invoking m4, Incompatibilities): Likewise.
1685 (Syscmd): Add a test that failed before this patch.
1687 2006-09-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1689 * checks/check-them: Quote $pwd.
1691 2006-09-05 Eric Blake <ebb9@byu.net>
1693 * src/builtin.c (define_macro): Warn on invalid macro name.
1694 * NEWS: Document this change.
1695 * doc/m4.texinfo: Fix typos.
1696 (Invoking m4, Macro Arguments, Pseudo Arguments, Defn, Indir)
1697 (Ifelse): Backport some improvements from head.
1699 2006-09-04 Eric Blake <ebb9@byu.net>
1701 * doc/m4.texinfo (Changeword): Skip test on mingw, where the
1702 native echo is braindead.
1703 * checks/check-them (strip_needed): Ignore \r in output. Now the
1704 testsuite will pass when cross-compiling from cygwin to mingw.
1706 * src/input.c (peek_input): Fix regression in handling macro
1707 without arguments as last token in file; debian bug 385720.
1708 (next_token): Always consume an input character.
1709 Reported by Andreas Schultz.
1710 * configure.ac (AC_INIT): Bump version number.
1711 * NEWS: Document this fix.
1712 * doc/m4.texinfo (History): Mention next version.
1713 (Changeword): Add example that exposes this bug.
1716 2006-08-25 Eric Blake <ebb9@byu.net>
1719 * configure.ac (AC_INIT): Bump version number.
1720 * NEWS: Describe changes since 1.4.5.
1722 * Makefile.maint (web-manual): Give up on VPATH build during
1723 distribution. But distributions are made so infrequently that
1724 this is not too much of a hardship.
1725 * Makefile.am (MAINTAINERCLEANFILES): Avoid error if lib/CVS/
1728 2006-08-24 Eric Blake <ebb9@byu.net>
1730 * src/builtin.c (m4_index, m4_substr, m4_translit): Similar to
1731 Solaris, produce output on just one argument.
1732 (m4_regexp, m4_patsubst): For consistency, do likewise.
1733 (m4_patsubst): Allow zero-length match at end of string.
1734 * doc/m4.texinfo (Sysval): Fix overfull hbox.
1735 (Bugs, Macro Arguments): Minor fixes.
1736 (Other tokens): Rearrange node order.
1737 (Index macro, Substr, Translit, Regexp, Patsubst): Add tests.
1738 * NEWS: Document these fixes.
1740 2006-08-22 Eric Blake <ebb9@byu.net>
1742 * src/input.c (pop_input): Avoid empty filename with -di option.
1743 * src/debug.c (debug_message_prefix): Put space before message.
1745 * m4/gnulib-cache.m4: We don't explicitly use alloca module.
1747 * m4/gnulib-cache.m4: Augment with gnulib-tool --import gnupload.
1748 * Makefile.maint (fetch): Simplify, now that we can use gnupload.
1750 * checks/check-them: State why a test is skipped.
1751 * doc/m4.texinfo (Changeword, Sysval, Maketemp): Likewise.
1753 * ChangeLog: Add copyright.
1754 * AUTHORS: Likewise.
1755 * BACKLOG: Likewise.
1759 * examples/COPYING: New file, add copyright for all the examples.
1760 * checks/get-them: Put copyright on testsuite files.
1762 2006-08-18 Eric Blake <ebb9@byu.net>
1764 Don't let unrelated child processes see too many files.
1765 * m4/gnulib-cache.m4: Augment with gnulib-tool --import cloexec.
1766 * src/builtin.c (m4_esyscmd, m4_regexp, m4_patsubst): Fix
1767 spelling in error message.
1768 * src/debug.c [!__STDC__]: Assume C89, and nuke old varargs.h.
1769 (debug_set_output): Close debug file on exec.
1770 * src/m4.h (includes): Add cloexec.h.
1771 * src/output.c (make_room_for): Close diversions on exec.
1772 * src/path.c (path_search): Close include files on exec.
1773 * NEWS: Document this.
1775 Regular expressions were leaking memory.
1776 * src/builtin.c (init_pattern_buffer, free_pattern_buffer): New
1778 (m4_regexp, m4_patsubst): Avoid memory leak.
1779 * src/input.c (init_pattern_buffer) [ENABLE_CHANGEWORD]: Make
1781 (set_word_regexp) [ENABLE_CHANGEWORD]: Avoid memory leak. Change
1782 from O(n^2) to O(n) for calculating word_start.
1783 (next_token, peek_token) [ENABLE_CHANGEWORD]: Treat word_start as
1784 O(1) bitmap, not O(n) search string.
1785 * NEWS: Document this fix.
1787 2006-08-17 Eric Blake <ebb9@byu.net>
1789 * NEWS: Document previous checkin.
1791 * src/builtin.c (substitute): Avoid core dump when accessing
1792 beyond bound of regular expression.
1793 Reported by Karl Nelson.
1794 * doc/m4.texinfo (Regexp): Add example that causes core dump on
1795 some architectures prior to this patch.
1798 2006-08-16 Eric Blake <ebb9@byu.net>
1800 * doc/m4.texinfo (Invoking m4, Debug Output): Fix wording to be
1801 clear that dumpdef does not always go to stderr.
1803 * src/builtin.c (m4_errprint): Flush buffers before printing to
1807 2006-08-15 Eric Blake <ebb9@byu.net>
1809 * src/builtin.c (m4_m4wrap, m4_errprint, m4_shift): Make blind,
1810 per debian bug 96075.
1811 * doc/m4.texinfo (Loops, M4wrap, Errprint): Document this change.
1812 (Changeword): Don't use shift as an example of a swallowed word.
1813 (Divert): Discuss fact that divert is an English word.
1814 Reported by Richard A Nelson.
1816 2006-08-14 Eric Blake <ebb9@byu.net>
1818 * doc/m4.texinfo (Invoking m4): Minor fixes.
1820 2006-08-12 Eric Blake <ebb9@byu.net>
1822 * doc/m4.texinfo (Arguments): Hint at better exch macro.
1823 (Answers): Provide a better definition.
1825 2006-08-09 Eric Blake <ebb9@byu.net>
1827 * doc/m4.texinfo (Incompatibilities): Document that m4 does not
1828 yet understand locales.
1829 * NEWS: Fix wording of a few items.
1831 2006-08-08 Eric Blake <ebb9@byu.net>
1833 Avoid printing `NONE:0:' in error messages.
1834 * src/m4.h (m4_error_at_line): New function.
1835 * src/m4.c (m4_error_at_line): Implement.
1836 * src/input.c (skip_line, input_init, next_token): Use "", not
1837 "NONE", for no file, since NONE can be a real file name.
1838 * src/macro.c (expand_argument): Likewise.
1839 * src/debug.c (debug_message_prefix, trace_header): Check for
1841 * doc/m4.texinfo (Dnl, M4wrap): Adjust accordingly.
1842 (Location): Document that synclines and internal message format
1843 are not impacted by redefining these macros.
1844 (M4exit): Hint at bug in fatal_error.
1845 (Answers): Provide workaround to match m4 output.
1847 * m4/gnulib-cache.m4: Augment with gnulib-tool --import verror.
1848 * src/m4.h (m4_error): New function.
1849 (M4ERROR, M4ERROR_AT_LINE): Reimplement without hacking around
1850 error module deficiencies.
1851 (reference_error, suppress_line): No longer needed.
1852 * src/m4.c (m4_error): Implement.
1853 (main): No longer need to install error callback.
1855 2006-08-04 Eric Blake <ebb9@byu.net>
1857 * src/m4.h (program_name): Declare.
1858 (suppress_line): New variable.
1859 (M4ERROR_AT_LINE): New macro.
1860 * src/m4.c (reference_error, main): Follow GNU Coding Standards
1861 for error message format.
1862 * src/input.c (skip_line, next_token): Use M4ERROR_AT_LINE.
1863 * src/macro.c (expand_argument): Likewise.
1864 * checks/check-them (examples): Adjust to new message format.
1865 * src/builtin.c (m4___program__): New builtin.
1866 * doc/m4.texinfo (Location): Split from Errprint into new node,
1867 and document __program__.
1868 (Builtin, Ifdef, Ifelse, Dumpdef, Trace, Debug Output, Dnl)
1869 (Include, Regexp, Patsubst, Incr, Eval): Adjust error message
1871 (Extensions): Document __program__.
1872 * NEWS: Document this change.
1874 2006-08-03 Eric Blake <ebb9@byu.net>
1876 Don't confuse leading `(' in comment or quote with start of
1877 argument collection.
1878 * src/m4.h (enum token_type): Add TOKEN_OPEN, TOKEN_COMMA,
1880 (peek_input): Make private to input.c.
1881 (peek_token): New prototype.
1882 * src/input.c (default_word_regexp): Reduce ifdefs.
1883 (peek_input): Make static.
1884 (next_token): Return new token types.
1885 (match_input, MATCH): Add argument consume, which controls
1886 whether match should be pushed back.
1887 (peek_token): New function.
1888 (token_type_string) [DEBUG_INPUT]: New function.
1889 * src/macro.c (expand_token, expand_argument, collect_arguments):
1890 Handle new token types.
1891 * doc/m4.texinfo (Changequote, Changecom): Document this.
1892 * NEWS: Document this.
1894 * src/stackovf.c (setup_stackovf_trap): Free memory on failure.
1896 * src/stackovf.c (setup_stackovf_trap): Gracefully avoid stack
1897 overflow detection when sigstack exists but is not implemented.
1898 Fixes debian bug 154053.
1900 Reported by David Perlin.
1902 2006-08-02 Eric Blake <ebb9@byu.net>
1904 * src/input.c (MATCH): Fix EOF detection on multi-byte comment
1907 2006-08-01 Eric Blake <ebb9@byu.net>
1909 * src/input.c (skip_line, next_token): Remember current file in
1910 case input file ends abruptly. Addresses debian bug 175365.
1911 (pop_input): Defer freeing storage that holds previous file
1913 (pop_wrapup): to here, after error message is issued.
1914 * src/macro.c (expand_argument): Remember current file in case
1915 input file ends abruptly.
1916 * doc/m4.texinfo (Macro Arguments, Dnl, Changequote, Changecom)
1917 (M4wrap): Adjust testsuite accordingly.
1918 (Errprint): Document line number limitation of m4wrap.
1919 * NEWS: Document this fix.
1922 2006-07-31 Eric Blake <ebb9@byu.net>
1924 * src/input.c (peek_input, next_char, match_input): Be eight-bit
1925 clean; fixes debian bug 311378.
1926 * doc/m4.texinfo (Syntax): Describe eight-bit handling.
1927 (Changequote, Changecom): Add examples to test this.
1928 * NEWS: Document this fix.
1930 Reported by Steven Augart.
1932 * doc/m4.texinfo: Whitespace fix.
1933 * checks/get-them: Avoid exceeding 14-char file name limit.
1936 2006-07-30 Eric Blake <ebb9@byu.net>
1938 * src/path.c (path_search): Detect allocation failure.
1940 Use native free when it is good enough.
1941 * m4/gnulib-cache.m4: Augment with gnulib-tool --import free.
1942 * src/builtin.c (define_user_macro, m4_regexp, m4_patsubst):
1944 * src/symtab.c (free_symbol): Likewise.
1945 * src/m4.c (xfree, main): Likewise.
1946 * src/m4.h (obstack_chunk_free): Likewise.
1947 * src/path.c (path_search): Likewise.
1948 * src/input.c (pop_wrapup, set_quotes, set_comment): Likewise.
1950 * doc/m4.texinfo (Errprint): Add example for last patch.
1951 * checks/check-them: Account for VPATH in latest example.
1953 2006-07-29 Eric Blake <ebb9@byu.net>
1955 * src/path.c (path_search): Add result parameter, so that
1956 -I can be accounted for. Debian bug 53685.
1957 * src/m4.h (path_search): Update prototype.
1958 * src/m4.c (main): Adjust callers.
1959 * src/freeze.c (reload_frozen_state): Likewise.
1960 * src/builtin.c (include, m4_undivert): Likewise.
1961 * NEWS: Document this change.
1962 Reported by Nicolas Lichtmaier.
1964 2006-07-28 Eric Blake <ebb9@byu.net>
1966 * Makefile.am (MAINTAINERCLEANFILES): Fix typo that tripped up
1967 several non-GNU makes.
1968 * src/stackovf.c (setup_stackovf_trap): Missed _ from yesterday.
1969 * src/m4.h: Likewise.
1970 * src/input.c (push_wrapup): Avoid compiler warning with Solaris
1973 2006-07-27 Eric Blake <ebb9@byu.net>
1975 * doc/m4.texinfo: Use @acronym{GNU} throughout.
1976 (History): Update for 1.4.6.
1978 * src/m4.h (_): Remove K&R cruft.
1979 * src/builtin.c: Likewise.
1980 * src/debug.c: Likewise.
1981 * src/eval.c: Likewise.
1982 * src/macro.c: Likewise.
1983 * src/stackovf.c: Likewise.
1985 * doc/Makefile.am (m4.1): Improve man page.
1986 * src/m4.c (usage): Improve --help output, including adding the
1987 bug reporting address.
1988 (main): Follow GNU Coding Standards for --version output.
1990 2006-07-26 Eric Blake <ebb9@byu.net>
1992 * doc/m4.texinfo: Use begin-quote, end-quote, begin-comment, and
1993 end-comment consistently, to match POSIX.
1995 * doc/m4.texinfo (Macro Arguments, Changequote, Changecom)
1996 (Dnl, M4wrap, Include): Document EOF issues, and add examples.
1997 (Incompatibilities): Document incompatibility of changecom
1998 vs. macro names, and of EOF in include.
1999 * src/input.c (next_token): Reject unterminated comments at EOF.
2000 (skip_line): Warn on unterminated dnl at EOF.
2001 * NEWS: Document these changes.
2003 2006-07-25 Eric Blake <ebb9@byu.net>
2005 * m4/gnulib-cache.m4: Update to reflect gnulib's split of
2006 stdio-safer into fopen-safer and tmpfile-safer.
2007 * src/m4.c: Remove redundant include.
2009 2006-07-24 Eric Blake <ebb9@byu.net>
2011 Fix bugs related to stream handling.
2012 * m4/gnulib-cache.m4: Augment with gnulib-tool --import
2013 unlocked-io stdio-safer stdlib-safer close-stream.
2014 * configure.ac (AC_CHECK_FUNCS_ONCE): Assume tmpfile; it can be
2015 provided by gnulib if needed.
2016 * src/output.c [! HAVE_TMPFILE]: Likewise.
2017 * src/m4.h (includes): Replace unistd, stdio, and stdlib with
2018 their safer counterparts.
2019 (retcode): New global variable.
2020 * src/input.c (pop_input): Check for read failure.
2021 * src/freeze.c (reload_frozen_state): Likewise.
2022 (produce_frozen_state): Check for write failure.
2023 * src/debug.c (debug_set_file): Likewise.
2024 * src/m4.c (usage, main): Likewise.
2025 (retcode): Make global.
2026 * src/builtin.c (m4_m4exit): Likewise. Ensure that the exit
2027 status is non-zero except when everything succeeds.
2028 * doc/m4.texinfo (M4exit): Document these changes.
2029 (Incompatibilities): Remove documentation of bug now fixed.
2030 * NEWS: Document these fixes.
2032 2006-07-22 Eric Blake <ebb9@byu.net>
2034 * src/format.c (format): Avoid compiler warning that str may be
2037 2006-07-21 Eric Blake <ebb9@byu.net>
2039 * src/m4.h [UNIX]: Add more platforms that are close enough to
2040 categorize as UNIX, but which don't predefine __unix__.
2041 Reported by Nelson H. F. Beebe.
2043 2006-07-20 Eric Blake <ebb9@byu.net>
2045 * m4/gnulib-cache.m4: gnulib-tool has changed again. Regenerate
2046 to explicitly ask for --assume-autoconf=2.60.
2048 2006-07-19 Eric Blake <ebb9@byu.net>
2050 * doc/m4.texinfo (Sysval): Avoid kill -1, since ksh traps SIGHUP
2051 and exits normally with 129.
2052 Reported by Nelson H. F. Beebe.
2055 * src/m4.h (EXIT_MISMATCH): Define.
2056 * src/freeze.c (reload_frozen_state): Detect version mismatch, by
2057 exiting with status 63.
2058 * src/m4.c (usage): Document this.
2059 * doc/m4.texinfo (Invoking m4, Using frozen files): Likewise.
2062 * doc/m4.texinfo (copying): Relax restriction on front-cover and
2065 2006-07-17 Eric Blake <ebb9@byu.net>
2067 * src/format.c (format): Support F, g, and G specifiers.
2068 * doc/m4.texinfo (Format): Document this.
2069 * NEWS: Document this addition.
2071 * doc/m4.texinfo (Builtin): Delete redundant text.
2073 * configure.ac (AC_INIT): Bump version number.
2074 * src/builtin.c (substitute): Bah. Fix buffer overrun.
2075 * NEWS: Document this fix.
2077 2006-07-15 Eric Blake <ebb9@byu.net>
2080 * configure.ac (AC_INIT): Bump version number.
2081 * NEWS: Describe changes since 1.4.4.
2083 * src/m4.c (usage): Document exit status.
2084 * doc/m4.texinfo: Use `exit status', not `exit code'.
2085 (Invoking m4): Document exit status.
2087 * bootstrap: Backport --help, --version from head.
2088 (func_update): New function, for easily grabbing up-to-date files
2090 * Makefile.maint (web-manual): Fix for VPATH builds.
2092 2006-07-14 Eric Blake <ebb9@byu.net>
2094 * doc/m4.texinfo: Global cleanup. Avoid @code{...}'d, as it
2095 looks bad in info. Use @deffn rather than @example for
2096 describing prototypes. Fix awkward wording and grammar.
2098 * src/builtin.c (substitute): Warn on bad escape sequences.
2099 Ignore trailing backslash.
2100 * doc/m4.texinfo (Regexp): Add documentation for this.
2101 * NEWS: Document this change.
2103 * src/builtin.c (m4_format, m4_indir): Warn on too few arguments.
2104 * doc/m4.texinfo (Defn, Builtin, Debug Levels, Debug Output): Add
2106 (Dnl): Update example to show side effects.
2107 * checks/get-them: Generate three digit test names.
2108 * checks/Makefile.in (CHECKS): Accomodate 100+ tests.
2110 2006-07-13 Eric Blake <ebb9@byu.net>
2112 * src/input.c (input_init): Simplify.
2113 (set_word_regexp): Treat empty string as default, since empty
2114 regexp would disable word parsing.
2115 * src/m4.c (user_word_regexp): Default to empty string.
2116 * src/builtin.c (builtin_tab): Make changeword blind.
2117 * doc/m4.texinfo (Changeword): Document this.
2118 * NEWS: Document this.
2119 * TODO: Knock off completed items.
2121 * src/builtin.c (m4_undefine, m4_popdef): Visit all arguments, not
2123 * doc/m4.texinfo (Undefine, Pushdef): Test this.
2124 * NEWS: Document this change.
2126 * src/builtin.c (numeric_arg): Treat empty string as 0, with a
2127 warning. Detect quoted leading space and overflow as warnings.
2128 (m4_eval): Treat empty radix as 10, and allow output in radix 1.
2129 Treat width as minimum number of digits, as required by POSIX.
2130 (m4_ifdef, m4_divert, m4_m4exit, m4_translit): Ignore extra
2132 (m4_substr): Likewise. Silently treat empty start as 0.
2133 (m4_undivert): Treat ` 1a' as file, not diversion 1.
2134 * src/eval.c (eval_lex): Parse radix 1 numbers.
2135 * doc/m4.texinfo (Invoking m4): Fix wording; there is more than
2136 one type of warning.
2137 (Manual): Document behavior of numeric parsing of empty string.
2138 (Divert, Incr): Document error handling.
2139 (Eval): Document radices better.
2140 (Incompatibilities): Document translit incompatibility.
2141 * NEWS: Document these changes.
2143 * Makefile.maint (fetch): Get gendocs from gnulib, not texinfo.
2144 (web-manual): Simplify.
2145 * m4/gnulib-cache.m4: Augment with gnulib-tool --import gendocs.
2146 * Makefile.am (EXTRA_DIST): Distribute gendocs.sh.
2147 (MAINTAINERCLEANFILES): Clean it as well.
2148 * doc/Makefile.am (EXTRA_DIST): Distribute gendocs_template.
2149 (MAINTAINERCLEANFILES): Clean it as well.
2151 2006-07-12 Eric Blake <ebb9@byu.net>
2153 * doc/m4.texinfo (Extensions): Document how to overcome
2154 implementation difference in > 9 positional parameters.
2156 * src/m4.c (usage): Sort within sections.
2157 (nesting_limit): Raise default from 250 to 1024.
2158 * doc/m4.texinfo: Use file name, not filename, per GNU coding
2159 standard. Use @option where appropriate.
2160 (Invoking m4): Sort to match --help output.
2161 (Debug Levels): Sort.
2162 (Frozen files): Sort and break into two nodes.
2164 * src/m4.c (nesting_limit): Raise default from 250 to 1024.
2165 * NEWS: Document raised -L limit.
2167 2006-07-11 Eric Blake <ebb9@byu.net>
2169 * Makefile.am (DISTCHECK_CONFIGURE_FLAGS): New macro, to
2170 stress-test changeword before a release.
2171 * doc/m4.texinfo: More doc cleanups.
2172 (Copying This Manual): New node; actually include the FDL in the
2174 * doc/Makefile.am (m4_TEXINFOS): Mention dependence on fdl.texi.
2175 * m4/gnulib-cache.m4: Augment with gnulib-tool --import fdl.
2176 * NEWS: Mention documentation improvements.
2178 * src/m4.h (OS2): New platform macro.
2179 * src/builtin.c (predefined_tab) [OS2]: Use it to give OS/2 a
2181 * doc/m4.texinfo (Platform macros): Document it.
2182 (Sysval): Remove non-portable test of system("").
2183 * NEWS: Document this change.
2184 Reported by Andreas Buening.
2186 2006-07-09 Eric Blake <ebb9@byu.net>
2188 * doc/m4.texinfo (Undivert): Fix typo in last commit.
2189 * src/m4.c (usage): Document M4PATH.
2190 * src/path.c (path_search): Reject empty string.
2191 * src/output.c (insert_diversion): Ignore diversion 0.
2192 * src/builtin.c (m4_undivert): Ignore empty string.
2193 * NEWS: Document this fix.
2195 2006-07-08 Eric Blake <ebb9@byu.net>
2197 * checks/get-them: Make filtering easier.
2198 * checks/check-them: Filter non-input lines, so line counts are
2199 more realistic in the documentation, and so changeword tests work
2200 even when dnl is disabled.
2201 * doc/m4.texinfo: Adjust example line numbers. Clean up
2202 front-matter, following autoconf's example.
2203 (Changeword): Enable tests, skipping if changeword not supported.
2204 (Define, Defn, Ifelse): Backport more examples from head.
2205 (Input processing, Answers): New nodes, backported from head.
2206 (Include): Expand test to cover empty filename.
2207 (Undivert): Add test of undivert(0).
2209 2006-07-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2211 * doc/m4.texinfo: Fix spelling errors.
2213 2006-07-07 Eric Blake <ebb9@byu.net>
2217 * doc/Makefile.am (m4.1): No need to go through a temporary file;
2218 this also ensures timestamps are updated.
2219 * src/m4.h (includes): Require config.h. Assume string.h,
2220 stdlib.h, errno. Include error.h, exit.h, and xalloc.h rather
2221 than prototyping ourselves.
2222 (builtin_func): Add parameter type-checking.
2223 (voidstar): Delete, now that we assume C89.
2224 * src/builtin.c, src/m4.c, src/macro.c, src/symtab.c: All users of
2226 * src/m4.c (xfree) [WITH_DMALLOC]: Avoid clash with dmalloc's
2229 2006-07-06 Eric Blake <ebb9@byu.net>
2231 * m4/gnulib-cache.m4: Augment with gnulib-tool --import
2233 * src/m4.h (includes): Add binary-io.h for O_BINARY.
2234 * src/freeze.c (produce_frozen_state): Use O_BINARY to remove
2235 #ifdef. Fixes patch from 2005-02-03 for cygwin.
2236 * NEWS: Mention this fix.
2238 * configure.ac (FUNC_SYSTEM_BROKEN): New check for OS/2 bug.
2239 * src/builtin.c (m4_syscmd): Work around OS/2 bug.
2241 * Makefile.am (SUBDIRS): Build . before src, so that autoheader
2242 runs first when needed.
2243 * doc/Makefile.am (m4.1): Backport rule from CVS head: build m4.1
2244 once in srcdir rather than multiple times in VPATH builds.
2246 2006-07-03 Eric Blake <ebb9@byu.net>
2248 * checks/check-them: Use portable = in test.
2249 * src/Makefile.am (AM_CPPFLAGS): Omit space between -I and
2250 directory, as required by Solaris cc. Include built headers, as
2251 required by Solaris make in VPATH build.
2252 * checks/Makefile.in: Use $(srcdir) where needed.
2253 (CHECKS): Factor $(srcdir) into macro.
2254 (DISTFILES): Likewise. Automake takes care of distributing
2257 (Makefile): Use modern syntax of config.status.
2258 * doc/m4.texinfo (Loops, Include, Undivert, Incompatibilities):
2259 Avoid overfull and underfull hboxes in dvi.
2261 Fix 'make check' in VPATH build. All files included by testsuite
2262 now live in a single directory. Use forloop.m4 in testsuite.
2263 * checks/incl.m4, checks/foo, checks/wrapfifo.m4: Move from
2265 * examples/incl.m4, examples/foo, examples/wrapfifo.m4: ...to
2267 * checks/Makefile.in (DISTFILES): Don't distribute moved files.
2268 * examples/Makefile.am (EXTRA_DIST): Distribute new files.
2269 * checks/check-them: Avoid s/// when filename is in pattern.
2270 * examples/forloop.m4: Fix to match documentation.
2271 * doc/m4.texinfo (Include, Undivert, Incompatibilities): Reflect
2273 (Loops, Format): Actually use forloop.m4 in tests.
2275 2006-07-02 Eric Blake <ebb9@byu.net>
2277 * checks/Makefile.in (exec_prefix, prefix): New macros, so that
2278 $(bindir) works in installcheck.
2279 (check, installcheck): No longer change directory, so that
2280 distcheck works with a read-only builddir.
2281 * checks/check-them: Work when pwd is no longer builddir.
2283 2006-07-01 Eric Blake <ebb9@byu.net>
2285 * GNUmakefile: New file, borrowed from coreutils.
2286 * Makefile.am (EXTRA_DIST): Distribute GNUmakefile.
2287 * Makefile.maint (Makefile): Delete this rule, now that
2288 GNUmakefile includes Makefile.
2290 2006-06-30 Eric Blake <ebb9@byu.net>
2292 For compatibility with other m4 implementations, sysval returns
2293 signal<<8 rather than 0 if syscmd is terminated by a signal.
2294 * configure.ac (AC_CHECK_HEADERS_ONCE): Check for sys/wait.h.
2295 * src/builtin.c (include): Include sys/wait.h when stdlib.h does
2296 not provide wait macros.
2297 (WTERMSIG, WIFSIGNALED, WIFEXITED): More fallback macros.
2298 (M4SYSVAL_EXITBITS, M4SYSVAL_TERMSIGBITS): New helper macros.
2299 (m4_esyscmd): Set sysval to -1 on failure.
2300 (m4_sysval): Print 127 on failure, and accomodate signals if they
2302 * NEWS: Document this change.
2303 * doc/m4.texinfo (Platform macros, Esyscmd, Sysval): Fix typos in
2305 * checks/check-them: Likewise.
2306 * src/debug.c (debug_set_file): Work around mingw fstat bug.
2308 * src/m4.h (UNIX, W32_NATIVE): Improve platform detection macros.
2309 * src/freeze.c (produce_frozen_state): Use new spelling of
2311 * src/builtin.c (predefined_tab): Add __windows__ on non-unix
2313 (m4_syscmd, m4_esyscmd): The empty command is successful.
2314 * doc/m4.texinfo (Shell commands): Rename from UNIX commands.
2315 Document platform-dependence of system().
2316 (Syscmd): Add example.
2317 (Esyscmd): Make example more robust, and actually demonstrate
2319 (Sysval): Expand test to cover esyscmd code path, and to check
2320 that empty command is successful. Add conditional check for
2322 (Other Incompatibilities): Move platform macros from here...
2323 (Platform macros): ...to this new node. Add windows macro.
2324 Check that exactly one platform macro is provided.
2325 * checks/check-them: Improve trap cleanup. Tolerate dirname and
2326 .exe in error messages. Allow for skipping checks.
2327 * configure.ac (HAVE_EFGCVT): Kill dead configure check.
2328 * NEWS: Document platform macros.
2330 2006-06-29 Eric Blake <ebb9@byu.net>
2332 Fix buffer overrun bug.
2333 * m4/gnulib-cache.m4: Augment with gnulib-tool --import
2335 * src/format.c [HAVE_EFGCVT]: Delete this code, and use *printf
2336 variant instead, since [efg]cvt are obsolete and our use of them
2337 was buggy (savannah sr #104303).
2338 (format): Fix buffer overflow by using xasprintf.
2339 * doc/m4.texinfo (Format): Expand format test to catch both bugs.
2340 * NEWS: Document this fix.
2342 * configure.ac (AC_CANONICAL_HOST, AC_CANONICAL_BUILD): Allow
2344 (AC_CACHE_CHECK): Cache search for ecvt.
2346 2006-06-27 Eric Blake <ebb9@byu.net>
2348 * doc/m4.texinfo (Eval): Document 32-bit signed limitations
2349 required by POSIX, and add example that exposed core dump on x86
2351 (Incompatibilities): Document incompatibility in eval precedence.
2352 * src/eval.c (shift_term): Explicitly mask, to avoid undefined
2354 (mult_term): Explicitly check for -1, to avoid SIGFPE on x86.
2355 * NEWS: Document this change.
2357 * doc/m4.texinfo: Use @noindent consistently.
2358 (Quoting Arguments): Document that unquoted parentheses group
2360 (Pseudo Arguments): Expand tests to show this.
2361 (Incompatibilities): Contrast traditional behavior of
2364 2006-06-24 Eric Blake <ebb9@byu.net>
2366 * configure.ac (AC_PREREQ): Autoconf 2.60 is now released.
2367 (AC_CHECK_HEADERS_ONCE): Use this new feature.
2368 (AC_CHECK_FUNCS_ONCE): Likewise.
2370 2006-06-23 Eric Blake <ebb9@byu.net>
2372 * doc/m4.texinfo: Quoting cleanup throughout - follow
2373 autoconf-recommended style of one level of quote per parenthesis
2374 in the normal case. Adjust error messages to match GNU coding
2375 standards (and to allow 'make check' to pass again).
2376 (Quoted strings, Inhibiting Invocation): Turn more examples into
2378 (Comments): Resolve FIXME by adding example.
2379 (Define): Add example about underquoting.
2380 (Defn): Add example about use of $0.
2381 (Indir, Format): Resolve FIXME done in last commit.
2382 (Ifelse): Add example about creating blind macro.
2383 (Debugging): Fix grammar.
2384 (Dnl): Add example about dnl with arguments.
2385 (M4wrap): Be explicit that LIFO order is non compliant, and will
2387 (Undivert): Resolve FIXME by adding example.
2388 (Frozen files): Document that m4wrap and sysval will not work
2389 consistently until m4 2.0.
2390 (Incompatibilities): Document another POSIX compliance bug, this
2391 time with changequote. Document a traditional incompatibility
2392 with partial input spanning file boundaries.
2394 Make error messages more consistent with GNU coding standards -
2395 start with lower case, and don't end sentence with punctuation.
2396 * src/debug.c (trace_pre): Update message wording.
2397 * src/eval.c (evaluate, cmp_term, shift_term, mult_term):
2399 * src/freeze.c (produce_frozen_state, issue_expect_message),
2400 (reload_frozen_state): Likewise.
2401 * src/input.c (push_string_init, pop_init, init_macro_token),
2402 (peek_input, next_char_1, set_word_regexp, next_token): Likewise.
2403 * src/m4.c (stackovf_handler, main): Likewise.
2404 * src/macro.c (expand_token, expand_argument, call_macro),
2405 (expand_macro): Likewise.
2406 * src/output.c (make_room_for, output_text, insert_file),
2407 (freeze_diversions): Likewise.
2408 * src/symtab.c (symtab_init, lookup_symbol): Likewise.
2410 * src/builtin.c (builtin_tab): Make format and indir blind.
2411 (substitute): Prefer "Warning:" vs. "ERROR:" in messages.
2412 * NEWS: Mention the change to builtins.
2414 2006-06-22 Eric Blake <ebb9@byu.net>
2416 Robustify frozen file format.
2417 * src/freeze.c (reload_frozen_state): Add GET_DIRECTIVE helper
2418 macro. Require V first, and only accept it once. For F, use
2419 placeholder if builtin is not found, rather than warning.
2420 * src/m4.h (m4_placeholder): New prototype.
2421 * src/builtin.c: Unify error message style.
2422 (m4_placeholder): New function, warn if invoked.
2423 (builtin_tab): Add m4_placeholder.
2424 (m4_defn): Warn if placeholder is encountered.
2425 (find_builtin_by_addr): Handle placeholder.
2426 (find_builtin_by_name): Return placeholder on failure.
2427 (m4_builtin): Treat placeholder as undefined.
2428 * doc/m4.texinfo (Frozen files): Document changes in V and F.
2429 * NEWS: Document this change.
2430 Reported by Bruno Haible.
2432 * doc/m4.texinfo: Whitespace cleanup. TABs are evil in texinfo.
2433 (tabchar): New macro, so that 'make check' still works.
2434 (Invoking m4): Document that ignored compatibility options -B, -S,
2435 and -T each consume an argument.
2436 * checks/get-them: Honor @tabchar{}.
2438 Avoid compiler warnings during -DDEBUG.
2439 * src/m4.h (M4_GNUC_ATTRIBUTE, M4_GNUC_UNUSED): New macros.
2440 [DEBUG]: Also imply DEBUG_OUTPUT and DEBUG_STKOVF.
2441 * src/input.c (print_token) [DEBUG_INPUT]: Use correct format.
2442 (lex_debug) [DEBUG_INPUT]: Fix to compile. Mark unused.
2443 (next_token) [DEBUG_INPUT]: Print before returning.
2444 * src/path.c (include_dump) [DEBUG_INCL]: Mark unused.
2445 * src/symtab.c (symtab_debug) [DEBUG_SYM]: Mark unused.
2447 Avoid mkstemp bugs on various platforms.
2448 * m4/gnulib-cache.c: Augment with gnulib-tool --import mkstemp.
2449 * src/output.c [! HAVE_MKSTEMP]: Delete.
2450 * configure.ac (AC_CHECK_FUNCS): Don't check for mkstemp.
2451 * src/m4.h (mkstemp) [! HAVE_MKSTEMP]: Prototype, if needed.
2452 * NEWS: Document this.
2454 * Makefile.am (EXTRA_DIST): Distribute gnulib-cache.m4.
2455 Reported by Bruno Haible.
2457 2006-06-21 Eric Blake <ebb9@byu.net>
2459 Avoid obsolete sigstack when POSIX sigaltstack is available.
2460 * src/m4.c: Blindly assume signal.h, since stackovf.c and gnulib
2462 * configure.ac (AC_CHECK_HEADERS): Likewise.
2463 (AC_CHECK_TYPES): New check for siginfo_t, since siginfo.h is
2464 obsolete and most hosts now have it in signal.h.
2465 (AC_CHECK_MEMBERS): New check for sigaction.sa_sigaction.
2466 (AC_CACHE_CHECK): Cache decision to use stackovf.
2467 (AC_EGREP_HEADER): Switch to AC_CHECK_TYPES.
2468 * src/stackovf.c (DEBUG_STACKOVF): Remove unused define.
2469 (SA_RESETHAND, SA_SIGINFO): Provide fallback definitions, to
2470 simplify later code.
2471 (PARAM_STACKOVF, PARAM_NOSTACKOVF): Move further away from NULL,
2472 in case of dereferencing a member of a NULL pointer.
2473 (sigsegv_handler) [HAVE_STRUCT_SIGACTION_SA_SIGACTION]: Define a
2475 (setup_stackovf_trap): Use NULL instead of 0 for pointers, use
2476 EXIT_FAILURE in error, indent preprocessor directives.
2477 [HAVE_SIGALTSTACK && HAVE_SIGINFO_T]: Depend on siginfo_t, not
2479 [HAVE_SIGACTION && defined SA_ONSTACK]: Prefer POSIX handler.
2480 Reported by Santiago Vila.
2482 2006-06-19 Eric Blake <ebb9@byu.net>
2486 2006-06-18 Andreas Buening <andreas.buening@nexgo.de> (tiny change)
2488 * checks/Makefile.in (PATH_SEPARATOR): New macro.
2489 (check, installcheck): Use it, for OS/2.
2491 2006-06-18 Eric Blake <ebb9@byu.net>
2493 Consistently use "GNU M4" as package name, "m4" as executable
2495 * NEWS: Document previous fix.
2497 * README: Fix grammar. Document that --enable-changeword is on
2499 * doc/m4.texinfo (Top, Changeword): Likewise.
2500 (Sysval): Enhance this test.
2501 (History): Backport this section from CVS head, and update.
2503 2006-06-18 Bruno Haible <bruno@clisp.org> (tiny change)
2504 Eric Blake <ebb9@byu.net>
2506 * src/builtin.c (WEXITSTATUS): Provide fallback definition.
2507 (m4_esyscmd): Set sysval to 0xffff, to accomodate both
2508 big-endian and little-endian wait status definitions.
2509 (m4_sysval): Use WEXITSTATUS.
2510 Reported by Andreas Buening.
2512 2006-06-18 Eric Blake <ebb9@byu.net>
2514 * configure.ac (AC_INIT): Bump version number.
2515 * NEWS: Describe changes in 1.4.4c.
2517 2006-06-17 Eric Blake <ebb9@byu.net>
2519 Beta Release 1.4.4b:
2520 * configure.ac (AC_INIT): Bump version number.
2521 * NEWS: Describe changes since 1.4.4.
2522 * Makefile.maint (cvs-news): Accomodate copyright line wrapping.
2524 * Makefile.am (MAINTAINERCLEANFILES): Clean files added by
2526 * checks/Makefile.in (maintainer-clean): Add missing target.
2527 * COPYING: Remove generated file from CVS.
2529 2006-06-16 Eric Blake <ebb9@byu.net>
2531 * checks/Makefile.in (DISTFILES): Distribute wrapfifo.m4.
2533 2006-06-15 Eric Blake <ebb9@byu.net>
2535 * checks/wrapfifo.m4: New file. Use it...
2536 * doc/m4.texinfo (Incompatibilities): here, in a new test case to
2537 demonstrate how to get POSIX behavior of m4wrap prior to m4 2.0.
2539 * src/m4.h (to_uchar): New function.
2540 * src/eval.c (eval_lex): Use it to avoid passing signed char to
2541 isdigit, isalpha, isupper, islower, isspace, isalnum.
2542 * src/builtin.c (expand_user_macro): Likewise.
2543 * src/format.c (format): Likewise.
2544 * src/macro.c (expand_argument): Likewise.
2545 * NEWS: Document this security fix.
2548 * src/symtab.c (lookup_symbol): Use invalid, not illegal.
2549 * src/freeze.c (reload_frozen_state): Fix typo in message.
2550 (produce_frozen_state): Standardize on builtin, not built-in.
2551 * src/builtin.c (numeric_arg, bad_argc): Likewise.
2553 * configure.ac (M4_EARLY, M4_INIT): Use gnulib.
2554 (AC_PROG_RANLIB, AC_AIX, AC_MINIX, AC_CHECK_HEADERS),
2555 (AC_FUNC_ALLOCA, AC_REPLACE_FUNCS): Avoid checks now done by
2557 * Makefile.am (ACLOCAL_AMFLAGS): New entry, for gnulib.
2558 * m4/gnulib-cache.m4: New file, from gnulib.
2559 * bootstrap: Invoke gnulib-tool --update.
2560 * src/m4.c (main): Cast away const.
2561 * NEWS: Document that regex is updated.
2564 2006-06-08 Eric Blake <ebb9@byu.net>
2566 * configure.ac (changeword): Work even when changeword is not a
2568 (AC_PROG_AWK, AC_PROG_INSTALL, AC_PROG_MAKE_SET, AC_HEADER_STDC):
2569 Delete; now done by automake.
2570 (AC_ISC_POSIX, AC_C_CONST): Delete; now obsolete.
2572 2006-06-07 Eric Blake <ebb9@byu.net>
2574 * lib/regex.c (bcmp_translate): Canonicalize type name.
2575 * doc/Makefile.am (MAINTAINERCLEANFILES): Fix typo.
2576 * configure.ac (changeword): Disable changeword for the creation
2577 of configure, in case of bootstrapping with an m4 configured with
2578 --enable-changeword.
2580 Distribute a rudimentary man page.
2581 * Makefile.am (SUBDIRS): Move doc after src so that 'm4 --help'
2583 * doc/Makefile.am (man_MANS, EXTRA_DIST, MAINTAINERDISTCLEAN),
2584 (SUFFIXES, m4.1): New macros and rules to build m4.1.
2586 2006-06-06 Eric Blake <ebb9@byu.net>
2588 * lib/regex.c (re_match_2_internal, bcmp_translate): Avoid
2589 compiler warnings at -O2.
2590 * lib/getopt.c (_getopt_internal): Likewise.
2592 Cleanup of previous patches.
2593 * src/input.c (struct input_block): Remove traced member.
2594 (push_macro, init_macro_token): Don't pass trace status around.
2595 * src/m4.h (struct token_data): Remove traced member.
2596 (struct symbol, struct builtin): Reduce unused space.
2597 (TOKEN_DATA_FUNC): Simplify.
2598 (TOKEN_DATA_FUNC_TRACED): Remove unused macro.
2599 (push_macro, define_builtin): Remove unused parameter.
2600 * src/builtin.c (define_builtin, builtin_init, define_macro),
2601 (m4_defn): Don't pass trace status around.
2602 * src/macro.c (expand_argument): Likewise.
2603 * src/freeze.c (reload_frozen_state): Likewise.
2604 * src/symtab.c: Whitespace cleanup.
2605 * NEWS: Clean up wording.
2606 * doc/m4.texinfo (Undefine, Dumpdef, Trace): Cleanup wording;
2607 ensure tests actually expose bugs prior to today's patches.
2609 Trace status of builtins is no longer inherited across
2610 define(...,defn(...)). Fixes bug that autom4te had been working
2612 * src/builtin.c (define_builtin): Don't override trace status.
2613 * doc/m4.texinfo (Trace): Add test for this.
2614 * NEWS: Document this.
2616 When changing macro definitions inside the arguments to the macro,
2617 consistently preserve the old definition that was in effect before
2618 argument collection, similar to the C pre-processor.
2619 Reported by John Brzustowski.
2620 * NEWS: Document this change.
2621 * doc/m4.texinfo (Macro Arguments, Undefine, Dumpdef): Document
2622 this policy, and add tests that expose core dumps prior to this
2624 * src/m4.h (struct symbol): New members to track when a symbol is
2625 still in use after removal from the symbol table.
2626 (SYMBOL_PENDING_EXPANSIONS, SYMBOL_DELETED): Define.
2627 (free_symbol): Prototype.
2628 * src/macro.c (expand_macro): Track pending expansions of a
2629 symbol. On completion, if a symbol is deleted and no longer
2630 pending, free its memory.
2631 * src/symtab.c (free_symbol): Export. Don't free memory if symbol
2633 (lookup_symbol) <SYMBOL_INSERT>: Create new entry when old entry
2635 (lookup_symbol) <SYMBOL_DELETE, SYMBOL_POPDEF>: Mark entries still
2636 in use as deleted and remove from the table without freeing
2638 (symtab_print_list) [DEBUG_SYM]: More debug output.
2640 * src/symtab.c (hack_all_symbols): Allow certain modifications of
2641 the symbol table during traversal.
2642 * src/builtin.c (set_trace): Replace SYMBOL_DELETE with
2643 SYMBOL_POPDEF, since only the latter is safe with
2646 Solve crash when passing "indir(`foo')" to "m4 -tfoo".
2647 * src/symtab.c (lookup_symbol) <SYMBOL_DELETE, SYMBOL_POPDEF>:
2648 Preserve placeholder when macro is being traced.
2649 * src/builtin.c (m4_ifdef, m4_indir): A traced but undefined
2650 symbol is not defined.
2651 (set_trace): Remove placeholder when no longer traced.
2652 (m4_traceon): On named traces, always reserve a slot in the
2654 (m4_traceoff): Don't warn about untracing a nonexistent symbol.
2655 * NEWS: Document new trace behavior.
2656 * doc/m4.texinfo (Trace): Tracing by name now consistently works
2657 no matter whether that macro is currently defined.
2658 (Incompatibilities): Document differences between traditional and
2661 2006-06-04 Paul Eggert <eggert@cs.ucla.edu> (tiny change)
2662 Eric Blake <ebb9@byu.net>
2664 * src/m4.h (hash_table_size): Now size_t instead of int.
2665 * src/m4.c (hash_table_size): Likewise.
2666 (main): Adjust to this; use atol rather than atoi.
2667 * src/symtab.c: Include <limits.h>, for CHAR_BIT.
2668 (symtab_init, lookup_symbol, hack_all_symbols):
2669 Use size_t for sizes and indexes, not int.
2670 (symtab_print_list) [DEBUG_SYM]: Likewise.
2671 (hash): Likewise. Don't case-fold in the hash function.
2672 Shift by 7, not 3, for consistency with gnulib/lib/hash.c.
2673 Don't assume hash word is 32 bits.
2674 * NEWS: Document this change.
2676 2006-06-04 Eric Blake <ebb9@byu.net>
2678 * src/symtab.c (symtab_debug, symtab_print_list) [DEBUG_SYM]: Fix
2679 to allow compilation, for use in debugger.
2680 (profiles, current_mode) [DEBUG_SYM]: New variables.
2681 (show_profile, profile_strcmp) [DEBUG_SYM]: New methods for
2682 determining hash table performance.
2684 2006-05-31 Eric Blake <ebb9@byu.net>
2685 John Brzustowski <jbrzusto@fastmail.fm>
2687 * src/input.c (input_stack): Delete; use current_input instead.
2688 (wrapup_stack): Dynamically allocate, so that recursion is handled
2690 (push_wrapup): Use current wrapup stack.
2691 (pop_wrapup): Rotate wrapup stack to current, and create new
2693 (input_init): Dynamically allocate stacks.
2694 * NEWS: Update, now that recursive m4wrap can no longer cause
2697 2006-05-31 Eric Blake <ebb9@byu.net>
2699 * lib/getopt.c: Fix copyright year.
2700 * lib/obstack.c: Ditto.
2701 * src/builtin.c: Ditto.
2703 2006-05-30 Eric Blake <ebb9@byu.net>
2705 * doc/m4.texinfo (M4wrap): Add test to expose m4wrap bug.
2706 Reported by John Brzustowski.
2707 (Incompatibilities): Document known POSIX incompatibilities.
2710 2006-05-29 Eric Blake <ebb9@byu.net>
2712 * doc/m4.texinfo (Maketemp): Work even when running 'make check'
2716 * Makefile.am: New file.
2717 * doc/Makefile.am: Ditto.
2718 * examples/Makefile.am: Ditto.
2719 * lib/Makefile.am: Ditto.
2720 * src/Makefile.am: Ditto.
2721 * acinclude.m4: New file, renamed from aclocal.m4.
2722 * configure.ac (AM_INIT_AUTOMAKE): Invoke new macro.
2723 (AC_ARG_PROGRAM): Now redundant.
2724 (STACKOVF): Turn into automake conditional.
2725 (AC_CONFIG_COMMANDS): stamp-h is a command, not a file.
2726 * checks/Makefile.in: Converting this dir to automake was not
2727 trivial; for now, just add missing targets demanded by top-level.
2728 * INSTALL: Remove files that are now generated from CVS.
2729 * Makefile.in: Ditto.
2730 * aclocal.m4: Ditto.
2731 * install-sh: Ditto.
2732 * mkinstalldirs: Ditto.
2733 * doc/Makefile.in: Ditto.
2734 * doc/texinfo.tex: Ditto.
2735 * examples/Makefile.in: Ditto.
2736 * lib/Makefile.in: Ditto.
2737 * src/Makefile.in: Ditto.
2739 * AUTHORS: Backport from CVS head, and update.
2740 * doc/m4.texinfo (Changeword): Fix examples to match behavior.
2742 2006-05-27 Eric Blake <ebb9@byu.net>
2744 * lib/regex.c (regex_compile): Kill compiler warnings.
2745 * lib/getopt.c: Likewise.
2746 * lib/obstack.c: Likewise.
2747 * src/builtin.c (builtin_init): Likewise.
2748 * src/path.c (path_search): Likewise.
2750 * doc/m4.texinfo: Fix usage of a vs. an.
2751 (Loops, Include, Cleardiv, Patsubst, Format, M4exit): Kill
2752 overfull hbox warnings.
2753 (Inhibiting Invocation, Divert, Maketemp, M4exit): Add new tests.
2755 * configure.ac: Update to autoconf 2.59. Forbid ^M4_. Fix
2757 * aclocal.m4 (fp_PROG_CC_STDC): Delete; now covered by autoconf.
2758 (fp_C_PROTOTYPES): Delete, GNU Coding Standards state we can now
2760 (M4_WITH_DMALLOC): Rename from fp_WITH_DMALLOC. Fix quoting.
2761 * src/m4.h (_): PROTOTYPES is no longer provided, assume C89.
2762 * src/Makefile.in: Delete remains of ansi2knr.
2763 * src/ansi2knr.1: Delete.
2764 * src/ansi2knr.c: Delete.
2766 2006-05-25 Eric Blake <ebb9@byu.net>
2768 * doc/m4.texinfo: Fix spelling errors. Use `invalid' instead of
2771 * doc/m4.texinfo (Francois): No longer needed as a tex variable.
2772 Reported by Karl Berry.
2774 2006-05-24 Eric Blake <ebb9@byu.net>
2776 * Makefile.in (html): New target.
2777 * doc/Makefile.in (html, m4.html): Likewise.
2778 (MAKEINFOHTML): New macro.
2779 * doc/m4.texinfo (Francois) [ifnottex]: Use newer texinfo
2781 (Regexp) [ifhtml]: Make cross-reference to emacs manual an
2783 Reported by Bob Badour.
2785 * THANKS: Update. Move reporter's email addresses here, instead
2788 2006-05-11 Eric Blake <ebb9@byu.net>
2791 * doc/m4.texinfo (Changequote): Give testsuite exposure to bug
2792 patched on 2005-12-04.
2793 Reported by Ilya N. Golubev.
2795 * bootstrap: New file, so that generated files need not be stored
2797 * Makefile.in (DISTFILES): Add bootstrap.
2799 Make testsuite less sensitive to doc changes.
2800 * doc/m4.texinfo: Use m4.input instead of filename.
2801 * checks/check-them (xerr): Turn m4.input into filename.
2802 * checks/Makefile.in (dist): Depend on stamp-checks.
2804 Portability updates for OS/2.
2805 * src/Makefile.in (EXEEXT, OBJEXT): Define.
2808 * lib/Makefile.in (OBJEXT): Define.
2810 * doc/Makefile.in (install, uninstall): Install info files into
2812 Reported by Andreas Buening.
2814 2006-05-09 Eric Blake <ebb9@byu.net>
2816 * install-sh: Update to newer upstream version.
2817 * mkinstalldirs: Likewise.
2818 Reported by Andreas Buening.
2820 * src/m4.c (main): Bump copyright year.
2821 * Makefile.in (datarootdir): Define, for autoconf 2.59c.
2822 * doc/Makefile.in (datarootdir): Likewise.
2824 2006-05-08 Eric Blake <ebb9@byu.net>
2827 * doc/m4.texinfo (Bugs): Backport bug email address from head.
2828 Reported by Stepan Kasal.
2830 2005-12-04 Ilya N. Golubev <gin@mo.msk.ru> (tiny change)
2832 * input.c (match_input): Do not pass expression with side effect
2833 to `obstack_grow'. Fix <INTERNAL ERROR: Recursive push_string!>.
2836 2005-12-04 Gary V. Vaughan <gary@gnu.org> (tiny change)
2838 * doc/m4.texinfo (How to debug macros and input): s/woould/would/
2839 Reported by Damian Menscher.
2841 2005-10-19 Gary V. Vaughan <gary@gnu.org> (tiny change)
2843 * configure.ac (AC_INIT): Bump to 1.4.4a.
2845 2005-10-19 Gary V. Vaughan <gary@gnu.org> (tiny change)
2848 * configure.ac (AC_INIT): Bump to 1.4.4.
2849 * NEWS: Describe 1.4.4's changes.
2850 * INSTALL, install-sh, doc/texinfo.tex: Updated from upstream.
2852 2005-10-17 John Gatewood Ham <zappaman@buraphalinux.org> (tiny change)
2854 * src/m4.c: fix return code when non-existent files are processed
2856 2005-10-17 John Gatewood Ham <zappaman@buraphalinux.org> (tiny change)
2858 * README: update email address for bug reports.
2860 2005-10-17 Gary V. Vaughan <gary@gnu.org>
2862 * doc/m4.info: Generated files are not kept in the repository.
2864 2005-05-01 Gary V. Vaughan <gary@gnu.org>
2866 The FSF are moving offices today. Changed their contact address
2867 in all files from `59 Temple Place, Suite 330, MA 02111-1307' to
2868 `51 Franklin Street, Fifth Floor, MA 02110-1301'.
2870 Also, some of the files here were never updated from the previous
2871 '675 Mass Ave, Cambridge, MA 02139', so changed those to the
2872 '51 Franklin Street, Fifth Floor, MA 02110-1301' address too.
2874 2005-03-31 Mike Frysinger <vapier@gentoo.org>
2876 * Makefile.in (bindir, infodir): Substitute from configure rather
2878 * doc/Makefile.in (infodir): Ditto.
2879 * src/Makefile.in (bindir): Ditto.
2882 2005-03-31 Gary V. Vaughan <gary@gnu.org>
2884 Changes needed to automate the release process for 1.4.3:
2886 * Makefile.in (dist): Make .tar.bz2 tarball too.
2887 * Makefile.maint (TSDEPS_DIST): Remove m4/libtool.m4.
2888 (cvs-news): Look 1 line further down for NEWS release number.
2889 (cvs-dist): We don't use automake, so make dist is fine.
2890 Remove double . before suffixes.
2891 (cvs-release): Don't mention manual.html.
2892 (fetch): Get latest gendocs files.
2893 (web-manual): Rewritten to use gendoc for multiformat manuals.
2894 * doc/gendocs.sh: Don't save an old version in m4 CVS!
2895 * doc/m4.texinfo (Index): HFS+ (the file system on my Mac) is case
2896 preserving, but case insensitive, so generating html docs per node
2897 clashes between Index.html, the node file, and index.html, the
2898 top-level of the document tree...
2899 (Index macro): ...so renamed to this. Changed all references.
2901 2005-03-31 Gary V. Vaughan <gary@gnu.org> (tiny change)
2903 * configure.ac (AC_INIT): Bump to 1.4.3a.
2905 2005-03-31 Gary V. Vaughan <gary@gnu.org> (tiny change)
2908 * configure.in (AC_INIT): Bump to 1.4.3.
2909 * NEWS: Describe 1.4.3's changes.
2911 2005-03-31 Gary V. Vaughan <gary@gnu.org>
2913 * Makefile.maint: New file with release rules, from CVS libtool.
2914 * Makefile.in (DISTFILES): Add Makefile.maint.
2915 * INSTALL, install-sh, doc/texinfo.tex: Updated to latest
2918 2005-03-31 Eric Blake <ebb9@byu.net> (tiny change)
2920 * doc/m4.texinfo (Patsubst): Re-add trailing space required by
2921 checks/47.patsubst, with a redundant @comment to prevent emacs
2922 from removing it accidentally again.
2923 * checks/get-them: Allow for trailing spaces tucked behind
2926 2005-03-31 Eric Blake <ebb9@byu.net> (tiny change)
2928 * doc/Makefile.in (install, uninstall): Accomodate DESTDIR.
2929 * src/Makefile.in (install, uninstall): Likewise.
2931 2005-02-07 Gary V. Vaughan <gary@gnu.org>
2933 * lib/regex.c, lib/regex.h: Reverted gnulib update, which broke
2935 Reported by Eric Blake.
2937 2005-02-04 Gary V. Vaughan <gary@gnu.org>
2939 * lib/regex.c, lib/regex.h: Updated from gnulib.
2940 * src/input.c (set_word_regexp): Don't change the word_regexp
2941 unless it compiles correctly.
2943 Reported by Frank Schwidom.
2945 * Makefile.in (stamp-h): Regenerate config.h properly.
2947 2005-02-03 Gary V. Vaughan <gary@gnu.org>
2949 * configure.ac (AC_DEFINE): Fix overquoting of description
2952 * src/m4.h (__CYGWIN__, WIN32): Canonicalise Windows and Cygwin
2954 * src/freeze.c (produce_frozen_state): Use \n line-endings even
2955 on Windows, so that the frozen file reader will work.
2956 Reported by Josef T. Burger.
2958 * src/m4.c (main): Modernise the --version output.
2960 2005-02-03 Gary V. Vaughan <gary@gnu.org>
2962 Modernise the configury a little to prevent spurious errors from
2963 Autoconf-2.59's autoreconf:
2965 * config.h.in: Renamed to...
2966 * config-h.in: ...this to better support DOS 8.3 file systems.
2967 * acconfig.h: Removed.
2968 * configure.in: Renamed to...
2969 * configure.ac: ...this, and AC_DEFINE used to declare config.h
2970 entry comments. Slight reorganisation and reformatting.
2971 * aclocal.m4: Use third argument to AC_DEFINE to declare config.h
2973 (AC_INIT): Use a modern 3 argument call.
2974 * Makefile.in, checks/Makefile.in, doc/Makefile.in,
2975 examples/Makefile.in, lib/Makefile.in, src/Makefile.in:
2976 s/PRODUCT/PACKAGE/g.
2977 * Makefile.in (DISTFILES): Removed acconfig.h, configure.in,
2978 config.h.in. Added configure.ac, config-h.in.
2979 (stamp-h.in): Removed acconfig.h from dependencies.
2980 (configure): Depends on configure.ac, not configure.in.
2981 * doc/Makefile.in (stamp-vti): Ditto.
2982 * src/freeze.c (produce_frozen_state), src/m4.c (main): Adjust for
2983 difference between PRODUCT="m4" and PACKAGE="GNU M4".
2984 * configure: Regenerated.
2986 2005-02-03 Noah Misch <noah@cs.caltech.edu>
2988 * src/output.c (mkstemp): Make non-static, and build regardless of
2989 HAVE_TMPFILE; src/builtin.c also needs this replacement.
2992 2004-09-09 Vincent Lonngren <Vincent.lonngren.759@student.lu.se>
2994 * configure.in (AC_CHECK_HEADERS): Commit works best when you save
2995 changes from your editor buffer first.
2997 * configure.in (AC_CHECK_HEADERS): Add signal.h, sys/signal.h.
2998 * src/m4.c: And include them as appropriate.
3001 2004-09-09 Andreas Schwab <schwab@suse.de>
3003 Refactoring of the string read case in next_char provides about a
3004 20% speedup of M4 as typically used by autoconf:
3006 * src/input.c (next_char_1): Renamed from next_char.
3007 (next_char): New macro.
3010 2004-08-21 Gary V. Vaughan <gary@gnu.org>
3012 * configure.in (VERSION): Bump to 1.4.2a.
3014 2004-08-19 Paul Eggert <eggert@twinsun.com>
3017 * configure.in (VERSION): Bump to 1.4.2.
3018 * News: Describe 1.4.2's changes.
3020 * src/m4.c (reference_error): Preserve errno, since M4ERROR
3022 * src/builtin.c (m4_esyscmd): Clear errno before calling popen.
3023 (m4_maketemp): Clear errno before calling mkstemp.
3024 * src/path.c (path_search): Don't let "free" trash errno when
3026 * src/output.c (insert_file): Don't assume errno has a valid
3027 value simply because fread returns zero. This fixes a
3028 portability bug reported by Marion Hakanson in
3029 <http://lists.gnu.org/archive/html/bug-m4/2004-07/msg00029.html>.
3031 2004-06-09 Gary V. Vaughan <gary@gnu.org>
3033 * configure.in (VERSION): Bump to 1.4.1a.
3034 * NEWS: Place holder for next stable release.
3036 2004-06-03 Paul Eggert <eggert@cs.ucla.edu>
3039 * configure.in (VERSION): Bump to 1.4.1.
3040 * NEWS: Describe 1.4.1's changes.
3042 * aclocal.m4 (fp_PROG_CC_STDC): Use AC_DEFUN, not define, to
3043 pacify Autoconf 2.59.
3045 * doc/m4.texinfo: Insert commas after @xref's that lack them,
3046 to pacify Texinfo 4.7.
3047 * doc/Makefile.in (info): Remove info-1, info-2, info-3.
3049 * src/m4.h, src/debug.c: Use #ifdef __STDC__, not #if __STDC__, to
3050 pacify Sun C compilers.
3052 2003-09-28 Akim Demaille <akim@epita.fr>
3054 * src/symtab.c (lookup_symbol): Fix an uninitialized-variable
3057 2003-09-03 Santiago Vila <sanvila@debian.org>
3059 * examples/stackovf.sh: Use tempfile if available.
3061 2001-04-02 Robert Bihlmeyer <robbe@orcus.priv.at>
3063 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=92629
3064 * src/output.c (m4_insert_file): Do not mix buffered and
3065 unbuffered I/O, as this breaks on the Hurd. (trivial change)
3067 2001-02-01 Santiago Vila <sanvila@debian.org>
3069 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=84451
3070 * src/m4.c (main): Fix format vulnerabilities. (trivial change)
3072 2001-02-01 Matt Kraai <kraai@debian.org>
3074 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=84416
3075 * doc/m4.texinfo (Maketemp): Change maketemp to refer to a new,
3076 empty file rather than to a nonexistent file. This closes a common
3078 * src/builtin.c (m4_maketemp): Implement the above, by using
3079 mkstemp rather than mktemp. (trivial change)
3081 2000-01-09 Akim Demaille <demaille@inf.enst.fr>
3083 * src/builtin.c (expand_ranges): Added break after trailing dash.
3084 This caused misbehaviors on some systems.
3086 Sat Nov 5 15:52:47 1994 Francois Pinard (pinard@icule)
3089 * doc/Makefile.in (realclean): Also remove stamp-vti.
3090 Reported by Eric Backus.
3092 Wed Nov 2 00:47:53 1994 Francois Pinard (pinard@icule)
3094 * src/freeze.c (produce_frozen_state): If the frozen file cannot
3095 be opened, return immediately after producing the error message.
3096 Reported by Andreas Schwab.
3098 * configure.in: Check for const only after having found possible
3099 ANSIfying compiler flags, this is of no use to check it before.
3100 Reported by Alexander Lehmann.
3102 Tue Nov 1 22:02:37 1994 Francois Pinard (pinard@icule)
3104 * src/macro.c (collect_arguments): Cast obstack arguments to
3105 (voidstar), so avoiding compiler warnings.
3106 Reported by Joseph E. Sacco.
3108 * src/freeze.c (produce_frozen_state): Cast printed lengths to
3109 (int) so they correspond to %d format items.
3110 Reported by Joseph E. Sacco.
3112 * src/m4.c (main): Cast the argument to xfree to (voidstar).
3113 * src/symtab.c (free_symbol): Idem.
3114 Reported by Karl Vogel.
3116 Mon Oct 31 02:11:19 1994 Francois Pinard (pinard@icule)
3118 * Makefile.in (DISTFILES): Distribute BACKLOG.
3120 * configure.in: Define PRODUCT and VERSION.
3121 * acconfig.h: Document PRODUCT and VERSION.
3122 * src/m4.c, src/freeze.c: Use PRODUCT and VERSION instead of the
3123 constant string m4 and variable or parameter named version.
3125 Sun Oct 30 08:13:03 1994 Francois Pinard (pinard@icule)
3127 * src/m4.h, src/debug.c: Replace all #ifdef __STDC__ by #if
3128 __STDC__. Alliant FX/2800 Concentrix 2.2 (i860-BSD4.3) compiler
3129 defines __STDC__ to 0, for indicating it is *not* ANSI!
3130 Reported by Kaveh R. Ghazi.
3132 * configure.in: Added obsolescent tests for AIX and Minix.
3134 * doc/Makefile.in (mostlyclean): Remove texclean in dependencies,
3135 which texclean does not exist anymore.
3136 Reported by Eric Backus, Jim Meyering, John David Anglin and
3139 Sat Oct 29 05:10:03 1994 Francois Pinard (pinard@icule)
3141 * aclocal.m4 (fp_C_PROTOTYPES): Force -D_HPUX_SOURCE with -Aa.
3142 Reported by John David Anglin.
3144 * src/ansi2knr.c: New version, sent by Peter Deutsch.
3145 * aclocal.m4 (fp_C_PROTOTYPES): Substitute empty or ansi2knr for
3146 ANSI2KNR, depending on the fact the compiler is ANSI or not.
3147 * src/Makefile.in: Use -Ovarargs=convert on ansi2knr calls.
3148 Remove the sed filter after ansi2knr for debug.c. Use $O instead
3149 of $U, put underline in extensions rather than in basenames. Use
3150 implicit rules, now that regularity makes this possible.
3151 Have $(OBJECTS) depend on $(ANSI2KNR), so to trigger compilation
3152 of ansi2knr whenever it is needed.
3153 * configure.in: Adjusted for correct STACKOVF substitution.
3154 * src/debug.c (trace_format): When not __STDC__, use (...) as a
3155 parameter list, so ansi2knr will convert it to (va_alist) va_dcl.
3156 Reported by David MacKenzie.
3158 * Makefile.in: Remove binprefix. Use transform_name instead.
3159 Reported by David MacKenzie.
3161 * doc/Makefile.in: Create version.texi, use it, clean it.
3162 Reported by Jim Meyering.
3164 Fri Oct 28 20:33:55 1994 Francois Pinard (pinard@icule)
3166 * Makefile.in (all, install, uninstall): Depend on Makefile.
3168 * Makefile.in: For actions invoking $(MAKE) from within compound
3169 sh statements, exit non-zero if the sub-make fails. Otherwise,
3170 the top-level make may exit successfully when it should fail.
3171 Reported by Jim Kingdon.
3173 * {,/*}Makefile.in: Use && after all cd, in case they fail.
3175 * {,*/}Makefile.in: Declare PRODUCT and VERSION macros.
3176 (dist): Use PRODUCT and VERSION instead of tricks on .fname.
3177 * configure.in: Substitute PRODUCT and VERSION.
3179 * {,*/}Makefile.in (dist): Always try a hard link before a copy.
3181 Thu Oct 27 22:32:58 1994 Francois Pinard (pinard@icule)
3183 * Makefile.in (mostlyclean-local): Do not remove *~.
3184 * */Makefile.in (mostlyclean): Idem.
3185 Reported by Robert E. Brown and Richard Stallman.
3187 Sun Oct 9 08:30:13 1994 Francois Pinard (pinard@icule)
3189 * src/m4.h: Get rid of CONFIG_BROKETS.
3191 Sun Oct 2 16:48:10 1994 Francois Pinard (pinard@icule)
3193 * configure.in: Use AC_ARG_PROGRAM.
3194 * aclocal.m4 (fp_C_PROTOTYPES): Substitute @kr@ by kr or empty.
3195 Reported by David MacKenzie.
3197 Sat Oct 1 11:22:42 1994 Francois Pinard (pinard@icule)
3199 * configure.in: Do not add -O to CFLAGS for GNU C, now that
3200 configure does it automatically.
3201 Reported by Jim Meyering.
3203 Fri Sep 23 08:16:58 1994 Francois Pinard (pinard@icule)
3205 * src/stackovf.c: Declare the handler_t typedef earlier in the
3206 code, use it for stackovf_handler.
3207 (setup_stackovf_trap): Use RETSIGTYPE instead of void while
3208 casting sigsegv_handler.
3209 Reported by Robert Bernstein.
3211 * src/m4.c (main): Initialize program_name to argv[0] without
3213 Reported by Karl Berry.
3215 Sun Sep 18 11:42:50 1994 Francois Pinard (pinard@icule)
3217 * src/Makefile.in (TAGS): Include a ../lib/TAGS reference.
3218 Reported by Karl Berry.
3220 Wed Sep 14 10:00:22 1994 Francois Pinard (pinard@icule)
3222 * lib/Makefile.in (mostlyclean): Added.
3223 (TAGS): Make in $(srcdir).
3225 * configure.in: Use `choke me' in test, like everywhere!
3227 * {doc,examples,lib,src}/Makefile.in (check): Deleted, as
3228 unreacheable and useless.
3230 * doc/Makefile.in (texclean): Deleted, merged in mostlyclean.
3232 * lib/Makefile.in (DISTFILES): Distribute TAGS.
3233 (distclean): Do not remove TAGS.
3234 (realclean): Remove it.
3235 * Makefile.in: Make TAGS in lib also, not just in src.
3236 Reported by Karl Berry.
3238 * Makefile.in (distclean, realclean): Instead of recursively
3239 calling $(MAKE) for the -local part, allow parallel execution of
3240 -recursive and -local, only delay the removal of config.status,
3241 which is repeated in both goals.
3243 Tue Sep 13 19:21:05 1994 Francois Pinard (pinard@icule)
3246 * Makefile.in: Group all *clean-recursive goals in one, using sed
3247 to remove `-recursive' while calling make recursively. Also, use
3248 a subshell for each recursive $(MAKE).
3249 Reported by Jim Meyering.
3251 * src/m4.h (memcpy): Define with bcopy for BSD systems.
3252 Reported by Kaveh R. Ghazi.
3254 * src/Makefile.in (ansi2knr): Use $(LIBS) while linking, for SunOS
3255 4.1.3 requires -ldl to link even ansik2nr, and we need a way to
3258 * configure.in: Use date instead of touch for stamp-h.
3259 * Makefile.in (stamp-h.in): Idem.
3261 * Makefile.in (distclean, realclean): Force serial execution of
3262 both goals, in case parallel makes are being used.
3263 Reported by Jim Meyering.
3265 * src/Makefile.in (DISTFILES): Distribute TAGS.
3266 (distclean): Do not remove TAGS.
3267 (realclean): Remove it.
3268 Reported by Karl Berry.
3270 Sat Sep 10 12:34:04 1994 Francois Pinard (pinard@icule)
3272 * configure.in: Use fp_ to match aclocal.m4. Revert _OS_ macros
3273 to old names, for following Autoconf.
3275 Thu Sep 8 15:07:27 1994 Francois Pinard (pinard@icule)
3277 * Makefile.in (MDEFINES): Remove INSTALL substitutions, for
3278 ./install.sh will not be correctly referred to in sub-Makefiles.
3279 Reported by John David Anglin.
3281 * doc/Makefile.in (texclean): Remove *.cps and *.fns too.
3282 Reported by Eric Backus.
3284 * Makefile.in, checks/Makefile.in, doc/Makefile.in,
3285 examples/Makefile.in, lib/Makefile.in, src/Makefile.in: Limit
3286 config.status into remaking this directory's Makefile only.
3287 * Makefile.in (stamp-h): Do not check nor touch stamp-h.
3288 * configure.in (AC_OUTPUT): Touch stamp-h if CONFIG_HEADERS.
3289 Reported by Jim Meyering.
3291 Tue Sep 6 12:07:33 1994 Francois Pinard (pinard@icule)
3293 * configure.in: Correct stack overflow detection logic, taking
3294 care of systems having only incomplete implementations (like for
3295 Pyramid 9820 OSx 5.0d).
3296 Reported by Kaveh R. Ghazi.
3298 * src/Makefile.in (TAGS): Remote -t from etags call.
3300 Fri Sep 2 10:37:10 1994 Francois Pinard (pinard@icule)
3302 * lib/Makefile.in (install): Depend on all.
3304 Wed Aug 31 11:17:21 1994 Francois Pinard (pinard@icule)
3306 * examples/Makefile.in (mostlyclean): Do not depend on texclean.
3307 Reported by Jim Meyering and John David Anglin.
3309 * Makefile.in (distclean-local): Delete config.log.
3310 Reported by Jim Meyering.
3312 Solidify frozen files with respect to -P:
3313 * src/m4.c: Have -P set prefix_all_buitins variable instead of
3314 calling a function by that name. Declare the variable.
3315 * src/m4.h: Adjust declaration for prefix_all_buitins.
3316 * src/builtin.c (builtin_init): Merge in functionality from
3317 previous prefix_all_buitins function, while making entries in the
3318 symbol table, but not modifying the builtin description itself.
3320 * src/freeze.c (reload_frozen_state): Add a useless `break;',
3321 because *many* compilers do not accept an empty `default:'.
3322 Reported by Akiko Matsushita, Eric Backus, John David Anglin,
3323 Joseph E. Sacco, Kaveh R. Ghazi, Tom McConnell and Ulrich Drepper.
3325 * configure.in: Use AC_TYPE_SIGNAL.
3326 * src/stackovf.c (setup_stackovf_trap): Use RETSIGTYPE.
3327 Reported by Robert Bernstein.
3329 * checks/Makefile.in (check): Modify PATH so check-them will find
3330 m4 in the src directory.
3331 * Makefile.in (check): Don't.
3332 Reported by Akiko Matsushita and Jim Meyering.
3334 * src/output.c (make_room_for, output_character_helper): New
3335 functions, for implementing a global MAXIMUM_TOTAL_SIZE instead of
3336 a per buffer MAXIMUM_BUFFER_SIZE.
3338 * src/output.c (output_text): New function, for optimizing the
3339 output of strings of characters. Use it.
3341 Tue Aug 30 01:44:29 1994 Francois Pinard (pinard@icule)
3343 * doc, src: New directories reorganizing the distribution.
3344 * doc/Makefile.in, src/Makefile.in, examples/Makefile.in: New
3346 * Makefile.in: Adjusted.
3347 * configure.in: Configure new Makefiles.
3349 * m4.h: Declare STRING typedef. Use it for comment and quote
3350 strings, adjusting all references. (This is the rudiments of a
3351 beginning for the eventual withdrawal of NUL terminated strings.)
3352 * output.c (shipout_text): Accept a length parameter, and use it.
3353 All callers adjusted.
3355 Mon Aug 29 12:27:19 1994 Francois Pinard (pinard@icule)
3357 * m4.h: Include <unistd.h> if it exists.
3358 * stackovf.c: Don't.
3360 Clean up for current_diversion variable:
3361 * output.c: Move current_diversion from builtin.c.
3362 * m4.h: Declare current_diversion so builtin.c can access it.
3363 * output.c (output_init, make_diversion): Initialize or update
3365 * builtin.c (builtin_init, m4_divert): Leave current_diversion
3368 Remove limit on number of diversions:
3369 * output.c: Replace ndiversion by diversions, declare it.
3370 (output_init): Allocate only diversion 0.
3371 (make_diversion): Allocate new diversions as needed.
3372 * m4.h, m4.c: Remove NDIVERSIONS and ndiversion related stuff.
3373 * m4.c: Still accept -N, but do nothing with it.
3374 Reported by David MacKenzie.
3377 * output.c (freeze_diversions): New function.
3378 * m4.h: Declare freeze_diversions.
3379 * freeze.c: Document frozen file format, revise it, call
3380 freeze_diversions to add diversions to frozen format, and code to
3381 reload them properly.
3382 * m4.c: Do not undivert automatically at end when status being
3383 frozen. Do not call builtin_init when reloading frozen state.
3385 Speed up diversion processing:
3386 * output.c: Add INITIAL_BUFFER_SIZE, MAXIMUM_BUFFER_SIZE,
3387 COPY_BUFFER_SIZE, in-memory diversion buffers, struct diversion
3388 structure and variables, cached variables out of output_diversion,
3389 reallocate_diversion_for and OUTPUT_CHARACTER.
3390 (shipout_text, make_diversion, insert_diversion): Adapted to new
3392 (insert_file): Use better buffering.
3393 Reported by David MacKenzie.
3395 Sun Aug 28 05:20:02 1994 Francois Pinard (pinard@icule)
3397 * Makefile.in, lib/Makefile.in, checks/Makefile.in: Arrange so
3398 dist works from another build directory.
3400 Sat Aug 27 14:32:45 1994 Francois Pinard (pinard@icule)
3402 * symtab.c (hack_all_symbols): Use hash_table_size instead of
3403 constant HASHMAX, for -H option to work better.
3405 * builtin.c (DECLARE): Simplify by using _ ().
3407 * freeze.c: New file.
3408 * Makefile.in: Compile it, distribute it.
3409 * m4.c: Recognize, document and process --freeze-state (-F) and
3410 --reload-state (-R) options. Pass a true flag to builtin_init
3411 only if no reloading some state.
3412 * builtin.c (define_builtin): Remove static specifier.
3413 (find_builtin_by_name): Remove static specifier.
3414 (builtin_init): Accept and obey a flag argument.
3415 * m4.h: Add declarations for freeze.c, changes for builtin.c.
3417 Wed Aug 24 16:14:19 1994 Francois Pinard (pinard@icule)
3419 * builtin.c (dumpdef_cmp): Rewrite so the cast protect the const
3422 * configure.in: Implement --with-dmalloc.
3423 * acconfig.h: Document WITH_DMALLOC.
3424 * m4.h: Add code for when WITH_DMALLOC.
3426 Mon Aug 15 12:38:05 1994 Francois Pinard (pinard@icule)
3428 * m4.c (long_options): Use "error-output", the dash was missing.
3429 Reported by Akiko Matsushita.
3431 Fri Aug 12 16:38:01 1994 Francois Pinard (pinard@icule)
3433 * m4.h: Include <sys/types.h>.
3434 * builtin.c, debug.c, m4.c, output.c, stackovf.c: Don't.
3435 * m4.h: Declare len_lquote and len_rquote as size_t, not int.
3437 * input.c: Declare len_lquote, len_rquote, len_bcomm and len_ecomm
3439 * builtin.c (dump_args): Declare len as size_t, not int.
3441 * debug.c: Prototype the forward declaration of debug_set_file.
3443 * builtin.c (m4_undivert): Replace div by file, for avoiding the
3444 shadowing of this variable.
3445 * output.c (insert_diversion): Idem.
3447 * input.c: Delete def_rquote, def_lquote, def_bcomm and def_ecomm.
3448 (input_init): Duplicate default quote and comment strings.
3449 (set_quotes): Free previous quote strings in all cases. Duplicate
3450 even default quote strings.
3451 (set_comment): Free previous comment strings in all cases.
3452 Duplicate even default comment strings.
3454 * configure.in: Updated for Autoconf 2.0.
3455 * Makefile.in (distclean-local): Also delete config.cache.
3457 * m4.c (usage): Reorganize the --help output by topic. Include a
3458 description for debugging flags.
3460 Fri Jul 29 10:15:52 1994 Francois Pinard (pinard@icule)
3462 * configure.in: If sigaction is available and SA_ONSTACK defined,
3463 use sigaction. Otherwise, if sigvec is available and SV_ONSTACK
3464 defined, use sigvec. Else don't compile stackovf.c.
3465 * stackovf.c (setup_stackovf_trap): Idem.
3466 Reported by Jim Avera, Karl Berry, Kaveh R. Ghazi, Matthias Rabe
3469 Thu Jul 21 22:43:17 1994 Francois Pinard (pinard@icule)
3471 * m4.c (usage): Replace printf par fputs.
3473 Mon Jul 18 23:48:23 1994 Francois Pinard (pinard@icule)
3477 Sun Jul 17 08:08:25 1994 Francois Pinard (pinard@icule)
3479 * configure.in: Check for sigaction and sigvec. Add a new delayed
3480 check for RLIMIT_STACK, combine in the checking for getrlimit.
3481 All those things are not universally available.
3482 * stackovf.c: Split setting up the trap handler and catching
3483 signals, for better taking care of various configure outcomes.
3484 * examples/stackovf.sh: Correct a typo.
3485 Reported by Eric Backus, Jim Avera and Jim Meyering.
3487 Sat Jul 16 20:36:19 1994 Francois Pinard (pinard@icule)
3489 * ansi2knr.c: New version sent by its author, Peter Deutsch.
3491 Fri Jul 15 14:36:21 1994 Francois Pinard (pinard@icule)
3493 * Makefile.in: Modify so parallel make will not try making
3494 lib/libm4.a twice simultaneously.
3495 Reported by Jim Meyering.
3497 Thu Jul 14 17:23:17 1994 Francois Pinard (pinard@icule)
3499 * stackovf.c (setup_stackovf_trap): Replace "Don't" by "Do not" in
3500 error message, for when no code possibility exists. Even if this
3501 line is completely #ifdef'ed out, it brings a syntax error.
3502 Reported by Andreas Schwab, Jim Meyering and Joseph E. Sacco.
3504 * Makefile.in (install): Have install depend on all too, for lib
3505 to be remade as needed.
3507 * examples/stackovf.sh: Try ksh, bsh and bash for shells
3508 providing ulimit, instead of using only ksh.
3509 Reported by Jim Avera and Joseph E. Sacco.
3511 Tue Jul 12 06:54:31 1994 Francois Pinard (pinard@icule)
3513 * Makefile.in (check): Have it depend on all instead of m4. In
3514 this way, a change in lib will be detected and processed.
3516 * builtin.c (numeric_arg): Use strtol and verify the conversion,
3517 instead of using sscanf which stops as soon as there is a
3518 non-digit in the input. Previously, incr(1xyzzy), eval(1,2xyzzy)
3519 and divert(1xyzzy) were all accepted without any warning or error
3521 * m4.h: Declare strtol as long if not including stdlib.h.
3522 * configure.in: Check for limits.h, and replace strtol if missing.
3523 * lib/Makefile.in: Substitute LIBOBJS. Distribute strtol.c.
3524 * lib/strtol.c: New file, from elsewhere.
3525 Reported by Andreas Schwab.
3527 Thu Jul 7 22:38:10 1994 Francois Pinard (pinard@icule)
3529 * macro.c (expand_macro): Cast value to (boolean) prior to
3530 assigning it to traced.
3531 Reported by Tom McConnell.
3533 * Makefile.in (m4): Always make all in lib first.
3534 Reported by Jim Meyering.
3536 Wed Jul 6 13:16:31 1994 Jim Avera (jima@netcom.com)
3538 * stackovf.c: Isolated OS-dependent sections; Improved portability,
3539 adding support for SunOS/BSD (sigvec, sigstack, and 4-parameter signal
3540 handlers), and a default error message if the fault address is not
3541 available (when neither siginfo.h nor BSD sigcontext are supported).
3542 * configure.in: Changes for stackovf.h: Check for sigcontext,
3543 sigaction, sigstack, and define rlim_t as int if necessary.
3544 * acconfig.h: Added HAVE_SIGCONTEXT and rlim_t.
3545 * examples/stackovf.sh: Run m4 -L99999999 to allow stack overflow.
3546 * ansi2knr.c: Fix for func-ptr args; convert "..." to varargs syntax.
3548 Tue Jul 5 19:13:54 1994 Francois Pinard (pinard@icule)
3550 * configure.in: Use AC_SET_MAKE.
3551 * Makefile.in: Use @SET_MAKE@.
3552 Reported by Jim Meyering.
3554 * checks/check-them: Do not trap on SIGQUIT or SIGALRM.
3555 Reported by Ian Taylor.
3557 Sat Jul 2 00:58:47 1994 Francois Pinard (pinard@icule)
3559 * configure.in: Remove dependency of USE_STACKOVF on STDC_HEADERS,
3560 because siginfo.h is unrelated to standard headers, and siginfo.h
3561 is already checked for.
3562 Reported by Joseph E. Sacco.
3564 * acconfig.h, aclocal.m4, m4.h: Replace HAVE_PROTOTYPES by
3566 * aclocal.m4, configure.in: Replace AC_HAVE_PROTOTYPES by
3569 Wed Jun 29 22:41:53 1994 Francois Pinard (pinard@icule)
3571 * builtin.c (substitute): Use \& to represent this part of the
3572 string which was matched by the whole regexp, instead of
3573 representing the whole string. Any usage of \0 issues a warning
3574 and acts like \&, it will disappear in some subsequent release.
3576 Mon Jun 27 14:24:23 1994 Francois Pinard (pinard@icule)
3578 * m4.c: Complete prototype for forwarded declaration of usage.
3580 * input.c (init_macro_token): Correct own reference in error
3581 message. Previous name get_macro_func was referred to instead.
3582 (next_char): Correct own reference in error message. Previous
3583 name advance_input was referred to instead.
3585 * m4.h: Declare eval_t and unsigned_eval_t typedefs to 32 bits.
3586 * eval.c (logical_or_term, logical_and_term, or_term, xor_term,
3587 and_term, not_term, logical_not_term, cmp_term, shift_term,
3588 add_term, mult_term, exp_term, unary_term, simple_term): Add
3589 prototype to forwarded declarations. Declare parameter v1 as
3590 eval_t * instead of int *. Same for local variable v2 in dyadic
3591 functions. Same for result in exp_term.
3592 * builtin.c (m4_eval): Declare value as eval_t instead of int.
3593 (ntoa): Declare value as eval_t instead of int. Declare uvalue as
3594 unsigned_eval_t instead of unsigned int. Change casts accordingly.
3595 (shipout_int): Cast first argument of ntoa to eval_t.
3596 Reported by Thorsten Ohl.
3598 * macro.c: Complete the prototypes of forwarded expand_macro and
3600 Reported by Thorsten Ohl.
3602 * m4.h: Define voidstar as void * or char * depending on __STDC__.
3603 The Ultrix 3.1 compiler cannot do much with void pointers.
3605 * builtin.c (dumpdef_cmp): Replace void * by voidstar.
3606 * m4.c (xfree): Replace void * by voidstar.
3607 Reported by Tom McConnell.
3609 * ansi2knr.1: New, from elsewhere.
3610 * Makefile.in (DISTFILES): Distribute ansi2knr.1
3612 * Makefile.in (stamp-h.in): Avoid running ./config.status if
3613 stamp-h does not exist yet. This avoids running it a second time
3614 just after the initial ./configure.
3615 Reported by David MacKenzie and Tom McConnell.
3617 * m4.h: Replace the enum debug_info declaration with a series of
3618 #define's. The Ultrix 3.1 compiler would otherwise need casting
3619 (int) to most references, when used in expressions.
3620 Reported by Tom McConnell.
3622 Sat Jun 25 00:10:05 1994 Francois Pinard (pinard@icule)
3624 * aclocal.m4: Replace FP_PROTOTYPES by AC_HAVE_PROTOTYPES,
3625 following an idea from Brook G. Milligan. AC_HAVE_PROTOTYPES
3626 calls the compiler. Previously, FP_PROTOTYPES was only calling
3627 the preprocessor; by not being subject to CFLAGS, this was
3628 discouraging those flags asking for ANSI compilation.
3629 * acconfig.h: Document HAVE_PROTOTYPES.
3630 * configure.in: Use AC_HAVE_PROTOTYPES instead of FP_PROTOTYPES.
3631 * m4.h: Define _() according to HAVE_PROTOTYPES, not __STDC__.
3632 Reported by Eric Backus.
3634 * configure.in: Substitute CFLAGS and LDFLAGS, taking their value
3635 from the environment. Default CFLAGS to -g if not set.
3636 * Makefile.in: Have CFLAGS and LDFLAGS substituted from configure.
3637 * lib/Makefile.in: Have CFLAGS substituted from configure.
3638 Reported by Eric Backus and Tom McConnell.
3640 * configure.in: m4_undefine changeword before using AC_ENABLE.
3642 * m4.h: Declare prototypes for error (for ANSI compilers only),
3643 prefix_all_builtins and reference_error.
3644 Reported by Tom McConnell.
3646 * input.c (set_word_regexp): Do not try to initialize the array
3647 test from a string, this does not work with non-ANSI compilers.
3648 Reported by Eric Backus.
3650 * Makefile.in (dist): Clean examples/ before saving it.
3651 (distclean-local): Also remove stamp-h.
3652 Reported by Eric Backus.
3654 * Makefile.in (_stackovf.c): Goal for compiling stacokovf.c with
3656 Reported by Tom McConnell.
3658 * checks/Makefile.in (clean): Depends on mostlyclean.
3659 (mostlyclean): New goal.
3661 Fri Jun 24 23:30:31 1994 Francois Pinard (pinard@icule)
3663 * Makefile.in (DISTFILES): Distribute install.sh.
3664 * install.sh: New file, copied from elsewhere.
3665 Reported by Assar Westerlund and Kaveh R. Ghazi.
3667 Thu Jun 23 00:00:30 1994 Francois Pinard (pinard@icule)
3669 * configure.in: Define ENABLE_CHANGEWORD if --enable-changeword.
3670 * acconfig.h: Explain ENABLE_CHANGEWORD.
3672 [These modifs all depend upon ENABLE_CHANGEWORD and are adapted
3673 from code provided by Pete Chown]
3674 * m4.h: Add original_text field to u_t variant of union u.
3675 Declare TOKEN_DATA_FUNC macro.
3676 * builtin.c: Declare changeword.
3677 (m4_changeword): New function.
3678 * input.c: Include "regex.h", define variables with word regexps.
3679 (input_init): Initialize the word regexp.
3680 (set_word_regexp): New.
3681 (next_token): Declare local variables, use the previous code if
3682 default_word_regexp is true. Else, match using a new code. Save
3684 * macro.c (expand_token): Ship out original text if not a macro
3686 Reported by Krste Asanovic and Pete Chown.
3688 [These modifs all depend upon ENABLE_CHANGEWORD]
3689 * m4.h: Declare external user_word_regexp.
3690 * m4.c: Declare user_word_regexp, and initialize it from
3691 --word-regexp or -W, or NULL if not specified.
3692 * input.c: Use user_word_regexp if specified, instead of
3693 DEFAULT_WORD_REGEXP.
3695 * Makefile.in (m4): Revert Jan 3 1994 change. I'm unable to
3698 * Makefile.in, lib/Makefile.in: Limit suffixes to .c and .o.
3699 * checks/Makefile.in: Empty the suffix list.
3700 Reported by Geoff Russell, Joel Sherrill and Roland McGrath.
3702 * m4.c: Declare nesting_limit and initialize it to 250.
3703 Implement -LNUMBER or --nesting-limit=NUMBER to change its
3705 * m4.h: Declare nesting_limit as external.
3706 * macro.c (expand_macro): Stop execution whenever nesting limit
3708 Reported by Bengt Mertensson.
3710 * eval.c (evaluate): Diagnose excess characters in eval input.
3711 Things like `eval(08)' used to return 0 with no diagnostic.
3713 * m4.h: Capitalize first letter of all macro arguments in
3716 * m4.c: Declare warning_status, initialize it to 0. Add new
3717 option -E, or --fatal-warnings, which sets warning_status to
3718 EXIT_FAILURE instead.
3719 * m4.h: Declare external warning_status. Define EXIT_SUCCESS and
3720 EXIT_FAILURE if not otherwise done by header files.
3721 * m4.c: Delete declarations for EXIT_SUCCESS and EXIT_FAILURE.
3722 * m4.c, input.c, output.c, symtab.c, builtin.c, macro.c, debug.c,
3723 eval.c: Replace 0 by warning_status and 1 by EXIT_FAILURE in first
3724 argument of all M4ERROR calls.
3725 Reported by Noah Friedman.
3727 * examples/incl-test.m4: Renamed from incl_test.m4.
3728 * examples/include.m4: Include incl-test.m4 instead of
3730 * examples/multiquotes.m4: Renamed from multi-quotes.m.
3732 Wed Jun 22 21:58:54 1994 Francois Pinard (pinard@icule)
3734 * configure.in: Avoid USE_STACKOVF if <siginfo.h> not found. Note
3735 that Jim developped stackovf.c on a 486 running SVR4.0 (ESIX), and
3736 also tested it on a Sun Sparc workstation running SunOS 4.x.
3738 * format.c (format): When not HAVE_EFGCVT, m4 was failing the
3739 49.format check, abusing a `union values' argument with sprintf
3740 without selecting the proper field. Now, save the formatting type
3741 first, delaying the fetch of the corresponding argument.
3742 Reported by Joseph E. Sacco and Tom Quinn.
3744 * format.c (format): Remove const from char *fmt declaration when
3745 not HAVE_EFGCVT, because a NUL may be forced into it.
3747 * m4.h: Declare atof() when not STDC_HEADERS.
3748 Reported by Joseph E. Sacco.
3750 * Regenerate configure using Autoconf 1.11, this corrects a
3751 problem about an incorrect cpp seting on NeXT 3.1.
3752 Reported by Alexander Lehmann.
3754 Sun Jun 5 16:25:19 1994 Francois Pinard (pinard@icule)
3756 * m4.h (_): Change argument from `x' to `Args'.
3758 Wed May 4 23:59:39 1994 Francois Pinard (pinard@icule)
3760 * Makefile.in: Remove all occurrences of $(MFLAGS), which were
3761 bringing more evil than good on a few systems.
3762 Reported by Greg A. Woods.
3764 Fri Apr 22 15:59:35 1994 Francois Pinard (pinard@icule)
3766 * m4.h: Rename Args() to _().
3767 * m4.h: Remove extern specifier from all function declarations.
3769 Fri Apr 22 15:51:21 1994 Jim Avera (jima@netcom.com)
3771 * stackovf.c: New file implementing stack-overflow detection.
3772 * configure.in: Check for getrlimit, sigaction. If all of
3773 standard headers, getrlimit and sigaction, define USE_STACKOVF and
3774 substitute ${U}stackovf.o for STACKOVF.
3775 * acconfig.h: Declare USE_STACKOVF.
3776 * Makefile.in: Distribute stackovf.c, link with $(STACKOVF).
3777 * m4.h: Declare setup_stackovf_trap().
3778 * m4.c: Call setup_stackovf_trap().
3779 * tests/stackovf_test.sh: New file.
3781 Wed Apr 13 14:10:30 1994 Francois Pinard (pinard@icule)
3783 * checks/Makefile.in: Rename .all-stamp to stamp-checks.
3785 * Makefile.in (Makefile, etc.): Adapt for Autoconf 1.8.
3787 Sun Jan 30 14:24:19 1994 (pinard at icule)
3789 * m4.h: Remove definition of volatile, not used anymore.
3790 Reported by Jim Meyering and Joseph E. Sacco.
3792 * m4.h: Consistently use `do { ... } while (0)' in macros, instead
3793 of `if ... else /* nothing */' for if macros.
3794 Reported by Jim Meyering.
3796 * builtin.c (m4_regexp): Reorganize the code for avoiding a
3797 warning from gcc about `repl' possibly used before defined.
3798 Reported by Jim Meyering.
3800 * m4.h: Avoid a pre-ANSI <memory.h> together with <string.h>.
3801 Reported by Jim Meyering.
3803 Tue Jan 25 18:39:37 1994 Francois Pinard (pinard at icule)
3805 * m4.h: Move the conditional definition of volatile after the
3806 inclusion of system files, because they may define it first.
3808 Tue Jan 4 19:46:50 1994 Francois Pinard (pinard@icule)
3810 * checks/Makefile.in (CHECKS): Add a useless `*' before `[', to
3811 get around a problem with Alpha make seeing a syntax error, there.
3812 Reported by Vern Paxson.
3814 Mon Jan 3 00:21:45 1994 Francois Pinard (pinard@icule)
3816 * Makefile.in: Do not define LDFLAGS, use CFLAGS on link calls.
3817 Reported by Richard Stallman.
3819 Sat Dec 25 08:06:05 1993 Francois Pinard (pinard@icule)
3821 * configure.in: Correct test for strerror, AC_FUNC_CHECK was used
3822 instead of AC_HAVE_FUNCS.
3823 Reported by Noah Friedman.
3825 Wed Dec 1 09:37:53 1993 Francois Pinard (pinard@icule)
3827 * m4.c: Initialize show_help and show_version to zero.
3829 * m4.c: Ensure EXIT_SUCCESS and EXIT_FAILURE are defined.
3830 Use them in exit() and usage() calls.
3832 Sat Nov 27 10:43:24 1993 Francois Pinard (pinard@icule)
3834 * m4.h: Delete extern sys_nerr, sys_errlist declarations, and
3835 syserr() macro. Delete errref, add reference_error and M4ERROR.
3836 * m4.c: Replace errref, which was returning an input reference
3837 string, with reference_error, which prints it on standard error.
3838 * builtin.c, output.c: Use errno as second parameter to error,
3839 instead of using syserr() with %s.
3840 * *.c: Use M4ERROR instead of error: no more errref() with %s.
3841 Doing so, the program name appears after the input reference
3842 instead of before, which eases M-x next-error processing.
3844 Wed Nov 24 22:16:15 1993 Francois Pinard (pinard@icule)
3846 * checks/get-them: Escape braces with backslashes in patterns,
3847 because HPUX-9.01 awk needs this.
3848 Reported by Jim Meyering.
3850 Mon Nov 22 10:55:52 1993 Francois Pinard (pinard@icule)
3852 * builtin.c: Declare "FILE *popen ();".
3854 * m4.h: Remove MESSAGE{,1,2}, WARNING1, FATAL{,1}, INTERNAL_ERROR
3855 macros, replace error_message_prefix() declaration by errref()'s.
3856 Declare xrealloc, for use in errref().
3857 * m4.c: Delete error_message_prefix() function, add errref().
3858 * *.c: Use error() systematically in place of all error macros,
3859 now that error() flushes stdout first. Make needed adjustments.
3861 * m4.h: Remove const in sys_errlist[] declaration, it creates
3862 conflicts on SGI and Alpha.
3863 Reported by Kaveh R. Ghazi.
3865 Sat Nov 20 08:26:15 1993 Francois Pinard (pinard@icule)
3867 * m4.c: Include <getopt.h> instead of "getopt.h".
3869 * configure.in: Output to config.h. Use HAVE_FUNCS preferably.
3870 * acconfig.h: New, for documenting HAVE_EFGCVT.
3871 * Makefile.in: Distribute acconfig.h, .stamp-h.in and config.h.in,
3872 use them wherever appropriate. Also use -I. for compilations.
3873 * lib/Makefile.in: Use -I.. for compilations.
3874 * *.c: Include <config.h> or "config.h".
3876 * m4.h: Test for HAVE_MEMORY_H instead of NEED_MEMORY_H.
3877 * configure.in: Use AC_HAVE_HEADERS(memory.h), delete AC_MEMORY_H.
3879 Wed Nov 17 09:34:55 1993 Francois Pinard (pinard@icule)
3881 * builtin.c (m4_eval): Cast strlen to (int) before comparing.
3883 * input.c (input_init): Initialize quote and comment strings
3884 explicitely instead of calling set_quotes and set_comment: by
3885 doing so, we ensure we do not free uninitialized variables.
3887 * checks/check-them: Reverse arguments to both diff, so the
3888 expected is on the left and the obtained on the right.
3890 * m4.h: Add MESSAGE{,1,2}, WARNING1, FATAL{,1} and INTERNAL_ERROR
3891 macros. Delete declarations for m4error, warning, fatal and
3892 internal_error, add declaration for error_message_prefix.
3893 * m4.c: Delete m4error, warning, fatal and internal_error
3894 routines, add error_message_prefix routine.
3895 * *.c: Replace m4error routine calls with MESSAGE* macro calls,
3896 warning with WARNING*, fatal with FATAL* and internal_error with
3898 * Makefile.in (_m4.c): Do not adjust ansi2knr output for va_alist,
3899 this is not needed anymore.
3901 * m4.h: Declare extern FILE *debug. Add DEBUG_PRINT{1,3} and
3902 DEBUG_MESSAGE{,1,2} macros. Delete declarations for debug_print
3903 and debug_message, add declaration for debug_message_prefix.
3904 * debug.c: Remove static specifier for FILE *debug declaration.
3905 Delete debug_print and debug_message routines, add
3906 debug_message_prefix routine.
3907 * builtin.c, debug.c: Replace debug_print routine calls with
3908 DEBUG_PRINT* macro calls.
3909 * input.c, path.c: Replace debug_message routine calls with
3910 DEBUG_MESSAGE* macro calls.
3912 * m4.h: Remove inclusion of <varargs.h>.
3913 * debug.c: Include <stdarg.h> or <varargs.h>.
3914 (trace_format): Use stdarg instead of varargs if __STDC__.
3916 * configure.in: Remove checks for vfprintf and _doprnt. These
3917 implementations use varargs tricks which are not portable enough.
3918 * lib/vfprintf.c: Deleted.
3919 * lib/_doprnt.c: Deleted.
3920 * lib/Makefile.in: Adjusted accordingly. Remove LIBOBJS.
3921 Reported by Joel Sherrill.
3923 * path.c (add_include_directory): Use xstrdup.
3925 * builtin.c (find_builtin_by_name): Declare static.
3927 * *.[ch]: Add const to a few "char *" declarations.
3929 * configure.in: Remove commented tests for fileno() and fstat().
3930 * debug.c: Remove comments about HAVE_FILENO and HAVE_FSTAT.
3932 * debug.c (debug_flush_files): New.
3933 * m4.h: Declares it.
3934 * builtin.c (m4_syscmd, m4_esyscmd): Use it.
3935 Reported by Nicolas Pioch.
3937 Fri Nov 12 10:02:26 1993 Francois Pinard (pinard@icule)
3939 * Makefile.in (m4.dvi): Use m4.texinfo instead of m4.texi.
3940 Reported by Joel Sherrill.
3942 * builtin.c (prefix_all_builtins): Instead of the table size, use
3943 the null entry at end for stopping the loop. It was overwritten.
3944 Reported by Andreas Schwab and Jim Meyering.
3946 * builtin.c (prefix_all_builtins): Cast xmalloc to (char *).
3947 Reported by Kaveh R. Ghazi.
3949 * macro.c (call_macro): Add * in (*SYMBOL_FUNC (sym)) (...).
3950 Reported by Karl Vogel.
3952 Tue Nov 9 09:31:47 1993 Francois Pinard (pinard@icule)
3954 * m4.h: Do not define volatile if already defined.
3955 Reported by Rene' Seindal.
3957 * lib/Makefile.in: Add a forgotten ALLOCA=@ALLOCA@. Grrr!
3959 Reported by Bernhard Daeubler, Eric Backus, Hal Peterson, Hoang
3960 Uong, Ian Taylor, Kaveh R. Ghazi, Tom McConnell and Walter Wong.
3962 Mon Nov 8 21:11:44 1993 Francois Pinard (pinard@icule)
3964 * m4.h: Define strchr and strrchr in terms of index and rindex,
3965 instead of the other way around.
3966 * builtin.c, m4.c, path.c: Use strchr instead of index.
3968 * input.c (next_char): Remove a "break;" after a "return ...;".
3969 Reported by Tom McConnell.
3971 Mon Nov 8 12:45:34 1993 Francois Pinard (pinard@icule)
3975 * configure.in: Do not copy check files in the build hierarchy.
3976 * checks/check-them: Identify the m4 version being checked. For
3977 finding m4, look in $PATH instead of in the parent directory.
3978 * Makefile.in (check): Prepend `pwd` to $PATH before checking.
3979 * checks/Makefile.in (.all-stamp): Always create check files in
3980 the source hierarchy, not anymore in the build hierarchy.
3981 (check): cd to the source hierarchy before performing checks.
3982 Do not copy nor clean COPYING anymore, take it from `..'.
3983 Reported by Tom McConnell.
3985 * Makefile.in (Makefile): Use $(SHELL).
3986 (config.status): Use $(SHELL). Use "config.status --recheck"
3987 instead of "configure --no-create", which is obsolete.
3988 Reported by Tom McConnell.
3990 Fri Nov 5 09:49:30 1993 Francois Pinard (pinard@compy.IRO.UMontreal.CA)
3992 * m4.c (usage): Use "%s" instead of "m4" in format string.
3993 Reported by Jim Meyering.
3995 * Makefile.in: Distribute mkinstalldirs.
3996 Reported by Pierre Gaumond.
3997 Reported by Jim Meyering.
3998 Reported by Tom McConnell.
3999 Reported by Andreas Gustafsson.
4001 * checks/check-them: Renamed from checks/check_them.
4002 * checks/get-them: Renamed from checks/get_them.
4003 * checks/.all-stamp: Renamed from checks/.all_stamp.
4004 * checks/Makefile.in: Changed accordingly.
4005 Reported by Jim Meyering.
4007 Thu Nov 4 13:50:52 1993 Francois Pinard (pinard@lagrande.IRO.UMontreal.CA)
4009 * lib/Makefile.in (dist): Correct permissions on files.
4011 * output.c: Declare tmpfile, some systems don't.
4013 Wed Nov 3 09:09:16 1993 Francois Pinard (pinard@icule)
4015 * checks/Makefile.in (dist): Correct permissions on files.
4017 * Makefile.in (dist): Ensure recursive linking for subdirectory
4018 `examples', also set read/write permissions on all its files.
4020 * mkinstalldirs: New, from elsewhere.
4021 * Makefile.in: Use it.
4023 * debug.c: Synchronize debug messages and regular output when
4024 the debug file and stdout are redirected to the same file.
4025 * configure.in: Add (commented) checks for fileno and fstat.
4026 Reported by Jim Avera.
4028 * builtin.c (m4_ifelse): Diagnose excess arguments if 5, 8, 11,
4029 etc., arguments, then ignore the superfluous one. m4 used to
4030 diagnose missing arguments and return the empty string.
4031 Reported by Nick S. Kanakakorn.
4033 Tue Nov 2 00:55:41 1993 Francois Pinard (pinard@icule)
4035 * m4.c (main): At end of all input, ensure all undiverted text
4036 goes to the main output stream.
4037 Reported by Andreas Gustafsson.
4039 * m4.c (main): exit (0), instead of return 0.
4041 * m4.c: Implement -P and --prefix-builtins.
4042 * builtin.c: Delete const specifier on builtin_tab.
4043 (prefix_all_builtins): New.
4044 Reported by Noah Friedman.
4045 Reported by Scott Bartram.
4047 * c-boxes.el: New, from elsewhere.
4048 * Makefile.in: Distribute it.
4050 * m4.h: Do not define bcopy if <string.h> defines it.
4051 Reported by Stephen Perkins.
4053 * builtin.c (define_macro): Allow a missing second argument, in
4054 which case it is implied empty. Affects define and pushdef.
4055 Reported by Eric Allman.
4057 Mon Nov 1 07:45:24 1993 Francois Pinard (pinard@icule)
4059 * m4.h: Add blind_if_no_args in struct builtin, blind_no_args in
4060 struct symbol adn SYMBOL_BLIND_NO_ARGS macro.
4061 * builtin.c: Initialize all the blindness fields in builtin_tab.
4062 (define_builtin): Copy the blindness of a builtin into its symbol.
4063 * macro.c (expand_token): Avoid processing a blind builtin if the
4064 next character is not an opening parenthesis.
4065 Reported by David MacKenzie.
4066 Reported by Noah Friedman.
4068 * configure.in: Ensure an exit status of 0 on completion.
4069 Reported by Vivek P. Singhal.
4071 * eval.c (eval_lex): Admit both lower and upper case letters for
4072 bases greater than 10. Only lower case letters were accepted.
4074 * eval.c (eval_lex): Recognize 0bDIGITS and 0rRADIX:DIGITS syntax.
4075 Reported by Krste Asanovic.
4077 * eval.c: Rename NOT to LNOT. Add XOR, NOT, LSHIFT and RSHIFT.
4078 * eval.c (logical_not_term): New name for not_term.
4079 * eval.c (xor_term): New, between or_term and and_term.
4080 * eval.c (not_term): New, between and_term and logical_not_term.
4081 * eval.c (shift_term): New, between cmp_term and add_term.
4082 Reported by Krste Asanovic: ~, ^, <<, >>.
4083 Reported by Ben A. Mesander: ** vs ^.
4085 * m4.c: Delete xmalloc.c, xrealloc.c, xstrdup.c.
4086 * m4.h: Delete xrealloc.c.
4087 * lib/xmalloc.c: New, from elsewhere.
4088 * lib/xstrdup.c: New, from elsewhere.
4089 * lib/Makefile.in: Distribute and compile them.
4091 * m4.c: Change progname to program_name.
4092 * builtin.c, eval.c, m4.c, m4.h: Rename error to m4error.
4093 * lib/error.c: New, from elsewhere.
4094 * lib/Makefile.in: Distribute and compile error.c.
4095 * configure.in: Check AC_VPRINTF and for strerror.
4096 * m4.c: Delete cmd_error. Use error instead.
4097 * m4.c: Change label capitalisation to "ERROR", "Warning", etc.
4099 * m4.h: Delete #define const, let Autoconf takes care of this.
4101 * m4.c: Remove all code conditionalized by IMPLEMENT_M4OPTS.
4102 Merge parse_args into main. Declare argv to be `char *const *',
4103 then remove superfluous casts.
4105 * m4.c: Rename --no-gnu-extensions to --traditional.
4106 Reported by Ben A. Mesander.
4108 * m4.c (usage): Add a status parameter. Supply one in various
4109 calls. Add --help processing. Remove -V for --version.
4111 * lib/Makefile.in: Put $(CFLAGS) last in .c.o rule.
4113 * lib/Makefile.in: Have an AR=ar declaration.
4114 Reported by Eric Backus.
4115 Reported by Bjorn R. Bjornsson.
4116 Reported by Tom Tromey.
4117 Reported by Kristine Lund.
4118 Reported by Marion Hakanson.
4120 Sat Oct 30 12:51:47 1993 Francois Pinard (pinard@icule)
4122 * Makefile.in (m4.info): Use -I$(srcdir) on $(MAKEINFO).
4123 Reported by Noah Friedman.
4125 Mon Oct 25 14:58:48 1993 Francois Pinard (pinard@icule)
4127 * Makefile.in: Remove MDEFINES and cleanup.
4129 Wed Jun 9 14:59:46 1993 Francois Pinard (pinard@icule)
4131 * Makefile.in (dist): Replace "echo `pwd`" by a mere "pwd".
4134 Sat Feb 6 14:59:22 1993 Francois Pinard (pinard@icule)
4136 * Makefile.in, lib/Makefile.in, check/Makefile.in: In dist goals,
4137 ensure 777 mode for directories, so older tar's will restore file
4140 Sun Jan 17 15:38:05 1993 Francois Pinard (pinard@icule)
4142 * Makefile.in, lib/Makefile.in: Put $(CFLAGS) after $(CPPFLAGS),
4143 so the installer can override automatically configured choices.
4144 Reported by Karl Berry.
4146 Fri Jan 15 16:07:00 1993 Francois Pinard (pinard@icule)
4148 * lib/vfprintf.c: Stolen from Oleo distribution and adapted. The
4149 previous version was not working properly on m68k-hp-bsd4.3.
4150 Reported by Roland McGrath.
4152 * lib/_doprnt.c: Stolen from Oleo distribution.
4153 * configure.in: Check for _doprnt.c if vfprintf.c selected.
4154 * lib/Makefile.in: Distribute _doprnt.c.
4155 Do not distribute regex.[ch].old anymore.
4157 Fri Jan 1 19:42:23 1993 Francois Pinard (pinard at icule)
4159 * Makefile.in, lib/Makefile.in: Reinstate $(CPPFLAGS), use it.
4160 Richard wants it there.
4162 Sun Dec 27 07:01:54 1992 Francois Pinard (pinard at icule)
4164 * Makefile.in: Add DEFS to MDEFINES.
4165 * lib/Makefile.in (.c.o): Remove $(CPPFLAGS).
4166 (libm4.a): Remove the library before creating it.
4167 (distclean): Remove tags and TAGS too.
4169 Wed Dec 23 12:46:55 1992 Francois Pinard (pinard at icule)
4171 * Makefile.in (dvi, m4.dvi): New goals.
4173 * builtin.c, eval.c, format.c, input.c, m4.[ch], m4.texinfo,
4174 macro.c, output.c, path.c, symtab.c: Change Copyright from
4175 1989-1992 to the explicit enumeration 1989, 1990, 1991, 1992.
4177 * examples/divert.m4: Deleted, this bug has been corrected.
4179 * Makefile.in (texclean, mostlyclean): New goals.
4181 * Makefile.in (clean): Remove clutter from ansi2knr.
4182 Reported by Pierre Gaumond.
4183 Reported by Greg A. Woods.
4185 Sun Dec 20 10:40:20 1992 Francois Pinard (pinard at icule)
4187 * Makefile.in: Remove $(CPPFLAGS) from the .c.o rule. The user
4188 might well use CFLAGS is s/he needs it.
4190 * Makefile.in: Allow installation of info files from a separate
4192 Reported by Jason Merrill.
4193 Reported by David MacKenzie.
4194 Reported by Skip Montanaro.
4195 Reported by Erez Zadok.
4196 Reported by Assar Westerlund.
4198 Sat Dec 19 08:21:34 1992 Francois Pinard (pinard at icule)
4201 This is still a beta release for the future GNU m4 version 1.1.
4203 * lib/alloca.c: New, from elsewhere.
4204 * lib/Makefile.in: Distribute it. Define and use $(ALLOCA).
4206 * m4.h: Do not define index/rindex if already defined. If
4207 FALSE/TRUE are already defined, do not redefine them, but merely
4208 define boolean typedef to int.
4210 * Makefile.in: Use $(DEFS) while compiling ansi2knr.
4211 * ansi2knr.c: Rewrite #ifdef HAVE_STRING_H || STDC_HEADERS,
4212 because some C compilers do not like connectives with #ifdef.
4213 * m4.h: Define `volatile' only if __GNUC__, instead of once for
4214 __GNUC__ and once for __STDC__.
4215 * lib/regex.h: Leave const alone, AC_CONST will take care of it.
4217 * checks/Makefile.in: Use .all_stamp instead of $(CHECKS) for
4218 Makefile dependencies. Without it, make keeps destroying and
4219 remaking $(CHECKS) in a loop (why?). Distribute .all_stamp.
4221 * m4.h, m4.c, builtin.c, output.c: Change all divertion/DIVERTION
4222 to diversion/DIVERSION, this was a spelling error.
4224 * m4.c: Declare version[], remove #include "version.h".
4225 * version.h: Deleted.
4226 * Makefile.in: Remove references to version.h.
4228 * output.c (shipout_text): Centralize all `#line NUM ["FILE"]'
4229 production, by using a simpler and more robust algorithm. This
4230 solves the problem of synclines sometimes written in the middle of
4231 an output line. Delete sync_line() and output_lines variable.
4232 * m4.h: Remove sync_line prototype and output_lines declaration.
4233 * input.c (next_char), output.c (shipout_text): Remove references
4235 * input.c (push_file, pop_file): Merely put the value -1 in
4236 output_current_line instead of calling sync_line, for delaying a
4237 single `#line NUM FILE' before next output line. Do not test
4238 for sync_output, because this is unnecessary clutter.
4239 * output.c (make_divertion, insert_divertion): Idem.
4240 * input.c: Rename must_advance_line to start_of_input_line, for
4243 * debug.c (trace_header): Select a new debug line format, which
4244 better complies with GNU standards for formatting error messages.
4245 With option `-dfl', M-x next-error might be used on the output.
4246 * m4.c (vmesg): Adjust format of error output to GNU standards.
4247 * m4.texinfo: Adjust examples for `make check' to work.
4249 * m4.h, builtin.c, debug.c, input.c, macro.c, path.c: Use upper
4250 case for enum debug_info constants, which were all lower case.
4252 * builtin.c (m4_regexp, m4_patsubst): Use re_search instead of
4254 * lib/regex.[ch]: Use new version from textutils 1.3.6, with some
4255 collected patches. I tried a few times using newer regex.[ch], it
4256 mysteriously stopped aborting with this one. Insecure feeling...
4257 * lib/Makefile.in: Distribute regex.[ch].old, just in case!
4259 Fri Dec 18 11:08:03 1992 Francois Pinard (pinard at icule)
4261 * m4.c: Change `--no-warnings' to `--silent'.
4262 Reported by David MacKenzie.
4264 * m4.c: Put all M4OPTS code upon IMPLEMENT_M4OPTS control, and
4265 leave it off for now. See comment in m4.c for justification.
4266 Reported by David MacKenzie.
4268 * configure.in: Replace AC_USG by AC_HAVE_HEADERS(string.h).
4269 * m4.h, ansi2knr.c, lib/regex.h: Replace USG by HAVE_STRING_H.
4271 * Makefile.in: Add a new `info' goal. Use macro MAKEINFO.
4273 * Makefile.in: Ensure recursive cleaning is done before local
4274 cleaning for all clean goals.
4276 * builtin.c (ntoa): Ensure the value is always interpreted as a
4277 signed quantity, whatever the radix is.
4279 Wed Nov 18 07:57:19 1992 Jim Meyering (meyering@idefix)
4281 * builtin.c, format.c, input.c: Split long lines.
4282 * m4.c: Use typedef macro_definition instead of struct
4284 * symtab.c: Use typedef symbol instead of struct symbol.
4286 Tue Nov 17 01:58:40 1992 Francois Pinard (pinard at icule)
4288 * *.[ch]: Remove all trailing whitespace, in code and comments.
4290 * configure.in: Find some awk.
4291 * Makefile.in: Add $(AWK) to MDEFINES.
4292 * checks/Makefile.in: Transmit $(AWK) to get_them.
4293 * checks/get_them: Use $AWK instead of gawk. Add a close in the
4294 awk script when switching files, because without this, mawk runs
4295 out of file descriptors.
4297 Mon Nov 16 20:42:56 1992 Francois Pinard (pinard at icule)
4299 * Makefile.in (realclean): Delete m4.info*.
4300 Reported by Jim Meyering.
4302 * Makefile.in: Adjust and link with checks/Makefile.
4303 * checks/Makefile.in: New.
4304 * configure.in: Output checks/Makefile.
4306 * checks/get_them: Have the dnl header of each test more
4307 recognizable by next-error, also use a better message.
4309 Mon Nov 16 07:48:52 1992 Jim Meyering (meyering@idefix)
4311 * m4.h [__GNUC__]: Use __volatile__ instead of `volatile.'
4312 And use that only if __GNUC__ since we're using it's GCC-specific
4313 semantics that tell the compiler the associated function doesn't
4316 * builtin.c (substitute): Don't use character as an array index.
4317 (dumpdef_cmp): Make formal arguments `const void *' to avoid
4318 warnings with gcc -W -Wall on systems with qsort prototype.
4319 (m4_errprint): Cast obstack_finish to `char *' to avoid warnings
4322 * eval.c (most functions): Add parentheses to assignments used
4323 as truth values go avoid warnings from gcc -Wall.
4325 * input.c, m4.c, output.c, path.c, symtab.c: Declare static
4326 any functions that don't need external scope.
4328 * builtin.c, debug.c, format.c, m4.c, m4.h, macro.c, symtab.c
4329 (many functions and arrays): Declare `const'.
4331 Sun Nov 15 09:42:09 1992 Francois Pinard (pinard at icule)
4333 * *.[ch]: Rename nil to NULL, using the declaration from <stdio.h>,
4334 removing the declaration from m4.h. Also rename false to FALSE
4337 * lib/Makefile.in (Makefile): New goal.
4339 * Makefile.in, lib/Makefile.in: Add a .c.o rule, so CFLAGS is not
4340 so heavily loaded. It gets more easily overridable, calling make.
4341 Reported by Jim Meyering.
4343 * Makefile.in (dist): Get .fname from the current directory name,
4344 instead of from version.h. I need updating many files manually,
4345 when the version changes, version.h is just one of them.
4347 Sat Nov 14 11:01:20 1992 Francois Pinard (pinard at icule)
4349 * m4.h: Remove the tag `boolean' on the enum introducing typedef
4350 `boolean'. This tag conflicts with <sys/types.h> on SVR4.
4351 Reported by Tom McConnell.
4353 Fri Nov 13 00:12:50 1992 Francois Pinard (pinard at icule)
4355 * m4.texinfo: Correct the examples for 33.divert, 38.divnum,
4356 39.cleardiv, which were describing missing or spurious newlines.
4357 Modify examples 52.eval, 53.esyscmd and 54.sysval so the results
4358 do not depend on machine word size, `/bin/false' implementation,
4359 or `wc' output format. `make check' is more dependable, now.
4361 * checks/check_them: Summarize the failed tests by listing their
4362 name, at end. If none, issue `All checks successful'. Output
4363 `Checking' instead of `Input file:'.
4365 * checks/get_them, checks/check_them: Reindented.
4367 * Makefile.in (dist): chmod a+r before making the tar file.
4369 Thu Nov 12 14:42:57 1992 Francois Pinard (pinard at icule)
4371 * builtin.c (m4_dnl): Diagnose any parameter to `dnl'.
4373 * input.c (next_token): Reinitialize token_buttom just after using
4374 it as a watermark with obstack_free. Or else, a future token, big
4375 enough for triggering reallocation of the obstack chunk, could
4376 void the initialized value of token_buttom, later causing panic in
4377 obstack_free. Rename token_buttom to token_bottom everywhere.
4379 * m4.h: Before declaring errno, first include <errno.h> and
4380 ensure that it does not define errno.
4381 Reported by Richard Stallman.
4383 Wed Nov 11 17:40:35 1992 Francois Pinard (pinard at icule)
4385 * builtin.c: Define and use DECLARE macro for builtins.
4387 * builtin.c (m4_ifelse): Avoid any diagnostic when exactly one
4388 argument, this is a common idiom for introducing long comments.
4390 * builtin.c (m4_ifelse): If 3n + 2 arguments, diagnose missing
4391 arguments. The last argument was silently ignored.
4393 * m4.c (cmd_error): Add a missing semicolon before va_end().
4395 Tue Nov 10 08:57:05 1992 Francois Pinard (pinard at icule)
4397 * Makefile.in: Now handle protoized sources. Define and use U.
4398 Compile and use ansi2knr with old compilers. Update DISTFILES.
4399 Add `aclocal.m4' to `configure' dependencies.
4400 * ansi2knr.c: New, from Ghostscript distribution.
4401 * configure.in: Define U through FP_PROTOTYPES for old compilers.
4402 Add AC_ISC_POSIX, AC_CONST, AC_SIZE_T.
4403 * aclocal.m4: New, provide FP_PROTOTYPES.
4404 * m4.h: Conditionnaly protoized through Args, save for varags.
4405 * builtin.c: Protoized. Then:
4406 Include <sys/types.h> if size_t is not defined, before "regex.h".
4407 (m4_ifelse): Fetch built-in name properly for diagnostic.
4408 (m4_dumpdef): Remove wrong (char *) cast calling dump_symbol.
4409 (m4_regexp): Add const to `msg' declaration.
4410 (m4_patsubst): Add const to `msg' declaration.
4411 * debug.c: Protoized, save for varargs.
4412 * eval.c: Protoized.
4413 * format.c: Protoized.
4414 * input.c: Protoized.
4415 * m4.c: Protoized, save for varargs. Then:
4416 (xfree): Accept void * instead of char *.
4417 (xmalloc): Return void * instead of char *.
4418 (xrealloc): Accept and return void * instead of char *.
4419 * macro.c: Protoized.
4420 * output.c: Protoized.
4421 * path.c: Protoized. Then cast some (char *) over xmalloc's.
4422 * symtab.c: Protoized.
4424 Fri Nov 6 02:05:21 1992 Francois Pinard (pinard at icule)
4426 * m4.texinfo: Remove directory from diagnostics in 30.include,
4427 51.eval, 56.errprint and 57.m4exit tests.
4429 * m4.h: Remove declarations for int or void system functions, they
4430 cause more conflicting trouble than they make good.
4432 * configure.in: Avoid configuration header file. Add some tests.
4433 * m4.h: Remove #include "config.h".
4434 * Makefile.in, lib/Makefile.in: Implement Autoconf interface.
4435 Then, rewritten for better compliance with GNU standards.
4437 Thu Nov 5 12:37:13 1992 Francois Pinard (pinard at icule)
4439 * format.c (format): Avoid syntax error if not HAVE_EFGCVT,
4440 because of a misplaced #endif.
4442 * Many *.[hc] files: Correct intra-line spacing here and there,
4443 according to GNU indent 1.6 advice.
4445 * configure.in: New, using Autoconf 1.2.
4446 * m4.h: Reverse NO_MEMORY_H to NEED_MEMORY_H.
4447 * Delete old configure.in, configure, etc/configure.in,
4448 etc/configure, lib/configure.in, lib/configure and config/*.
4449 Reported by Jason Merrill.
4451 * symtab.c (hash): Change (char) NULL to '\0'.
4452 Reported by Jason Merrill.
4454 * Delete .vers, etc/newdist.sh, etc/newvers.sh and
4455 etc/nextvers.sh. Release numbers will be edited `by hand'.
4456 * version.h: De-automatize, force value in.
4458 * m4.c: Changes in order to use a newer getopt.h.
4459 Reported by David MacKenzie.
4461 * checks/: New name for examples/.
4462 * checks/get_them: New location for etc/get_examples.
4463 * checks/check_them: New location for etc/check_examples.
4464 * Makefile.in, checks/get_them, checks/check_them: Adjust.
4465 * lib/vfprintf.c: New location for etc/vfprintf.c.
4466 * Delete empty etc/.
4467 * examples/: New name for test/.
4469 Tue Mar 10 00:29:46 1992 Francois Pinard (pinard at icule)
4471 * Makefile.in (check): Add m4 as dependency.
4473 * m4.c: Accept --no-warnings instead of --no_warnings, and
4474 --no-gnu-extensions instead of --no_gnu_extensions. Make the
4475 usage message more informative.
4476 Reported by David MacKenzie.
4478 Mon Mar 9 14:53:40 1992 Francois Pinard (pinard at icule)
4480 * etc/check_examples: New name for check_examples.sh.
4481 * etc/get_examples: New name for get_examples.sh.
4482 * Makefile.in, etc/Makefile.in: Use new names.
4484 * Makefile.in: Transmit $(CC) while making in lib.
4486 * Many *.[hc] files: GNU indent'ed, with further fine tuning of
4487 code disposition by hand.
4489 Sun Mar 8 11:01:55 1992 Francois Pinard (pinard at icule)
4491 * m4.h: Delete definitions for abort() and exit().
4492 Reported by Richard Stallman.
4494 * config/hmake-unicos, config/s-unicos.h: New files.
4495 Reported by Hal Peterson.
4497 * eval.c (exp_term): Have N^0 return 1.
4498 Reported by Michael Fetterman.
4500 * eval.c, input.c, m4.h: Remove last comma in enums.
4501 Reported by Mike Lijewski.
4503 * Transfer of maintenance duties from Rene' to Franc,ois.
4505 Thu Oct 24 15:18:46 1991 Rene' Seindal (seindal at diku.dk)
4507 * Release 1.0. Many thanks to those, who provided me with bug
4508 reports and feedback.
4510 * Uses GNU configure, taken from the gdb distribution.
4512 * Uses GNU getopt(), with long option names.
4514 * The -Q/+quiet option is added, which suppresses warnings about
4515 missing or superflous arguments to built-in macros.
4517 * Added default options via the M4OPTS environment variable.
4519 * The built-in format can now be configured to use sprintf as
4520 the formatting engine, for systems without [efg]cvt(3).
4522 * GNU library code is moved to the ./lib subdirectory; other
4523 utility files are now in ./etc.
4525 * Several minor bugs have been fixed.
4527 Fri Jul 26 15:28:42 1991 Rene' Seindal (seindal at diku.dk)
4529 * Fixed various bugs. Release 0.99, manual 0.09. Many thanks to
4530 Francois Pinard and Roland H. Pesch for providing me with reports.
4532 * The builtins incr and decr are now implemented without use of
4535 * The builtin indir is added, to allow for indirect macro calls
4536 (allows use of "illegal" macro names).
4538 * The debugging and tracing facilities has been enhanced
4539 considerably. See the manual for details.
4541 * The -tMACRO option is added, marks MACRO for tracing as soon
4544 * Builtins are traced after renaming iff they were before.
4546 * Named files can now be undiverted.
4548 * The -Nnum option can be used to increase the number of
4549 divertions available.
4551 * Calling changecom without arguments now disables all comment
4554 * The function m4_patsubst() is now consistently declared
4557 * A bug in dnl is fixed.
4559 * A bug in the multi-character quoting code is fixed.
4561 * Several typos in the manual has been corrected. More probably
4564 * The m4.info file is now installed along with the program.
4566 Thu Nov 15 21:51:06 1990 Rene' Seindal (seindal at diku.dk)
4568 * Updated and enhanced version. Release 0.75, manual 0.07.
4570 * Implemented search path for include files (-I option and
4571 M4PATH envronment variable).
4573 * Implemented builtin "format" for printf-like formatting.
4575 * Implemented builtin "regexp" for searching for regular
4578 * Implemented builtin "patsubst" for substitution with regular
4581 * Implemented builtin "esyscmd", which expands to a shell
4584 * Implemented "__file__" and "__line__" for use in error
4587 * Implemented character ranges in "translit".
4589 * Implemented control over debugging output.
4591 * Implemented multi-character quotes.
4593 * Implemented multi-character comment delimiters.
4595 * Changed predefined macro "gnu" to "__gnu__".
4597 * Changed predefined macro "unix" to "__unix__", when the -G
4598 option is not used. With -G, "unix" is still defined.
4600 * Changed "shift", "$@" and "$*" to not insert spaces afters
4603 * Added program name to error messages.
4605 * Fixed two missing null bytes bugs.
4607 Mon Jan 22 21:08:52 1990 Rene' Seindal (seindal at diku.dk)
4609 * Initial beta release. Release 0.50, manual 0.05.
4619 Copyright (C) 1990, 1991, 1992, 1993, 1994, 2000, 2001, 2003,
4620 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
4622 Copying and distribution of this file, with or without
4623 modification, are permitted provided the copyright notice
4624 and this notice are preserved.