1 2008-03-04 Eric Blake <ebb9@byu.net>
3 Make GNUmakefile work with in-place builds.
4 * configure.ac (AC_CONFIG_LINKS): Use m4_PACKAGE_VERSION to work
5 with older autoconf. Use shell variable to bypass older automake
7 * Makefile.am (distclean-local): Remove GNUmakefile link in VPATH
8 builds, since we bypassed automake.
9 * GNUmakefile: Collapse redundant lines.
10 (_is-dist-target): 'distclean' is not a dist target.
11 * Makefile.maint (vc-diff-check): Support out-of-tree VPATH build.
12 Reported by Ralf Wildenhues.
14 2008-03-03 Eric Blake <ebb9@byu.net>
16 More maintainer build adjustments.
17 * configure.ac (AC_CONFIG_LINKS): Link GNUMakefile into VPATH
18 build tree, but only if autoconf is new enough.
19 * GNUmakefile (_have-Makefile, _dummy): Don't pollute Makefile.am
21 (_is-dist-target): Support out-of-tree VPATH build.
22 (check, install, dist, distcheck) [!_have-Makefile]: Forward
23 common build targets on to all to get nicer error messages.
24 * Makefile.maint (makefile-check, news-date-check)
25 (changelog-check, m4-check, vc-diff-check, web-manual): Work in
27 * m4/gnulib-cache.m4: Remove obsolete free module. Import memchr2
30 2008-02-26 Eric Blake <ebb9@byu.net>
33 Reported by Ralf Wildenhues.
35 2008-02-25 Eric Blake <ebb9@byu.net>
37 Make intra-release version numbers more intelligent.
38 * m4/gnulib-cache.m4: Import git-version-gen module.
39 * GNUmakefile (_curr-ver): Add rules to ensure releases have
40 up-to-date version string.
41 * Makefile.am (EXTRA_DIST): Distribute .version.
42 (.version, dist-hook): New rule for generating it.
43 * configure.ac (AC_INIT): Make version track intermediate
45 * .gitignore: Don't version-control version files.
47 * Makefile.cfg (url_dir_list): Fix location.
49 Minor tweaks, learned from the release.
50 * Makefile.maint (VC-tag): Avoid dashed git commands, and use
51 signing key from Makefile.cfg.
52 (delta-diff): Avoid blank lines mid-macro.
53 * HACKING: Tweak instructions.
55 * configure.ac (AC_INIT): Likewise.
57 Beta Release Version 1.4.10b.
58 * configure.ac (AC_INIT): Bump version.
59 (AM_INIT_AUTOMAKE): Increase requirement, and add dist-lzma.
61 * HACKING: Update for git release procedures.
62 * README: Update to mention this is a beta release on the stable
64 * bootstrap: Mention new automake dependency.
65 * Makefile.cfg: New file.
66 * GNUmakefile: Use it.
67 * Makefile.maint (gzip_rsyncable, GZIP_ENV, GIT, VC, VC-tag)
68 (VERSION_REGEXP, this-vc-tag, my_distdir, null_AM_MAKEFLAGS)
69 (TMPDIR, gnulib-version): New macros, borrowed from coreutils.
70 (makefile-check, news-date-check, changelog-check, m4-check)
71 (vc-diff-check, maintainer-distcheck, vc-dist, my-distcheck)
72 (announcement, alpha, beta, major): New rules, borrowed from
74 (TEXI2HTML, cvs-release, update-timestamps, cvs-news, cvs-commit)
76 * Makefile.am (EXTRA_DIST): Distribute new file.
77 * m4/gnulib-cache.m4: Import announce-gen module.
79 2008-02-23 Eric Blake <ebb9@byu.net>
81 Use size_t consistently for string length truncation.
82 * src/m4.h (max_debug_argument_length): Change type to size_t.
83 (shipout_string_trunc, arg_print): Change parameter type.
84 * src/debug.c (trace_format, trace_pre): Adjust all callers.
85 * src/input.c (input_print): Likewise.
86 * src/m4.c (max_debug_argument_length, main): Likewise.
87 * src/macro.c (arg_print): Likewise.
88 * src/output.c (shipout_string_trunc): Likewise.
89 Reported by Ralf Wildenhues.
91 s/obstack_print/shipout_string_trunc/.
92 * src/m4.h (obstack_print): Rename...
93 (shipout_string_trunc): ...to this, to leave obstack_ prefix for
95 * src/debug.c (trace_format): Adjust caller.
96 (obstack_print): Move...
97 * src/output.c (shipout_string_trunc): ...here, including rename.
98 * src/input.c (input_print): Adjust caller.
99 * src/macro.c (arg_print): Likewise.
100 Reported by Ralf Wildenhues.
102 s/shipout_text/divert_text/.
103 * src/m4.h (shipout_text): Rename...
104 (divert_text): ...to this, so that shipout_ prefix can be used for
105 functions that do not do #line tracking.
106 * src/output.c (divert_text): Rename.
107 * src/macro.c (expand_token): Adjust all callers.
109 Stage 18: try harder to reuse argv in recursion.
110 When pushing arguments that contain an existing $@ ref, reuse the
111 ref rather than creating another layer of wrappers.
112 Memory impact: noticeable improvement, due to better $@ reuse.
113 Speed impact: noticeable improvement, due to O(n^2) to O(n)
114 reduction in unboxed recursion.
115 * src/macro.c (make_argv_ref_token): Avoid wrapping $@ when
117 (push_args): Let make_argv_ref_token take care of pending data.
118 * doc/m4.texinfo (Improved foreach): Tweak wording to match new
119 performance capability. Add regression tests.
120 * NEWS: Document the speedup.
121 * src/m4.c (AUTHORS): Claim credit for my rewrite.
123 2008-02-22 Eric Blake <ebb9@byu.net>
125 Stage 17: pass argv through quoted strings.
126 Allow the concatenation of $@ references with other text input
127 inside quoted contexts, which requires distinguishing between a
128 wrapper around many arguments vs. a reference serving as part of a
129 single argument. Also optimize based on whether argv contains
130 builtin tokens that might need flattening to the empty string.
131 Memory impact: noticeable improvement, due to O(n^2) to O(n)
132 reduction from total reuse of $@ references.
133 Speed impact: noticeable improvement, due to O(n^2) to O(n)
134 reduction in boxed recursion.
135 * src/input.c (append_quote_token): Allow an argv ref inside
137 (init_argv_token): Populate new fields.
138 (push_macro): Ensure a macro is actually pushed.
139 * src/m4.h (struct token_chain): Add has_func member.
140 (struct token_data): Add wrapper and has_func members.
141 * src/macro.c (struct macro_arguments): Add flatten and has_func
143 (expand_argument, collect_arguments, make_argv_ref_token)
144 (make_argv_ref): Populate new fields.
145 (arg_equal, arg_len) Handle embedded argv.
146 (arg_token, arg_mark, arg_type): Use new fields.
148 2008-02-21 Eric Blake <ebb9@byu.net>
150 Stage 16: cache quotes and improve arg_print.
151 Cache rather than always copying quotes when pushing $@ refs; in
152 particular, reconstruct single-byte quotes on the fly. Allow NUL
153 through m4wrap. Improve sharing of code that prints arguments.
154 Memory impact: slight improvement, due to cached quotes.
155 Speed impact: slight improvement, due to less copying.
156 * src/m4.h (push_wrapup_init, push_wrapup_finish, quote_cache)
157 (func_print): New prototypes.
158 (arg_print): Adjust prototype.
159 * src/builtin.h (func_print): New function.
160 (define_user_macro): Slight cleanup.
161 (dump_args): Delete, no longer used.
162 (m4_errprint): Use arg_print.
163 (m4_m4wrap): Handle embedded NUL.
164 * src/debug.c (trace_pre): Use arg_print.
165 * src/input.c (cached_quote): New variable.
166 (push_wrapup): Split...
167 (push_wrapup_init, push_wrapup_finish): ...into these.
168 (input_print): Use arg_print.
169 (quote_cache): New function.
170 (pop_input, next_char_1, append_quote_token, set_quote_age):
172 * src/macro.c (arg_text, make_argv_ref_token): Adjust users.
173 (arg_print): Add parameters.
174 * examples/null.m4: Test for NUL in m4wrap.
175 * examples/null.out: Update expected output.
176 * doc/m4.texinfo (Debug Levels): Test --arglength truncation.
178 Fix out-of-bounds read for sanitized macro names, from 2008-02-06.
179 * src/m4.c (m4_verror_at_line): Properly terminate the string.
180 Reported by Ralf Wildenhues.
182 2008-02-19 Eric Blake <ebb9@byu.net>
184 Clean up foreach example.
185 * doc/m4.texinfo (Foreach, Improved foreach): Document another
186 shortcoming in foreach.m4.
188 2008-02-18 Eric Blake <ebb9@byu.net>
190 Avoid some magic numbers.
191 * src/m4.h (DEBUG_TRACE_ARGS, DEBUG_TRACE_EXPANSION)
192 (DEBUG_TRACE_QUOTE, DEBUT_TRACE_ALL, DEBUG_TRACE_LINE)
193 (DEBUG_TRACE_FILE, DEBUG_TRACE_PATH, DEBUG_TRACE_CALL)
194 (DEBUG_TRACE_INPUT, DEBUG_TRACE_CALLID, DEBUG_TRACE_VERBOSE)
195 (DEBUG_TRACE_DEFAULT): Use hex constants, to make it obvious these
197 * src/input.c (CHAR_EOF, CHAR_MACRO, CHAR_QUOTE, CHAR_ARGV):
198 Define in terms of UCHAR_MAX.
199 (set_word_regexp): Likewise.
200 * src/builtin.c (compile_pattern, m4_translit): Likewise.
201 Reported by Ralf Wildenhues.
203 2008-02-16 Eric Blake <ebb9@byu.net>
205 Add regression test for multi-character quote recursion.
206 * examples/foreach2.m4: Use $0 rather than spelling out name.
207 * examples/foreachq2.m4: Likewise.
208 * examples/forloop2.m4: Likewise.
209 * examples/hanoi.m4: Likewise.
210 * examples/trace.m4: Likewise.
211 * doc/m4.texinfo (Improved forloop): Document advantage of $0.
212 (Improved foreach): Adjust dump from file.
214 Stage 15: return argv refs back to collect_arguments.
215 Collect an entire $@ reference at once rather than one argument at
216 a time, outside of quotes (but inside quotes, $@ is still
217 flattened for now). The skip_last field allows concatenation of
218 $@ with other text when collecting arguments.
219 Memory impact: noticeable improvement, due to better reuse of $@.
220 Speed impact: noticeable improvement, due to less parsing.
221 * src/m4.h (enum token_type): Add TOKEN_ARGV.
222 (struct token_chain): Add skip_last member to argv link.
223 (next_token): Update prototype.
224 * src/input.c (CHAR_ARGV): New placeholder input character.
225 (peek_input): Add parameter, to pass $@ at once.
226 (next_char_1, append_quote_token): Handle $@ inside quotes.
227 (init_argv_token): New function.
228 (push_token, match_input, next_token, peek_token, lex_debug):
230 * src/macro.c (expand_input, collect_arguments): Likewise.
231 (expand_argument): Handle incoming $@ token.
232 (arg_adjust_refcount, arg_token, arg_text, make_argv_ref_token):
233 Handle nested $@ refs.
234 * src/symtab.c (symtab_debug): Update caller.
235 * examples/null.m4: Document more tests that are needed. Add
236 tests for NUL with divert, patsubst, and regexp.
237 * examples/null.out: Update for new tests.
238 * doc/m4.texinfo (Syntax): Add test for m4exit and NUL.
239 * checks/get-them (AWK): Give a default value.
240 * checks/check-them: Allow tests to invoke child processes with
241 same include path. Perform message normalization on stderr.
243 2008-02-15 Eric Blake <ebb9@byu.net>
245 Use fastmaps for better regex performance.
246 * src/builtin.c (compile_pattern): Allocate a fastmap.
247 * src/input.c (word_start): Delete.
248 (set_word_regexp): Compile a fastmap instead.
249 (peek_token, next_token): Use fastmap.
250 (pop_wrapup): Free memory on exit.
252 2008-02-13 Eric Blake <ebb9@byu.net>
255 * doc/m4.texinfo (Incompatibilities): Use @. after capital.
256 (History): Use @: after abbreviations.
257 (M4exit): Use correct Latin abbreviation.
259 2008-02-11 Eric Blake <ebb9@byu.net>
261 Document behavior of __gnu__().
262 * doc/m4.texinfo (Platform macros): Enhance test.
263 (Macro expansion): New test.
265 Use gnulib's git-merge-changelog driver when available.
266 * .gitattributes: New file.
267 * bootstrap: Install driver, if not already present.
269 2008-02-06 Eric Blake <ebb9@byu.net>
271 Fix security hole introduced 2007-11-22.
272 * src/m4.h (includes): Add quotearg.h.
273 * src/m4.c (m4_verror_at_line): Properly escape macro names.
274 (main): Manage quoteargs defaults.
275 * doc/m4.texinfo (Indir): Document and test this.
277 2008-02-05 Eric Blake <ebb9@byu.net>
279 * m4/gnulib-cache.m4: Import the strtod module.
281 2008-02-02 Eric Blake <ebb9@byu.net>
283 Stage 14: allow pushing argv references.
284 Push a $@ reference to the input engine in one go, rather than
285 pushing each element. For now, argument collection still gets one
286 argument of a $@ at a time; but the penalties of this patch make
287 it easier to manage $@ efficiently in future patches.
288 Memory impact: noticeable penalty, due to larger struct and O(n)
289 to O(n^2) on unboxed recursion.
290 Speed impact: noticeable penalty, due to more bookkeeping.
291 * src/m4.h (struct token_chain): Add comma and quotes fields.
292 (arg_adjust_refcount, arg_print, push_arg_quote): New prototypes.
293 * src/input.c (push_token, pop_input, input_print, peek_input)
294 (next_char_1): Support $@ references.
295 * src/macro.c (struct macro_arguments): Add level field. Match
296 type of arraylen to argc.
297 (collect_arguments): Populate new field.
298 (expand_macro, make_argv_ref, push_arg): Factor...
299 (arg_adjust_refcount, make_argv_ref_token, push_arg_quote):
300 ...into these new methods.
301 (arg_token): Add new parameter.
302 (arg_print): New function.
303 (arg_mark, arg_type, arg_text, arg_equal, arg_empty, arg_len)
304 (arg_func, push_args): Adjust callers.
305 * doc/m4.texinfo (Ifelse): Augment test.
307 2008-01-31 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
309 * checks/Makefile.in: Use @SET_MAKE@, and use @SHELL@ rather
310 than hard-coding /bin/sh.
312 Reported by Lawson Chan.
314 2008-01-27 Eric Blake <ebb9@byu.net>
316 Stage 13: push composite text tokens.
317 Support pushing composite tokens, allowing back-references to be
318 reused through multiple macro expansions. Add hueristic that
319 avoids creating new reference when pushing existing references.
320 Memory impact: noticeable improvement due to better reference
321 reuse, except for O(n) to O(n^2) copying in boxed recursion.
322 Speed impact: slight penalty, due to more bookkeeping.
323 * src/m4.h (push_token): Adjust prototype.
324 * src/input.c (push_token): Add parameter, and handle composite
326 (append_quote_token): Inline short strings.
327 * src/macro.c (push_arg, push_args): Adjust callers.
329 2008-01-26 Eric Blake <ebb9@byu.net>
331 Stage 12: make token_chain a union, add string_pair.
332 Shrink size of symbol chains by using a union. Make passing quote
333 delimiters around more efficient. Other code cleanups.
334 Memory impact: slight improvement, due to smaller struct.
335 Speed impact: slight penalty, due to more bookkeeping.
336 * src/m4.h (STRING): Delete typedef.
337 (struct string_pair, enum token_chain_type): New types.
338 (struct token_chain): Reduce size via a union.
339 (ARG_LEN): New macro.
341 * src/builtin.c (ARG): ...from here.
342 (dump_args, define_macro, m4_dumpdef, m4_builtin, m4_indir)
343 (m4_defn, mkstemp_helper, m4_maketemp, m4_mkstemp, m4___file__)
344 (m4___program__, m4_m4wrap, m4_len, m4_index, m4_substr)
345 (m4_regexp, m4_patsubst): Adjust callers.
346 * src/input.c (rquote, lquote, bcomm, ecomm): Delete...
347 (curr_quote, curr_comm): ...replaced by these.
348 (make_text_link, push_token, pop_input, input_print, peek_input)
349 (next_char_1, input_init, set_quotes, set_comment, set_quote_age)
350 (next_token, peek_token): Adjust callers.
351 * src/macro.c (expand_macro, arg_token, arg_mark, arg_text)
352 (arg_equal, arg_len, make_argv_ref, push_arg, push_args):
354 * src/format.c (ARG_INT, ARG_LONG, ARG_STR, ARG_DOUBLE, format):
356 * src/freeze.c (produce_frozen_state): Likewise.
357 * src/debug.c (trace_format, trace_pre): Likewise.
358 (debug_decode): Don't lose partial traces prior to reducing
361 2008-01-22 Eric Blake <ebb9@byu.net>
363 Stage 11: full circle for single argument references.
364 Pass quoted strings through to argument collection in a single
365 action, so that an argument can be reused throughout macro
366 recursion if it remains unchanged.
367 Memory impact: noticeable improvement, due to more reuse in
368 argument collection stacks; O(n^2) to O(n) on boxed recursion.
369 Speed impact: noticeable improvement, due to less copying.
370 * src/m4.h (struct token_chain): Add quote_age member.
371 (struct token_data): Add end member to chain alternate.
372 (make_text_link): New prototype.
373 * src/input.c (CHAR_QUOTE): New macro.
374 (word_start): Pre-allocate.
375 (set_word_regexp): Simplify.
376 (make_text_link): Export, and handle new fields.
377 (next_char, next_char_1): Add parameter.
378 (append_quote_token): New function.
379 (match_input, next_token): Adjust callers to handle quoted input
381 * src/macro.c (struct macro_arguments): Add wrapper member.
382 (expand_argument): Accept composite blocks from input engine.
383 (expand_macro): Reduce refcounts of composite arguments.
384 (collect_arguments, arg_token, arg_mark, make_argv_ref): Update to
386 (arg_type, arg_text, arg_equal, arg_len): Treat composite
388 (push_arg, push_args): Handle composites.
390 2008-01-17 Eric Blake <ebb9@byu.net>
392 Stage 10: avoid extra copying of strings and comments.
393 When collecting tokens that are immune to further expansion, avoid
394 copying data from one obstack to another by outputting it into the
395 destination obstack to begin with. Also reduce copying done in
397 Memory impact: slight improvement, due to better obstack usage.
398 Speed impact: noticeable improvement, due less data copying.
399 * m4/gnulib-cache.m4: Import the intprops and vasnprintf-posix
401 * src/m4.h (includes): Use new gnulib modules.
402 (next_token): Adjust prototype.
403 (bad_argc): New prototype.
404 * src/format.c (arg_int, arg_long, arg_double): New helper
406 (ARG_INT, ARG_LONG, ARG_STR, ARG_DOUBLE): Track missing
408 (format): Improve warnings, and avoid copying into obstack in the
410 * src/input.c (next_token): Add new parameter.
411 (lex_debug): Adjust caller.
412 * src/symtab.c (symtab_debug): Likewise.
413 * src/macro.c (expand_input, expand_token, expand_argument)
414 (collect_arguments): Likewise.
415 * src/output.c (m4_tmpname): Guarantee correct buffer size.
416 * src/builtin.c (builtin_init): Improve efficiency.
418 (ntoa): Tighten buffer allocation.
419 * doc/m4.texinfo (Format): Test the improvements.
420 * NEWS: Document the improvement.
422 2008-01-14 Eric Blake <ebb9@byu.net>
424 Fix --warn-macro-sequence regression from 2007-11-29.
425 * src/builtin.c (define_user_macro): Use correct length.
426 * doc/m4.texinfo (Arguments): Test the fix.
427 (History): Reword to account for new year and eventual result of
430 2008-01-08 Eric Blake <ebb9@byu.net>
433 * NEWS: Update year. Mention effect of my recent memmem
434 contributions to gnulib.
436 2007-12-21 Eric Blake <ebb9@byu.net>
438 Stage 9: share rather than copy single-arg refs.
439 Use hooks of previous patch to create back-references to arguments
440 in the input engine, and inline short text rather than always
441 creating a FIFO link. Also start testing embedded NUL behavior.
442 Until the argument collection engine also shares references, the
443 memory usage increases.
444 Memory impact: noticeable penalty, due to longer life of argv
445 changing O(n) to O(n^2) on boxed recursion.
446 Speed impact: slight improvement, due less data copying.
447 * m4/gnulib-cache.m4: Import quote and memmem modules.
448 * src/m4.h (arg_scratch): New prototype.
449 * src/input.c (INPUT_INLINE_THRESHOLD): New define.
450 (push_token): Use it to inline short text, and save references to
452 (input_init, next_token): Simplify obstack handling.
453 * src/macro.c (expand_argument): Likewise.
454 (expand_macro): Track scratch space.
455 (arg_scratch): New function.
456 (make_argv_ref): Use it.
457 (push_args): Likewise, and simplify comma handling, since most
458 separators are short enough to be inlined.
459 * src/builtin.c (builtin_init): Avoid cast.
460 (m4_errprint, m4_index): Transparently support NUL.
461 (m4_translit): Use scratch space, rather than leaking memory on
463 * doc/m4.texinfo (Syntax): Add new test of embedded NUL.
464 * checks/get-them: Extract test that uses external files.
465 * checks/check-them: Run the new test. Use unified diff if
466 possible, and force text mode when debugging NUL handling.
467 * examples/null.m4: New file.
468 * examples/null.out: Likewise.
469 * examples/null.err: Likewise.
470 * examples/Makefile.am (EXTRA_FILES): Distribute these files.
471 * .gitattributes: Treat new files as text, in spite of embedded
474 2007-12-18 Eric Blake <ebb9@byu.net>
476 Stage 8: extend life of references into argv.
477 Add hooks to lengthen the lifetime of arguments reused in a macro
478 expansion, rather than always discarding arguments at the end of
479 expand_macro. Rework the expand_macro obstacks to handle longer
480 lifetimes. For now, the hooks remain unused.
481 Memory impact: slight penalty, due to larger structs.
482 Speed impact: slight penalty, due to more bookkeeping.
483 * src/m4.h (obstack_regrow): Delete, now that it is unused.
484 (struct token_chain): Add level field.
485 (push_token): Adjust prototype.
486 (adjust_refcount): New prototype.
487 * src/macro.c [DEBUG_MACRO]: Add debugging hooks for $@ reference
489 (argc_stack, argv_stack): Delete, replaced by...
490 (struct macro_arg_stacks, stacks, stacks_count): ...these new
491 structure for tracking $@ references.
492 (expand_input): Initialize new structure.
493 (collect_arguments): Alter signature.
494 (expand_macro): Rework obstack handling, in order to keep $@
495 references alive until they have been rescanned.
496 (adjust_refcount, arg_mark): New functions.
497 (make_argv_ref): Use new field.
498 (push_arg, push_args): Update callers.
499 * src/input.c (make_text_link): Use new field.
500 (push_token): Change signature.
501 (pop_input, next_char_1): Call new function.
502 * doc/m4.texinfo: Clean up some examples of -d option usage.
503 (Ifelse): Add some stress tests.
505 2007-12-13 Eric Blake <ebb9@byu.net>
508 * doc/m4.texinfo (Inhibiting Invocation): Missed one instance in
513 2007-12-13 Paolo Bonzini <bonzini@gnu.org> (tiny change)
515 * doc/m4.texinfo (Inhibiting Invocation): Fix quoting of a quoting
517 Reported by Giovanni Toffetti.
519 2007-12-11 Eric Blake <ebb9@byu.net>
521 Stage 7: add chained token support to input parser.
522 Allow the LIFO input engine to rescan a macro expansion composed
523 of smaller chunks of FIFO data, rather than the old approach of a
524 monolithic string. For now, all chunks are still copied.
525 Memory impact: slight penalty, due to FIFO chain overhead.
526 Speed impact: noticeable penalty, due to extra bookkeeping.
527 * src/m4.h (struct token_chain): Add const safety.
528 (push_token): New prototype.
529 * src/input.c (INPUT_CHAIN): New enumerator.
530 (struct input_block): Add new input type u_c, and change u_s to
531 length-based processing.
532 (make_text_link): New helper function.
533 (push_token): New function.
534 (push_string_finish): Use it.
535 (pop_input, input_print, peek_input, next_char, next_char_1):
536 Adjust to handle new input type.
537 * src/macro.c (push_arg, push_args): Use new function.
539 2007-12-10 Eric Blake <ebb9@byu.net>
541 Stage 6: convert builtins to push arg at a time.
542 Add new methods to factor all builtins whose expansion includes an
543 argument, making back-reference creation easier in future patches.
544 Factor out length-limited printing to obstacks, and use -1 rather
545 than 0 for unlimited length.
547 Speed impact: slight improvement, due to better code sharing.
548 * src/m4.h (includes): Include <limits.h> here, instead of in
550 (input_block): New typedef.
551 (trace_pre, trace_post, push_string_finish): Update prototypes.
552 (obstack_print, input_print, push_arg, push_args): New
554 * src/input.c (push_string_finish): Change return type.
555 (input_print): New function.
556 * src/debug.c (trace_format): Add %B specifier, and use new
558 (trace_pre): Remove redundant argc parameter.
559 (trace_post): Likewise, and change signature.
560 (obstack_print): New function.
561 * src/macro.c (expand_macro): Update caller.
562 (push_arg, push_args): New functions.
563 * src/builtin.c (m4_ifdef, m4_ifelse, m4_shift, m4_substr)
564 (m4_patsubst, expand_user_macro): Use new functions.
565 (mkstemp_helper, m4_maketemp): Avoid extra trailing NULs.
566 * src/m4.c (max_debug_argument_length, main): Set to INT_MAX, not
568 * src/output.c: Update includes.
569 * src/symtab.c: Likewise.
571 2007-12-07 Eric Blake <ebb9@byu.net>
573 Minor security fix: Quote output of mkstemp.
574 * src/builtin.c (mkstemp_helper): Produce quoted output.
575 * doc/m4.texinfo (Mkstemp): Update the documentation and tests.
576 * NEWS: Document this change.
578 Stage 5: add notion of quote age.
579 Cache the quoting rules that were in effect when a string was
580 parsed, to avoid reparsing that string if no changequote or other
581 quote age change took place in the meantime. A quote_age of 0 is
582 always safe, but does not benefit from caching.
583 Memory impact: slight penalty, due to larger struct.
584 Speed impact: slight penalty, due to more bookkeeping.
585 * src/input.c: Comment cleanups.
586 (current_quote_age): New global variable.
587 (set_quote_age): New helper function.
588 (input_init, set_word_regexp): Use it.
589 (set_quotes, set_comment): Likewise, and detect no-op changes.
590 (quote_age, safe_quotes): New functions.
591 (next_token): Track quote age.
592 * src/m4.h (struct token_data): Add quote_age member.
593 (TOKEN_DATA_QUOTE_AGE, quote_age, safe_quotes): New prototypes.
594 * src/macro.c (struct macro_arguments): Add quote_age member.
595 (expand_token): Alter signature and track quote age.
596 (expand_input, expand_argument): All callers changed.
597 (collect_arguments, make_argv_ref): Track quote age.
598 (arg_text, arg_len, arg_func): Detect type mismatch.
599 * doc/m4.texinfo (Ifelse, Changequote): Add more tests.
600 (Incompatibilities): Fix typo.
601 * examples/wraplifo.m4: New file.
602 * examples/Makefile.am (EXTRA_DIST): Distribute it.
604 2007-12-04 Eric Blake <ebb9@byu.net>
606 Fix builds with OpenBSD make.
607 * doc/Makefile.am (HELP2MAN): New macro.
608 (man_MANS, m4.1): Fix rules for building m4.1 into srcdir.
609 * README: Update copyright.
610 * HACKING: Mention help2man and makeinfo dependencies.
612 2007-11-29 Eric Blake <ebb9@byu.net>
614 Stage 4: route indir, builtin through ref; make argv opaque.
615 Finish making struct opaque to all but the input engine, by
616 reworking obstack usage in expand_macro to better support creation
617 of a $@ reference. Canonicalize the empty argument, to allow
618 pointer comparison optimizations.
619 Memory impact: slight penalty, due to larger struct.
620 Speed impact: slight improvement, due to fewer function calls.
621 * src/m4.h (obstack_regrow): Borrow definition from head.
622 (struct token_chain): Add flatten and len members.
623 (arg_equal, arg_empty, make_argv_ref): New prototypes.
624 (struct macro_arguments): Move...
625 * src/macro.c (struct macro_arguments): ...here, making it
626 opaque. Add has_ref member.
627 (empty_token): New placeholder, for optimizing comparison with
629 (collect_arguments): Change signature, and populate new fields.
630 (expand_macro): Alter handling of obstacks.
631 (arg_token): New helper method.
632 (arg_equal, arg_empty, make_argv_ref): New methods.
633 (arg_type, arg_text, arg_len, arg_func): Use new methods.
634 * src/builtin.c (m4_ifelse, m4_builtin, m4_indir, m4_eval):
636 * src/format.c (format): Likewise.
638 Stage 3: cache length, rather than computing it.
639 Cache the length of a token, to avoid repeating lots of strlen
640 calls. Additionally, by using obstack length rather than strlen,
641 the input engine can now support embedded NUL.
642 Memory impact: slight penalty, due to larger struct.
643 Speed impact: noticeable improvement, due to fewer function
645 * src/input.c (next_token): Grab length from obstack rather than
647 * src/m4.h (token_data, macro_arguments): Add length field.
648 (TOKEN_DATA_LEN): New accessor.
649 (define_user_macro): Add parameter.
650 * src/builtin.c (define_user_macro, mkstemp_helper): Use
652 (builtin_init, define_macro, m4_maketemp, m4_mkstemp): Adjust
654 (dump_args, m4_ifdef, m4_ifelse, m4_builtin, m4_indir, m4_eval)
655 (m4_len, m4_substr, m4_translit, m4_regexp, m4_patsubst)
656 (expand_user_macro): Use cached lengths.
657 * src/freeze.c (reload_frozen_state): Adjust callers.
658 * src/m4.c (main): Likewise.
659 * src/macro.c (expand_token, expand_argument, collect_arguments)
660 (arg_len): Use cached length.
661 * doc/m4.texinfo (Mkstemp): Ensure mkstemp does not produce NUL.
663 2007-11-27 Eric Blake <ebb9@byu.net>
665 Stage 2: use accessors, not direct reference, into argv.
666 Outside of macro.c, use accessor methods rather than direct access
667 into the argv struct.
669 Speed impact: slight penalty, due to increased function calls.
670 * src/m4.h (TOKEN_EOF): Alter value, to ease debugging.
671 (arg_argc, arg_type, arg_text, arg_len, arg_func): New
673 * src/macro.c (arg_argc, arg_type, arg_text, arg_len, arg_func):
674 New accessor functions.
675 * src/builtin.c (ARG, dump_args, define_macro, m4_builtin)
676 (m4_indir): Use new accessors.
677 * src/debug.c (trace_pre): Likewise.
678 * src/format.c (ARG_INT, ARG_LONG, ARG_STR, ARG_DOUBLE):
681 2007-11-24 Eric Blake <ebb9@byu.net>
683 Stage 1: convert token_data** into new object.
684 Pass a variable-size wrapper structure instead of an array to
685 builtins, so that subsequent optimizations in the structure need
686 not impact every builtin client.
687 Memory impact: slight penalty, since struct is larger than array.
688 Speed impact: slight penalty, due to increased bookkeeping.
689 * m4/gnulib-cache.m4: Import flexmember module.
690 * src/m4.h (struct macro_arguments, struct token_chain): New
692 (builtin_func): Alter signature.
693 (token_data): Add new TOKEN_COMP alternative.
694 * src/builtin.c: All builtins changed.
695 (ARG, dump_args, define_macro, expand_user_macro): Update to use
697 * src/debug.c (trace_pre, trace_post): Likewise.
698 * src/format.c (ARG_INT, ARG_LONG, ARG_STR, ARG_DOUBLE, format):
700 * src/macro.c (collect_arguments): Build new struct.
701 (call_macro, expand_macro): Update to use new struct.
703 2007-11-22 Eric Blake <ebb9@byu.net>
705 More error messages tied to macro names.
706 * src/input.c (set_word_regexp): Take additional parameter.
707 (input_init): Adjust caller.
708 * src/debug.c (debug_set_file, debug_set_output): Take additional
710 (debug_init): Adjust caller.
711 (expansion_level): Move declaration...
712 * src/m4.h (expansion_level): ...here.
713 (debug_set_output, set_word_regexp): Adjust prototypes.
714 * src/builtin.c (m4_changeword, m4_m4exit, m4_debugfile): Adjust
716 * src/m4.c (main): Likewise.
718 Refactor error messages to avoid macros.
719 * src/m4.h (_): Define, as a placeholder for now.
720 (M4ERROR, M4ERROR_AT_LINE): Delete.
721 (m4_error, m4_error_at_line): Change prototype.
722 (m4_warn, m4_warn_at_line): New prototypes.
723 * src/m4.c (m4_verror_at_line): New helper function.
724 (m4_error, m4_error_at_line): Use new function, and properly call
726 (m4_warn, m4_warn_at_line): New functions.
727 (stackovf_handler, main): All callers changed.
728 * src/builtin.c: Likewise.
729 * src/debug.c: Likewise.
730 * src/eval.c: Likewise.
731 * src/format.c: Likewise.
732 * src/freeze.c: Likewise.
733 * src/input.c: Likewise.
734 * src/macro.c: Likewise.
735 * doc/m4.texinfo (Indir, Builtin, Dumpdef, Incr, Eval, Substr)
736 (Improved forloop): Adjust tests accordingly.
738 Security fix: avoid arbitrary code execution with 'm4 -F'.
739 * src/freeze.c (produce_frozen_state): Never pass raw file name as
741 * NEWS: Document this fix.
743 2007-11-21 Eric Blake <ebb9@byu.net>
745 Consistently report macro name first in messages.
746 * src/m4.h (evaluate): Adjust prototype.
747 * src/builtin.c (bad_argc, numeric_arg, m4_placeholder): Alter
748 wording to match head.
749 (mkstemp_helper, substitute): Adjust signature. All callers
751 (m4_dumpdef, m4_builtin, m4_indir, m4_defn, m4_esyscmd, m4_eval)
752 (m4_undivert, m4_maketemp, m4_m4exit, m4_debugmode)
753 (m4_debugfile, m4_regexp, m4_patsubst): Mention macro name in
755 (m4_format): Adjust call.
756 * src/format.c (format): No longer skip argv[0].
757 * src/eval.c (evaluate): Mention macro name in message.
758 (logical_or_term, logical_and_term, or_term, xor_term, and_term)
759 (equality_term, cmp_term, shift_term, add_term, mult_term)
760 (exp_term, unary_term, simple_term): Adjust signature.
761 * src/macro.c (warn_builtin_concat): Likewise.
762 (expand_argument): Adjust caller.
763 * doc/m4.texinfo (Macro Arguments, Ifdef, Ifelse, Debug Output)
764 (Dnl, Improved fatal_error, Defn, Builtin, Index macro, Regexp)
765 (Substr, Translit, Patsubst, Format, Eval, Dumpdef, Include)
766 (Improved forloop, Indir, Trace, Incr): Adjust tests to match.
768 Make argument checking a bit more sane.
769 * src/builtin.c (bad_argc): Adjust signature, and don't force
770 callers to add 1. Adjust all callers.
771 (numeric_arg): Adjust signature. Adjust all callers.
773 Make dnl diagnostic print macro name.
774 * src/m4.h (skip_line): Adjust prototype.
775 * src/input.c (skip_line): Report error on behalf of caller.
776 * src/builtin.c (m4_dnl): Adjust caller.
777 (dump_args, m4_dumpdef, m4_changequote, m4_changecom)
778 (m4_changeword, m4_traceon, m4_traceoff, expand_user_macro): Use
779 ARG macro instead of open-coding.
780 * doc/m4.texinfo (Dnl): Adjust test.
782 2007-11-20 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
784 * Makefile.am (EXTRA_DIST): gendocs.sh is gone here.
786 2007-11-14 Eric Blake <ebb9@byu.net>
788 Avoid builtin concatenation in macro arguments.
789 * doc/m4.texinfo (Defn): Add tests.
790 * src/macro.c (warn_builtin_concat): New function.
791 (expand_argument): Use it to warn on more corner cases.
792 * NEWS: Mention new warning.
794 2007-11-13 Eric Blake <ebb9@byu.net>
796 Simplify previous patch.
797 * src/input.c (pop_input): Change signature.
798 (push_string_init, next_char_1): Adjust callers.
800 Note: Patches titled Stage 0 through N form a series of patches
801 which decreases the algorithmic complexity of tail recursion in
802 macro expansions from O(n^2) to O(n) in both time and memory, then
803 performs cleanups, such as handling of embedded NUL, made easier
804 by the code refactoring.
806 Stage 0: Fix memory leak in tail recursion.
807 Free expansion text in the input engine as soon as it is parsed,
808 rather than when the recursive expansion completes.
809 Memory impact: noticeable improvement, due to reduction from
810 O(n^2) to O(n) on recursion.
811 Speed impact: minor improvement, due to better memory usage.
812 * src/input.c (push_string_init): Let go of memory earlier.
813 (next_char_1): Make end of string detection reliable.
814 (match_input): Simplify use of push_string_init.
815 * NEWS: Document this fix.
817 2007-11-07 Eric Blake <ebb9@byu.net>
819 * doc/m4.texinfo (Pseudo Arguments): Test more corner cases.
821 2007-11-05 Eric Blake <ebb9@byu.net>
823 Use assert, rather than INTERNAL ERROR.
824 * src/m4.h: Include <assert.h>.
825 * src/builtin.c (m4_dumpdef, define_macro, m4_defn): Use assert.
826 * src/debug.c (trace_pre): Likewise.
827 * src/eval.c (evaluate, cmp_term, shift_term, mult_term):
829 * src/freeze.c (produce_frozen_state): Likewise.
830 * src/input.c (push_string_init, pop_input, init_macro_token)
831 (peek_input, next_char_1, set_word_regexp): Likewise.
832 * src/m4.c (main): Likewise.
833 * src/macro.c (expand_token, expand_argument, call_macro):
835 * src/output.c (make_diversion): Likewise.
836 * src/symtab.c (symtab_init): Likewise.
838 Use build-aux directory.
839 * configure.ac (PACKAGE, VERSION): Delete, since Automake does
841 (AC_CONFIG_AUX_DIR): Add, with auxiliary files in build-aux
842 instead of the top level.
843 * bootstrap: Adjust accordingly.
844 * m4/gnulib-cache.m4: Add --aux-dir option.
845 * doc/Makefile.am (m4.1): Rewrite rule to use build-aux/missing.
847 2007-11-02 Eric Blake <ebb9@byu.net>
849 Update some documentation about version control.
850 * NEWS: M4 is now stored in git.
853 * bootstrap: Likewise.
854 * commit: Delete, now that CVS commits are no longer necessary.
856 Adjust to recent gnulib change.
857 * m4/gnulib-cache.m4: Drop vasprintf-posix and xvasprintf, and use
858 xvasprintf-posix instead.
860 2007-11-01 Eric Blake <ebb9@byu.net>
862 Improve error message when early end of file occurs.
863 * doc/m4.texinfo (Macro Arguments, Changequote, Changecom)
864 (M4wrap): Adjust to new messages.
865 (Improved capitalize): Enhance test.
866 * src/m4.h (next_token): Adjust prototype.
867 * src/input.c (next_token): Add new parameter, and improve error
869 (lex_debug): Adjust callers.
870 * src/symtab.c (symtab_debug): Likewise.
871 * src/macro.c (expand_input, collect_arguments): Likewise.
872 (expand_argument): Likewise, and add parameter.
874 2007-10-31 Eric Blake <ebb9@byu.net>
876 Test more corner cases.
877 * doc/m4.texinfo (Changecom, Pseudo Arguments): Beef up tests.
878 (Improved foreach): Document alternate foreachq style.
879 * examples/foreachq3.m4: New file.
880 * examples/loop.m4: New file.
881 * examples/Makefile.am (EXTRA_DIST): Distribute them.
883 2007-10-28 Eric Blake <ebb9@byu.net>
885 More test coverage for autoconf usage patterns.
886 * doc/m4.texinfo (Inhibiting Invocation, Pseudo Arguments)
887 (Builtin): Add new undocumented tests.
888 (Shift): Document cond macro, and add new test.
890 2007-10-27 Eric Blake <ebb9@byu.net>
892 Document one use of changequote(`(',`)').
893 * doc/m4.texinfo (Changequote): Add new test, based on recent
894 autoconf addition of m4_expand.
896 2007-10-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
898 * examples/Makefile.am (EXTRA_DIST): Add capitalize2.m4.
900 2007-10-24 Eric Blake <ebb9@byu.net>
902 Reduce number of mingw testsuite failures.
903 * doc/m4.texinfo (Using frozen files): Skip test on mingw.
905 2007-10-22 Eric Blake <ebb9@byu.net>
907 Add DEBUG_REGEX debugging information.
908 * src/m4.h (DEBUG_REGEX): New debug macro.
909 * src/m4.c (main) [DEBUG_REGEX]: Open regex trace file when
911 * src/builtin.c (m4_patsubst, m4_regexp, compile_pattern)
912 [DEBUG_REGEX]: Trace regex usage.
914 Never let printf failures go undetected.
915 * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
917 * src/m4.h: Include xprintf.h.
918 * src/format.c (format): Warn on format failures.
919 * src/builtin.c (ntoa): Export.
920 (m4_errprint): Adjust all *printf callers.
921 * src/debug.c (debug_message_prefix, trace_format): Likewise.
922 * src/freeze.c (produce_frozen_state): Likewise.
923 * src/input.c [DEBUG_INPUT]: Likewise.
924 * src/m4.c (usage): Likewise.
925 * src/m4.h (DEBUG_PRINT1, DEBUG_PRINT3, DEBUG_MESSAGE)
926 (DEBUG_MESSAGE1, DEBUG_MESSAGE2): Likewise.
927 * src/output.c (m4_tmpname, shipout_text, freeze_diversione):
929 * src/path.c [DEBUG_INCL]: Likewise.
930 * src/stackovf.c (process_sigsegv) [DEBUG_STKOVF]: Likewise.
931 * src/symtab.c [DEBUG_SYM]: Likewise.
933 2007-10-17 Eric Blake <ebb9@byu.net>
935 Fix 'm4 -F file -t undefined'.
936 * src/freeze.c (produce_frozen_state): Avoid core dump.
937 * doc/m4.texinfo (Using frozen files): Test for the bug.
938 * NEWS: Mention the fix.
940 2007-10-09 Eric Blake <ebb9@byu.net>
942 * NEWS: Document recent speedups.
944 Fix regexp regression of 2007-09-29.
945 * src/builtin.c (substitute): Allow NULL regs when no
946 subexpressions were present.
947 (m4_regexp): Handle \ escapes even with empty regex.
948 * doc/m4.texinfo (Regexp, Patsubst): Catch this bug.
950 Cache regex compilation for another autoconf speedup.
951 * src/m4.h (free_macro_sequence): Rename...
952 (free_regex): ...to this.
953 * src/m4.c (main): Update caller.
954 * src/builtin.c (REGEX_CACHE_SIZE, m4_regex, regex_cache): New
956 (compile_pattern): New function; cache recent regexes.
957 (free_regex): Rename, and clean up additional memory.
958 (m4_regexp, m4_patsubst): Use new function.
960 2007-10-02 Eric Blake <ebb9@byu.net>
962 Document quoting pitfalls in capitalize.
963 * doc/m4.texinfo (Patsubst): Use the examples directory. Also
965 (Improved capitalize): New node.
966 * examples/capitalize.m4: Update to match manual.
967 * examples/capitalize2.m4: New file.
969 2007-10-01 Eric Blake <ebb9@byu.net>
971 Another Autoconf usage pattern optimization.
972 * src/builtin.c (m4_index): Optimize search for one byte.
973 * doc/m4.texinfo (Index macro, Regexp, Patsubst): Test the new
976 2007-09-29 Eric Blake <ebb9@byu.net>
978 Optimize for Autoconf usage pattern.
979 * src/builtin.c (m4_regexp, m4_patsubst): Handle empty regex
982 2007-09-24 Eric Blake <ebb9@byu.net>
984 Create .gitignore alongside .cvsignore.
985 * bootstrap (LC_ALL): Set up front.
986 (version control) Borrow idea from head, to avoid churn in
987 m4/.*ignore files modified by gnulib-tool.
989 2007-09-13 Eric Blake <ebb9@byu.net>
993 2007-09-07 Eric Blake <ebb9@byu.net>
995 * AUTHORS: Simplify, to match libtool and autoconf layout.
996 * THANKS: Sync with head.
998 2007-08-10 Eric Blake <ebb9@byu.net>
1000 * doc/m4.texinfo (Compatibility): Sync with head.
1002 2007-08-10 Konrad Schwarz <konrad.schwarz@siemens.com> (tiny change)
1003 and Eric Blake <ebb9@byu.net>
1005 * doc/m4.texinfo (Defn): Update wording.
1007 2007-08-09 Eric Blake <ebb9@byu.net>
1009 POSIX requires defn(`a',`b') to concatenate definitions.
1010 * src/builtin.c (m4_defn): Allow multiple arguments, but warn if
1011 trying to mix a builtin with anything else.
1012 * doc/m4.texinfo (Defn): Document a use for this POSIX
1014 (Incompatibilities): Update to match current status.
1015 * NEWS: Document this change.
1017 Reported by Konrad Schwarz.
1019 2007-08-04 Eric Blake <ebb9@byu.net>
1021 Normalize all GPL license notices.
1022 * GNUmakefile: Update license wording.
1023 * Makefile.am: Likewise.
1024 * Makefile.maint: Likewise.
1025 * bootstrap: Likewise.
1027 * configure.ac: Likewise.
1028 * checks/Makefile.in: Likewise.
1029 * doc/Makefile.am: Likewise.
1030 * examples/Makefile.am: Likewise.
1031 * src/Makefile.am: Likewise.
1032 * src/builtin.c: Likewise.
1033 * src/debug.c: Likewise.
1034 * src/eval.c: Likewise.
1035 * src/format.c: Likewise.
1036 * src/freeze.c: Likewise.
1037 * src/input.c: Likewise.
1038 * src/m4.c: Likewise.
1039 * src/m4.h: Likewise.
1040 * src/macro.c: Likewise.
1041 * src/output.c: Likewise.
1042 * src/path.c: Likewise.
1043 * src/stackovf.c: Likewise.
1044 * src/symtab.c: Likewise.
1046 2007-07-21 Eric Blake <ebb9@byu.net>
1048 Fix regression on NetBSD from 2007-05-28.
1049 * src/output.c (m4_tmpopen): Explicitly reset append-mode stream
1051 * NEWS: Document this fix.
1053 Reported by Thomas Klausner.
1055 2007-07-20 Eric Blake <ebb9@byu.net>
1057 Fix 'make distcheck' issues.
1058 * Makefile.am (EXTRA_DIST): No need to distribute
1059 gpl-3.0.texi.diff anymore.
1060 * m4/gnulib-cache.m4: Update to latest gnulib.
1062 2007-07-14 Eric Blake <ebb9@byu.net>
1064 Reflect upstream license .texi changes.
1065 * doc/m4.texinfo (Copying): Rename node...
1066 (GNU General Public License): ...to this.
1067 (GNU Free Documentation License): Adjust node location.
1068 * local/doc/gpl-3.0.texi.diff: Remove file.
1070 2007-07-10 Eric Blake <ebb9@byu.net>
1073 * configure.ac (AC_INIT): Bump version number.
1074 * NEWS: Start changes since 1.4.10.
1075 * doc/m4.texinfo (History): Mention 1.4.11.
1076 (Copying This Package, Copying This Manual): Add index entries.
1077 * local/lib/version-etc.c.diff: Delete, now that gnulib has been
1079 * Makefile.am (EXTRA_DIST): Remove dead file.
1081 2007-07-09 Eric Blake <ebb9@byu.net>
1083 Release Version 1.4.10.
1084 * doc/Makefile.am (m4_TEXINFOS): Distribute gpl-3.0.texi.
1085 * Makefile.am (EXTRA_DIST): Distribute gnulib diffs.
1086 * configure.ac (AC_INIT): Bump version number.
1087 * NEWS: Describe changes since 1.4.9.
1089 * src/format.c: Missed a GPLv3 conversion.
1091 Avoid undefined behavior of %.*c in printf.
1092 * src/format.c (format): Special case %c.
1093 * TODO: Document that more remains to be done.
1094 * NEWS: Document the fix.
1096 2007-07-05 Eric Blake <ebb9@byu.net>
1098 Fix up gnulib-tool usage.
1099 * m4/gnulib-cache.m4: Change local-dir to local, not `.'.
1100 * version-etc.c.diff: Move to...
1101 * local/lib/version-etc.c.diff: ...here.
1102 * gpl-3.0.texi.diff: Move to...
1103 * local/doc/gpl-3.0.texi.diff: ...here.
1105 2007-07-04 Eric Blake <ebb9@byu.net>
1107 Upgrade to GPL version 3 or later.
1108 * bootstrap: Pick up GPLv3.
1109 * m4/gnulib-cache.m4: Augment with 'gnulib-tool
1110 --local-dir=. --import gpl-3.0'.
1111 * doc/m4.texinfo (Copying This Package): New appendix.
1112 * NEWS: Mention this change.
1113 * README: Mention why some files still claim to be version 2.
1114 * version-etc.c.diff: New file, to make sure --version claims
1115 correct GPL version. Temporary until gnulib makes move.
1116 * gpl-3.0.texi.diff: New file, to allow inclusion of GPLv3 as
1117 appendix, rather than section, of the manual.
1118 * GNUmakefile: Update to new license.
1119 * Makefile.am: Likewise.
1120 * Makefile.maint: Likewise.
1122 * configure.ac: Likewise.
1123 * checks/Makefile.in: Likewise.
1124 * doc/Makefile.am: Likewise.
1125 * examples/Makefile.am: Likewise.
1126 * src/Makefile.am: Likewise.
1127 * src/builtin.c: Likewise.
1128 * src/debug.c: Likewise.
1129 * src/eval.c: Likewise.
1130 * src/freeze.c: Likewise.
1131 * src/input.c: Likewise.
1132 * src/m4.c: Likewise.
1133 * src/m4.h: Likewise.
1134 * src/macro.c: Likewise.
1135 * src/output.c: Likewise.
1136 * src/path.c: Likewise.
1137 * src/stackovf.c: Likewise.
1138 * src/symtab.c: Likewise.
1140 2007-06-26 Eric Blake <ebb9@byu.net>
1142 * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import assert'.
1144 2007-06-26 Karl Berry <karl@freefriends.org> (tiny change)
1146 Match Free Software Directory categories.
1147 * doc/m4.texinfo (dircategory): Update.
1149 2007-05-31 Eric Blake <ebb9@byu.net>
1151 * src/output.c (output_text): Fix regression from 2007-05-28.
1152 * doc/m4.texinfo (History): Mention 1.4.10.
1153 (Format): Make testsuite output easier to debug.
1155 2007-05-29 Eric Blake <ebb9@byu.net>
1158 * configure.ac (AC_INIT): Bump version number.
1159 * NEWS: Start changes since 1.4.9b, and fix typo.
1161 Beta Release Version 1.4.9b.
1162 * configure.ac (AC_INIT): Bump version number.
1163 * NEWS: Describe changes since 1.4.9.
1165 Improve format support.
1166 * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
1168 * src/format.c (format): Parse %'hhd, %a, %A. Avoid calling
1169 printf with too few arguments, as in format(%*.*d,-1,-1,1).
1170 * doc/m4.texinfo (Format): Expand tests, and improve
1172 * NEWS: Document this change.
1174 2007-05-28 Eric Blake <ebb9@byu.net>
1176 Fix large diversion corner cases, including 1.4.8 regression.
1177 * src/output.c (m4_tmpfile, m4_tmpopen): Simplify use of errno.
1178 (make_room_for): Use NULL, not 0, for pointers.
1179 (insert_diversion_helper): Avoid using rewind.
1180 (freeze_diversions): Allow freezing large diversions.
1181 * NEWS: Document this fix.
1183 Also run gnulib unit tests during make check.
1184 * m4/gnulib-cache.m4: Augment with 'gnulib-tool
1185 --tests-base=tests --with-tests'.
1186 * configure.ac (AC_CONFIG_FILES): Build gnulib testdir.
1187 * Makefile.am (SUBDIRS): Run gnulib tests before ours.
1189 2007-05-25 Eric Blake <ebb9@byu.net>
1191 Backport prompts in examples from head.
1192 * src/macro.c (expand_macro): Shorten message.
1193 * doc/m4.texinfo (Manual, Command line files, Comments)
1194 (Inhibiting Invocation, Macro Arguments, Macro expansion, Indir)
1195 (Builtin, Shift, Forloop, Foreach, Dumpdef, Trace, Debug Levels)
1196 (Debug Output, Include, Format, Syscmd, Mkstemp, Location)
1197 (Using frozen files, Improved forloop, Improved foreach): Add
1198 prompts to examples.
1199 * checks/get-them: Ignore prompts in examples.
1201 Fix sync line interaction with multiline comments.
1202 * doc/m4.texinfo (Other Incompatibilities): Add example, and
1203 document bug in --syncline/divert interaction.
1204 (Preprocessor features): Augment test.
1205 * src/m4.h (output_text): Export.
1206 (shipout_text, next_token): Add parameter.
1207 * src/freeze.c (reload_frozen_state): Don't interfere with
1208 synclines when reloading state.
1209 * src/output.c (output_text): Export.
1210 (shipout_text): Take new parameter for start line of token.
1211 Output at most one syncline per token.
1212 * src/input.c (next_token): Report line where multiline tokens
1214 * src/macro.c (expand_input, expand_token, expand_argument):
1215 Adjust callers so that line is passed from input to output.
1216 * NEWS: Document this fix.
1217 Reported by Sergey Poznyakoff.
1219 Test -s in testsuite.
1220 * doc/m4.texinfo (Preprocessor features): Add a test.
1221 * checks/get-them: Support extra options in testsuite.
1222 * checks/check-them (examples): Use extra options.
1224 Reported by Sergey Poznyakoff.
1226 2007-05-24 Eric Blake <ebb9@byu.net>
1228 Support POSIX flush semantics on all platforms.
1229 * m4/gnulib-cache.m4: Remove closeout, and augment with
1230 'gnulib-tool --import closein fflush'.
1231 * src/m4.h (includes): Use closein, not closeout.
1232 * src/m4.c (main): Ensure stdin is flushed when not all input is
1234 (process_file): No return needed.
1235 * src/debug.c (debug_flush_files): Rely on gnulib module, rather
1236 than excluding mingw.
1237 * NEWS: Document this change.
1239 Work around cygwin and mingw fseeko bugs.
1240 * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import fseeko'.
1241 * src/debug.c (debug_flush_files): Prefer fseeko over fseek.
1243 2007-04-25 Eric Blake <ebb9@byu.net>
1245 Fix negative division within eval, regression of 2007-01-06.
1246 * doc/m4.texinfo (Eval): Catch this bug.
1247 * src/eval.c (mult_term): Fix it.
1248 * NEWS: Document this.
1250 Reported by Cesar Strauss.
1252 2007-04-23 Eric Blake <ebb9@byu.net>
1255 * configure.ac (AC_INIT): Bump version number.
1256 * NEWS: Start changes since 1.4.9.
1258 2007-03-23 Eric Blake <ebb9@byu.net>
1261 * configure.ac (AC_INIT): Bump version number.
1262 * NEWS: Describe changes since 1.4.8b.
1264 2007-03-16 Eric Blake <ebb9@byu.net>
1266 * doc/m4.texinfo (Mkstemp): Tweak wording.
1267 * src/output.c (output_init): Adjust to latest gnulib.
1269 2007-03-15 Eric Blake <ebb9@byu.net>
1271 Avoid Tandem/NSK's broken long long (without a symmetric unsigned
1272 long long, it confuses gnulib).
1273 * configure.ac (AC_TYPE_LONG_LONG_INT): Declare long long broken
1274 if unsigned long long doesn't work.
1276 Reported by Matthew Woehlke.
1278 2007-03-07 Eric Blake <ebb9@byu.net>
1281 * doc/m4.texinfo: Minor tweaks, avoid makeinfo warning.
1283 2007-03-01 Eric Blake <ebb9@byu.net>
1285 * doc/m4.texinfo: Pick up more index entries from head. Follow
1286 more texinfo recommendations.
1287 (Sysval): Improve tests.
1289 Avoid overfull \vbox warning from texinfo, due to indices that
1290 weren't quite big enough to split across page boundaries.
1291 * doc/m4.texinfo: Add lots of concept index entries.
1292 (Concept Index): Move to be last, as recommended by texinfo
1294 (Define, Arguments, Pseudo Arguments): Add more function entries.
1296 2007-02-28 Eric Blake <ebb9@byu.net>
1298 * doc/m4.texinfo (Eval): Clean up wording to reflext POSIX XCU ERN
1300 (Pseudo Arguments): Add useful example.
1302 * doc/m4.texinfo (Pushdef, Incompatibilities): Clean up wording to
1303 reflect POSIX XCU ERN 118.
1305 * src/m4.h (DEFAULT_MACRO_SEQUENCE): Factor out from...
1306 * src/m4.c (usage): ...here,...
1307 * src/builtin.c (set_macro_sequence): ...and here.
1308 (define_user_macro): Fix typo.
1309 * doc/m4.texinfo (Preprocessor features, Arguments): Fix minor
1311 (Shift): Document composite macro argn for portably getting at
1312 positional parameters beyond 9.
1313 * configure.ac (AC_INIT): Bump version number.
1314 * NEWS: Start changes of 1.4.8c.
1316 2007-02-24 Eric Blake <ebb9@byu.net>
1318 Beta Release 1.4.8b:
1319 * configure.ac (AC_INIT): Bump version number.
1320 * NEWS: Describe changes since 1.4.8.
1322 Reserve all uses of raw ${} in macro definitions, not just
1324 * src/builtin.c (set_macro_sequence): Change default macro
1326 * doc/m4.texinfo (Operation modes): Update to match.
1327 * src/m4.c (usage): Likewise.
1330 2007-02-23 Eric Blake <ebb9@byu.net>
1332 * src/m4.h (includes): Update to latest gnulib.
1334 2007-02-08 Eric Blake <ebb9@byu.net>
1336 Rename --warn-syntax to --warn-macro-sequence[=regex], to make it
1337 more flexible, and so that autoconf can use it.
1338 * src/m4.h (set_macro_sequence, free_macro_sequence): New
1340 * src/builtin.c (macro_sequence_buf, macro_sequence_regs)
1341 (macro_sequence_inuse, set_macro_sequence, free_macro_sequence):
1342 New variables and functions.
1343 (define_user_macro): Allow flexibility in regular expression used
1345 * src/m4.c (warn_syntax): Delete.
1346 (usage, WARN_MACRO_SEQUENCE_OPTION, main): Implement changed
1347 spelling of option, along with optional argument.
1348 * doc/m4.texinfo (Operation modes, Arguments): Document this
1350 * NEWS: Document this change.
1352 2007-02-05 Eric Blake <ebb9@byu.net>
1354 * m4/gnulib-cache.m4: Module strstr no longer exists.
1356 Avoid bool bitfields, as they don't work on AIX.
1357 * src/m4.h (bool_bitfield): New typedef.
1358 (struct symbol, struct builtin): Use it.
1359 * src/input.c (struct input_block): Likewise.
1360 Reported by Albert Chin.
1362 * doc/m4.texinfo (Sysval): Avoid SIGPIPE in test as unreliable.
1363 Reported by Albert Chin.
1366 2006-06-18 Bruno Haible <bruno@clisp.org> (tiny change)
1368 * doc/m4.texinfo (Input processing): Further clarifications.
1370 2007-02-03 Eric Blake <ebb9@byu.net>
1372 * doc/m4.texinfo (Input processing, Quoting Arguments): Beef up
1374 Reported by Bruno Haible.
1376 2007-02-01 Eric Blake <ebb9@byu.net>
1378 * src/m4.c (fatal_warnings): New variable.
1379 (usage): Document new -E behavior.
1380 (main): Make -E an additive option.
1381 (m4_error, m4_error_at_line): Change exit status when required.
1382 * NEWS: Document this change.
1383 * doc/m4.texinfo (Operation modes): Likewise.
1384 Reported by Ralf Wildenhues.
1386 2007-01-27 Eric Blake <ebb9@byu.net>
1388 * src/m4.h (warn_syntax): Declare.
1389 (init_pattern_buffer): Export.
1390 * src/m4.c (warn_syntax, usage, WARN_SYNTAX_OPTIONS)
1391 (long_options, main): Implement new option.
1392 * src/builtin.c (init_pattern_buffer): Allow NULL regs argument.
1393 (define_user_macro): Warn on $11 and ${1} if requested.
1394 * src/input.c (init_pattern_buffer): Delete duplicate method.
1395 * doc/m4.texinfo (Operation modes): Document it.
1396 (Arguments): Document future direction of ${11} vs. $11.
1397 (Incompatibilities): Fix wording on POSIX limitations.
1398 * checks/get-them: Parse @{ and @} correctly.
1399 * NEWS: Document this change.
1401 2007-01-26 Eric Blake <ebb9@byu.net>
1403 * src/builtin.c (includes): Adjust to gnulib changes.
1405 2007-01-15 Eric Blake <ebb9@byu.net>
1407 * doc/m4.texinfo: Pull in various improvements from head.
1408 * src/builtin.c (include): Alter exit status on failure.
1409 * NEWS: Document this fix.
1411 2007-01-13 Eric Blake <ebb9@byu.net>
1413 * configure.ac (AC_CHECK_MEMBERS): Check for stack_t.ss_sp, and
1414 assume the fallback of ss_base for BSDI 4.0.1.
1415 * src/stackovf.c (setup_stackovf_trap) [HAVE_SIGALTSTACK &&
1416 ! HAVE_STACK_T_SS_SP]: Use this check.
1417 Reported by Chris McGuire.
1419 * NEWS: Document the improvement.
1421 2007-01-09 Eric Blake <ebb9@byu.net>
1423 * src/eval.c (ASSIGN): New enumerator.
1424 (eval_lex): Recognize '='.
1425 (equality_term): Treat '=' like '==', but warn that it is
1427 * doc/m4.texinfo (Eval): Document and test this.
1428 (Incompatibilities): Document the POSIX incompatibility.
1429 * NEWS: Document this change.
1431 2007-01-06 Eric Blake <ebb9@byu.net>
1433 * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import stdint'.
1434 * checks/check-them: Record expected exit status.
1435 * checks/get-them: Check exit status.
1436 * src/m4.h (eval_t, unsigned_eval_t): Delete, use POSIX int32_t
1438 * src/builtin.c: All users changed.
1439 * src/eval.c: Likewise. Also document where we are triggering
1440 undefined or implementation-defined behavior.
1441 (BADOP, NEGATIVE_EXPONENT, INVALID_OPERATOR, eval_lex, evaluate)
1442 (logical_or_term, logical_and_term, logical_not_term, not_term)
1443 (equality_term, unary_term): Port from head to follow POSIX
1445 (exp_term): Reject 0**0 as undefined.
1446 * doc/m4.texinfo (History): Mention 1.4.9.
1447 (Format, Incompatibilities): Update to document POSIX compliance.
1448 * NEWS: Document this change.
1450 2007-01-04 Eric Blake <ebb9@byu.net>
1452 * NEWS: Document previous fix.
1455 2007-01-04 Sami Liedes <sliedes@cc.hut.fi> (tiny change)
1457 Fix Debian bug 405594, introduced 2006-11-01 from a bad
1458 copy-n-paste from head.
1459 * src/m4.c (main): Use correct file name after --.
1461 2007-01-04 Eric Blake <ebb9@byu.net>
1463 Fix regression from 1.4.7 in large file handling on some
1464 platforms, introduced on 2006-10-13.
1465 * configure.ac (AC_LARGE_SYSFILE): Guarantee that large files
1467 * NEWS: Document this fix.
1469 2007-01-03 Eric Blake <ebb9@byu.net>
1471 * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
1473 * src/m4.c (AUTHORS, main): Use FSF wording for --version (plus
1474 it bumps the copyright year).
1476 2006-12-27 Eric Blake <ebb9@byu.net>
1478 * doc/m4.texinfo (Patsubst): Fix typo.
1480 2006-12-16 Eric Blake <ebb9@byu.net>
1482 * src/m4.c (main): Check for errors when closing stdin.
1484 2006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1486 * doc/m4.texinfo: Fix some typos.
1488 2006-12-09 Eric Blake <ebb9@byu.net>
1490 * configure.ac (AC_INIT): Bump version number.
1491 * NEWS: Start changes of 1.4.8a.
1493 2006-11-20 Eric Blake <ebb9@byu.net>
1496 * configure.ac (AC_INIT): Bump version number.
1497 * NEWS: Describe changes since 1.4.7.
1499 2006-11-16 Eric Blake <ebb9@byu.net>
1501 * doc/m4.texinfo (Include, Search Path, Diversions, Divert):
1502 Minor tweaks noticed while porting to head.
1504 2006-11-14 Eric Blake <ebb9@byu.net>
1506 * src/output.c (cleanup_tmpfile, freeze_diversions): Clean up
1508 (m4_tmpname): Avoid memory leak.
1510 2006-11-13 Eric Blake <ebb9@byu.net>
1512 * src/output.c (cleanup_tmpfile): Avoid double error message when
1513 umask is prohibitive.
1514 (m4_tmpname, m4_tmpopen, m4_tmpclose, m4_tmpremove): New
1516 (m4_tmpfile): Add parameter, move cloexec action here.
1517 (make_room_for): Adjust caller. Don't keep too many files open.
1518 (insert_diversion_helper): Unlink emptied temp files.
1519 (make_diversion): Don't keep too many files open.
1520 * doc/m4.texinfo (Diversions): Tweak wording, now that open file
1521 descriptors are no longer a limiting factor.
1522 * NEWS: Document this change.
1524 Backport sparse diversion handling from head.
1525 * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
1527 * src/output.c (struct m4_diversion): Rename from struct
1528 diversion, and update members. All users changed.
1529 (diversion_table): Change to an ordered set, instead of an array.
1530 (div0): New storage for diversion 0.
1531 (diversions): No longer needed.
1532 (free_list): New list to allow recycling diversion storage.
1533 (diversion_storage): New storage to reduce malloc overhead.
1534 (cmp_diversion_CB, threshold_diversion_CB): New callbacks.
1535 (output_init, output_exit, cleanup_tmpfile, make_room_for)
1536 (make_diversion): Handle new diversion storage scheme.
1537 (insert_diversion_helper): New function.
1538 (insert_diversion, undivert_all, freeze_diversions): Use it.
1539 * doc/m4.texinfo (Divert, Diversions): Move hidden test of memory
1540 exhaustion to visible test of large diversion numbers.
1541 * NEWS: Document this fix.
1543 2006-11-11 Eric Blake <ebb9@byu.net>
1545 * src/builtin.c (m4_translit): Slight optimization.
1547 * src/m4.h (to_uchar): Depend on HAVE_INLINE.
1549 * src/builtin.c: Remove unnecessary casts.
1550 (expand_ranges): Make 8-bit clean.
1551 * doc/m4.texinfo (Translit): Add tests and wording.
1552 * NEWS: Document this fix.
1554 2006-11-07 Eric Blake <ebb9@byu.net>
1556 * src/m4.h (output_exit): New prototype.
1557 * src/m4.c (main): Use it.
1558 * src/output.c (cleanup_tmpfile): Close files before removing
1560 (insert_diversion): Check for failure.
1561 (output_exit): Avoid memory leak.
1562 * doc/m4.texinfo (Diversions): Test this bug.
1564 * doc/m4.texinfo (Esyscmd, Errprint): Minor touchups.
1566 2006-11-01 Eric Blake <ebb9@byu.net>
1568 Allow C++ compilation on Linux, as a safety measure in type
1570 * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
1572 * src/m4.h (hack_symbol, hack_all_symbols): Use full prototype.
1573 (boolean): Kill this, and use stdbool.h instead.
1574 * src/debug.c, src/eval.c, src/input.c, src/macro.c, src/m4.c:
1575 * src/output.c, src/symtab.c: All users changed.
1576 * src/symtab.c (hack_all_symbols): Update prototype.
1577 * src/builtin.c (dump_symbol, set_trace): Update signature.
1578 (m4_dumpdef, m4_traceon, m4_traceoff): Update callers.
1579 (mkstemp_helper, m4_m4wrap, expand_ranges, m4_translit): Allow
1581 * src/debug.c (trace_flush): Likewise.
1582 * src/freeze.c (reload_frozen_state): Likewise.
1583 * src/input.c (push_file, push_string_finish, push_wrapup):
1584 (token_bottom, next_token): Likewise.
1585 * src/m4.c (main): Likewise.
1587 * doc/m4.texinfo (Invoking m4): Update according to POSIX 200x
1589 * src/m4.h (m4_path_search): Tweak signature.
1590 * src/path.c (m4_path_search): Likewise.
1591 * src/builtin.c (include): Update caller.
1592 * src/m4.c (main): Allow -D, -U, -t, and -s to be interspersed
1593 with file names. Don't write to **argv.
1594 (process_file): New helper method.
1595 * NEWS: Document this fix.
1597 2006-10-31 Eric Blake <ebb9@byu.net>
1599 * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import strstr'.
1600 * doc/m4.texinfo (Translit): Improve the documentation.
1601 * src/builtin.c (m4_translit): Optimize to O(n) instead of O(n^2)
1603 (m4_index): Simplify, and speed up slightly.
1604 * NEWS: Document this fix.
1606 2006-10-28 Eric Blake <ebb9@byu.net>
1608 * src/input.c (set_quotes): Don't allow empty end-quote with
1609 non-empty start-quote.
1610 (set_comment): Likewise for end-comment.
1611 * src/builtin.c (m4_changecom): Adjust caller.
1612 * doc/m4.texinfo (Changequote, Changecom): Update documentation to
1614 (Incompatibilities): Document another POSIX bug.
1615 * NEWS: Mention this change.
1617 2006-10-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1619 * examples/Makefile.am (EXTRA_DIST): Distribute recently-added
1622 2006-10-26 Eric Blake <ebb9@byu.net>
1624 Silence -Wwrite-strings -Wpointer-arith warnings.
1625 * src/builtin.c (define_user_macro): Allow NULL argument.
1626 (m4_builtin, m4_indir): Cast away const of "".
1627 * src/format.c (format): Likewise.
1628 * src/macro.c (collect_arguments): Likewise.
1629 (expand_macro): Avoid math on void*.
1630 * src/m4.c (main): Adjust caller.
1631 * src/output.c (freeze_diversions): Detect off_t overflow.
1633 * src/input.c (pop_input): Remove unnecessary code.
1635 2006-10-25 Eric Blake <ebb9@byu.net>
1637 * src/symtab.c (symtab_init): Avoid size_t overflow.
1638 * src/output.c (make_diversion): Avoid size_t overflow.
1639 * doc/m4.texinfo (Diversions): Test this fix.
1640 * src/input.c (input_block): Remove unused member. Reduce size
1642 (push_file, pop_input): Avoid useless assignment.
1643 * NEWS: Document the bug fix.
1645 Redo location tracking. Instead of having just files track the
1646 line to return to when popping input, now all input blocks track
1648 * src/input.c (INPUT_STRING_WRAP, INPUT_FILE_INIT): No longer
1650 (input_block): Have line and file storage for all input types, and
1651 rename some members.
1652 (input_change): New global flag.
1653 (push_file, push_macro, push_string_init, push_wrapup): Store
1655 (push_string_finish, pop_input, pop_wrapup): Notice changes in
1657 (peek_input): Adjust to new member names.
1658 (next_char, next_char1): Adjust location if needed.
1659 (skip_line): Simplify restoring location.
1660 * doc/m4.texinfo (Location): Augment the test to catch line
1661 location of expansion of multi-line arguments.
1662 Reported by Stepan Kasal.
1664 2006-10-23 Eric Blake <ebb9@byu.net>
1666 * doc/m4.texinfo (Macro Arguments): Document that leading space
1667 in argument collection stops at macro expansion.
1668 (Incompatibilities): Document POSIX whitespace wording issue.
1670 2006-10-20 Eric Blake <ebb9@byu.net>
1672 * doc/m4.texinfo: Trailing '@comment' doesn't format nicely in
1673 TeX, so recognize '@w{ }' instead. Likewise, @code{_name} at the
1674 end of a TeX line splits incorrectly.
1675 (Foreach, Improved foreach): Write these sections, borrowing ideas
1676 from CVS head and from m4sugar.
1677 * checks/get-them: Accomodate new way to show trailing space in
1679 * examples/foreach.m4: Make usable in documentation.
1680 * examples/foreachq.m4: New file.
1681 * examples/foreachq2.m4: New file.
1682 * examples/foreach2.m4: New file.
1683 * NEWS: Document the documentation updates.
1685 2006-10-19 Eric Blake <ebb9@byu.net>
1687 * src/builtin.c (mkstemp_helper, m4_mkstemp): New functions.
1688 (m4_maketemp): Provide traditional behavior.
1689 * doc/m4.texinfo (Mkstemp): Rename from Maketemp. Document the
1690 new `mkstemp' macro and the flaws of the old `maketemp'.
1691 (Incompatibilities): Move maketemp discussion to...
1692 (Extensions): ...here, since -G now supresses the GNU extension.
1693 * NEWS: Document this.
1695 * examples/forloop.m4: Simplify.
1696 * examples/forloop2.m4: New file.
1697 * examples/quote.m4: New file.
1698 * doc/m4.texinfo (Loops): Rename to...
1699 (Shift): ...this node.
1700 (Forloop, Foreach, Improved forloop, Improved foreach): New
1703 2006-10-17 Eric Blake <ebb9@byu.net>
1705 * m4/gnulib-cache.m4: Update with 'gnulib-tool --import
1707 * configure.ac (AC_CONFIG_HEADERS): Create config.h alongside
1708 gnulib headers, rather than in top directory.
1709 * src/Makefile.am (AUTOMAKE_OPTIONS): Add nostdinc, to reduce make
1712 2006-10-16 Eric Blake <ebb9@byu.net>
1714 * doc/m4.texinfo: Backport some minor cleanups from head.
1715 (Cleardivert): Rename from cleardiv.
1717 * doc/m4.texinfo (Invoking m4): Promote to a chapter, instead of
1718 a section of Preliminaries.
1719 (Operation modes, Preprocessor features, Limits control)
1720 (Frozen state, Debugging options, Command line files): Subdivide
1722 (Input processing, Quoting Arguments, Define, Arguments)
1723 (Cleardiv, Format, M4exit): Fix grammar of references.
1724 (Inhibiting Invocation, Macro Arguments, Builtin, Trace)
1725 (Debug Levels, Debug Output, Include, Search Path, Divert)
1726 (Platform macros, Syscmd, Location, Extensions): Point to new
1728 (Top, Loops, Include, Undivert, Location, Incompatibilities):
1729 Improve file references.
1731 2006-10-14 Eric Blake <ebb9@byu.net>
1733 * m4/input.c (file_clean): Don't close stdin twice, POSIX says it
1735 Reported by Ralf Wildenhues.
1737 * src/builtin.c (m4_undivert): Check for read error.
1739 2006-10-13 Eric Blake <ebb9@byu.net>
1741 * src/m4.h (UNIX, W32_NATIVE, OS2): Move platform checks after
1742 header files are included, since <unistd.h> can affect the tests.
1744 Reported by Martin Koeppe.
1746 Backport head's usage of clean-temp module, as it is cleaner than
1747 using tmpfile-safer.
1748 * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
1749 clean-temp closeout', and remove tmpfile-safer.
1750 * src/m4.h (includes): Adjust.
1751 (m4_path_search): Rename from path_search, to avoid collision
1753 * src/m4.c (main): Install closeout handler. Adjust caller.
1754 (usage): Now done by closeout module.
1755 * src/builtin.c (m4_m4exit): Likewise.
1756 (m4_undivert, include): Adjust callers.
1757 * src/freeze.c (reload_frozen_state): Likewise.
1758 * src/path.c (m4_path_search): Rename from path_search.
1759 * src/output.c (output_temp_dir): New variable.
1760 (cleanup_tmpfile, m4_tmpfile): New functions, from head.
1761 (insert_diversion, make_room_for): Use them.
1762 * doc/m4.texinfo (Diversions): Document this, and add a test.
1763 (Improved fatal_error): Fix typo.
1764 (Maketemp): Port test to mingw, and no longer hide from
1766 * NEWS: Document the change in TMPDIR behavior.
1768 * configure.ac (m4_pattern_forbid): Narrow the range of forbidden
1769 macros, to work with recent gnulib-tool update.
1771 * src/builtin.c (m4_builtin, m4_indir): Allow transparent
1772 handling of defn results.
1773 * doc/m4.texinfo (Builtin, Indir): Add test cases.
1774 * NEWS: Document this.
1776 2006-10-12 Eric Blake <ebb9@byu.net>
1778 * doc/m4.texinfo (Location): Fix typo in previous commit.
1779 (Changeword): Catch one more case.
1780 * src/input.c (skip_line): Fix case when outer file used macro to
1783 2006-10-11 Eric Blake <ebb9@byu.net>
1785 * src/input.c (enum input_type): Add additional types, to shave
1786 time off the common case.
1787 (push_wrapup): Wrapped strings remember location.
1788 (push_string_finish): Normal strings carry no location.
1789 (push_file): Start new files uninitialized.
1790 (peek_input, next_char_1): Optimize common cases by updating
1791 location only on new input types.
1792 (pop_input): Update to honor new input types.
1793 (skip_line, push_string_finish): Fix regression in previous patch
1794 when dnl is not followed by newline in included file.
1795 (push_string_init): Initialize all fields of INPUT_STRING sooner.
1796 (peek_token): Simplify.
1797 (peek_input): Don't pop input files on peek, so that __file__ and
1798 __line__ as last token of include file work correctly.
1799 * doc/m4.texinfo (History): Mention 1.4.8.
1800 (Answers): Split into sections, one per answer.
1801 (Improved exch, Improved cleardivert, Improved fatal_error): New
1803 (Dnl, M4wrap, Location, M4exit, Improved fatal_error): Update to
1804 new m4wrap location semantics.
1805 (Changeword): Add test that caught the regression.
1806 * NEWS: Document this.
1808 * src/macro.c (expand_macro): In macro expansion errors, report
1809 line number at open parenthesis.
1810 * src/input.c (next_token): Fix off-by-one bug in reporting end
1811 of file in unterminated comment and string.
1812 (file_names): New obstack, necessary since expand_macro now hangs
1813 on to file names longer than the files remain open.
1814 (input_init): Initialize new obstack.
1815 (push_file): Use new obstack. Delay updates to current_file
1816 until after expand_macro has restored state.
1817 (peek_input, next_char_1): Update current_file if necessary.
1818 (pop_wrapup): Release memory.
1819 * doc/m4.texinfo (Macro Arguments, Changequote, Changecom): Catch
1821 (Dnl): Update to the new location reporting rules.
1822 * NEWS: Document these changes.
1824 2006-10-10 Eric Blake <ebb9@byu.net>
1826 * src/macro.c (argc_stack, argv_stack): New variables for sharing
1827 obstacks across multiple macro calls.
1828 (expand_input): Initialize and tear down stack once per input
1829 file, instead of once per macro.
1830 (expand_macro): Reuse existing stacks when possible.
1831 (collect_arguments): Simplify slightly.
1833 * src/path.c (include_env_init): Fix botched patch application.
1834 Reported by Ralf Wildenhues.
1836 2006-10-09 Eric Blake <ebb9@byu.net>
1838 * src/m4.c (usage, main): Detect write failures to stderr.
1839 * src/builtin.c (m4_m4exit): Likewise.
1840 * NEWS: Document this.
1842 * src/macro.c (expand_macro): Allow --nesting-limit=0 to remove
1844 * NEWS: Document this.
1845 * doc/m4.texinfo (Invoking m4): Likewise.
1847 2006-10-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1849 * src/path.c (include_env_init): Copy the string returned
1850 by getenv before overwriting it; POSIX disallows this.
1852 2006-10-09 Eric Blake <ebb9@byu.net>
1854 * src/m4.c (main): Defer debugfile until after --help.
1855 * configure.ac (AC_INIT): Bump version number.
1856 * NEWS: Start changes of 1.4.7a.
1858 2006-09-25 Eric Blake <ebb9@byu.net>
1861 * configure.ac (AC_INIT): Bump version number.
1862 * NEWS: Describe changes since 1.4.6.
1864 2006-09-21 Eric Blake <ebb9@byu.net>
1866 * doc/m4.texinfo (Invoking m4): Add clarification on option
1867 processing behavior.
1869 Reported by Mikhail Teterin.
1871 * bootstrap: Add --force option, based on idea from coreutils.
1872 * README: Document that ./bootstrap and autoreconf are for
1873 developers, and not lightly done in tarballs.
1875 2006-09-20 Eric Blake <ebb9@byu.net>
1877 * src/m4.c (usage, OPTSTRING, main): Rename -e to -i, and give
1878 deprecation warning on -e.
1879 * doc/m4.texinfo (Invoking m4, Extensions): Document this.
1880 * NEWS: Document this.
1882 2006-09-19 Eric Blake <ebb9@byu.net>
1884 * src/m4.c (usage, long_options, main, DEBUGFILE_OPTION): Rename
1885 -o/--error-output to --debugfile, and deprecate the former. This
1886 will allow a future release to be more consistent with other GNU
1887 tools, with -o/--output affecting stdout, not debug.
1888 * doc/m4.texinfo (Invoking m4, Debug Output): Document this.
1889 * NEWS: Document this.
1891 2006-09-14 Eric Blake <ebb9@byu.net>
1893 * src/m4.c (main): Warn on deprecated options -B, -S, -T, -N,
1894 --diversions. `m4 --help --version' now displays help, not
1896 (interactive, frozen_file_to_read, frozen_file_to_write): Move to
1898 (show_help, show_version): No longer needed.
1899 (long_options, DIVERSIONS_OPTION): Backport patch from head to
1900 distinguish between -N and --diversions in warning.
1901 * doc/m4.texinfo (Invoking m4): Document this.
1904 2006-09-11 Eric Blake <ebb9@byu.net>
1906 * src/Makefile.am (m4_LDADD): Add any gnulib dependent libraries.
1907 * src/debug.c (debug_flush_files) [UNIX]: Flush stdin if it is
1909 (debug_set_file): Use STDOUT_FILENO.
1910 * src/builtin.c (m4_m4exit): Flush stdin before exiting, to comply
1911 with POSIX in regards to unread input.
1912 * NEWS: Document this fix.
1913 * doc/m4.texinfo (Syscmd, Esyscmd, M4exit): Likewise.
1915 2006-09-07 Eric Blake <ebb9@byu.net>
1917 * m4/gnulib-cache.m4: Update to newer gnulib-tool.
1918 * src/m4.h (push_file): Change prototype.
1919 * src/input.c (push_file, peek_input, next_char_1): Only call getc
1920 once at EOF, to avoid double ^D on terminal stdin; regression from
1922 (push_file, pop_file): Allow reading stdin twice.
1923 * src/m4.c (main): Likewise.
1924 * src/builtin.c (include): Update caller.
1925 * NEWS: Document this change.
1926 * doc/m4.texinfo (Invoking m4, Incompatibilities): Likewise.
1927 (Syscmd): Add a test that failed before this patch.
1929 2006-09-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1931 * checks/check-them: Quote $pwd.
1933 2006-09-05 Eric Blake <ebb9@byu.net>
1935 * src/builtin.c (define_macro): Warn on invalid macro name.
1936 * NEWS: Document this change.
1937 * doc/m4.texinfo: Fix typos.
1938 (Invoking m4, Macro Arguments, Pseudo Arguments, Defn, Indir)
1939 (Ifelse): Backport some improvements from head.
1941 2006-09-04 Eric Blake <ebb9@byu.net>
1943 * doc/m4.texinfo (Changeword): Skip test on mingw, where the
1944 native echo is braindead.
1945 * checks/check-them (strip_needed): Ignore \r in output. Now the
1946 testsuite will pass when cross-compiling from cygwin to mingw.
1948 * src/input.c (peek_input): Fix regression in handling macro
1949 without arguments as last token in file; debian bug 385720.
1950 (next_token): Always consume an input character.
1951 Reported by Andreas Schultz.
1952 * configure.ac (AC_INIT): Bump version number.
1953 * NEWS: Document this fix.
1954 * doc/m4.texinfo (History): Mention next version.
1955 (Changeword): Add example that exposes this bug.
1958 2006-08-25 Eric Blake <ebb9@byu.net>
1961 * configure.ac (AC_INIT): Bump version number.
1962 * NEWS: Describe changes since 1.4.5.
1964 * Makefile.maint (web-manual): Give up on VPATH build during
1965 distribution. But distributions are made so infrequently that
1966 this is not too much of a hardship.
1967 * Makefile.am (MAINTAINERCLEANFILES): Avoid error if lib/CVS/
1970 2006-08-24 Eric Blake <ebb9@byu.net>
1972 * src/builtin.c (m4_index, m4_substr, m4_translit): Similar to
1973 Solaris, produce output on just one argument.
1974 (m4_regexp, m4_patsubst): For consistency, do likewise.
1975 (m4_patsubst): Allow zero-length match at end of string.
1976 * doc/m4.texinfo (Sysval): Fix overfull hbox.
1977 (Bugs, Macro Arguments): Minor fixes.
1978 (Other tokens): Rearrange node order.
1979 (Index macro, Substr, Translit, Regexp, Patsubst): Add tests.
1980 * NEWS: Document these fixes.
1982 2006-08-22 Eric Blake <ebb9@byu.net>
1984 * src/input.c (pop_input): Avoid empty filename with -di option.
1985 * src/debug.c (debug_message_prefix): Put space before message.
1987 * m4/gnulib-cache.m4: We don't explicitly use alloca module.
1989 * m4/gnulib-cache.m4: Augment with gnulib-tool --import gnupload.
1990 * Makefile.maint (fetch): Simplify, now that we can use gnupload.
1992 * checks/check-them: State why a test is skipped.
1993 * doc/m4.texinfo (Changeword, Sysval, Maketemp): Likewise.
1995 * ChangeLog: Add copyright.
1996 * AUTHORS: Likewise.
1997 * BACKLOG: Likewise.
2001 * examples/COPYING: New file, add copyright for all the examples.
2002 * checks/get-them: Put copyright on testsuite files.
2004 2006-08-18 Eric Blake <ebb9@byu.net>
2006 Don't let unrelated child processes see too many files.
2007 * m4/gnulib-cache.m4: Augment with gnulib-tool --import cloexec.
2008 * src/builtin.c (m4_esyscmd, m4_regexp, m4_patsubst): Fix
2009 spelling in error message.
2010 * src/debug.c [!__STDC__]: Assume C89, and nuke old varargs.h.
2011 (debug_set_output): Close debug file on exec.
2012 * src/m4.h (includes): Add cloexec.h.
2013 * src/output.c (make_room_for): Close diversions on exec.
2014 * src/path.c (path_search): Close include files on exec.
2015 * NEWS: Document this.
2017 Regular expressions were leaking memory.
2018 * src/builtin.c (init_pattern_buffer, free_pattern_buffer): New
2020 (m4_regexp, m4_patsubst): Avoid memory leak.
2021 * src/input.c (init_pattern_buffer) [ENABLE_CHANGEWORD]: Make
2023 (set_word_regexp) [ENABLE_CHANGEWORD]: Avoid memory leak. Change
2024 from O(n^2) to O(n) for calculating word_start.
2025 (next_token, peek_token) [ENABLE_CHANGEWORD]: Treat word_start as
2026 O(1) bitmap, not O(n) search string.
2027 * NEWS: Document this fix.
2029 2006-08-17 Eric Blake <ebb9@byu.net>
2031 * NEWS: Document previous checkin.
2033 * src/builtin.c (substitute): Avoid core dump when accessing
2034 beyond bound of regular expression.
2035 Reported by Karl Nelson.
2036 * doc/m4.texinfo (Regexp): Add example that causes core dump on
2037 some architectures prior to this patch.
2040 2006-08-16 Eric Blake <ebb9@byu.net>
2042 * doc/m4.texinfo (Invoking m4, Debug Output): Fix wording to be
2043 clear that dumpdef does not always go to stderr.
2045 * src/builtin.c (m4_errprint): Flush buffers before printing to
2049 2006-08-15 Eric Blake <ebb9@byu.net>
2051 * src/builtin.c (m4_m4wrap, m4_errprint, m4_shift): Make blind,
2052 per debian bug 96075.
2053 * doc/m4.texinfo (Loops, M4wrap, Errprint): Document this change.
2054 (Changeword): Don't use shift as an example of a swallowed word.
2055 (Divert): Discuss fact that divert is an English word.
2056 Reported by Richard A Nelson.
2058 2006-08-14 Eric Blake <ebb9@byu.net>
2060 * doc/m4.texinfo (Invoking m4): Minor fixes.
2062 2006-08-12 Eric Blake <ebb9@byu.net>
2064 * doc/m4.texinfo (Arguments): Hint at better exch macro.
2065 (Answers): Provide a better definition.
2067 2006-08-09 Eric Blake <ebb9@byu.net>
2069 * doc/m4.texinfo (Incompatibilities): Document that m4 does not
2070 yet understand locales.
2071 * NEWS: Fix wording of a few items.
2073 2006-08-08 Eric Blake <ebb9@byu.net>
2075 Avoid printing `NONE:0:' in error messages.
2076 * src/m4.h (m4_error_at_line): New function.
2077 * src/m4.c (m4_error_at_line): Implement.
2078 * src/input.c (skip_line, input_init, next_token): Use "", not
2079 "NONE", for no file, since NONE can be a real file name.
2080 * src/macro.c (expand_argument): Likewise.
2081 * src/debug.c (debug_message_prefix, trace_header): Check for
2083 * doc/m4.texinfo (Dnl, M4wrap): Adjust accordingly.
2084 (Location): Document that synclines and internal message format
2085 are not impacted by redefining these macros.
2086 (M4exit): Hint at bug in fatal_error.
2087 (Answers): Provide workaround to match m4 output.
2089 * m4/gnulib-cache.m4: Augment with gnulib-tool --import verror.
2090 * src/m4.h (m4_error): New function.
2091 (M4ERROR, M4ERROR_AT_LINE): Reimplement without hacking around
2092 error module deficiencies.
2093 (reference_error, suppress_line): No longer needed.
2094 * src/m4.c (m4_error): Implement.
2095 (main): No longer need to install error callback.
2097 2006-08-04 Eric Blake <ebb9@byu.net>
2099 * src/m4.h (program_name): Declare.
2100 (suppress_line): New variable.
2101 (M4ERROR_AT_LINE): New macro.
2102 * src/m4.c (reference_error, main): Follow GNU Coding Standards
2103 for error message format.
2104 * src/input.c (skip_line, next_token): Use M4ERROR_AT_LINE.
2105 * src/macro.c (expand_argument): Likewise.
2106 * checks/check-them (examples): Adjust to new message format.
2107 * src/builtin.c (m4___program__): New builtin.
2108 * doc/m4.texinfo (Location): Split from Errprint into new node,
2109 and document __program__.
2110 (Builtin, Ifdef, Ifelse, Dumpdef, Trace, Debug Output, Dnl)
2111 (Include, Regexp, Patsubst, Incr, Eval): Adjust error message
2113 (Extensions): Document __program__.
2114 * NEWS: Document this change.
2116 2006-08-03 Eric Blake <ebb9@byu.net>
2118 Don't confuse leading `(' in comment or quote with start of
2119 argument collection.
2120 * src/m4.h (enum token_type): Add TOKEN_OPEN, TOKEN_COMMA,
2122 (peek_input): Make private to input.c.
2123 (peek_token): New prototype.
2124 * src/input.c (default_word_regexp): Reduce ifdefs.
2125 (peek_input): Make static.
2126 (next_token): Return new token types.
2127 (match_input, MATCH): Add argument consume, which controls
2128 whether match should be pushed back.
2129 (peek_token): New function.
2130 (token_type_string) [DEBUG_INPUT]: New function.
2131 * src/macro.c (expand_token, expand_argument, collect_arguments):
2132 Handle new token types.
2133 * doc/m4.texinfo (Changequote, Changecom): Document this.
2134 * NEWS: Document this.
2136 * src/stackovf.c (setup_stackovf_trap): Free memory on failure.
2138 * src/stackovf.c (setup_stackovf_trap): Gracefully avoid stack
2139 overflow detection when sigstack exists but is not implemented.
2140 Fixes debian bug 154053.
2142 Reported by David Perlin.
2144 2006-08-02 Eric Blake <ebb9@byu.net>
2146 * src/input.c (MATCH): Fix EOF detection on multi-byte comment
2149 2006-08-01 Eric Blake <ebb9@byu.net>
2151 * src/input.c (skip_line, next_token): Remember current file in
2152 case input file ends abruptly. Addresses debian bug 175365.
2153 (pop_input): Defer freeing storage that holds previous file
2155 (pop_wrapup): to here, after error message is issued.
2156 * src/macro.c (expand_argument): Remember current file in case
2157 input file ends abruptly.
2158 * doc/m4.texinfo (Macro Arguments, Dnl, Changequote, Changecom)
2159 (M4wrap): Adjust testsuite accordingly.
2160 (Errprint): Document line number limitation of m4wrap.
2161 * NEWS: Document this fix.
2164 2006-07-31 Eric Blake <ebb9@byu.net>
2166 * src/input.c (peek_input, next_char, match_input): Be eight-bit
2167 clean; fixes debian bug 311378.
2168 * doc/m4.texinfo (Syntax): Describe eight-bit handling.
2169 (Changequote, Changecom): Add examples to test this.
2170 * NEWS: Document this fix.
2172 Reported by Steven Augart.
2174 * doc/m4.texinfo: Whitespace fix.
2175 * checks/get-them: Avoid exceeding 14-char file name limit.
2178 2006-07-30 Eric Blake <ebb9@byu.net>
2180 * src/path.c (path_search): Detect allocation failure.
2182 Use native free when it is good enough.
2183 * m4/gnulib-cache.m4: Augment with gnulib-tool --import free.
2184 * src/builtin.c (define_user_macro, m4_regexp, m4_patsubst):
2186 * src/symtab.c (free_symbol): Likewise.
2187 * src/m4.c (xfree, main): Likewise.
2188 * src/m4.h (obstack_chunk_free): Likewise.
2189 * src/path.c (path_search): Likewise.
2190 * src/input.c (pop_wrapup, set_quotes, set_comment): Likewise.
2192 * doc/m4.texinfo (Errprint): Add example for last patch.
2193 * checks/check-them: Account for VPATH in latest example.
2195 2006-07-29 Eric Blake <ebb9@byu.net>
2197 * src/path.c (path_search): Add result parameter, so that
2198 -I can be accounted for. Debian bug 53685.
2199 * src/m4.h (path_search): Update prototype.
2200 * src/m4.c (main): Adjust callers.
2201 * src/freeze.c (reload_frozen_state): Likewise.
2202 * src/builtin.c (include, m4_undivert): Likewise.
2203 * NEWS: Document this change.
2204 Reported by Nicolas Lichtmaier.
2206 2006-07-28 Eric Blake <ebb9@byu.net>
2208 * Makefile.am (MAINTAINERCLEANFILES): Fix typo that tripped up
2209 several non-GNU makes.
2210 * src/stackovf.c (setup_stackovf_trap): Missed _ from yesterday.
2211 * src/m4.h: Likewise.
2212 * src/input.c (push_wrapup): Avoid compiler warning with Solaris
2215 2006-07-27 Eric Blake <ebb9@byu.net>
2217 * doc/m4.texinfo: Use @acronym{GNU} throughout.
2218 (History): Update for 1.4.6.
2220 * src/m4.h (_): Remove K&R cruft.
2221 * src/builtin.c: Likewise.
2222 * src/debug.c: Likewise.
2223 * src/eval.c: Likewise.
2224 * src/macro.c: Likewise.
2225 * src/stackovf.c: Likewise.
2227 * doc/Makefile.am (m4.1): Improve man page.
2228 * src/m4.c (usage): Improve --help output, including adding the
2229 bug reporting address.
2230 (main): Follow GNU Coding Standards for --version output.
2232 2006-07-26 Eric Blake <ebb9@byu.net>
2234 * doc/m4.texinfo: Use begin-quote, end-quote, begin-comment, and
2235 end-comment consistently, to match POSIX.
2237 * doc/m4.texinfo (Macro Arguments, Changequote, Changecom)
2238 (Dnl, M4wrap, Include): Document EOF issues, and add examples.
2239 (Incompatibilities): Document incompatibility of changecom
2240 vs. macro names, and of EOF in include.
2241 * src/input.c (next_token): Reject unterminated comments at EOF.
2242 (skip_line): Warn on unterminated dnl at EOF.
2243 * NEWS: Document these changes.
2245 2006-07-25 Eric Blake <ebb9@byu.net>
2247 * m4/gnulib-cache.m4: Update to reflect gnulib's split of
2248 stdio-safer into fopen-safer and tmpfile-safer.
2249 * src/m4.c: Remove redundant include.
2251 2006-07-24 Eric Blake <ebb9@byu.net>
2253 Fix bugs related to stream handling.
2254 * m4/gnulib-cache.m4: Augment with gnulib-tool --import
2255 unlocked-io stdio-safer stdlib-safer close-stream.
2256 * configure.ac (AC_CHECK_FUNCS_ONCE): Assume tmpfile; it can be
2257 provided by gnulib if needed.
2258 * src/output.c [! HAVE_TMPFILE]: Likewise.
2259 * src/m4.h (includes): Replace unistd, stdio, and stdlib with
2260 their safer counterparts.
2261 (retcode): New global variable.
2262 * src/input.c (pop_input): Check for read failure.
2263 * src/freeze.c (reload_frozen_state): Likewise.
2264 (produce_frozen_state): Check for write failure.
2265 * src/debug.c (debug_set_file): Likewise.
2266 * src/m4.c (usage, main): Likewise.
2267 (retcode): Make global.
2268 * src/builtin.c (m4_m4exit): Likewise. Ensure that the exit
2269 status is non-zero except when everything succeeds.
2270 * doc/m4.texinfo (M4exit): Document these changes.
2271 (Incompatibilities): Remove documentation of bug now fixed.
2272 * NEWS: Document these fixes.
2274 2006-07-22 Eric Blake <ebb9@byu.net>
2276 * src/format.c (format): Avoid compiler warning that str may be
2279 2006-07-21 Eric Blake <ebb9@byu.net>
2281 * src/m4.h [UNIX]: Add more platforms that are close enough to
2282 categorize as UNIX, but which don't predefine __unix__.
2283 Reported by Nelson H. F. Beebe.
2285 2006-07-20 Eric Blake <ebb9@byu.net>
2287 * m4/gnulib-cache.m4: gnulib-tool has changed again. Regenerate
2288 to explicitly ask for --assume-autoconf=2.60.
2290 2006-07-19 Eric Blake <ebb9@byu.net>
2292 * doc/m4.texinfo (Sysval): Avoid kill -1, since ksh traps SIGHUP
2293 and exits normally with 129.
2294 Reported by Nelson H. F. Beebe.
2297 * src/m4.h (EXIT_MISMATCH): Define.
2298 * src/freeze.c (reload_frozen_state): Detect version mismatch, by
2299 exiting with status 63.
2300 * src/m4.c (usage): Document this.
2301 * doc/m4.texinfo (Invoking m4, Using frozen files): Likewise.
2304 * doc/m4.texinfo (copying): Relax restriction on front-cover and
2307 2006-07-17 Eric Blake <ebb9@byu.net>
2309 * src/format.c (format): Support F, g, and G specifiers.
2310 * doc/m4.texinfo (Format): Document this.
2311 * NEWS: Document this addition.
2313 * doc/m4.texinfo (Builtin): Delete redundant text.
2315 * configure.ac (AC_INIT): Bump version number.
2316 * src/builtin.c (substitute): Bah. Fix buffer overrun.
2317 * NEWS: Document this fix.
2319 2006-07-15 Eric Blake <ebb9@byu.net>
2322 * configure.ac (AC_INIT): Bump version number.
2323 * NEWS: Describe changes since 1.4.4.
2325 * src/m4.c (usage): Document exit status.
2326 * doc/m4.texinfo: Use `exit status', not `exit code'.
2327 (Invoking m4): Document exit status.
2329 * bootstrap: Backport --help, --version from head.
2330 (func_update): New function, for easily grabbing up-to-date files
2332 * Makefile.maint (web-manual): Fix for VPATH builds.
2334 2006-07-14 Eric Blake <ebb9@byu.net>
2336 * doc/m4.texinfo: Global cleanup. Avoid @code{...}'d, as it
2337 looks bad in info. Use @deffn rather than @example for
2338 describing prototypes. Fix awkward wording and grammar.
2340 * src/builtin.c (substitute): Warn on bad escape sequences.
2341 Ignore trailing backslash.
2342 * doc/m4.texinfo (Regexp): Add documentation for this.
2343 * NEWS: Document this change.
2345 * src/builtin.c (m4_format, m4_indir): Warn on too few arguments.
2346 * doc/m4.texinfo (Defn, Builtin, Debug Levels, Debug Output): Add
2348 (Dnl): Update example to show side effects.
2349 * checks/get-them: Generate three digit test names.
2350 * checks/Makefile.in (CHECKS): Accomodate 100+ tests.
2352 2006-07-13 Eric Blake <ebb9@byu.net>
2354 * src/input.c (input_init): Simplify.
2355 (set_word_regexp): Treat empty string as default, since empty
2356 regexp would disable word parsing.
2357 * src/m4.c (user_word_regexp): Default to empty string.
2358 * src/builtin.c (builtin_tab): Make changeword blind.
2359 * doc/m4.texinfo (Changeword): Document this.
2360 * NEWS: Document this.
2361 * TODO: Knock off completed items.
2363 * src/builtin.c (m4_undefine, m4_popdef): Visit all arguments, not
2365 * doc/m4.texinfo (Undefine, Pushdef): Test this.
2366 * NEWS: Document this change.
2368 * src/builtin.c (numeric_arg): Treat empty string as 0, with a
2369 warning. Detect quoted leading space and overflow as warnings.
2370 (m4_eval): Treat empty radix as 10, and allow output in radix 1.
2371 Treat width as minimum number of digits, as required by POSIX.
2372 (m4_ifdef, m4_divert, m4_m4exit, m4_translit): Ignore extra
2374 (m4_substr): Likewise. Silently treat empty start as 0.
2375 (m4_undivert): Treat ` 1a' as file, not diversion 1.
2376 * src/eval.c (eval_lex): Parse radix 1 numbers.
2377 * doc/m4.texinfo (Invoking m4): Fix wording; there is more than
2378 one type of warning.
2379 (Manual): Document behavior of numeric parsing of empty string.
2380 (Divert, Incr): Document error handling.
2381 (Eval): Document radices better.
2382 (Incompatibilities): Document translit incompatibility.
2383 * NEWS: Document these changes.
2385 * Makefile.maint (fetch): Get gendocs from gnulib, not texinfo.
2386 (web-manual): Simplify.
2387 * m4/gnulib-cache.m4: Augment with gnulib-tool --import gendocs.
2388 * Makefile.am (EXTRA_DIST): Distribute gendocs.sh.
2389 (MAINTAINERCLEANFILES): Clean it as well.
2390 * doc/Makefile.am (EXTRA_DIST): Distribute gendocs_template.
2391 (MAINTAINERCLEANFILES): Clean it as well.
2393 2006-07-12 Eric Blake <ebb9@byu.net>
2395 * doc/m4.texinfo (Extensions): Document how to overcome
2396 implementation difference in > 9 positional parameters.
2398 * src/m4.c (usage): Sort within sections.
2399 (nesting_limit): Raise default from 250 to 1024.
2400 * doc/m4.texinfo: Use file name, not filename, per GNU coding
2401 standard. Use @option where appropriate.
2402 (Invoking m4): Sort to match --help output.
2403 (Debug Levels): Sort.
2404 (Frozen files): Sort and break into two nodes.
2406 * src/m4.c (nesting_limit): Raise default from 250 to 1024.
2407 * NEWS: Document raised -L limit.
2409 2006-07-11 Eric Blake <ebb9@byu.net>
2411 * Makefile.am (DISTCHECK_CONFIGURE_FLAGS): New macro, to
2412 stress-test changeword before a release.
2413 * doc/m4.texinfo: More doc cleanups.
2414 (Copying This Manual): New node; actually include the FDL in the
2416 * doc/Makefile.am (m4_TEXINFOS): Mention dependence on fdl.texi.
2417 * m4/gnulib-cache.m4: Augment with gnulib-tool --import fdl.
2418 * NEWS: Mention documentation improvements.
2420 * src/m4.h (OS2): New platform macro.
2421 * src/builtin.c (predefined_tab) [OS2]: Use it to give OS/2 a
2423 * doc/m4.texinfo (Platform macros): Document it.
2424 (Sysval): Remove non-portable test of system("").
2425 * NEWS: Document this change.
2426 Reported by Andreas Buening.
2428 2006-07-09 Eric Blake <ebb9@byu.net>
2430 * doc/m4.texinfo (Undivert): Fix typo in last commit.
2431 * src/m4.c (usage): Document M4PATH.
2432 * src/path.c (path_search): Reject empty string.
2433 * src/output.c (insert_diversion): Ignore diversion 0.
2434 * src/builtin.c (m4_undivert): Ignore empty string.
2435 * NEWS: Document this fix.
2437 2006-07-08 Eric Blake <ebb9@byu.net>
2439 * checks/get-them: Make filtering easier.
2440 * checks/check-them: Filter non-input lines, so line counts are
2441 more realistic in the documentation, and so changeword tests work
2442 even when dnl is disabled.
2443 * doc/m4.texinfo: Adjust example line numbers. Clean up
2444 front-matter, following autoconf's example.
2445 (Changeword): Enable tests, skipping if changeword not supported.
2446 (Define, Defn, Ifelse): Backport more examples from head.
2447 (Input processing, Answers): New nodes, backported from head.
2448 (Include): Expand test to cover empty filename.
2449 (Undivert): Add test of undivert(0).
2451 2006-07-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2453 * doc/m4.texinfo: Fix spelling errors.
2455 2006-07-07 Eric Blake <ebb9@byu.net>
2459 * doc/Makefile.am (m4.1): No need to go through a temporary file;
2460 this also ensures timestamps are updated.
2461 * src/m4.h (includes): Require config.h. Assume string.h,
2462 stdlib.h, errno. Include error.h, exit.h, and xalloc.h rather
2463 than prototyping ourselves.
2464 (builtin_func): Add parameter type-checking.
2465 (voidstar): Delete, now that we assume C89.
2466 * src/builtin.c, src/m4.c, src/macro.c, src/symtab.c: All users of
2468 * src/m4.c (xfree) [WITH_DMALLOC]: Avoid clash with dmalloc's
2471 2006-07-06 Eric Blake <ebb9@byu.net>
2473 * m4/gnulib-cache.m4: Augment with gnulib-tool --import
2475 * src/m4.h (includes): Add binary-io.h for O_BINARY.
2476 * src/freeze.c (produce_frozen_state): Use O_BINARY to remove
2477 #ifdef. Fixes patch from 2005-02-03 for cygwin.
2478 * NEWS: Mention this fix.
2480 * configure.ac (FUNC_SYSTEM_BROKEN): New check for OS/2 bug.
2481 * src/builtin.c (m4_syscmd): Work around OS/2 bug.
2483 * Makefile.am (SUBDIRS): Build . before src, so that autoheader
2484 runs first when needed.
2485 * doc/Makefile.am (m4.1): Backport rule from CVS head: build m4.1
2486 once in srcdir rather than multiple times in VPATH builds.
2488 2006-07-03 Eric Blake <ebb9@byu.net>
2490 * checks/check-them: Use portable = in test.
2491 * src/Makefile.am (AM_CPPFLAGS): Omit space between -I and
2492 directory, as required by Solaris cc. Include built headers, as
2493 required by Solaris make in VPATH build.
2494 * checks/Makefile.in: Use $(srcdir) where needed.
2495 (CHECKS): Factor $(srcdir) into macro.
2496 (DISTFILES): Likewise. Automake takes care of distributing
2499 (Makefile): Use modern syntax of config.status.
2500 * doc/m4.texinfo (Loops, Include, Undivert, Incompatibilities):
2501 Avoid overfull and underfull hboxes in dvi.
2503 Fix 'make check' in VPATH build. All files included by testsuite
2504 now live in a single directory. Use forloop.m4 in testsuite.
2505 * checks/incl.m4, checks/foo, checks/wrapfifo.m4: Move from
2507 * examples/incl.m4, examples/foo, examples/wrapfifo.m4: ...to
2509 * checks/Makefile.in (DISTFILES): Don't distribute moved files.
2510 * examples/Makefile.am (EXTRA_DIST): Distribute new files.
2511 * checks/check-them: Avoid s/// when filename is in pattern.
2512 * examples/forloop.m4: Fix to match documentation.
2513 * doc/m4.texinfo (Include, Undivert, Incompatibilities): Reflect
2515 (Loops, Format): Actually use forloop.m4 in tests.
2517 2006-07-02 Eric Blake <ebb9@byu.net>
2519 * checks/Makefile.in (exec_prefix, prefix): New macros, so that
2520 $(bindir) works in installcheck.
2521 (check, installcheck): No longer change directory, so that
2522 distcheck works with a read-only builddir.
2523 * checks/check-them: Work when pwd is no longer builddir.
2525 2006-07-01 Eric Blake <ebb9@byu.net>
2527 * GNUmakefile: New file, borrowed from coreutils.
2528 * Makefile.am (EXTRA_DIST): Distribute GNUmakefile.
2529 * Makefile.maint (Makefile): Delete this rule, now that
2530 GNUmakefile includes Makefile.
2532 2006-06-30 Eric Blake <ebb9@byu.net>
2534 For compatibility with other m4 implementations, sysval returns
2535 signal<<8 rather than 0 if syscmd is terminated by a signal.
2536 * configure.ac (AC_CHECK_HEADERS_ONCE): Check for sys/wait.h.
2537 * src/builtin.c (include): Include sys/wait.h when stdlib.h does
2538 not provide wait macros.
2539 (WTERMSIG, WIFSIGNALED, WIFEXITED): More fallback macros.
2540 (M4SYSVAL_EXITBITS, M4SYSVAL_TERMSIGBITS): New helper macros.
2541 (m4_esyscmd): Set sysval to -1 on failure.
2542 (m4_sysval): Print 127 on failure, and accomodate signals if they
2544 * NEWS: Document this change.
2545 * doc/m4.texinfo (Platform macros, Esyscmd, Sysval): Fix typos in
2547 * checks/check-them: Likewise.
2548 * src/debug.c (debug_set_file): Work around mingw fstat bug.
2550 * src/m4.h (UNIX, W32_NATIVE): Improve platform detection macros.
2551 * src/freeze.c (produce_frozen_state): Use new spelling of
2553 * src/builtin.c (predefined_tab): Add __windows__ on non-unix
2555 (m4_syscmd, m4_esyscmd): The empty command is successful.
2556 * doc/m4.texinfo (Shell commands): Rename from UNIX commands.
2557 Document platform-dependence of system().
2558 (Syscmd): Add example.
2559 (Esyscmd): Make example more robust, and actually demonstrate
2561 (Sysval): Expand test to cover esyscmd code path, and to check
2562 that empty command is successful. Add conditional check for
2564 (Other Incompatibilities): Move platform macros from here...
2565 (Platform macros): ...to this new node. Add windows macro.
2566 Check that exactly one platform macro is provided.
2567 * checks/check-them: Improve trap cleanup. Tolerate dirname and
2568 .exe in error messages. Allow for skipping checks.
2569 * configure.ac (HAVE_EFGCVT): Kill dead configure check.
2570 * NEWS: Document platform macros.
2572 2006-06-29 Eric Blake <ebb9@byu.net>
2574 Fix buffer overrun bug.
2575 * m4/gnulib-cache.m4: Augment with gnulib-tool --import
2577 * src/format.c [HAVE_EFGCVT]: Delete this code, and use *printf
2578 variant instead, since [efg]cvt are obsolete and our use of them
2579 was buggy (savannah sr #104303).
2580 (format): Fix buffer overflow by using xasprintf.
2581 * doc/m4.texinfo (Format): Expand format test to catch both bugs.
2582 * NEWS: Document this fix.
2584 * configure.ac (AC_CANONICAL_HOST, AC_CANONICAL_BUILD): Allow
2586 (AC_CACHE_CHECK): Cache search for ecvt.
2588 2006-06-27 Eric Blake <ebb9@byu.net>
2590 * doc/m4.texinfo (Eval): Document 32-bit signed limitations
2591 required by POSIX, and add example that exposed core dump on x86
2593 (Incompatibilities): Document incompatibility in eval precedence.
2594 * src/eval.c (shift_term): Explicitly mask, to avoid undefined
2596 (mult_term): Explicitly check for -1, to avoid SIGFPE on x86.
2597 * NEWS: Document this change.
2599 * doc/m4.texinfo: Use @noindent consistently.
2600 (Quoting Arguments): Document that unquoted parentheses group
2602 (Pseudo Arguments): Expand tests to show this.
2603 (Incompatibilities): Contrast traditional behavior of
2606 2006-06-24 Eric Blake <ebb9@byu.net>
2608 * configure.ac (AC_PREREQ): Autoconf 2.60 is now released.
2609 (AC_CHECK_HEADERS_ONCE): Use this new feature.
2610 (AC_CHECK_FUNCS_ONCE): Likewise.
2612 2006-06-23 Eric Blake <ebb9@byu.net>
2614 * doc/m4.texinfo: Quoting cleanup throughout - follow
2615 autoconf-recommended style of one level of quote per parenthesis
2616 in the normal case. Adjust error messages to match GNU coding
2617 standards (and to allow 'make check' to pass again).
2618 (Quoted strings, Inhibiting Invocation): Turn more examples into
2620 (Comments): Resolve FIXME by adding example.
2621 (Define): Add example about underquoting.
2622 (Defn): Add example about use of $0.
2623 (Indir, Format): Resolve FIXME done in last commit.
2624 (Ifelse): Add example about creating blind macro.
2625 (Debugging): Fix grammar.
2626 (Dnl): Add example about dnl with arguments.
2627 (M4wrap): Be explicit that LIFO order is non compliant, and will
2629 (Undivert): Resolve FIXME by adding example.
2630 (Frozen files): Document that m4wrap and sysval will not work
2631 consistently until m4 2.0.
2632 (Incompatibilities): Document another POSIX compliance bug, this
2633 time with changequote. Document a traditional incompatibility
2634 with partial input spanning file boundaries.
2636 Make error messages more consistent with GNU coding standards -
2637 start with lower case, and don't end sentence with punctuation.
2638 * src/debug.c (trace_pre): Update message wording.
2639 * src/eval.c (evaluate, cmp_term, shift_term, mult_term):
2641 * src/freeze.c (produce_frozen_state, issue_expect_message),
2642 (reload_frozen_state): Likewise.
2643 * src/input.c (push_string_init, pop_init, init_macro_token),
2644 (peek_input, next_char_1, set_word_regexp, next_token): Likewise.
2645 * src/m4.c (stackovf_handler, main): Likewise.
2646 * src/macro.c (expand_token, expand_argument, call_macro),
2647 (expand_macro): Likewise.
2648 * src/output.c (make_room_for, output_text, insert_file),
2649 (freeze_diversions): Likewise.
2650 * src/symtab.c (symtab_init, lookup_symbol): Likewise.
2652 * src/builtin.c (builtin_tab): Make format and indir blind.
2653 (substitute): Prefer "Warning:" vs. "ERROR:" in messages.
2654 * NEWS: Mention the change to builtins.
2656 2006-06-22 Eric Blake <ebb9@byu.net>
2658 Robustify frozen file format.
2659 * src/freeze.c (reload_frozen_state): Add GET_DIRECTIVE helper
2660 macro. Require V first, and only accept it once. For F, use
2661 placeholder if builtin is not found, rather than warning.
2662 * src/m4.h (m4_placeholder): New prototype.
2663 * src/builtin.c: Unify error message style.
2664 (m4_placeholder): New function, warn if invoked.
2665 (builtin_tab): Add m4_placeholder.
2666 (m4_defn): Warn if placeholder is encountered.
2667 (find_builtin_by_addr): Handle placeholder.
2668 (find_builtin_by_name): Return placeholder on failure.
2669 (m4_builtin): Treat placeholder as undefined.
2670 * doc/m4.texinfo (Frozen files): Document changes in V and F.
2671 * NEWS: Document this change.
2672 Reported by Bruno Haible.
2674 * doc/m4.texinfo: Whitespace cleanup. TABs are evil in texinfo.
2675 (tabchar): New macro, so that 'make check' still works.
2676 (Invoking m4): Document that ignored compatibility options -B, -S,
2677 and -T each consume an argument.
2678 * checks/get-them: Honor @tabchar{}.
2680 Avoid compiler warnings during -DDEBUG.
2681 * src/m4.h (M4_GNUC_ATTRIBUTE, M4_GNUC_UNUSED): New macros.
2682 [DEBUG]: Also imply DEBUG_OUTPUT and DEBUG_STKOVF.
2683 * src/input.c (print_token) [DEBUG_INPUT]: Use correct format.
2684 (lex_debug) [DEBUG_INPUT]: Fix to compile. Mark unused.
2685 (next_token) [DEBUG_INPUT]: Print before returning.
2686 * src/path.c (include_dump) [DEBUG_INCL]: Mark unused.
2687 * src/symtab.c (symtab_debug) [DEBUG_SYM]: Mark unused.
2689 Avoid mkstemp bugs on various platforms.
2690 * m4/gnulib-cache.c: Augment with gnulib-tool --import mkstemp.
2691 * src/output.c [! HAVE_MKSTEMP]: Delete.
2692 * configure.ac (AC_CHECK_FUNCS): Don't check for mkstemp.
2693 * src/m4.h (mkstemp) [! HAVE_MKSTEMP]: Prototype, if needed.
2694 * NEWS: Document this.
2696 * Makefile.am (EXTRA_DIST): Distribute gnulib-cache.m4.
2697 Reported by Bruno Haible.
2699 2006-06-21 Eric Blake <ebb9@byu.net>
2701 Avoid obsolete sigstack when POSIX sigaltstack is available.
2702 * src/m4.c: Blindly assume signal.h, since stackovf.c and gnulib
2704 * configure.ac (AC_CHECK_HEADERS): Likewise.
2705 (AC_CHECK_TYPES): New check for siginfo_t, since siginfo.h is
2706 obsolete and most hosts now have it in signal.h.
2707 (AC_CHECK_MEMBERS): New check for sigaction.sa_sigaction.
2708 (AC_CACHE_CHECK): Cache decision to use stackovf.
2709 (AC_EGREP_HEADER): Switch to AC_CHECK_TYPES.
2710 * src/stackovf.c (DEBUG_STACKOVF): Remove unused define.
2711 (SA_RESETHAND, SA_SIGINFO): Provide fallback definitions, to
2712 simplify later code.
2713 (PARAM_STACKOVF, PARAM_NOSTACKOVF): Move further away from NULL,
2714 in case of dereferencing a member of a NULL pointer.
2715 (sigsegv_handler) [HAVE_STRUCT_SIGACTION_SA_SIGACTION]: Define a
2717 (setup_stackovf_trap): Use NULL instead of 0 for pointers, use
2718 EXIT_FAILURE in error, indent preprocessor directives.
2719 [HAVE_SIGALTSTACK && HAVE_SIGINFO_T]: Depend on siginfo_t, not
2721 [HAVE_SIGACTION && defined SA_ONSTACK]: Prefer POSIX handler.
2722 Reported by Santiago Vila.
2724 2006-06-19 Eric Blake <ebb9@byu.net>
2728 2006-06-18 Andreas Buening <andreas.buening@nexgo.de> (tiny change)
2730 * checks/Makefile.in (PATH_SEPARATOR): New macro.
2731 (check, installcheck): Use it, for OS/2.
2733 2006-06-18 Eric Blake <ebb9@byu.net>
2735 Consistently use "GNU M4" as package name, "m4" as executable
2737 * NEWS: Document previous fix.
2739 * README: Fix grammar. Document that --enable-changeword is on
2741 * doc/m4.texinfo (Top, Changeword): Likewise.
2742 (Sysval): Enhance this test.
2743 (History): Backport this section from CVS head, and update.
2745 2006-06-18 Bruno Haible <bruno@clisp.org> (tiny change)
2746 Eric Blake <ebb9@byu.net>
2748 * src/builtin.c (WEXITSTATUS): Provide fallback definition.
2749 (m4_esyscmd): Set sysval to 0xffff, to accomodate both
2750 big-endian and little-endian wait status definitions.
2751 (m4_sysval): Use WEXITSTATUS.
2752 Reported by Andreas Buening.
2754 2006-06-18 Eric Blake <ebb9@byu.net>
2756 * configure.ac (AC_INIT): Bump version number.
2757 * NEWS: Describe changes in 1.4.4c.
2759 2006-06-17 Eric Blake <ebb9@byu.net>
2761 Beta Release 1.4.4b:
2762 * configure.ac (AC_INIT): Bump version number.
2763 * NEWS: Describe changes since 1.4.4.
2764 * Makefile.maint (cvs-news): Accomodate copyright line wrapping.
2766 * Makefile.am (MAINTAINERCLEANFILES): Clean files added by
2768 * checks/Makefile.in (maintainer-clean): Add missing target.
2769 * COPYING: Remove generated file from CVS.
2771 2006-06-16 Eric Blake <ebb9@byu.net>
2773 * checks/Makefile.in (DISTFILES): Distribute wrapfifo.m4.
2775 2006-06-15 Eric Blake <ebb9@byu.net>
2777 * checks/wrapfifo.m4: New file. Use it...
2778 * doc/m4.texinfo (Incompatibilities): here, in a new test case to
2779 demonstrate how to get POSIX behavior of m4wrap prior to m4 2.0.
2781 * src/m4.h (to_uchar): New function.
2782 * src/eval.c (eval_lex): Use it to avoid passing signed char to
2783 isdigit, isalpha, isupper, islower, isspace, isalnum.
2784 * src/builtin.c (expand_user_macro): Likewise.
2785 * src/format.c (format): Likewise.
2786 * src/macro.c (expand_argument): Likewise.
2787 * NEWS: Document this security fix.
2790 * src/symtab.c (lookup_symbol): Use invalid, not illegal.
2791 * src/freeze.c (reload_frozen_state): Fix typo in message.
2792 (produce_frozen_state): Standardize on builtin, not built-in.
2793 * src/builtin.c (numeric_arg, bad_argc): Likewise.
2795 * configure.ac (M4_EARLY, M4_INIT): Use gnulib.
2796 (AC_PROG_RANLIB, AC_AIX, AC_MINIX, AC_CHECK_HEADERS),
2797 (AC_FUNC_ALLOCA, AC_REPLACE_FUNCS): Avoid checks now done by
2799 * Makefile.am (ACLOCAL_AMFLAGS): New entry, for gnulib.
2800 * m4/gnulib-cache.m4: New file, from gnulib.
2801 * bootstrap: Invoke gnulib-tool --update.
2802 * src/m4.c (main): Cast away const.
2803 * NEWS: Document that regex is updated.
2806 2006-06-08 Eric Blake <ebb9@byu.net>
2808 * configure.ac (changeword): Work even when changeword is not a
2810 (AC_PROG_AWK, AC_PROG_INSTALL, AC_PROG_MAKE_SET, AC_HEADER_STDC):
2811 Delete; now done by automake.
2812 (AC_ISC_POSIX, AC_C_CONST): Delete; now obsolete.
2814 2006-06-07 Eric Blake <ebb9@byu.net>
2816 * lib/regex.c (bcmp_translate): Canonicalize type name.
2817 * doc/Makefile.am (MAINTAINERCLEANFILES): Fix typo.
2818 * configure.ac (changeword): Disable changeword for the creation
2819 of configure, in case of bootstrapping with an m4 configured with
2820 --enable-changeword.
2822 Distribute a rudimentary man page.
2823 * Makefile.am (SUBDIRS): Move doc after src so that 'm4 --help'
2825 * doc/Makefile.am (man_MANS, EXTRA_DIST, MAINTAINERDISTCLEAN),
2826 (SUFFIXES, m4.1): New macros and rules to build m4.1.
2828 2006-06-06 Eric Blake <ebb9@byu.net>
2830 * lib/regex.c (re_match_2_internal, bcmp_translate): Avoid
2831 compiler warnings at -O2.
2832 * lib/getopt.c (_getopt_internal): Likewise.
2834 Cleanup of previous patches.
2835 * src/input.c (struct input_block): Remove traced member.
2836 (push_macro, init_macro_token): Don't pass trace status around.
2837 * src/m4.h (struct token_data): Remove traced member.
2838 (struct symbol, struct builtin): Reduce unused space.
2839 (TOKEN_DATA_FUNC): Simplify.
2840 (TOKEN_DATA_FUNC_TRACED): Remove unused macro.
2841 (push_macro, define_builtin): Remove unused parameter.
2842 * src/builtin.c (define_builtin, builtin_init, define_macro),
2843 (m4_defn): Don't pass trace status around.
2844 * src/macro.c (expand_argument): Likewise.
2845 * src/freeze.c (reload_frozen_state): Likewise.
2846 * src/symtab.c: Whitespace cleanup.
2847 * NEWS: Clean up wording.
2848 * doc/m4.texinfo (Undefine, Dumpdef, Trace): Cleanup wording;
2849 ensure tests actually expose bugs prior to today's patches.
2851 Trace status of builtins is no longer inherited across
2852 define(...,defn(...)). Fixes bug that autom4te had been working
2854 * src/builtin.c (define_builtin): Don't override trace status.
2855 * doc/m4.texinfo (Trace): Add test for this.
2856 * NEWS: Document this.
2858 When changing macro definitions inside the arguments to the macro,
2859 consistently preserve the old definition that was in effect before
2860 argument collection, similar to the C pre-processor.
2861 Reported by John Brzustowski.
2862 * NEWS: Document this change.
2863 * doc/m4.texinfo (Macro Arguments, Undefine, Dumpdef): Document
2864 this policy, and add tests that expose core dumps prior to this
2866 * src/m4.h (struct symbol): New members to track when a symbol is
2867 still in use after removal from the symbol table.
2868 (SYMBOL_PENDING_EXPANSIONS, SYMBOL_DELETED): Define.
2869 (free_symbol): Prototype.
2870 * src/macro.c (expand_macro): Track pending expansions of a
2871 symbol. On completion, if a symbol is deleted and no longer
2872 pending, free its memory.
2873 * src/symtab.c (free_symbol): Export. Don't free memory if symbol
2875 (lookup_symbol) <SYMBOL_INSERT>: Create new entry when old entry
2877 (lookup_symbol) <SYMBOL_DELETE, SYMBOL_POPDEF>: Mark entries still
2878 in use as deleted and remove from the table without freeing
2880 (symtab_print_list) [DEBUG_SYM]: More debug output.
2882 * src/symtab.c (hack_all_symbols): Allow certain modifications of
2883 the symbol table during traversal.
2884 * src/builtin.c (set_trace): Replace SYMBOL_DELETE with
2885 SYMBOL_POPDEF, since only the latter is safe with
2888 Solve crash when passing "indir(`foo')" to "m4 -tfoo".
2889 * src/symtab.c (lookup_symbol) <SYMBOL_DELETE, SYMBOL_POPDEF>:
2890 Preserve placeholder when macro is being traced.
2891 * src/builtin.c (m4_ifdef, m4_indir): A traced but undefined
2892 symbol is not defined.
2893 (set_trace): Remove placeholder when no longer traced.
2894 (m4_traceon): On named traces, always reserve a slot in the
2896 (m4_traceoff): Don't warn about untracing a nonexistent symbol.
2897 * NEWS: Document new trace behavior.
2898 * doc/m4.texinfo (Trace): Tracing by name now consistently works
2899 no matter whether that macro is currently defined.
2900 (Incompatibilities): Document differences between traditional and
2903 2006-06-04 Paul Eggert <eggert@cs.ucla.edu> (tiny change)
2904 Eric Blake <ebb9@byu.net>
2906 * src/m4.h (hash_table_size): Now size_t instead of int.
2907 * src/m4.c (hash_table_size): Likewise.
2908 (main): Adjust to this; use atol rather than atoi.
2909 * src/symtab.c: Include <limits.h>, for CHAR_BIT.
2910 (symtab_init, lookup_symbol, hack_all_symbols):
2911 Use size_t for sizes and indexes, not int.
2912 (symtab_print_list) [DEBUG_SYM]: Likewise.
2913 (hash): Likewise. Don't case-fold in the hash function.
2914 Shift by 7, not 3, for consistency with gnulib/lib/hash.c.
2915 Don't assume hash word is 32 bits.
2916 * NEWS: Document this change.
2918 2006-06-04 Eric Blake <ebb9@byu.net>
2920 * src/symtab.c (symtab_debug, symtab_print_list) [DEBUG_SYM]: Fix
2921 to allow compilation, for use in debugger.
2922 (profiles, current_mode) [DEBUG_SYM]: New variables.
2923 (show_profile, profile_strcmp) [DEBUG_SYM]: New methods for
2924 determining hash table performance.
2926 2006-05-31 Eric Blake <ebb9@byu.net>
2927 John Brzustowski <jbrzusto@fastmail.fm>
2929 * src/input.c (input_stack): Delete; use current_input instead.
2930 (wrapup_stack): Dynamically allocate, so that recursion is handled
2932 (push_wrapup): Use current wrapup stack.
2933 (pop_wrapup): Rotate wrapup stack to current, and create new
2935 (input_init): Dynamically allocate stacks.
2936 * NEWS: Update, now that recursive m4wrap can no longer cause
2939 2006-05-31 Eric Blake <ebb9@byu.net>
2941 * lib/getopt.c: Fix copyright year.
2942 * lib/obstack.c: Ditto.
2943 * src/builtin.c: Ditto.
2945 2006-05-30 Eric Blake <ebb9@byu.net>
2947 * doc/m4.texinfo (M4wrap): Add test to expose m4wrap bug.
2948 Reported by John Brzustowski.
2949 (Incompatibilities): Document known POSIX incompatibilities.
2952 2006-05-29 Eric Blake <ebb9@byu.net>
2954 * doc/m4.texinfo (Maketemp): Work even when running 'make check'
2958 * Makefile.am: New file.
2959 * doc/Makefile.am: Ditto.
2960 * examples/Makefile.am: Ditto.
2961 * lib/Makefile.am: Ditto.
2962 * src/Makefile.am: Ditto.
2963 * acinclude.m4: New file, renamed from aclocal.m4.
2964 * configure.ac (AM_INIT_AUTOMAKE): Invoke new macro.
2965 (AC_ARG_PROGRAM): Now redundant.
2966 (STACKOVF): Turn into automake conditional.
2967 (AC_CONFIG_COMMANDS): stamp-h is a command, not a file.
2968 * checks/Makefile.in: Converting this dir to automake was not
2969 trivial; for now, just add missing targets demanded by top-level.
2970 * INSTALL: Remove files that are now generated from CVS.
2971 * Makefile.in: Ditto.
2972 * aclocal.m4: Ditto.
2973 * install-sh: Ditto.
2974 * mkinstalldirs: Ditto.
2975 * doc/Makefile.in: Ditto.
2976 * doc/texinfo.tex: Ditto.
2977 * examples/Makefile.in: Ditto.
2978 * lib/Makefile.in: Ditto.
2979 * src/Makefile.in: Ditto.
2981 * AUTHORS: Backport from CVS head, and update.
2982 * doc/m4.texinfo (Changeword): Fix examples to match behavior.
2984 2006-05-27 Eric Blake <ebb9@byu.net>
2986 * lib/regex.c (regex_compile): Kill compiler warnings.
2987 * lib/getopt.c: Likewise.
2988 * lib/obstack.c: Likewise.
2989 * src/builtin.c (builtin_init): Likewise.
2990 * src/path.c (path_search): Likewise.
2992 * doc/m4.texinfo: Fix usage of a vs. an.
2993 (Loops, Include, Cleardiv, Patsubst, Format, M4exit): Kill
2994 overfull hbox warnings.
2995 (Inhibiting Invocation, Divert, Maketemp, M4exit): Add new tests.
2997 * configure.ac: Update to autoconf 2.59. Forbid ^M4_. Fix
2999 * aclocal.m4 (fp_PROG_CC_STDC): Delete; now covered by autoconf.
3000 (fp_C_PROTOTYPES): Delete, GNU Coding Standards state we can now
3002 (M4_WITH_DMALLOC): Rename from fp_WITH_DMALLOC. Fix quoting.
3003 * src/m4.h (_): PROTOTYPES is no longer provided, assume C89.
3004 * src/Makefile.in: Delete remains of ansi2knr.
3005 * src/ansi2knr.1: Delete.
3006 * src/ansi2knr.c: Delete.
3008 2006-05-25 Eric Blake <ebb9@byu.net>
3010 * doc/m4.texinfo: Fix spelling errors. Use `invalid' instead of
3013 * doc/m4.texinfo (Francois): No longer needed as a tex variable.
3014 Reported by Karl Berry.
3016 2006-05-24 Eric Blake <ebb9@byu.net>
3018 * Makefile.in (html): New target.
3019 * doc/Makefile.in (html, m4.html): Likewise.
3020 (MAKEINFOHTML): New macro.
3021 * doc/m4.texinfo (Francois) [ifnottex]: Use newer texinfo
3023 (Regexp) [ifhtml]: Make cross-reference to emacs manual an
3025 Reported by Bob Badour.
3027 * THANKS: Update. Move reporter's email addresses here, instead
3030 2006-05-11 Eric Blake <ebb9@byu.net>
3033 * doc/m4.texinfo (Changequote): Give testsuite exposure to bug
3034 patched on 2005-12-04.
3035 Reported by Ilya N. Golubev.
3037 * bootstrap: New file, so that generated files need not be stored
3039 * Makefile.in (DISTFILES): Add bootstrap.
3041 Make testsuite less sensitive to doc changes.
3042 * doc/m4.texinfo: Use m4.input instead of filename.
3043 * checks/check-them (xerr): Turn m4.input into filename.
3044 * checks/Makefile.in (dist): Depend on stamp-checks.
3046 Portability updates for OS/2.
3047 * src/Makefile.in (EXEEXT, OBJEXT): Define.
3050 * lib/Makefile.in (OBJEXT): Define.
3052 * doc/Makefile.in (install, uninstall): Install info files into
3054 Reported by Andreas Buening.
3056 2006-05-09 Eric Blake <ebb9@byu.net>
3058 * install-sh: Update to newer upstream version.
3059 * mkinstalldirs: Likewise.
3060 Reported by Andreas Buening.
3062 * src/m4.c (main): Bump copyright year.
3063 * Makefile.in (datarootdir): Define, for autoconf 2.59c.
3064 * doc/Makefile.in (datarootdir): Likewise.
3066 2006-05-08 Eric Blake <ebb9@byu.net>
3069 * doc/m4.texinfo (Bugs): Backport bug email address from head.
3070 Reported by Stepan Kasal.
3072 2005-12-04 Ilya N. Golubev <gin@mo.msk.ru> (tiny change)
3074 * input.c (match_input): Do not pass expression with side effect
3075 to `obstack_grow'. Fix <INTERNAL ERROR: Recursive push_string!>.
3078 2005-12-04 Gary V. Vaughan <gary@gnu.org> (tiny change)
3080 * doc/m4.texinfo (How to debug macros and input): s/woould/would/
3081 Reported by Damian Menscher.
3083 2005-10-19 Gary V. Vaughan <gary@gnu.org> (tiny change)
3085 * configure.ac (AC_INIT): Bump to 1.4.4a.
3087 2005-10-19 Gary V. Vaughan <gary@gnu.org> (tiny change)
3090 * configure.ac (AC_INIT): Bump to 1.4.4.
3091 * NEWS: Describe 1.4.4's changes.
3092 * INSTALL, install-sh, doc/texinfo.tex: Updated from upstream.
3094 2005-10-17 John Gatewood Ham <zappaman@buraphalinux.org> (tiny change)
3096 * src/m4.c: fix return code when non-existent files are processed
3098 2005-10-17 John Gatewood Ham <zappaman@buraphalinux.org> (tiny change)
3100 * README: update email address for bug reports.
3102 2005-10-17 Gary V. Vaughan <gary@gnu.org>
3104 * doc/m4.info: Generated files are not kept in the repository.
3106 2005-05-01 Gary V. Vaughan <gary@gnu.org>
3108 The FSF are moving offices today. Changed their contact address
3109 in all files from `59 Temple Place, Suite 330, MA 02111-1307' to
3110 `51 Franklin Street, Fifth Floor, MA 02110-1301'.
3112 Also, some of the files here were never updated from the previous
3113 '675 Mass Ave, Cambridge, MA 02139', so changed those to the
3114 '51 Franklin Street, Fifth Floor, MA 02110-1301' address too.
3116 2005-03-31 Mike Frysinger <vapier@gentoo.org>
3118 * Makefile.in (bindir, infodir): Substitute from configure rather
3120 * doc/Makefile.in (infodir): Ditto.
3121 * src/Makefile.in (bindir): Ditto.
3124 2005-03-31 Gary V. Vaughan <gary@gnu.org>
3126 Changes needed to automate the release process for 1.4.3:
3128 * Makefile.in (dist): Make .tar.bz2 tarball too.
3129 * Makefile.maint (TSDEPS_DIST): Remove m4/libtool.m4.
3130 (cvs-news): Look 1 line further down for NEWS release number.
3131 (cvs-dist): We don't use automake, so make dist is fine.
3132 Remove double . before suffixes.
3133 (cvs-release): Don't mention manual.html.
3134 (fetch): Get latest gendocs files.
3135 (web-manual): Rewritten to use gendoc for multiformat manuals.
3136 * doc/gendocs.sh: Don't save an old version in m4 CVS!
3137 * doc/m4.texinfo (Index): HFS+ (the file system on my Mac) is case
3138 preserving, but case insensitive, so generating html docs per node
3139 clashes between Index.html, the node file, and index.html, the
3140 top-level of the document tree...
3141 (Index macro): ...so renamed to this. Changed all references.
3143 2005-03-31 Gary V. Vaughan <gary@gnu.org> (tiny change)
3145 * configure.ac (AC_INIT): Bump to 1.4.3a.
3147 2005-03-31 Gary V. Vaughan <gary@gnu.org> (tiny change)
3150 * configure.in (AC_INIT): Bump to 1.4.3.
3151 * NEWS: Describe 1.4.3's changes.
3153 2005-03-31 Gary V. Vaughan <gary@gnu.org>
3155 * Makefile.maint: New file with release rules, from CVS libtool.
3156 * Makefile.in (DISTFILES): Add Makefile.maint.
3157 * INSTALL, install-sh, doc/texinfo.tex: Updated to latest
3160 2005-03-31 Eric Blake <ebb9@byu.net> (tiny change)
3162 * doc/m4.texinfo (Patsubst): Re-add trailing space required by
3163 checks/47.patsubst, with a redundant @comment to prevent emacs
3164 from removing it accidentally again.
3165 * checks/get-them: Allow for trailing spaces tucked behind
3168 2005-03-31 Eric Blake <ebb9@byu.net> (tiny change)
3170 * doc/Makefile.in (install, uninstall): Accomodate DESTDIR.
3171 * src/Makefile.in (install, uninstall): Likewise.
3173 2005-02-07 Gary V. Vaughan <gary@gnu.org>
3175 * lib/regex.c, lib/regex.h: Reverted gnulib update, which broke
3177 Reported by Eric Blake.
3179 2005-02-04 Gary V. Vaughan <gary@gnu.org>
3181 * lib/regex.c, lib/regex.h: Updated from gnulib.
3182 * src/input.c (set_word_regexp): Don't change the word_regexp
3183 unless it compiles correctly.
3185 Reported by Frank Schwidom.
3187 * Makefile.in (stamp-h): Regenerate config.h properly.
3189 2005-02-03 Gary V. Vaughan <gary@gnu.org>
3191 * configure.ac (AC_DEFINE): Fix overquoting of description
3194 * src/m4.h (__CYGWIN__, WIN32): Canonicalise Windows and Cygwin
3196 * src/freeze.c (produce_frozen_state): Use \n line-endings even
3197 on Windows, so that the frozen file reader will work.
3198 Reported by Josef T. Burger.
3200 * src/m4.c (main): Modernise the --version output.
3202 2005-02-03 Gary V. Vaughan <gary@gnu.org>
3204 Modernise the configury a little to prevent spurious errors from
3205 Autoconf-2.59's autoreconf:
3207 * config.h.in: Renamed to...
3208 * config-h.in: ...this to better support DOS 8.3 file systems.
3209 * acconfig.h: Removed.
3210 * configure.in: Renamed to...
3211 * configure.ac: ...this, and AC_DEFINE used to declare config.h
3212 entry comments. Slight reorganisation and reformatting.
3213 * aclocal.m4: Use third argument to AC_DEFINE to declare config.h
3215 (AC_INIT): Use a modern 3 argument call.
3216 * Makefile.in, checks/Makefile.in, doc/Makefile.in,
3217 examples/Makefile.in, lib/Makefile.in, src/Makefile.in:
3218 s/PRODUCT/PACKAGE/g.
3219 * Makefile.in (DISTFILES): Removed acconfig.h, configure.in,
3220 config.h.in. Added configure.ac, config-h.in.
3221 (stamp-h.in): Removed acconfig.h from dependencies.
3222 (configure): Depends on configure.ac, not configure.in.
3223 * doc/Makefile.in (stamp-vti): Ditto.
3224 * src/freeze.c (produce_frozen_state), src/m4.c (main): Adjust for
3225 difference between PRODUCT="m4" and PACKAGE="GNU M4".
3226 * configure: Regenerated.
3228 2005-02-03 Noah Misch <noah@cs.caltech.edu>
3230 * src/output.c (mkstemp): Make non-static, and build regardless of
3231 HAVE_TMPFILE; src/builtin.c also needs this replacement.
3234 2004-09-09 Vincent Lonngren <Vincent.lonngren.759@student.lu.se>
3236 * configure.in (AC_CHECK_HEADERS): Commit works best when you save
3237 changes from your editor buffer first.
3239 * configure.in (AC_CHECK_HEADERS): Add signal.h, sys/signal.h.
3240 * src/m4.c: And include them as appropriate.
3243 2004-09-09 Andreas Schwab <schwab@suse.de>
3245 Refactoring of the string read case in next_char provides about a
3246 20% speedup of M4 as typically used by autoconf:
3248 * src/input.c (next_char_1): Renamed from next_char.
3249 (next_char): New macro.
3252 2004-08-21 Gary V. Vaughan <gary@gnu.org>
3254 * configure.in (VERSION): Bump to 1.4.2a.
3256 2004-08-19 Paul Eggert <eggert@twinsun.com>
3259 * configure.in (VERSION): Bump to 1.4.2.
3260 * News: Describe 1.4.2's changes.
3262 * src/m4.c (reference_error): Preserve errno, since M4ERROR
3264 * src/builtin.c (m4_esyscmd): Clear errno before calling popen.
3265 (m4_maketemp): Clear errno before calling mkstemp.
3266 * src/path.c (path_search): Don't let "free" trash errno when
3268 * src/output.c (insert_file): Don't assume errno has a valid
3269 value simply because fread returns zero. This fixes a
3270 portability bug reported by Marion Hakanson in
3271 <http://lists.gnu.org/archive/html/bug-m4/2004-07/msg00029.html>.
3273 2004-06-09 Gary V. Vaughan <gary@gnu.org>
3275 * configure.in (VERSION): Bump to 1.4.1a.
3276 * NEWS: Place holder for next stable release.
3278 2004-06-03 Paul Eggert <eggert@cs.ucla.edu>
3281 * configure.in (VERSION): Bump to 1.4.1.
3282 * NEWS: Describe 1.4.1's changes.
3284 * aclocal.m4 (fp_PROG_CC_STDC): Use AC_DEFUN, not define, to
3285 pacify Autoconf 2.59.
3287 * doc/m4.texinfo: Insert commas after @xref's that lack them,
3288 to pacify Texinfo 4.7.
3289 * doc/Makefile.in (info): Remove info-1, info-2, info-3.
3291 * src/m4.h, src/debug.c: Use #ifdef __STDC__, not #if __STDC__, to
3292 pacify Sun C compilers.
3294 2003-09-28 Akim Demaille <akim@epita.fr>
3296 * src/symtab.c (lookup_symbol): Fix an uninitialized-variable
3299 2003-09-03 Santiago Vila <sanvila@debian.org>
3301 * examples/stackovf.sh: Use tempfile if available.
3303 2001-04-02 Robert Bihlmeyer <robbe@orcus.priv.at>
3305 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=92629
3306 * src/output.c (m4_insert_file): Do not mix buffered and
3307 unbuffered I/O, as this breaks on the Hurd. (trivial change)
3309 2001-02-01 Santiago Vila <sanvila@debian.org>
3311 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=84451
3312 * src/m4.c (main): Fix format vulnerabilities. (trivial change)
3314 2001-02-01 Matt Kraai <kraai@debian.org>
3316 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=84416
3317 * doc/m4.texinfo (Maketemp): Change maketemp to refer to a new,
3318 empty file rather than to a nonexistent file. This closes a common
3320 * src/builtin.c (m4_maketemp): Implement the above, by using
3321 mkstemp rather than mktemp. (trivial change)
3323 2000-01-09 Akim Demaille <demaille@inf.enst.fr>
3325 * src/builtin.c (expand_ranges): Added break after trailing dash.
3326 This caused misbehaviors on some systems.
3328 Sat Nov 5 15:52:47 1994 Francois Pinard (pinard@icule)
3331 * doc/Makefile.in (realclean): Also remove stamp-vti.
3332 Reported by Eric Backus.
3334 Wed Nov 2 00:47:53 1994 Francois Pinard (pinard@icule)
3336 * src/freeze.c (produce_frozen_state): If the frozen file cannot
3337 be opened, return immediately after producing the error message.
3338 Reported by Andreas Schwab.
3340 * configure.in: Check for const only after having found possible
3341 ANSIfying compiler flags, this is of no use to check it before.
3342 Reported by Alexander Lehmann.
3344 Tue Nov 1 22:02:37 1994 Francois Pinard (pinard@icule)
3346 * src/macro.c (collect_arguments): Cast obstack arguments to
3347 (voidstar), so avoiding compiler warnings.
3348 Reported by Joseph E. Sacco.
3350 * src/freeze.c (produce_frozen_state): Cast printed lengths to
3351 (int) so they correspond to %d format items.
3352 Reported by Joseph E. Sacco.
3354 * src/m4.c (main): Cast the argument to xfree to (voidstar).
3355 * src/symtab.c (free_symbol): Idem.
3356 Reported by Karl Vogel.
3358 Mon Oct 31 02:11:19 1994 Francois Pinard (pinard@icule)
3360 * Makefile.in (DISTFILES): Distribute BACKLOG.
3362 * configure.in: Define PRODUCT and VERSION.
3363 * acconfig.h: Document PRODUCT and VERSION.
3364 * src/m4.c, src/freeze.c: Use PRODUCT and VERSION instead of the
3365 constant string m4 and variable or parameter named version.
3367 Sun Oct 30 08:13:03 1994 Francois Pinard (pinard@icule)
3369 * src/m4.h, src/debug.c: Replace all #ifdef __STDC__ by #if
3370 __STDC__. Alliant FX/2800 Concentrix 2.2 (i860-BSD4.3) compiler
3371 defines __STDC__ to 0, for indicating it is *not* ANSI!
3372 Reported by Kaveh R. Ghazi.
3374 * configure.in: Added obsolescent tests for AIX and Minix.
3376 * doc/Makefile.in (mostlyclean): Remove texclean in dependencies,
3377 which texclean does not exist anymore.
3378 Reported by Eric Backus, Jim Meyering, John David Anglin and
3381 Sat Oct 29 05:10:03 1994 Francois Pinard (pinard@icule)
3383 * aclocal.m4 (fp_C_PROTOTYPES): Force -D_HPUX_SOURCE with -Aa.
3384 Reported by John David Anglin.
3386 * src/ansi2knr.c: New version, sent by Peter Deutsch.
3387 * aclocal.m4 (fp_C_PROTOTYPES): Substitute empty or ansi2knr for
3388 ANSI2KNR, depending on the fact the compiler is ANSI or not.
3389 * src/Makefile.in: Use -Ovarargs=convert on ansi2knr calls.
3390 Remove the sed filter after ansi2knr for debug.c. Use $O instead
3391 of $U, put underline in extensions rather than in basenames. Use
3392 implicit rules, now that regularity makes this possible.
3393 Have $(OBJECTS) depend on $(ANSI2KNR), so to trigger compilation
3394 of ansi2knr whenever it is needed.
3395 * configure.in: Adjusted for correct STACKOVF substitution.
3396 * src/debug.c (trace_format): When not __STDC__, use (...) as a
3397 parameter list, so ansi2knr will convert it to (va_alist) va_dcl.
3398 Reported by David MacKenzie.
3400 * Makefile.in: Remove binprefix. Use transform_name instead.
3401 Reported by David MacKenzie.
3403 * doc/Makefile.in: Create version.texi, use it, clean it.
3404 Reported by Jim Meyering.
3406 Fri Oct 28 20:33:55 1994 Francois Pinard (pinard@icule)
3408 * Makefile.in (all, install, uninstall): Depend on Makefile.
3410 * Makefile.in: For actions invoking $(MAKE) from within compound
3411 sh statements, exit non-zero if the sub-make fails. Otherwise,
3412 the top-level make may exit successfully when it should fail.
3413 Reported by Jim Kingdon.
3415 * {,/*}Makefile.in: Use && after all cd, in case they fail.
3417 * {,*/}Makefile.in: Declare PRODUCT and VERSION macros.
3418 (dist): Use PRODUCT and VERSION instead of tricks on .fname.
3419 * configure.in: Substitute PRODUCT and VERSION.
3421 * {,*/}Makefile.in (dist): Always try a hard link before a copy.
3423 Thu Oct 27 22:32:58 1994 Francois Pinard (pinard@icule)
3425 * Makefile.in (mostlyclean-local): Do not remove *~.
3426 * */Makefile.in (mostlyclean): Idem.
3427 Reported by Robert E. Brown and Richard Stallman.
3429 Sun Oct 9 08:30:13 1994 Francois Pinard (pinard@icule)
3431 * src/m4.h: Get rid of CONFIG_BROKETS.
3433 Sun Oct 2 16:48:10 1994 Francois Pinard (pinard@icule)
3435 * configure.in: Use AC_ARG_PROGRAM.
3436 * aclocal.m4 (fp_C_PROTOTYPES): Substitute @kr@ by kr or empty.
3437 Reported by David MacKenzie.
3439 Sat Oct 1 11:22:42 1994 Francois Pinard (pinard@icule)
3441 * configure.in: Do not add -O to CFLAGS for GNU C, now that
3442 configure does it automatically.
3443 Reported by Jim Meyering.
3445 Fri Sep 23 08:16:58 1994 Francois Pinard (pinard@icule)
3447 * src/stackovf.c: Declare the handler_t typedef earlier in the
3448 code, use it for stackovf_handler.
3449 (setup_stackovf_trap): Use RETSIGTYPE instead of void while
3450 casting sigsegv_handler.
3451 Reported by Robert Bernstein.
3453 * src/m4.c (main): Initialize program_name to argv[0] without
3455 Reported by Karl Berry.
3457 Sun Sep 18 11:42:50 1994 Francois Pinard (pinard@icule)
3459 * src/Makefile.in (TAGS): Include a ../lib/TAGS reference.
3460 Reported by Karl Berry.
3462 Wed Sep 14 10:00:22 1994 Francois Pinard (pinard@icule)
3464 * lib/Makefile.in (mostlyclean): Added.
3465 (TAGS): Make in $(srcdir).
3467 * configure.in: Use `choke me' in test, like everywhere!
3469 * {doc,examples,lib,src}/Makefile.in (check): Deleted, as
3470 unreacheable and useless.
3472 * doc/Makefile.in (texclean): Deleted, merged in mostlyclean.
3474 * lib/Makefile.in (DISTFILES): Distribute TAGS.
3475 (distclean): Do not remove TAGS.
3476 (realclean): Remove it.
3477 * Makefile.in: Make TAGS in lib also, not just in src.
3478 Reported by Karl Berry.
3480 * Makefile.in (distclean, realclean): Instead of recursively
3481 calling $(MAKE) for the -local part, allow parallel execution of
3482 -recursive and -local, only delay the removal of config.status,
3483 which is repeated in both goals.
3485 Tue Sep 13 19:21:05 1994 Francois Pinard (pinard@icule)
3488 * Makefile.in: Group all *clean-recursive goals in one, using sed
3489 to remove `-recursive' while calling make recursively. Also, use
3490 a subshell for each recursive $(MAKE).
3491 Reported by Jim Meyering.
3493 * src/m4.h (memcpy): Define with bcopy for BSD systems.
3494 Reported by Kaveh R. Ghazi.
3496 * src/Makefile.in (ansi2knr): Use $(LIBS) while linking, for SunOS
3497 4.1.3 requires -ldl to link even ansik2nr, and we need a way to
3500 * configure.in: Use date instead of touch for stamp-h.
3501 * Makefile.in (stamp-h.in): Idem.
3503 * Makefile.in (distclean, realclean): Force serial execution of
3504 both goals, in case parallel makes are being used.
3505 Reported by Jim Meyering.
3507 * src/Makefile.in (DISTFILES): Distribute TAGS.
3508 (distclean): Do not remove TAGS.
3509 (realclean): Remove it.
3510 Reported by Karl Berry.
3512 Sat Sep 10 12:34:04 1994 Francois Pinard (pinard@icule)
3514 * configure.in: Use fp_ to match aclocal.m4. Revert _OS_ macros
3515 to old names, for following Autoconf.
3517 Thu Sep 8 15:07:27 1994 Francois Pinard (pinard@icule)
3519 * Makefile.in (MDEFINES): Remove INSTALL substitutions, for
3520 ./install.sh will not be correctly referred to in sub-Makefiles.
3521 Reported by John David Anglin.
3523 * doc/Makefile.in (texclean): Remove *.cps and *.fns too.
3524 Reported by Eric Backus.
3526 * Makefile.in, checks/Makefile.in, doc/Makefile.in,
3527 examples/Makefile.in, lib/Makefile.in, src/Makefile.in: Limit
3528 config.status into remaking this directory's Makefile only.
3529 * Makefile.in (stamp-h): Do not check nor touch stamp-h.
3530 * configure.in (AC_OUTPUT): Touch stamp-h if CONFIG_HEADERS.
3531 Reported by Jim Meyering.
3533 Tue Sep 6 12:07:33 1994 Francois Pinard (pinard@icule)
3535 * configure.in: Correct stack overflow detection logic, taking
3536 care of systems having only incomplete implementations (like for
3537 Pyramid 9820 OSx 5.0d).
3538 Reported by Kaveh R. Ghazi.
3540 * src/Makefile.in (TAGS): Remote -t from etags call.
3542 Fri Sep 2 10:37:10 1994 Francois Pinard (pinard@icule)
3544 * lib/Makefile.in (install): Depend on all.
3546 Wed Aug 31 11:17:21 1994 Francois Pinard (pinard@icule)
3548 * examples/Makefile.in (mostlyclean): Do not depend on texclean.
3549 Reported by Jim Meyering and John David Anglin.
3551 * Makefile.in (distclean-local): Delete config.log.
3552 Reported by Jim Meyering.
3554 Solidify frozen files with respect to -P:
3555 * src/m4.c: Have -P set prefix_all_buitins variable instead of
3556 calling a function by that name. Declare the variable.
3557 * src/m4.h: Adjust declaration for prefix_all_buitins.
3558 * src/builtin.c (builtin_init): Merge in functionality from
3559 previous prefix_all_buitins function, while making entries in the
3560 symbol table, but not modifying the builtin description itself.
3562 * src/freeze.c (reload_frozen_state): Add a useless `break;',
3563 because *many* compilers do not accept an empty `default:'.
3564 Reported by Akiko Matsushita, Eric Backus, John David Anglin,
3565 Joseph E. Sacco, Kaveh R. Ghazi, Tom McConnell and Ulrich Drepper.
3567 * configure.in: Use AC_TYPE_SIGNAL.
3568 * src/stackovf.c (setup_stackovf_trap): Use RETSIGTYPE.
3569 Reported by Robert Bernstein.
3571 * checks/Makefile.in (check): Modify PATH so check-them will find
3572 m4 in the src directory.
3573 * Makefile.in (check): Don't.
3574 Reported by Akiko Matsushita and Jim Meyering.
3576 * src/output.c (make_room_for, output_character_helper): New
3577 functions, for implementing a global MAXIMUM_TOTAL_SIZE instead of
3578 a per buffer MAXIMUM_BUFFER_SIZE.
3580 * src/output.c (output_text): New function, for optimizing the
3581 output of strings of characters. Use it.
3583 Tue Aug 30 01:44:29 1994 Francois Pinard (pinard@icule)
3585 * doc, src: New directories reorganizing the distribution.
3586 * doc/Makefile.in, src/Makefile.in, examples/Makefile.in: New
3588 * Makefile.in: Adjusted.
3589 * configure.in: Configure new Makefiles.
3591 * m4.h: Declare STRING typedef. Use it for comment and quote
3592 strings, adjusting all references. (This is the rudiments of a
3593 beginning for the eventual withdrawal of NUL terminated strings.)
3594 * output.c (shipout_text): Accept a length parameter, and use it.
3595 All callers adjusted.
3597 Mon Aug 29 12:27:19 1994 Francois Pinard (pinard@icule)
3599 * m4.h: Include <unistd.h> if it exists.
3600 * stackovf.c: Don't.
3602 Clean up for current_diversion variable:
3603 * output.c: Move current_diversion from builtin.c.
3604 * m4.h: Declare current_diversion so builtin.c can access it.
3605 * output.c (output_init, make_diversion): Initialize or update
3607 * builtin.c (builtin_init, m4_divert): Leave current_diversion
3610 Remove limit on number of diversions:
3611 * output.c: Replace ndiversion by diversions, declare it.
3612 (output_init): Allocate only diversion 0.
3613 (make_diversion): Allocate new diversions as needed.
3614 * m4.h, m4.c: Remove NDIVERSIONS and ndiversion related stuff.
3615 * m4.c: Still accept -N, but do nothing with it.
3616 Reported by David MacKenzie.
3619 * output.c (freeze_diversions): New function.
3620 * m4.h: Declare freeze_diversions.
3621 * freeze.c: Document frozen file format, revise it, call
3622 freeze_diversions to add diversions to frozen format, and code to
3623 reload them properly.
3624 * m4.c: Do not undivert automatically at end when status being
3625 frozen. Do not call builtin_init when reloading frozen state.
3627 Speed up diversion processing:
3628 * output.c: Add INITIAL_BUFFER_SIZE, MAXIMUM_BUFFER_SIZE,
3629 COPY_BUFFER_SIZE, in-memory diversion buffers, struct diversion
3630 structure and variables, cached variables out of output_diversion,
3631 reallocate_diversion_for and OUTPUT_CHARACTER.
3632 (shipout_text, make_diversion, insert_diversion): Adapted to new
3634 (insert_file): Use better buffering.
3635 Reported by David MacKenzie.
3637 Sun Aug 28 05:20:02 1994 Francois Pinard (pinard@icule)
3639 * Makefile.in, lib/Makefile.in, checks/Makefile.in: Arrange so
3640 dist works from another build directory.
3642 Sat Aug 27 14:32:45 1994 Francois Pinard (pinard@icule)
3644 * symtab.c (hack_all_symbols): Use hash_table_size instead of
3645 constant HASHMAX, for -H option to work better.
3647 * builtin.c (DECLARE): Simplify by using _ ().
3649 * freeze.c: New file.
3650 * Makefile.in: Compile it, distribute it.
3651 * m4.c: Recognize, document and process --freeze-state (-F) and
3652 --reload-state (-R) options. Pass a true flag to builtin_init
3653 only if no reloading some state.
3654 * builtin.c (define_builtin): Remove static specifier.
3655 (find_builtin_by_name): Remove static specifier.
3656 (builtin_init): Accept and obey a flag argument.
3657 * m4.h: Add declarations for freeze.c, changes for builtin.c.
3659 Wed Aug 24 16:14:19 1994 Francois Pinard (pinard@icule)
3661 * builtin.c (dumpdef_cmp): Rewrite so the cast protect the const
3664 * configure.in: Implement --with-dmalloc.
3665 * acconfig.h: Document WITH_DMALLOC.
3666 * m4.h: Add code for when WITH_DMALLOC.
3668 Mon Aug 15 12:38:05 1994 Francois Pinard (pinard@icule)
3670 * m4.c (long_options): Use "error-output", the dash was missing.
3671 Reported by Akiko Matsushita.
3673 Fri Aug 12 16:38:01 1994 Francois Pinard (pinard@icule)
3675 * m4.h: Include <sys/types.h>.
3676 * builtin.c, debug.c, m4.c, output.c, stackovf.c: Don't.
3677 * m4.h: Declare len_lquote and len_rquote as size_t, not int.
3679 * input.c: Declare len_lquote, len_rquote, len_bcomm and len_ecomm
3681 * builtin.c (dump_args): Declare len as size_t, not int.
3683 * debug.c: Prototype the forward declaration of debug_set_file.
3685 * builtin.c (m4_undivert): Replace div by file, for avoiding the
3686 shadowing of this variable.
3687 * output.c (insert_diversion): Idem.
3689 * input.c: Delete def_rquote, def_lquote, def_bcomm and def_ecomm.
3690 (input_init): Duplicate default quote and comment strings.
3691 (set_quotes): Free previous quote strings in all cases. Duplicate
3692 even default quote strings.
3693 (set_comment): Free previous comment strings in all cases.
3694 Duplicate even default comment strings.
3696 * configure.in: Updated for Autoconf 2.0.
3697 * Makefile.in (distclean-local): Also delete config.cache.
3699 * m4.c (usage): Reorganize the --help output by topic. Include a
3700 description for debugging flags.
3702 Fri Jul 29 10:15:52 1994 Francois Pinard (pinard@icule)
3704 * configure.in: If sigaction is available and SA_ONSTACK defined,
3705 use sigaction. Otherwise, if sigvec is available and SV_ONSTACK
3706 defined, use sigvec. Else don't compile stackovf.c.
3707 * stackovf.c (setup_stackovf_trap): Idem.
3708 Reported by Jim Avera, Karl Berry, Kaveh R. Ghazi, Matthias Rabe
3711 Thu Jul 21 22:43:17 1994 Francois Pinard (pinard@icule)
3713 * m4.c (usage): Replace printf par fputs.
3715 Mon Jul 18 23:48:23 1994 Francois Pinard (pinard@icule)
3719 Sun Jul 17 08:08:25 1994 Francois Pinard (pinard@icule)
3721 * configure.in: Check for sigaction and sigvec. Add a new delayed
3722 check for RLIMIT_STACK, combine in the checking for getrlimit.
3723 All those things are not universally available.
3724 * stackovf.c: Split setting up the trap handler and catching
3725 signals, for better taking care of various configure outcomes.
3726 * examples/stackovf.sh: Correct a typo.
3727 Reported by Eric Backus, Jim Avera and Jim Meyering.
3729 Sat Jul 16 20:36:19 1994 Francois Pinard (pinard@icule)
3731 * ansi2knr.c: New version sent by its author, Peter Deutsch.
3733 Fri Jul 15 14:36:21 1994 Francois Pinard (pinard@icule)
3735 * Makefile.in: Modify so parallel make will not try making
3736 lib/libm4.a twice simultaneously.
3737 Reported by Jim Meyering.
3739 Thu Jul 14 17:23:17 1994 Francois Pinard (pinard@icule)
3741 * stackovf.c (setup_stackovf_trap): Replace "Don't" by "Do not" in
3742 error message, for when no code possibility exists. Even if this
3743 line is completely #ifdef'ed out, it brings a syntax error.
3744 Reported by Andreas Schwab, Jim Meyering and Joseph E. Sacco.
3746 * Makefile.in (install): Have install depend on all too, for lib
3747 to be remade as needed.
3749 * examples/stackovf.sh: Try ksh, bsh and bash for shells
3750 providing ulimit, instead of using only ksh.
3751 Reported by Jim Avera and Joseph E. Sacco.
3753 Tue Jul 12 06:54:31 1994 Francois Pinard (pinard@icule)
3755 * Makefile.in (check): Have it depend on all instead of m4. In
3756 this way, a change in lib will be detected and processed.
3758 * builtin.c (numeric_arg): Use strtol and verify the conversion,
3759 instead of using sscanf which stops as soon as there is a
3760 non-digit in the input. Previously, incr(1xyzzy), eval(1,2xyzzy)
3761 and divert(1xyzzy) were all accepted without any warning or error
3763 * m4.h: Declare strtol as long if not including stdlib.h.
3764 * configure.in: Check for limits.h, and replace strtol if missing.
3765 * lib/Makefile.in: Substitute LIBOBJS. Distribute strtol.c.
3766 * lib/strtol.c: New file, from elsewhere.
3767 Reported by Andreas Schwab.
3769 Thu Jul 7 22:38:10 1994 Francois Pinard (pinard@icule)
3771 * macro.c (expand_macro): Cast value to (boolean) prior to
3772 assigning it to traced.
3773 Reported by Tom McConnell.
3775 * Makefile.in (m4): Always make all in lib first.
3776 Reported by Jim Meyering.
3778 Wed Jul 6 13:16:31 1994 Jim Avera (jima@netcom.com)
3780 * stackovf.c: Isolated OS-dependent sections; Improved portability,
3781 adding support for SunOS/BSD (sigvec, sigstack, and 4-parameter signal
3782 handlers), and a default error message if the fault address is not
3783 available (when neither siginfo.h nor BSD sigcontext are supported).
3784 * configure.in: Changes for stackovf.h: Check for sigcontext,
3785 sigaction, sigstack, and define rlim_t as int if necessary.
3786 * acconfig.h: Added HAVE_SIGCONTEXT and rlim_t.
3787 * examples/stackovf.sh: Run m4 -L99999999 to allow stack overflow.
3788 * ansi2knr.c: Fix for func-ptr args; convert "..." to varargs syntax.
3790 Tue Jul 5 19:13:54 1994 Francois Pinard (pinard@icule)
3792 * configure.in: Use AC_SET_MAKE.
3793 * Makefile.in: Use @SET_MAKE@.
3794 Reported by Jim Meyering.
3796 * checks/check-them: Do not trap on SIGQUIT or SIGALRM.
3797 Reported by Ian Taylor.
3799 Sat Jul 2 00:58:47 1994 Francois Pinard (pinard@icule)
3801 * configure.in: Remove dependency of USE_STACKOVF on STDC_HEADERS,
3802 because siginfo.h is unrelated to standard headers, and siginfo.h
3803 is already checked for.
3804 Reported by Joseph E. Sacco.
3806 * acconfig.h, aclocal.m4, m4.h: Replace HAVE_PROTOTYPES by
3808 * aclocal.m4, configure.in: Replace AC_HAVE_PROTOTYPES by
3811 Wed Jun 29 22:41:53 1994 Francois Pinard (pinard@icule)
3813 * builtin.c (substitute): Use \& to represent this part of the
3814 string which was matched by the whole regexp, instead of
3815 representing the whole string. Any usage of \0 issues a warning
3816 and acts like \&, it will disappear in some subsequent release.
3818 Mon Jun 27 14:24:23 1994 Francois Pinard (pinard@icule)
3820 * m4.c: Complete prototype for forwarded declaration of usage.
3822 * input.c (init_macro_token): Correct own reference in error
3823 message. Previous name get_macro_func was referred to instead.
3824 (next_char): Correct own reference in error message. Previous
3825 name advance_input was referred to instead.
3827 * m4.h: Declare eval_t and unsigned_eval_t typedefs to 32 bits.
3828 * eval.c (logical_or_term, logical_and_term, or_term, xor_term,
3829 and_term, not_term, logical_not_term, cmp_term, shift_term,
3830 add_term, mult_term, exp_term, unary_term, simple_term): Add
3831 prototype to forwarded declarations. Declare parameter v1 as
3832 eval_t * instead of int *. Same for local variable v2 in dyadic
3833 functions. Same for result in exp_term.
3834 * builtin.c (m4_eval): Declare value as eval_t instead of int.
3835 (ntoa): Declare value as eval_t instead of int. Declare uvalue as
3836 unsigned_eval_t instead of unsigned int. Change casts accordingly.
3837 (shipout_int): Cast first argument of ntoa to eval_t.
3838 Reported by Thorsten Ohl.
3840 * macro.c: Complete the prototypes of forwarded expand_macro and
3842 Reported by Thorsten Ohl.
3844 * m4.h: Define voidstar as void * or char * depending on __STDC__.
3845 The Ultrix 3.1 compiler cannot do much with void pointers.
3847 * builtin.c (dumpdef_cmp): Replace void * by voidstar.
3848 * m4.c (xfree): Replace void * by voidstar.
3849 Reported by Tom McConnell.
3851 * ansi2knr.1: New, from elsewhere.
3852 * Makefile.in (DISTFILES): Distribute ansi2knr.1
3854 * Makefile.in (stamp-h.in): Avoid running ./config.status if
3855 stamp-h does not exist yet. This avoids running it a second time
3856 just after the initial ./configure.
3857 Reported by David MacKenzie and Tom McConnell.
3859 * m4.h: Replace the enum debug_info declaration with a series of
3860 #define's. The Ultrix 3.1 compiler would otherwise need casting
3861 (int) to most references, when used in expressions.
3862 Reported by Tom McConnell.
3864 Sat Jun 25 00:10:05 1994 Francois Pinard (pinard@icule)
3866 * aclocal.m4: Replace FP_PROTOTYPES by AC_HAVE_PROTOTYPES,
3867 following an idea from Brook G. Milligan. AC_HAVE_PROTOTYPES
3868 calls the compiler. Previously, FP_PROTOTYPES was only calling
3869 the preprocessor; by not being subject to CFLAGS, this was
3870 discouraging those flags asking for ANSI compilation.
3871 * acconfig.h: Document HAVE_PROTOTYPES.
3872 * configure.in: Use AC_HAVE_PROTOTYPES instead of FP_PROTOTYPES.
3873 * m4.h: Define _() according to HAVE_PROTOTYPES, not __STDC__.
3874 Reported by Eric Backus.
3876 * configure.in: Substitute CFLAGS and LDFLAGS, taking their value
3877 from the environment. Default CFLAGS to -g if not set.
3878 * Makefile.in: Have CFLAGS and LDFLAGS substituted from configure.
3879 * lib/Makefile.in: Have CFLAGS substituted from configure.
3880 Reported by Eric Backus and Tom McConnell.
3882 * configure.in: m4_undefine changeword before using AC_ENABLE.
3884 * m4.h: Declare prototypes for error (for ANSI compilers only),
3885 prefix_all_builtins and reference_error.
3886 Reported by Tom McConnell.
3888 * input.c (set_word_regexp): Do not try to initialize the array
3889 test from a string, this does not work with non-ANSI compilers.
3890 Reported by Eric Backus.
3892 * Makefile.in (dist): Clean examples/ before saving it.
3893 (distclean-local): Also remove stamp-h.
3894 Reported by Eric Backus.
3896 * Makefile.in (_stackovf.c): Goal for compiling stacokovf.c with
3898 Reported by Tom McConnell.
3900 * checks/Makefile.in (clean): Depends on mostlyclean.
3901 (mostlyclean): New goal.
3903 Fri Jun 24 23:30:31 1994 Francois Pinard (pinard@icule)
3905 * Makefile.in (DISTFILES): Distribute install.sh.
3906 * install.sh: New file, copied from elsewhere.
3907 Reported by Assar Westerlund and Kaveh R. Ghazi.
3909 Thu Jun 23 00:00:30 1994 Francois Pinard (pinard@icule)
3911 * configure.in: Define ENABLE_CHANGEWORD if --enable-changeword.
3912 * acconfig.h: Explain ENABLE_CHANGEWORD.
3914 [These modifs all depend upon ENABLE_CHANGEWORD and are adapted
3915 from code provided by Pete Chown]
3916 * m4.h: Add original_text field to u_t variant of union u.
3917 Declare TOKEN_DATA_FUNC macro.
3918 * builtin.c: Declare changeword.
3919 (m4_changeword): New function.
3920 * input.c: Include "regex.h", define variables with word regexps.
3921 (input_init): Initialize the word regexp.
3922 (set_word_regexp): New.
3923 (next_token): Declare local variables, use the previous code if
3924 default_word_regexp is true. Else, match using a new code. Save
3926 * macro.c (expand_token): Ship out original text if not a macro
3928 Reported by Krste Asanovic and Pete Chown.
3930 [These modifs all depend upon ENABLE_CHANGEWORD]
3931 * m4.h: Declare external user_word_regexp.
3932 * m4.c: Declare user_word_regexp, and initialize it from
3933 --word-regexp or -W, or NULL if not specified.
3934 * input.c: Use user_word_regexp if specified, instead of
3935 DEFAULT_WORD_REGEXP.
3937 * Makefile.in (m4): Revert Jan 3 1994 change. I'm unable to
3940 * Makefile.in, lib/Makefile.in: Limit suffixes to .c and .o.
3941 * checks/Makefile.in: Empty the suffix list.
3942 Reported by Geoff Russell, Joel Sherrill and Roland McGrath.
3944 * m4.c: Declare nesting_limit and initialize it to 250.
3945 Implement -LNUMBER or --nesting-limit=NUMBER to change its
3947 * m4.h: Declare nesting_limit as external.
3948 * macro.c (expand_macro): Stop execution whenever nesting limit
3950 Reported by Bengt Mertensson.
3952 * eval.c (evaluate): Diagnose excess characters in eval input.
3953 Things like `eval(08)' used to return 0 with no diagnostic.
3955 * m4.h: Capitalize first letter of all macro arguments in
3958 * m4.c: Declare warning_status, initialize it to 0. Add new
3959 option -E, or --fatal-warnings, which sets warning_status to
3960 EXIT_FAILURE instead.
3961 * m4.h: Declare external warning_status. Define EXIT_SUCCESS and
3962 EXIT_FAILURE if not otherwise done by header files.
3963 * m4.c: Delete declarations for EXIT_SUCCESS and EXIT_FAILURE.
3964 * m4.c, input.c, output.c, symtab.c, builtin.c, macro.c, debug.c,
3965 eval.c: Replace 0 by warning_status and 1 by EXIT_FAILURE in first
3966 argument of all M4ERROR calls.
3967 Reported by Noah Friedman.
3969 * examples/incl-test.m4: Renamed from incl_test.m4.
3970 * examples/include.m4: Include incl-test.m4 instead of
3972 * examples/multiquotes.m4: Renamed from multi-quotes.m.
3974 Wed Jun 22 21:58:54 1994 Francois Pinard (pinard@icule)
3976 * configure.in: Avoid USE_STACKOVF if <siginfo.h> not found. Note
3977 that Jim developped stackovf.c on a 486 running SVR4.0 (ESIX), and
3978 also tested it on a Sun Sparc workstation running SunOS 4.x.
3980 * format.c (format): When not HAVE_EFGCVT, m4 was failing the
3981 49.format check, abusing a `union values' argument with sprintf
3982 without selecting the proper field. Now, save the formatting type
3983 first, delaying the fetch of the corresponding argument.
3984 Reported by Joseph E. Sacco and Tom Quinn.
3986 * format.c (format): Remove const from char *fmt declaration when
3987 not HAVE_EFGCVT, because a NUL may be forced into it.
3989 * m4.h: Declare atof() when not STDC_HEADERS.
3990 Reported by Joseph E. Sacco.
3992 * Regenerate configure using Autoconf 1.11, this corrects a
3993 problem about an incorrect cpp seting on NeXT 3.1.
3994 Reported by Alexander Lehmann.
3996 Sun Jun 5 16:25:19 1994 Francois Pinard (pinard@icule)
3998 * m4.h (_): Change argument from `x' to `Args'.
4000 Wed May 4 23:59:39 1994 Francois Pinard (pinard@icule)
4002 * Makefile.in: Remove all occurrences of $(MFLAGS), which were
4003 bringing more evil than good on a few systems.
4004 Reported by Greg A. Woods.
4006 Fri Apr 22 15:59:35 1994 Francois Pinard (pinard@icule)
4008 * m4.h: Rename Args() to _().
4009 * m4.h: Remove extern specifier from all function declarations.
4011 Fri Apr 22 15:51:21 1994 Jim Avera (jima@netcom.com)
4013 * stackovf.c: New file implementing stack-overflow detection.
4014 * configure.in: Check for getrlimit, sigaction. If all of
4015 standard headers, getrlimit and sigaction, define USE_STACKOVF and
4016 substitute ${U}stackovf.o for STACKOVF.
4017 * acconfig.h: Declare USE_STACKOVF.
4018 * Makefile.in: Distribute stackovf.c, link with $(STACKOVF).
4019 * m4.h: Declare setup_stackovf_trap().
4020 * m4.c: Call setup_stackovf_trap().
4021 * tests/stackovf_test.sh: New file.
4023 Wed Apr 13 14:10:30 1994 Francois Pinard (pinard@icule)
4025 * checks/Makefile.in: Rename .all-stamp to stamp-checks.
4027 * Makefile.in (Makefile, etc.): Adapt for Autoconf 1.8.
4029 Sun Jan 30 14:24:19 1994 (pinard at icule)
4031 * m4.h: Remove definition of volatile, not used anymore.
4032 Reported by Jim Meyering and Joseph E. Sacco.
4034 * m4.h: Consistently use `do { ... } while (0)' in macros, instead
4035 of `if ... else /* nothing */' for if macros.
4036 Reported by Jim Meyering.
4038 * builtin.c (m4_regexp): Reorganize the code for avoiding a
4039 warning from gcc about `repl' possibly used before defined.
4040 Reported by Jim Meyering.
4042 * m4.h: Avoid a pre-ANSI <memory.h> together with <string.h>.
4043 Reported by Jim Meyering.
4045 Tue Jan 25 18:39:37 1994 Francois Pinard (pinard at icule)
4047 * m4.h: Move the conditional definition of volatile after the
4048 inclusion of system files, because they may define it first.
4050 Tue Jan 4 19:46:50 1994 Francois Pinard (pinard@icule)
4052 * checks/Makefile.in (CHECKS): Add a useless `*' before `[', to
4053 get around a problem with Alpha make seeing a syntax error, there.
4054 Reported by Vern Paxson.
4056 Mon Jan 3 00:21:45 1994 Francois Pinard (pinard@icule)
4058 * Makefile.in: Do not define LDFLAGS, use CFLAGS on link calls.
4059 Reported by Richard Stallman.
4061 Sat Dec 25 08:06:05 1993 Francois Pinard (pinard@icule)
4063 * configure.in: Correct test for strerror, AC_FUNC_CHECK was used
4064 instead of AC_HAVE_FUNCS.
4065 Reported by Noah Friedman.
4067 Wed Dec 1 09:37:53 1993 Francois Pinard (pinard@icule)
4069 * m4.c: Initialize show_help and show_version to zero.
4071 * m4.c: Ensure EXIT_SUCCESS and EXIT_FAILURE are defined.
4072 Use them in exit() and usage() calls.
4074 Sat Nov 27 10:43:24 1993 Francois Pinard (pinard@icule)
4076 * m4.h: Delete extern sys_nerr, sys_errlist declarations, and
4077 syserr() macro. Delete errref, add reference_error and M4ERROR.
4078 * m4.c: Replace errref, which was returning an input reference
4079 string, with reference_error, which prints it on standard error.
4080 * builtin.c, output.c: Use errno as second parameter to error,
4081 instead of using syserr() with %s.
4082 * *.c: Use M4ERROR instead of error: no more errref() with %s.
4083 Doing so, the program name appears after the input reference
4084 instead of before, which eases M-x next-error processing.
4086 Wed Nov 24 22:16:15 1993 Francois Pinard (pinard@icule)
4088 * checks/get-them: Escape braces with backslashes in patterns,
4089 because HPUX-9.01 awk needs this.
4090 Reported by Jim Meyering.
4092 Mon Nov 22 10:55:52 1993 Francois Pinard (pinard@icule)
4094 * builtin.c: Declare "FILE *popen ();".
4096 * m4.h: Remove MESSAGE{,1,2}, WARNING1, FATAL{,1}, INTERNAL_ERROR
4097 macros, replace error_message_prefix() declaration by errref()'s.
4098 Declare xrealloc, for use in errref().
4099 * m4.c: Delete error_message_prefix() function, add errref().
4100 * *.c: Use error() systematically in place of all error macros,
4101 now that error() flushes stdout first. Make needed adjustments.
4103 * m4.h: Remove const in sys_errlist[] declaration, it creates
4104 conflicts on SGI and Alpha.
4105 Reported by Kaveh R. Ghazi.
4107 Sat Nov 20 08:26:15 1993 Francois Pinard (pinard@icule)
4109 * m4.c: Include <getopt.h> instead of "getopt.h".
4111 * configure.in: Output to config.h. Use HAVE_FUNCS preferably.
4112 * acconfig.h: New, for documenting HAVE_EFGCVT.
4113 * Makefile.in: Distribute acconfig.h, .stamp-h.in and config.h.in,
4114 use them wherever appropriate. Also use -I. for compilations.
4115 * lib/Makefile.in: Use -I.. for compilations.
4116 * *.c: Include <config.h> or "config.h".
4118 * m4.h: Test for HAVE_MEMORY_H instead of NEED_MEMORY_H.
4119 * configure.in: Use AC_HAVE_HEADERS(memory.h), delete AC_MEMORY_H.
4121 Wed Nov 17 09:34:55 1993 Francois Pinard (pinard@icule)
4123 * builtin.c (m4_eval): Cast strlen to (int) before comparing.
4125 * input.c (input_init): Initialize quote and comment strings
4126 explicitely instead of calling set_quotes and set_comment: by
4127 doing so, we ensure we do not free uninitialized variables.
4129 * checks/check-them: Reverse arguments to both diff, so the
4130 expected is on the left and the obtained on the right.
4132 * m4.h: Add MESSAGE{,1,2}, WARNING1, FATAL{,1} and INTERNAL_ERROR
4133 macros. Delete declarations for m4error, warning, fatal and
4134 internal_error, add declaration for error_message_prefix.
4135 * m4.c: Delete m4error, warning, fatal and internal_error
4136 routines, add error_message_prefix routine.
4137 * *.c: Replace m4error routine calls with MESSAGE* macro calls,
4138 warning with WARNING*, fatal with FATAL* and internal_error with
4140 * Makefile.in (_m4.c): Do not adjust ansi2knr output for va_alist,
4141 this is not needed anymore.
4143 * m4.h: Declare extern FILE *debug. Add DEBUG_PRINT{1,3} and
4144 DEBUG_MESSAGE{,1,2} macros. Delete declarations for debug_print
4145 and debug_message, add declaration for debug_message_prefix.
4146 * debug.c: Remove static specifier for FILE *debug declaration.
4147 Delete debug_print and debug_message routines, add
4148 debug_message_prefix routine.
4149 * builtin.c, debug.c: Replace debug_print routine calls with
4150 DEBUG_PRINT* macro calls.
4151 * input.c, path.c: Replace debug_message routine calls with
4152 DEBUG_MESSAGE* macro calls.
4154 * m4.h: Remove inclusion of <varargs.h>.
4155 * debug.c: Include <stdarg.h> or <varargs.h>.
4156 (trace_format): Use stdarg instead of varargs if __STDC__.
4158 * configure.in: Remove checks for vfprintf and _doprnt. These
4159 implementations use varargs tricks which are not portable enough.
4160 * lib/vfprintf.c: Deleted.
4161 * lib/_doprnt.c: Deleted.
4162 * lib/Makefile.in: Adjusted accordingly. Remove LIBOBJS.
4163 Reported by Joel Sherrill.
4165 * path.c (add_include_directory): Use xstrdup.
4167 * builtin.c (find_builtin_by_name): Declare static.
4169 * *.[ch]: Add const to a few "char *" declarations.
4171 * configure.in: Remove commented tests for fileno() and fstat().
4172 * debug.c: Remove comments about HAVE_FILENO and HAVE_FSTAT.
4174 * debug.c (debug_flush_files): New.
4175 * m4.h: Declares it.
4176 * builtin.c (m4_syscmd, m4_esyscmd): Use it.
4177 Reported by Nicolas Pioch.
4179 Fri Nov 12 10:02:26 1993 Francois Pinard (pinard@icule)
4181 * Makefile.in (m4.dvi): Use m4.texinfo instead of m4.texi.
4182 Reported by Joel Sherrill.
4184 * builtin.c (prefix_all_builtins): Instead of the table size, use
4185 the null entry at end for stopping the loop. It was overwritten.
4186 Reported by Andreas Schwab and Jim Meyering.
4188 * builtin.c (prefix_all_builtins): Cast xmalloc to (char *).
4189 Reported by Kaveh R. Ghazi.
4191 * macro.c (call_macro): Add * in (*SYMBOL_FUNC (sym)) (...).
4192 Reported by Karl Vogel.
4194 Tue Nov 9 09:31:47 1993 Francois Pinard (pinard@icule)
4196 * m4.h: Do not define volatile if already defined.
4197 Reported by Rene' Seindal.
4199 * lib/Makefile.in: Add a forgotten ALLOCA=@ALLOCA@. Grrr!
4201 Reported by Bernhard Daeubler, Eric Backus, Hal Peterson, Hoang
4202 Uong, Ian Taylor, Kaveh R. Ghazi, Tom McConnell and Walter Wong.
4204 Mon Nov 8 21:11:44 1993 Francois Pinard (pinard@icule)
4206 * m4.h: Define strchr and strrchr in terms of index and rindex,
4207 instead of the other way around.
4208 * builtin.c, m4.c, path.c: Use strchr instead of index.
4210 * input.c (next_char): Remove a "break;" after a "return ...;".
4211 Reported by Tom McConnell.
4213 Mon Nov 8 12:45:34 1993 Francois Pinard (pinard@icule)
4217 * configure.in: Do not copy check files in the build hierarchy.
4218 * checks/check-them: Identify the m4 version being checked. For
4219 finding m4, look in $PATH instead of in the parent directory.
4220 * Makefile.in (check): Prepend `pwd` to $PATH before checking.
4221 * checks/Makefile.in (.all-stamp): Always create check files in
4222 the source hierarchy, not anymore in the build hierarchy.
4223 (check): cd to the source hierarchy before performing checks.
4224 Do not copy nor clean COPYING anymore, take it from `..'.
4225 Reported by Tom McConnell.
4227 * Makefile.in (Makefile): Use $(SHELL).
4228 (config.status): Use $(SHELL). Use "config.status --recheck"
4229 instead of "configure --no-create", which is obsolete.
4230 Reported by Tom McConnell.
4232 Fri Nov 5 09:49:30 1993 Francois Pinard (pinard@compy.IRO.UMontreal.CA)
4234 * m4.c (usage): Use "%s" instead of "m4" in format string.
4235 Reported by Jim Meyering.
4237 * Makefile.in: Distribute mkinstalldirs.
4238 Reported by Pierre Gaumond.
4239 Reported by Jim Meyering.
4240 Reported by Tom McConnell.
4241 Reported by Andreas Gustafsson.
4243 * checks/check-them: Renamed from checks/check_them.
4244 * checks/get-them: Renamed from checks/get_them.
4245 * checks/.all-stamp: Renamed from checks/.all_stamp.
4246 * checks/Makefile.in: Changed accordingly.
4247 Reported by Jim Meyering.
4249 Thu Nov 4 13:50:52 1993 Francois Pinard (pinard@lagrande.IRO.UMontreal.CA)
4251 * lib/Makefile.in (dist): Correct permissions on files.
4253 * output.c: Declare tmpfile, some systems don't.
4255 Wed Nov 3 09:09:16 1993 Francois Pinard (pinard@icule)
4257 * checks/Makefile.in (dist): Correct permissions on files.
4259 * Makefile.in (dist): Ensure recursive linking for subdirectory
4260 `examples', also set read/write permissions on all its files.
4262 * mkinstalldirs: New, from elsewhere.
4263 * Makefile.in: Use it.
4265 * debug.c: Synchronize debug messages and regular output when
4266 the debug file and stdout are redirected to the same file.
4267 * configure.in: Add (commented) checks for fileno and fstat.
4268 Reported by Jim Avera.
4270 * builtin.c (m4_ifelse): Diagnose excess arguments if 5, 8, 11,
4271 etc., arguments, then ignore the superfluous one. m4 used to
4272 diagnose missing arguments and return the empty string.
4273 Reported by Nick S. Kanakakorn.
4275 Tue Nov 2 00:55:41 1993 Francois Pinard (pinard@icule)
4277 * m4.c (main): At end of all input, ensure all undiverted text
4278 goes to the main output stream.
4279 Reported by Andreas Gustafsson.
4281 * m4.c (main): exit (0), instead of return 0.
4283 * m4.c: Implement -P and --prefix-builtins.
4284 * builtin.c: Delete const specifier on builtin_tab.
4285 (prefix_all_builtins): New.
4286 Reported by Noah Friedman.
4287 Reported by Scott Bartram.
4289 * c-boxes.el: New, from elsewhere.
4290 * Makefile.in: Distribute it.
4292 * m4.h: Do not define bcopy if <string.h> defines it.
4293 Reported by Stephen Perkins.
4295 * builtin.c (define_macro): Allow a missing second argument, in
4296 which case it is implied empty. Affects define and pushdef.
4297 Reported by Eric Allman.
4299 Mon Nov 1 07:45:24 1993 Francois Pinard (pinard@icule)
4301 * m4.h: Add blind_if_no_args in struct builtin, blind_no_args in
4302 struct symbol adn SYMBOL_BLIND_NO_ARGS macro.
4303 * builtin.c: Initialize all the blindness fields in builtin_tab.
4304 (define_builtin): Copy the blindness of a builtin into its symbol.
4305 * macro.c (expand_token): Avoid processing a blind builtin if the
4306 next character is not an opening parenthesis.
4307 Reported by David MacKenzie.
4308 Reported by Noah Friedman.
4310 * configure.in: Ensure an exit status of 0 on completion.
4311 Reported by Vivek P. Singhal.
4313 * eval.c (eval_lex): Admit both lower and upper case letters for
4314 bases greater than 10. Only lower case letters were accepted.
4316 * eval.c (eval_lex): Recognize 0bDIGITS and 0rRADIX:DIGITS syntax.
4317 Reported by Krste Asanovic.
4319 * eval.c: Rename NOT to LNOT. Add XOR, NOT, LSHIFT and RSHIFT.
4320 * eval.c (logical_not_term): New name for not_term.
4321 * eval.c (xor_term): New, between or_term and and_term.
4322 * eval.c (not_term): New, between and_term and logical_not_term.
4323 * eval.c (shift_term): New, between cmp_term and add_term.
4324 Reported by Krste Asanovic: ~, ^, <<, >>.
4325 Reported by Ben A. Mesander: ** vs ^.
4327 * m4.c: Delete xmalloc.c, xrealloc.c, xstrdup.c.
4328 * m4.h: Delete xrealloc.c.
4329 * lib/xmalloc.c: New, from elsewhere.
4330 * lib/xstrdup.c: New, from elsewhere.
4331 * lib/Makefile.in: Distribute and compile them.
4333 * m4.c: Change progname to program_name.
4334 * builtin.c, eval.c, m4.c, m4.h: Rename error to m4error.
4335 * lib/error.c: New, from elsewhere.
4336 * lib/Makefile.in: Distribute and compile error.c.
4337 * configure.in: Check AC_VPRINTF and for strerror.
4338 * m4.c: Delete cmd_error. Use error instead.
4339 * m4.c: Change label capitalisation to "ERROR", "Warning", etc.
4341 * m4.h: Delete #define const, let Autoconf takes care of this.
4343 * m4.c: Remove all code conditionalized by IMPLEMENT_M4OPTS.
4344 Merge parse_args into main. Declare argv to be `char *const *',
4345 then remove superfluous casts.
4347 * m4.c: Rename --no-gnu-extensions to --traditional.
4348 Reported by Ben A. Mesander.
4350 * m4.c (usage): Add a status parameter. Supply one in various
4351 calls. Add --help processing. Remove -V for --version.
4353 * lib/Makefile.in: Put $(CFLAGS) last in .c.o rule.
4355 * lib/Makefile.in: Have an AR=ar declaration.
4356 Reported by Eric Backus.
4357 Reported by Bjorn R. Bjornsson.
4358 Reported by Tom Tromey.
4359 Reported by Kristine Lund.
4360 Reported by Marion Hakanson.
4362 Sat Oct 30 12:51:47 1993 Francois Pinard (pinard@icule)
4364 * Makefile.in (m4.info): Use -I$(srcdir) on $(MAKEINFO).
4365 Reported by Noah Friedman.
4367 Mon Oct 25 14:58:48 1993 Francois Pinard (pinard@icule)
4369 * Makefile.in: Remove MDEFINES and cleanup.
4371 Wed Jun 9 14:59:46 1993 Francois Pinard (pinard@icule)
4373 * Makefile.in (dist): Replace "echo `pwd`" by a mere "pwd".
4376 Sat Feb 6 14:59:22 1993 Francois Pinard (pinard@icule)
4378 * Makefile.in, lib/Makefile.in, check/Makefile.in: In dist goals,
4379 ensure 777 mode for directories, so older tar's will restore file
4382 Sun Jan 17 15:38:05 1993 Francois Pinard (pinard@icule)
4384 * Makefile.in, lib/Makefile.in: Put $(CFLAGS) after $(CPPFLAGS),
4385 so the installer can override automatically configured choices.
4386 Reported by Karl Berry.
4388 Fri Jan 15 16:07:00 1993 Francois Pinard (pinard@icule)
4390 * lib/vfprintf.c: Stolen from Oleo distribution and adapted. The
4391 previous version was not working properly on m68k-hp-bsd4.3.
4392 Reported by Roland McGrath.
4394 * lib/_doprnt.c: Stolen from Oleo distribution.
4395 * configure.in: Check for _doprnt.c if vfprintf.c selected.
4396 * lib/Makefile.in: Distribute _doprnt.c.
4397 Do not distribute regex.[ch].old anymore.
4399 Fri Jan 1 19:42:23 1993 Francois Pinard (pinard at icule)
4401 * Makefile.in, lib/Makefile.in: Reinstate $(CPPFLAGS), use it.
4402 Richard wants it there.
4404 Sun Dec 27 07:01:54 1992 Francois Pinard (pinard at icule)
4406 * Makefile.in: Add DEFS to MDEFINES.
4407 * lib/Makefile.in (.c.o): Remove $(CPPFLAGS).
4408 (libm4.a): Remove the library before creating it.
4409 (distclean): Remove tags and TAGS too.
4411 Wed Dec 23 12:46:55 1992 Francois Pinard (pinard at icule)
4413 * Makefile.in (dvi, m4.dvi): New goals.
4415 * builtin.c, eval.c, format.c, input.c, m4.[ch], m4.texinfo,
4416 macro.c, output.c, path.c, symtab.c: Change Copyright from
4417 1989-1992 to the explicit enumeration 1989, 1990, 1991, 1992.
4419 * examples/divert.m4: Deleted, this bug has been corrected.
4421 * Makefile.in (texclean, mostlyclean): New goals.
4423 * Makefile.in (clean): Remove clutter from ansi2knr.
4424 Reported by Pierre Gaumond.
4425 Reported by Greg A. Woods.
4427 Sun Dec 20 10:40:20 1992 Francois Pinard (pinard at icule)
4429 * Makefile.in: Remove $(CPPFLAGS) from the .c.o rule. The user
4430 might well use CFLAGS is s/he needs it.
4432 * Makefile.in: Allow installation of info files from a separate
4434 Reported by Jason Merrill.
4435 Reported by David MacKenzie.
4436 Reported by Skip Montanaro.
4437 Reported by Erez Zadok.
4438 Reported by Assar Westerlund.
4440 Sat Dec 19 08:21:34 1992 Francois Pinard (pinard at icule)
4443 This is still a beta release for the future GNU m4 version 1.1.
4445 * lib/alloca.c: New, from elsewhere.
4446 * lib/Makefile.in: Distribute it. Define and use $(ALLOCA).
4448 * m4.h: Do not define index/rindex if already defined. If
4449 FALSE/TRUE are already defined, do not redefine them, but merely
4450 define boolean typedef to int.
4452 * Makefile.in: Use $(DEFS) while compiling ansi2knr.
4453 * ansi2knr.c: Rewrite #ifdef HAVE_STRING_H || STDC_HEADERS,
4454 because some C compilers do not like connectives with #ifdef.
4455 * m4.h: Define `volatile' only if __GNUC__, instead of once for
4456 __GNUC__ and once for __STDC__.
4457 * lib/regex.h: Leave const alone, AC_CONST will take care of it.
4459 * checks/Makefile.in: Use .all_stamp instead of $(CHECKS) for
4460 Makefile dependencies. Without it, make keeps destroying and
4461 remaking $(CHECKS) in a loop (why?). Distribute .all_stamp.
4463 * m4.h, m4.c, builtin.c, output.c: Change all divertion/DIVERTION
4464 to diversion/DIVERSION, this was a spelling error.
4466 * m4.c: Declare version[], remove #include "version.h".
4467 * version.h: Deleted.
4468 * Makefile.in: Remove references to version.h.
4470 * output.c (shipout_text): Centralize all `#line NUM ["FILE"]'
4471 production, by using a simpler and more robust algorithm. This
4472 solves the problem of synclines sometimes written in the middle of
4473 an output line. Delete sync_line() and output_lines variable.
4474 * m4.h: Remove sync_line prototype and output_lines declaration.
4475 * input.c (next_char), output.c (shipout_text): Remove references
4477 * input.c (push_file, pop_file): Merely put the value -1 in
4478 output_current_line instead of calling sync_line, for delaying a
4479 single `#line NUM FILE' before next output line. Do not test
4480 for sync_output, because this is unnecessary clutter.
4481 * output.c (make_divertion, insert_divertion): Idem.
4482 * input.c: Rename must_advance_line to start_of_input_line, for
4485 * debug.c (trace_header): Select a new debug line format, which
4486 better complies with GNU standards for formatting error messages.
4487 With option `-dfl', M-x next-error might be used on the output.
4488 * m4.c (vmesg): Adjust format of error output to GNU standards.
4489 * m4.texinfo: Adjust examples for `make check' to work.
4491 * m4.h, builtin.c, debug.c, input.c, macro.c, path.c: Use upper
4492 case for enum debug_info constants, which were all lower case.
4494 * builtin.c (m4_regexp, m4_patsubst): Use re_search instead of
4496 * lib/regex.[ch]: Use new version from textutils 1.3.6, with some
4497 collected patches. I tried a few times using newer regex.[ch], it
4498 mysteriously stopped aborting with this one. Insecure feeling...
4499 * lib/Makefile.in: Distribute regex.[ch].old, just in case!
4501 Fri Dec 18 11:08:03 1992 Francois Pinard (pinard at icule)
4503 * m4.c: Change `--no-warnings' to `--silent'.
4504 Reported by David MacKenzie.
4506 * m4.c: Put all M4OPTS code upon IMPLEMENT_M4OPTS control, and
4507 leave it off for now. See comment in m4.c for justification.
4508 Reported by David MacKenzie.
4510 * configure.in: Replace AC_USG by AC_HAVE_HEADERS(string.h).
4511 * m4.h, ansi2knr.c, lib/regex.h: Replace USG by HAVE_STRING_H.
4513 * Makefile.in: Add a new `info' goal. Use macro MAKEINFO.
4515 * Makefile.in: Ensure recursive cleaning is done before local
4516 cleaning for all clean goals.
4518 * builtin.c (ntoa): Ensure the value is always interpreted as a
4519 signed quantity, whatever the radix is.
4521 Wed Nov 18 07:57:19 1992 Jim Meyering (meyering@idefix)
4523 * builtin.c, format.c, input.c: Split long lines.
4524 * m4.c: Use typedef macro_definition instead of struct
4526 * symtab.c: Use typedef symbol instead of struct symbol.
4528 Tue Nov 17 01:58:40 1992 Francois Pinard (pinard at icule)
4530 * *.[ch]: Remove all trailing whitespace, in code and comments.
4532 * configure.in: Find some awk.
4533 * Makefile.in: Add $(AWK) to MDEFINES.
4534 * checks/Makefile.in: Transmit $(AWK) to get_them.
4535 * checks/get_them: Use $AWK instead of gawk. Add a close in the
4536 awk script when switching files, because without this, mawk runs
4537 out of file descriptors.
4539 Mon Nov 16 20:42:56 1992 Francois Pinard (pinard at icule)
4541 * Makefile.in (realclean): Delete m4.info*.
4542 Reported by Jim Meyering.
4544 * Makefile.in: Adjust and link with checks/Makefile.
4545 * checks/Makefile.in: New.
4546 * configure.in: Output checks/Makefile.
4548 * checks/get_them: Have the dnl header of each test more
4549 recognizable by next-error, also use a better message.
4551 Mon Nov 16 07:48:52 1992 Jim Meyering (meyering@idefix)
4553 * m4.h [__GNUC__]: Use __volatile__ instead of `volatile.'
4554 And use that only if __GNUC__ since we're using it's GCC-specific
4555 semantics that tell the compiler the associated function doesn't
4558 * builtin.c (substitute): Don't use character as an array index.
4559 (dumpdef_cmp): Make formal arguments `const void *' to avoid
4560 warnings with gcc -W -Wall on systems with qsort prototype.
4561 (m4_errprint): Cast obstack_finish to `char *' to avoid warnings
4564 * eval.c (most functions): Add parentheses to assignments used
4565 as truth values go avoid warnings from gcc -Wall.
4567 * input.c, m4.c, output.c, path.c, symtab.c: Declare static
4568 any functions that don't need external scope.
4570 * builtin.c, debug.c, format.c, m4.c, m4.h, macro.c, symtab.c
4571 (many functions and arrays): Declare `const'.
4573 Sun Nov 15 09:42:09 1992 Francois Pinard (pinard at icule)
4575 * *.[ch]: Rename nil to NULL, using the declaration from <stdio.h>,
4576 removing the declaration from m4.h. Also rename false to FALSE
4579 * lib/Makefile.in (Makefile): New goal.
4581 * Makefile.in, lib/Makefile.in: Add a .c.o rule, so CFLAGS is not
4582 so heavily loaded. It gets more easily overridable, calling make.
4583 Reported by Jim Meyering.
4585 * Makefile.in (dist): Get .fname from the current directory name,
4586 instead of from version.h. I need updating many files manually,
4587 when the version changes, version.h is just one of them.
4589 Sat Nov 14 11:01:20 1992 Francois Pinard (pinard at icule)
4591 * m4.h: Remove the tag `boolean' on the enum introducing typedef
4592 `boolean'. This tag conflicts with <sys/types.h> on SVR4.
4593 Reported by Tom McConnell.
4595 Fri Nov 13 00:12:50 1992 Francois Pinard (pinard at icule)
4597 * m4.texinfo: Correct the examples for 33.divert, 38.divnum,
4598 39.cleardiv, which were describing missing or spurious newlines.
4599 Modify examples 52.eval, 53.esyscmd and 54.sysval so the results
4600 do not depend on machine word size, `/bin/false' implementation,
4601 or `wc' output format. `make check' is more dependable, now.
4603 * checks/check_them: Summarize the failed tests by listing their
4604 name, at end. If none, issue `All checks successful'. Output
4605 `Checking' instead of `Input file:'.
4607 * checks/get_them, checks/check_them: Reindented.
4609 * Makefile.in (dist): chmod a+r before making the tar file.
4611 Thu Nov 12 14:42:57 1992 Francois Pinard (pinard at icule)
4613 * builtin.c (m4_dnl): Diagnose any parameter to `dnl'.
4615 * input.c (next_token): Reinitialize token_buttom just after using
4616 it as a watermark with obstack_free. Or else, a future token, big
4617 enough for triggering reallocation of the obstack chunk, could
4618 void the initialized value of token_buttom, later causing panic in
4619 obstack_free. Rename token_buttom to token_bottom everywhere.
4621 * m4.h: Before declaring errno, first include <errno.h> and
4622 ensure that it does not define errno.
4623 Reported by Richard Stallman.
4625 Wed Nov 11 17:40:35 1992 Francois Pinard (pinard at icule)
4627 * builtin.c: Define and use DECLARE macro for builtins.
4629 * builtin.c (m4_ifelse): Avoid any diagnostic when exactly one
4630 argument, this is a common idiom for introducing long comments.
4632 * builtin.c (m4_ifelse): If 3n + 2 arguments, diagnose missing
4633 arguments. The last argument was silently ignored.
4635 * m4.c (cmd_error): Add a missing semicolon before va_end().
4637 Tue Nov 10 08:57:05 1992 Francois Pinard (pinard at icule)
4639 * Makefile.in: Now handle protoized sources. Define and use U.
4640 Compile and use ansi2knr with old compilers. Update DISTFILES.
4641 Add `aclocal.m4' to `configure' dependencies.
4642 * ansi2knr.c: New, from Ghostscript distribution.
4643 * configure.in: Define U through FP_PROTOTYPES for old compilers.
4644 Add AC_ISC_POSIX, AC_CONST, AC_SIZE_T.
4645 * aclocal.m4: New, provide FP_PROTOTYPES.
4646 * m4.h: Conditionnaly protoized through Args, save for varags.
4647 * builtin.c: Protoized. Then:
4648 Include <sys/types.h> if size_t is not defined, before "regex.h".
4649 (m4_ifelse): Fetch built-in name properly for diagnostic.
4650 (m4_dumpdef): Remove wrong (char *) cast calling dump_symbol.
4651 (m4_regexp): Add const to `msg' declaration.
4652 (m4_patsubst): Add const to `msg' declaration.
4653 * debug.c: Protoized, save for varargs.
4654 * eval.c: Protoized.
4655 * format.c: Protoized.
4656 * input.c: Protoized.
4657 * m4.c: Protoized, save for varargs. Then:
4658 (xfree): Accept void * instead of char *.
4659 (xmalloc): Return void * instead of char *.
4660 (xrealloc): Accept and return void * instead of char *.
4661 * macro.c: Protoized.
4662 * output.c: Protoized.
4663 * path.c: Protoized. Then cast some (char *) over xmalloc's.
4664 * symtab.c: Protoized.
4666 Fri Nov 6 02:05:21 1992 Francois Pinard (pinard at icule)
4668 * m4.texinfo: Remove directory from diagnostics in 30.include,
4669 51.eval, 56.errprint and 57.m4exit tests.
4671 * m4.h: Remove declarations for int or void system functions, they
4672 cause more conflicting trouble than they make good.
4674 * configure.in: Avoid configuration header file. Add some tests.
4675 * m4.h: Remove #include "config.h".
4676 * Makefile.in, lib/Makefile.in: Implement Autoconf interface.
4677 Then, rewritten for better compliance with GNU standards.
4679 Thu Nov 5 12:37:13 1992 Francois Pinard (pinard at icule)
4681 * format.c (format): Avoid syntax error if not HAVE_EFGCVT,
4682 because of a misplaced #endif.
4684 * Many *.[hc] files: Correct intra-line spacing here and there,
4685 according to GNU indent 1.6 advice.
4687 * configure.in: New, using Autoconf 1.2.
4688 * m4.h: Reverse NO_MEMORY_H to NEED_MEMORY_H.
4689 * Delete old configure.in, configure, etc/configure.in,
4690 etc/configure, lib/configure.in, lib/configure and config/*.
4691 Reported by Jason Merrill.
4693 * symtab.c (hash): Change (char) NULL to '\0'.
4694 Reported by Jason Merrill.
4696 * Delete .vers, etc/newdist.sh, etc/newvers.sh and
4697 etc/nextvers.sh. Release numbers will be edited `by hand'.
4698 * version.h: De-automatize, force value in.
4700 * m4.c: Changes in order to use a newer getopt.h.
4701 Reported by David MacKenzie.
4703 * checks/: New name for examples/.
4704 * checks/get_them: New location for etc/get_examples.
4705 * checks/check_them: New location for etc/check_examples.
4706 * Makefile.in, checks/get_them, checks/check_them: Adjust.
4707 * lib/vfprintf.c: New location for etc/vfprintf.c.
4708 * Delete empty etc/.
4709 * examples/: New name for test/.
4711 Tue Mar 10 00:29:46 1992 Francois Pinard (pinard at icule)
4713 * Makefile.in (check): Add m4 as dependency.
4715 * m4.c: Accept --no-warnings instead of --no_warnings, and
4716 --no-gnu-extensions instead of --no_gnu_extensions. Make the
4717 usage message more informative.
4718 Reported by David MacKenzie.
4720 Mon Mar 9 14:53:40 1992 Francois Pinard (pinard at icule)
4722 * etc/check_examples: New name for check_examples.sh.
4723 * etc/get_examples: New name for get_examples.sh.
4724 * Makefile.in, etc/Makefile.in: Use new names.
4726 * Makefile.in: Transmit $(CC) while making in lib.
4728 * Many *.[hc] files: GNU indent'ed, with further fine tuning of
4729 code disposition by hand.
4731 Sun Mar 8 11:01:55 1992 Francois Pinard (pinard at icule)
4733 * m4.h: Delete definitions for abort() and exit().
4734 Reported by Richard Stallman.
4736 * config/hmake-unicos, config/s-unicos.h: New files.
4737 Reported by Hal Peterson.
4739 * eval.c (exp_term): Have N^0 return 1.
4740 Reported by Michael Fetterman.
4742 * eval.c, input.c, m4.h: Remove last comma in enums.
4743 Reported by Mike Lijewski.
4745 * Transfer of maintenance duties from Rene' to Franc,ois.
4747 Thu Oct 24 15:18:46 1991 Rene' Seindal (seindal at diku.dk)
4749 * Release 1.0. Many thanks to those, who provided me with bug
4750 reports and feedback.
4752 * Uses GNU configure, taken from the gdb distribution.
4754 * Uses GNU getopt(), with long option names.
4756 * The -Q/+quiet option is added, which suppresses warnings about
4757 missing or superflous arguments to built-in macros.
4759 * Added default options via the M4OPTS environment variable.
4761 * The built-in format can now be configured to use sprintf as
4762 the formatting engine, for systems without [efg]cvt(3).
4764 * GNU library code is moved to the ./lib subdirectory; other
4765 utility files are now in ./etc.
4767 * Several minor bugs have been fixed.
4769 Fri Jul 26 15:28:42 1991 Rene' Seindal (seindal at diku.dk)
4771 * Fixed various bugs. Release 0.99, manual 0.09. Many thanks to
4772 Francois Pinard and Roland H. Pesch for providing me with reports.
4774 * The builtins incr and decr are now implemented without use of
4777 * The builtin indir is added, to allow for indirect macro calls
4778 (allows use of "illegal" macro names).
4780 * The debugging and tracing facilities has been enhanced
4781 considerably. See the manual for details.
4783 * The -tMACRO option is added, marks MACRO for tracing as soon
4786 * Builtins are traced after renaming iff they were before.
4788 * Named files can now be undiverted.
4790 * The -Nnum option can be used to increase the number of
4791 divertions available.
4793 * Calling changecom without arguments now disables all comment
4796 * The function m4_patsubst() is now consistently declared
4799 * A bug in dnl is fixed.
4801 * A bug in the multi-character quoting code is fixed.
4803 * Several typos in the manual has been corrected. More probably
4806 * The m4.info file is now installed along with the program.
4808 Thu Nov 15 21:51:06 1990 Rene' Seindal (seindal at diku.dk)
4810 * Updated and enhanced version. Release 0.75, manual 0.07.
4812 * Implemented search path for include files (-I option and
4813 M4PATH envronment variable).
4815 * Implemented builtin "format" for printf-like formatting.
4817 * Implemented builtin "regexp" for searching for regular
4820 * Implemented builtin "patsubst" for substitution with regular
4823 * Implemented builtin "esyscmd", which expands to a shell
4826 * Implemented "__file__" and "__line__" for use in error
4829 * Implemented character ranges in "translit".
4831 * Implemented control over debugging output.
4833 * Implemented multi-character quotes.
4835 * Implemented multi-character comment delimiters.
4837 * Changed predefined macro "gnu" to "__gnu__".
4839 * Changed predefined macro "unix" to "__unix__", when the -G
4840 option is not used. With -G, "unix" is still defined.
4842 * Changed "shift", "$@" and "$*" to not insert spaces afters
4845 * Added program name to error messages.
4847 * Fixed two missing null bytes bugs.
4849 Mon Jan 22 21:08:52 1990 Rene' Seindal (seindal at diku.dk)
4851 * Initial beta release. Release 0.50, manual 0.05.
4861 Copyright (C) 1990, 1991, 1992, 1993, 1994, 2000, 2001, 2003,
4862 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
4864 Copying and distribution of this file, with or without
4865 modification, are permitted provided the copyright notice
4866 and this notice are preserved.