1 2008-03-06 Eric Blake <ebb9@byu.net>
3 Fix nested builtin(`shift',$@) regression from 2008-02-22.
4 * src/macro.c (make_argv_ref_token): Don't output expansion text
5 when making wrapper for builtin or indir.
6 * doc/m4.texinfo (Builtin): Test it.
7 * NEWS: Document the fix.
8 Reported by Andreas Schwab.
10 2008-03-04 Eric Blake <ebb9@byu.net>
12 Make GNUmakefile work with in-place builds.
13 * configure.ac (AC_CONFIG_LINKS): Use m4_PACKAGE_VERSION to work
14 with older autoconf. Use shell variable to bypass older automake
16 * Makefile.am (distclean-local): Remove GNUmakefile link in VPATH
17 builds, since we bypassed automake.
18 * GNUmakefile: Collapse redundant lines.
19 (_is-dist-target): 'distclean' is not a dist target.
20 * Makefile.maint (vc-diff-check): Support out-of-tree VPATH build.
21 Reported by Ralf Wildenhues.
23 2008-03-03 Eric Blake <ebb9@byu.net>
25 More maintainer build adjustments.
26 * configure.ac (AC_CONFIG_LINKS): Link GNUMakefile into VPATH
27 build tree, but only if autoconf is new enough.
28 * GNUmakefile (_have-Makefile, _dummy): Don't pollute Makefile.am
30 (_is-dist-target): Support out-of-tree VPATH build.
31 (check, install, dist, distcheck) [!_have-Makefile]: Forward
32 common build targets on to all to get nicer error messages.
33 * Makefile.maint (makefile-check, news-date-check)
34 (changelog-check, m4-check, vc-diff-check, web-manual): Work in
36 * m4/gnulib-cache.m4: Remove obsolete free module. Import memchr2
39 2008-02-26 Eric Blake <ebb9@byu.net>
42 Reported by Ralf Wildenhues.
44 2008-02-25 Eric Blake <ebb9@byu.net>
46 Make intra-release version numbers more intelligent.
47 * m4/gnulib-cache.m4: Import git-version-gen module.
48 * GNUmakefile (_curr-ver): Add rules to ensure releases have
49 up-to-date version string.
50 * Makefile.am (EXTRA_DIST): Distribute .version.
51 (.version, dist-hook): New rule for generating it.
52 * configure.ac (AC_INIT): Make version track intermediate
54 * .gitignore: Don't version-control version files.
56 * Makefile.cfg (url_dir_list): Fix location.
58 Minor tweaks, learned from the release.
59 * Makefile.maint (VC-tag): Avoid dashed git commands, and use
60 signing key from Makefile.cfg.
61 (delta-diff): Avoid blank lines mid-macro.
62 * HACKING: Tweak instructions.
64 * configure.ac (AC_INIT): Likewise.
66 Beta Release Version 1.4.10b.
67 * configure.ac (AC_INIT): Bump version.
68 (AM_INIT_AUTOMAKE): Increase requirement, and add dist-lzma.
70 * HACKING: Update for git release procedures.
71 * README: Update to mention this is a beta release on the stable
73 * bootstrap: Mention new automake dependency.
74 * Makefile.cfg: New file.
75 * GNUmakefile: Use it.
76 * Makefile.maint (gzip_rsyncable, GZIP_ENV, GIT, VC, VC-tag)
77 (VERSION_REGEXP, this-vc-tag, my_distdir, null_AM_MAKEFLAGS)
78 (TMPDIR, gnulib-version): New macros, borrowed from coreutils.
79 (makefile-check, news-date-check, changelog-check, m4-check)
80 (vc-diff-check, maintainer-distcheck, vc-dist, my-distcheck)
81 (announcement, alpha, beta, major): New rules, borrowed from
83 (TEXI2HTML, cvs-release, update-timestamps, cvs-news, cvs-commit)
85 * Makefile.am (EXTRA_DIST): Distribute new file.
86 * m4/gnulib-cache.m4: Import announce-gen module.
88 2008-02-23 Eric Blake <ebb9@byu.net>
90 Use size_t consistently for string length truncation.
91 * src/m4.h (max_debug_argument_length): Change type to size_t.
92 (shipout_string_trunc, arg_print): Change parameter type.
93 * src/debug.c (trace_format, trace_pre): Adjust all callers.
94 * src/input.c (input_print): Likewise.
95 * src/m4.c (max_debug_argument_length, main): Likewise.
96 * src/macro.c (arg_print): Likewise.
97 * src/output.c (shipout_string_trunc): Likewise.
98 Reported by Ralf Wildenhues.
100 s/obstack_print/shipout_string_trunc/.
101 * src/m4.h (obstack_print): Rename...
102 (shipout_string_trunc): ...to this, to leave obstack_ prefix for
104 * src/debug.c (trace_format): Adjust caller.
105 (obstack_print): Move...
106 * src/output.c (shipout_string_trunc): ...here, including rename.
107 * src/input.c (input_print): Adjust caller.
108 * src/macro.c (arg_print): Likewise.
109 Reported by Ralf Wildenhues.
111 s/shipout_text/divert_text/.
112 * src/m4.h (shipout_text): Rename...
113 (divert_text): ...to this, so that shipout_ prefix can be used for
114 functions that do not do #line tracking.
115 * src/output.c (divert_text): Rename.
116 * src/macro.c (expand_token): Adjust all callers.
118 Stage 18: try harder to reuse argv in recursion.
119 When pushing arguments that contain an existing $@ ref, reuse the
120 ref rather than creating another layer of wrappers.
121 Memory impact: noticeable improvement, due to better $@ reuse.
122 Speed impact: noticeable improvement, due to O(n^2) to O(n)
123 reduction in unboxed recursion.
124 * src/macro.c (make_argv_ref_token): Avoid wrapping $@ when
126 (push_args): Let make_argv_ref_token take care of pending data.
127 * doc/m4.texinfo (Improved foreach): Tweak wording to match new
128 performance capability. Add regression tests.
129 * NEWS: Document the speedup.
130 * src/m4.c (AUTHORS): Claim credit for my rewrite.
132 2008-02-22 Eric Blake <ebb9@byu.net>
134 Stage 17: pass argv through quoted strings.
135 Allow the concatenation of $@ references with other text input
136 inside quoted contexts, which requires distinguishing between a
137 wrapper around many arguments vs. a reference serving as part of a
138 single argument. Also optimize based on whether argv contains
139 builtin tokens that might need flattening to the empty string.
140 Memory impact: noticeable improvement, due to O(n^2) to O(n)
141 reduction from total reuse of $@ references.
142 Speed impact: noticeable improvement, due to O(n^2) to O(n)
143 reduction in boxed recursion.
144 * src/input.c (append_quote_token): Allow an argv ref inside
146 (init_argv_token): Populate new fields.
147 (push_macro): Ensure a macro is actually pushed.
148 * src/m4.h (struct token_chain): Add has_func member.
149 (struct token_data): Add wrapper and has_func members.
150 * src/macro.c (struct macro_arguments): Add flatten and has_func
152 (expand_argument, collect_arguments, make_argv_ref_token)
153 (make_argv_ref): Populate new fields.
154 (arg_equal, arg_len) Handle embedded argv.
155 (arg_token, arg_mark, arg_type): Use new fields.
157 2008-02-21 Eric Blake <ebb9@byu.net>
159 Stage 16: cache quotes and improve arg_print.
160 Cache rather than always copying quotes when pushing $@ refs; in
161 particular, reconstruct single-byte quotes on the fly. Allow NUL
162 through m4wrap. Improve sharing of code that prints arguments.
163 Memory impact: slight improvement, due to cached quotes.
164 Speed impact: slight improvement, due to less copying.
165 * src/m4.h (push_wrapup_init, push_wrapup_finish, quote_cache)
166 (func_print): New prototypes.
167 (arg_print): Adjust prototype.
168 * src/builtin.h (func_print): New function.
169 (define_user_macro): Slight cleanup.
170 (dump_args): Delete, no longer used.
171 (m4_errprint): Use arg_print.
172 (m4_m4wrap): Handle embedded NUL.
173 * src/debug.c (trace_pre): Use arg_print.
174 * src/input.c (cached_quote): New variable.
175 (push_wrapup): Split...
176 (push_wrapup_init, push_wrapup_finish): ...into these.
177 (input_print): Use arg_print.
178 (quote_cache): New function.
179 (pop_input, next_char_1, append_quote_token, set_quote_age):
181 * src/macro.c (arg_text, make_argv_ref_token): Adjust users.
182 (arg_print): Add parameters.
183 * examples/null.m4: Test for NUL in m4wrap.
184 * examples/null.out: Update expected output.
185 * doc/m4.texinfo (Debug Levels): Test --arglength truncation.
187 Fix out-of-bounds read for sanitized macro names, from 2008-02-06.
188 * src/m4.c (m4_verror_at_line): Properly terminate the string.
189 Reported by Ralf Wildenhues.
191 2008-02-19 Eric Blake <ebb9@byu.net>
193 Clean up foreach example.
194 * doc/m4.texinfo (Foreach, Improved foreach): Document another
195 shortcoming in foreach.m4.
197 2008-02-18 Eric Blake <ebb9@byu.net>
199 Avoid some magic numbers.
200 * src/m4.h (DEBUG_TRACE_ARGS, DEBUG_TRACE_EXPANSION)
201 (DEBUG_TRACE_QUOTE, DEBUT_TRACE_ALL, DEBUG_TRACE_LINE)
202 (DEBUG_TRACE_FILE, DEBUG_TRACE_PATH, DEBUG_TRACE_CALL)
203 (DEBUG_TRACE_INPUT, DEBUG_TRACE_CALLID, DEBUG_TRACE_VERBOSE)
204 (DEBUG_TRACE_DEFAULT): Use hex constants, to make it obvious these
206 * src/input.c (CHAR_EOF, CHAR_MACRO, CHAR_QUOTE, CHAR_ARGV):
207 Define in terms of UCHAR_MAX.
208 (set_word_regexp): Likewise.
209 * src/builtin.c (compile_pattern, m4_translit): Likewise.
210 Reported by Ralf Wildenhues.
212 2008-02-16 Eric Blake <ebb9@byu.net>
214 Add regression test for multi-character quote recursion.
215 * examples/foreach2.m4: Use $0 rather than spelling out name.
216 * examples/foreachq2.m4: Likewise.
217 * examples/forloop2.m4: Likewise.
218 * examples/hanoi.m4: Likewise.
219 * examples/trace.m4: Likewise.
220 * doc/m4.texinfo (Improved forloop): Document advantage of $0.
221 (Improved foreach): Adjust dump from file.
223 Stage 15: return argv refs back to collect_arguments.
224 Collect an entire $@ reference at once rather than one argument at
225 a time, outside of quotes (but inside quotes, $@ is still
226 flattened for now). The skip_last field allows concatenation of
227 $@ with other text when collecting arguments.
228 Memory impact: noticeable improvement, due to better reuse of $@.
229 Speed impact: noticeable improvement, due to less parsing.
230 * src/m4.h (enum token_type): Add TOKEN_ARGV.
231 (struct token_chain): Add skip_last member to argv link.
232 (next_token): Update prototype.
233 * src/input.c (CHAR_ARGV): New placeholder input character.
234 (peek_input): Add parameter, to pass $@ at once.
235 (next_char_1, append_quote_token): Handle $@ inside quotes.
236 (init_argv_token): New function.
237 (push_token, match_input, next_token, peek_token, lex_debug):
239 * src/macro.c (expand_input, collect_arguments): Likewise.
240 (expand_argument): Handle incoming $@ token.
241 (arg_adjust_refcount, arg_token, arg_text, make_argv_ref_token):
242 Handle nested $@ refs.
243 * src/symtab.c (symtab_debug): Update caller.
244 * examples/null.m4: Document more tests that are needed. Add
245 tests for NUL with divert, patsubst, and regexp.
246 * examples/null.out: Update for new tests.
247 * doc/m4.texinfo (Syntax): Add test for m4exit and NUL.
248 * checks/get-them (AWK): Give a default value.
249 * checks/check-them: Allow tests to invoke child processes with
250 same include path. Perform message normalization on stderr.
252 2008-02-15 Eric Blake <ebb9@byu.net>
254 Use fastmaps for better regex performance.
255 * src/builtin.c (compile_pattern): Allocate a fastmap.
256 * src/input.c (word_start): Delete.
257 (set_word_regexp): Compile a fastmap instead.
258 (peek_token, next_token): Use fastmap.
259 (pop_wrapup): Free memory on exit.
261 2008-02-13 Eric Blake <ebb9@byu.net>
264 * doc/m4.texinfo (Incompatibilities): Use @. after capital.
265 (History): Use @: after abbreviations.
266 (M4exit): Use correct Latin abbreviation.
268 2008-02-11 Eric Blake <ebb9@byu.net>
270 Document behavior of __gnu__().
271 * doc/m4.texinfo (Platform macros): Enhance test.
272 (Macro expansion): New test.
274 Use gnulib's git-merge-changelog driver when available.
275 * .gitattributes: New file.
276 * bootstrap: Install driver, if not already present.
278 2008-02-06 Eric Blake <ebb9@byu.net>
280 Fix security hole introduced 2007-11-22.
281 * src/m4.h (includes): Add quotearg.h.
282 * src/m4.c (m4_verror_at_line): Properly escape macro names.
283 (main): Manage quoteargs defaults.
284 * doc/m4.texinfo (Indir): Document and test this.
286 2008-02-05 Eric Blake <ebb9@byu.net>
288 * m4/gnulib-cache.m4: Import the strtod module.
290 2008-02-02 Eric Blake <ebb9@byu.net>
292 Stage 14: allow pushing argv references.
293 Push a $@ reference to the input engine in one go, rather than
294 pushing each element. For now, argument collection still gets one
295 argument of a $@ at a time; but the penalties of this patch make
296 it easier to manage $@ efficiently in future patches.
297 Memory impact: noticeable penalty, due to larger struct and O(n)
298 to O(n^2) on unboxed recursion.
299 Speed impact: noticeable penalty, due to more bookkeeping.
300 * src/m4.h (struct token_chain): Add comma and quotes fields.
301 (arg_adjust_refcount, arg_print, push_arg_quote): New prototypes.
302 * src/input.c (push_token, pop_input, input_print, peek_input)
303 (next_char_1): Support $@ references.
304 * src/macro.c (struct macro_arguments): Add level field. Match
305 type of arraylen to argc.
306 (collect_arguments): Populate new field.
307 (expand_macro, make_argv_ref, push_arg): Factor...
308 (arg_adjust_refcount, make_argv_ref_token, push_arg_quote):
309 ...into these new methods.
310 (arg_token): Add new parameter.
311 (arg_print): New function.
312 (arg_mark, arg_type, arg_text, arg_equal, arg_empty, arg_len)
313 (arg_func, push_args): Adjust callers.
314 * doc/m4.texinfo (Ifelse): Augment test.
316 2008-01-31 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
318 * checks/Makefile.in: Use @SET_MAKE@, and use @SHELL@ rather
319 than hard-coding /bin/sh.
321 Reported by Lawson Chan.
323 2008-01-27 Eric Blake <ebb9@byu.net>
325 Stage 13: push composite text tokens.
326 Support pushing composite tokens, allowing back-references to be
327 reused through multiple macro expansions. Add hueristic that
328 avoids creating new reference when pushing existing references.
329 Memory impact: noticeable improvement due to better reference
330 reuse, except for O(n) to O(n^2) copying in boxed recursion.
331 Speed impact: slight penalty, due to more bookkeeping.
332 * src/m4.h (push_token): Adjust prototype.
333 * src/input.c (push_token): Add parameter, and handle composite
335 (append_quote_token): Inline short strings.
336 * src/macro.c (push_arg, push_args): Adjust callers.
338 2008-01-26 Eric Blake <ebb9@byu.net>
340 Stage 12: make token_chain a union, add string_pair.
341 Shrink size of symbol chains by using a union. Make passing quote
342 delimiters around more efficient. Other code cleanups.
343 Memory impact: slight improvement, due to smaller struct.
344 Speed impact: slight penalty, due to more bookkeeping.
345 * src/m4.h (STRING): Delete typedef.
346 (struct string_pair, enum token_chain_type): New types.
347 (struct token_chain): Reduce size via a union.
348 (ARG_LEN): New macro.
350 * src/builtin.c (ARG): ...from here.
351 (dump_args, define_macro, m4_dumpdef, m4_builtin, m4_indir)
352 (m4_defn, mkstemp_helper, m4_maketemp, m4_mkstemp, m4___file__)
353 (m4___program__, m4_m4wrap, m4_len, m4_index, m4_substr)
354 (m4_regexp, m4_patsubst): Adjust callers.
355 * src/input.c (rquote, lquote, bcomm, ecomm): Delete...
356 (curr_quote, curr_comm): ...replaced by these.
357 (make_text_link, push_token, pop_input, input_print, peek_input)
358 (next_char_1, input_init, set_quotes, set_comment, set_quote_age)
359 (next_token, peek_token): Adjust callers.
360 * src/macro.c (expand_macro, arg_token, arg_mark, arg_text)
361 (arg_equal, arg_len, make_argv_ref, push_arg, push_args):
363 * src/format.c (ARG_INT, ARG_LONG, ARG_STR, ARG_DOUBLE, format):
365 * src/freeze.c (produce_frozen_state): Likewise.
366 * src/debug.c (trace_format, trace_pre): Likewise.
367 (debug_decode): Don't lose partial traces prior to reducing
370 2008-01-22 Eric Blake <ebb9@byu.net>
372 Stage 11: full circle for single argument references.
373 Pass quoted strings through to argument collection in a single
374 action, so that an argument can be reused throughout macro
375 recursion if it remains unchanged.
376 Memory impact: noticeable improvement, due to more reuse in
377 argument collection stacks; O(n^2) to O(n) on boxed recursion.
378 Speed impact: noticeable improvement, due to less copying.
379 * src/m4.h (struct token_chain): Add quote_age member.
380 (struct token_data): Add end member to chain alternate.
381 (make_text_link): New prototype.
382 * src/input.c (CHAR_QUOTE): New macro.
383 (word_start): Pre-allocate.
384 (set_word_regexp): Simplify.
385 (make_text_link): Export, and handle new fields.
386 (next_char, next_char_1): Add parameter.
387 (append_quote_token): New function.
388 (match_input, next_token): Adjust callers to handle quoted input
390 * src/macro.c (struct macro_arguments): Add wrapper member.
391 (expand_argument): Accept composite blocks from input engine.
392 (expand_macro): Reduce refcounts of composite arguments.
393 (collect_arguments, arg_token, arg_mark, make_argv_ref): Update to
395 (arg_type, arg_text, arg_equal, arg_len): Treat composite
397 (push_arg, push_args): Handle composites.
399 2008-01-17 Eric Blake <ebb9@byu.net>
401 Stage 10: avoid extra copying of strings and comments.
402 When collecting tokens that are immune to further expansion, avoid
403 copying data from one obstack to another by outputting it into the
404 destination obstack to begin with. Also reduce copying done in
406 Memory impact: slight improvement, due to better obstack usage.
407 Speed impact: noticeable improvement, due less data copying.
408 * m4/gnulib-cache.m4: Import the intprops and vasnprintf-posix
410 * src/m4.h (includes): Use new gnulib modules.
411 (next_token): Adjust prototype.
412 (bad_argc): New prototype.
413 * src/format.c (arg_int, arg_long, arg_double): New helper
415 (ARG_INT, ARG_LONG, ARG_STR, ARG_DOUBLE): Track missing
417 (format): Improve warnings, and avoid copying into obstack in the
419 * src/input.c (next_token): Add new parameter.
420 (lex_debug): Adjust caller.
421 * src/symtab.c (symtab_debug): Likewise.
422 * src/macro.c (expand_input, expand_token, expand_argument)
423 (collect_arguments): Likewise.
424 * src/output.c (m4_tmpname): Guarantee correct buffer size.
425 * src/builtin.c (builtin_init): Improve efficiency.
427 (ntoa): Tighten buffer allocation.
428 * doc/m4.texinfo (Format): Test the improvements.
429 * NEWS: Document the improvement.
431 2008-01-14 Eric Blake <ebb9@byu.net>
433 Fix --warn-macro-sequence regression from 2007-11-29.
434 * src/builtin.c (define_user_macro): Use correct length.
435 * doc/m4.texinfo (Arguments): Test the fix.
436 (History): Reword to account for new year and eventual result of
439 2008-01-08 Eric Blake <ebb9@byu.net>
442 * NEWS: Update year. Mention effect of my recent memmem
443 contributions to gnulib.
445 2007-12-21 Eric Blake <ebb9@byu.net>
447 Stage 9: share rather than copy single-arg refs.
448 Use hooks of previous patch to create back-references to arguments
449 in the input engine, and inline short text rather than always
450 creating a FIFO link. Also start testing embedded NUL behavior.
451 Until the argument collection engine also shares references, the
452 memory usage increases.
453 Memory impact: noticeable penalty, due to longer life of argv
454 changing O(n) to O(n^2) on boxed recursion.
455 Speed impact: slight improvement, due less data copying.
456 * m4/gnulib-cache.m4: Import quote and memmem modules.
457 * src/m4.h (arg_scratch): New prototype.
458 * src/input.c (INPUT_INLINE_THRESHOLD): New define.
459 (push_token): Use it to inline short text, and save references to
461 (input_init, next_token): Simplify obstack handling.
462 * src/macro.c (expand_argument): Likewise.
463 (expand_macro): Track scratch space.
464 (arg_scratch): New function.
465 (make_argv_ref): Use it.
466 (push_args): Likewise, and simplify comma handling, since most
467 separators are short enough to be inlined.
468 * src/builtin.c (builtin_init): Avoid cast.
469 (m4_errprint, m4_index): Transparently support NUL.
470 (m4_translit): Use scratch space, rather than leaking memory on
472 * doc/m4.texinfo (Syntax): Add new test of embedded NUL.
473 * checks/get-them: Extract test that uses external files.
474 * checks/check-them: Run the new test. Use unified diff if
475 possible, and force text mode when debugging NUL handling.
476 * examples/null.m4: New file.
477 * examples/null.out: Likewise.
478 * examples/null.err: Likewise.
479 * examples/Makefile.am (EXTRA_FILES): Distribute these files.
480 * .gitattributes: Treat new files as text, in spite of embedded
483 2007-12-18 Eric Blake <ebb9@byu.net>
485 Stage 8: extend life of references into argv.
486 Add hooks to lengthen the lifetime of arguments reused in a macro
487 expansion, rather than always discarding arguments at the end of
488 expand_macro. Rework the expand_macro obstacks to handle longer
489 lifetimes. For now, the hooks remain unused.
490 Memory impact: slight penalty, due to larger structs.
491 Speed impact: slight penalty, due to more bookkeeping.
492 * src/m4.h (obstack_regrow): Delete, now that it is unused.
493 (struct token_chain): Add level field.
494 (push_token): Adjust prototype.
495 (adjust_refcount): New prototype.
496 * src/macro.c [DEBUG_MACRO]: Add debugging hooks for $@ reference
498 (argc_stack, argv_stack): Delete, replaced by...
499 (struct macro_arg_stacks, stacks, stacks_count): ...these new
500 structure for tracking $@ references.
501 (expand_input): Initialize new structure.
502 (collect_arguments): Alter signature.
503 (expand_macro): Rework obstack handling, in order to keep $@
504 references alive until they have been rescanned.
505 (adjust_refcount, arg_mark): New functions.
506 (make_argv_ref): Use new field.
507 (push_arg, push_args): Update callers.
508 * src/input.c (make_text_link): Use new field.
509 (push_token): Change signature.
510 (pop_input, next_char_1): Call new function.
511 * doc/m4.texinfo: Clean up some examples of -d option usage.
512 (Ifelse): Add some stress tests.
514 2007-12-13 Eric Blake <ebb9@byu.net>
517 * doc/m4.texinfo (Inhibiting Invocation): Missed one instance in
522 2007-12-13 Paolo Bonzini <bonzini@gnu.org> (tiny change)
524 * doc/m4.texinfo (Inhibiting Invocation): Fix quoting of a quoting
526 Reported by Giovanni Toffetti.
528 2007-12-11 Eric Blake <ebb9@byu.net>
530 Stage 7: add chained token support to input parser.
531 Allow the LIFO input engine to rescan a macro expansion composed
532 of smaller chunks of FIFO data, rather than the old approach of a
533 monolithic string. For now, all chunks are still copied.
534 Memory impact: slight penalty, due to FIFO chain overhead.
535 Speed impact: noticeable penalty, due to extra bookkeeping.
536 * src/m4.h (struct token_chain): Add const safety.
537 (push_token): New prototype.
538 * src/input.c (INPUT_CHAIN): New enumerator.
539 (struct input_block): Add new input type u_c, and change u_s to
540 length-based processing.
541 (make_text_link): New helper function.
542 (push_token): New function.
543 (push_string_finish): Use it.
544 (pop_input, input_print, peek_input, next_char, next_char_1):
545 Adjust to handle new input type.
546 * src/macro.c (push_arg, push_args): Use new function.
548 2007-12-10 Eric Blake <ebb9@byu.net>
550 Stage 6: convert builtins to push arg at a time.
551 Add new methods to factor all builtins whose expansion includes an
552 argument, making back-reference creation easier in future patches.
553 Factor out length-limited printing to obstacks, and use -1 rather
554 than 0 for unlimited length.
556 Speed impact: slight improvement, due to better code sharing.
557 * src/m4.h (includes): Include <limits.h> here, instead of in
559 (input_block): New typedef.
560 (trace_pre, trace_post, push_string_finish): Update prototypes.
561 (obstack_print, input_print, push_arg, push_args): New
563 * src/input.c (push_string_finish): Change return type.
564 (input_print): New function.
565 * src/debug.c (trace_format): Add %B specifier, and use new
567 (trace_pre): Remove redundant argc parameter.
568 (trace_post): Likewise, and change signature.
569 (obstack_print): New function.
570 * src/macro.c (expand_macro): Update caller.
571 (push_arg, push_args): New functions.
572 * src/builtin.c (m4_ifdef, m4_ifelse, m4_shift, m4_substr)
573 (m4_patsubst, expand_user_macro): Use new functions.
574 (mkstemp_helper, m4_maketemp): Avoid extra trailing NULs.
575 * src/m4.c (max_debug_argument_length, main): Set to INT_MAX, not
577 * src/output.c: Update includes.
578 * src/symtab.c: Likewise.
580 2007-12-07 Eric Blake <ebb9@byu.net>
582 Minor security fix: Quote output of mkstemp.
583 * src/builtin.c (mkstemp_helper): Produce quoted output.
584 * doc/m4.texinfo (Mkstemp): Update the documentation and tests.
585 * NEWS: Document this change.
587 Stage 5: add notion of quote age.
588 Cache the quoting rules that were in effect when a string was
589 parsed, to avoid reparsing that string if no changequote or other
590 quote age change took place in the meantime. A quote_age of 0 is
591 always safe, but does not benefit from caching.
592 Memory impact: slight penalty, due to larger struct.
593 Speed impact: slight penalty, due to more bookkeeping.
594 * src/input.c: Comment cleanups.
595 (current_quote_age): New global variable.
596 (set_quote_age): New helper function.
597 (input_init, set_word_regexp): Use it.
598 (set_quotes, set_comment): Likewise, and detect no-op changes.
599 (quote_age, safe_quotes): New functions.
600 (next_token): Track quote age.
601 * src/m4.h (struct token_data): Add quote_age member.
602 (TOKEN_DATA_QUOTE_AGE, quote_age, safe_quotes): New prototypes.
603 * src/macro.c (struct macro_arguments): Add quote_age member.
604 (expand_token): Alter signature and track quote age.
605 (expand_input, expand_argument): All callers changed.
606 (collect_arguments, make_argv_ref): Track quote age.
607 (arg_text, arg_len, arg_func): Detect type mismatch.
608 * doc/m4.texinfo (Ifelse, Changequote): Add more tests.
609 (Incompatibilities): Fix typo.
610 * examples/wraplifo.m4: New file.
611 * examples/Makefile.am (EXTRA_DIST): Distribute it.
613 2007-12-04 Eric Blake <ebb9@byu.net>
615 Fix builds with OpenBSD make.
616 * doc/Makefile.am (HELP2MAN): New macro.
617 (man_MANS, m4.1): Fix rules for building m4.1 into srcdir.
618 * README: Update copyright.
619 * HACKING: Mention help2man and makeinfo dependencies.
621 2007-11-29 Eric Blake <ebb9@byu.net>
623 Stage 4: route indir, builtin through ref; make argv opaque.
624 Finish making struct opaque to all but the input engine, by
625 reworking obstack usage in expand_macro to better support creation
626 of a $@ reference. Canonicalize the empty argument, to allow
627 pointer comparison optimizations.
628 Memory impact: slight penalty, due to larger struct.
629 Speed impact: slight improvement, due to fewer function calls.
630 * src/m4.h (obstack_regrow): Borrow definition from head.
631 (struct token_chain): Add flatten and len members.
632 (arg_equal, arg_empty, make_argv_ref): New prototypes.
633 (struct macro_arguments): Move...
634 * src/macro.c (struct macro_arguments): ...here, making it
635 opaque. Add has_ref member.
636 (empty_token): New placeholder, for optimizing comparison with
638 (collect_arguments): Change signature, and populate new fields.
639 (expand_macro): Alter handling of obstacks.
640 (arg_token): New helper method.
641 (arg_equal, arg_empty, make_argv_ref): New methods.
642 (arg_type, arg_text, arg_len, arg_func): Use new methods.
643 * src/builtin.c (m4_ifelse, m4_builtin, m4_indir, m4_eval):
645 * src/format.c (format): Likewise.
647 Stage 3: cache length, rather than computing it.
648 Cache the length of a token, to avoid repeating lots of strlen
649 calls. Additionally, by using obstack length rather than strlen,
650 the input engine can now support embedded NUL.
651 Memory impact: slight penalty, due to larger struct.
652 Speed impact: noticeable improvement, due to fewer function
654 * src/input.c (next_token): Grab length from obstack rather than
656 * src/m4.h (token_data, macro_arguments): Add length field.
657 (TOKEN_DATA_LEN): New accessor.
658 (define_user_macro): Add parameter.
659 * src/builtin.c (define_user_macro, mkstemp_helper): Use
661 (builtin_init, define_macro, m4_maketemp, m4_mkstemp): Adjust
663 (dump_args, m4_ifdef, m4_ifelse, m4_builtin, m4_indir, m4_eval)
664 (m4_len, m4_substr, m4_translit, m4_regexp, m4_patsubst)
665 (expand_user_macro): Use cached lengths.
666 * src/freeze.c (reload_frozen_state): Adjust callers.
667 * src/m4.c (main): Likewise.
668 * src/macro.c (expand_token, expand_argument, collect_arguments)
669 (arg_len): Use cached length.
670 * doc/m4.texinfo (Mkstemp): Ensure mkstemp does not produce NUL.
672 2007-11-27 Eric Blake <ebb9@byu.net>
674 Stage 2: use accessors, not direct reference, into argv.
675 Outside of macro.c, use accessor methods rather than direct access
676 into the argv struct.
678 Speed impact: slight penalty, due to increased function calls.
679 * src/m4.h (TOKEN_EOF): Alter value, to ease debugging.
680 (arg_argc, arg_type, arg_text, arg_len, arg_func): New
682 * src/macro.c (arg_argc, arg_type, arg_text, arg_len, arg_func):
683 New accessor functions.
684 * src/builtin.c (ARG, dump_args, define_macro, m4_builtin)
685 (m4_indir): Use new accessors.
686 * src/debug.c (trace_pre): Likewise.
687 * src/format.c (ARG_INT, ARG_LONG, ARG_STR, ARG_DOUBLE):
690 2007-11-24 Eric Blake <ebb9@byu.net>
692 Stage 1: convert token_data** into new object.
693 Pass a variable-size wrapper structure instead of an array to
694 builtins, so that subsequent optimizations in the structure need
695 not impact every builtin client.
696 Memory impact: slight penalty, since struct is larger than array.
697 Speed impact: slight penalty, due to increased bookkeeping.
698 * m4/gnulib-cache.m4: Import flexmember module.
699 * src/m4.h (struct macro_arguments, struct token_chain): New
701 (builtin_func): Alter signature.
702 (token_data): Add new TOKEN_COMP alternative.
703 * src/builtin.c: All builtins changed.
704 (ARG, dump_args, define_macro, expand_user_macro): Update to use
706 * src/debug.c (trace_pre, trace_post): Likewise.
707 * src/format.c (ARG_INT, ARG_LONG, ARG_STR, ARG_DOUBLE, format):
709 * src/macro.c (collect_arguments): Build new struct.
710 (call_macro, expand_macro): Update to use new struct.
712 2007-11-22 Eric Blake <ebb9@byu.net>
714 More error messages tied to macro names.
715 * src/input.c (set_word_regexp): Take additional parameter.
716 (input_init): Adjust caller.
717 * src/debug.c (debug_set_file, debug_set_output): Take additional
719 (debug_init): Adjust caller.
720 (expansion_level): Move declaration...
721 * src/m4.h (expansion_level): ...here.
722 (debug_set_output, set_word_regexp): Adjust prototypes.
723 * src/builtin.c (m4_changeword, m4_m4exit, m4_debugfile): Adjust
725 * src/m4.c (main): Likewise.
727 Refactor error messages to avoid macros.
728 * src/m4.h (_): Define, as a placeholder for now.
729 (M4ERROR, M4ERROR_AT_LINE): Delete.
730 (m4_error, m4_error_at_line): Change prototype.
731 (m4_warn, m4_warn_at_line): New prototypes.
732 * src/m4.c (m4_verror_at_line): New helper function.
733 (m4_error, m4_error_at_line): Use new function, and properly call
735 (m4_warn, m4_warn_at_line): New functions.
736 (stackovf_handler, main): All callers changed.
737 * src/builtin.c: Likewise.
738 * src/debug.c: Likewise.
739 * src/eval.c: Likewise.
740 * src/format.c: Likewise.
741 * src/freeze.c: Likewise.
742 * src/input.c: Likewise.
743 * src/macro.c: Likewise.
744 * doc/m4.texinfo (Indir, Builtin, Dumpdef, Incr, Eval, Substr)
745 (Improved forloop): Adjust tests accordingly.
747 Security fix: avoid arbitrary code execution with 'm4 -F'.
748 * src/freeze.c (produce_frozen_state): Never pass raw file name as
750 * NEWS: Document this fix.
752 2007-11-21 Eric Blake <ebb9@byu.net>
754 Consistently report macro name first in messages.
755 * src/m4.h (evaluate): Adjust prototype.
756 * src/builtin.c (bad_argc, numeric_arg, m4_placeholder): Alter
757 wording to match head.
758 (mkstemp_helper, substitute): Adjust signature. All callers
760 (m4_dumpdef, m4_builtin, m4_indir, m4_defn, m4_esyscmd, m4_eval)
761 (m4_undivert, m4_maketemp, m4_m4exit, m4_debugmode)
762 (m4_debugfile, m4_regexp, m4_patsubst): Mention macro name in
764 (m4_format): Adjust call.
765 * src/format.c (format): No longer skip argv[0].
766 * src/eval.c (evaluate): Mention macro name in message.
767 (logical_or_term, logical_and_term, or_term, xor_term, and_term)
768 (equality_term, cmp_term, shift_term, add_term, mult_term)
769 (exp_term, unary_term, simple_term): Adjust signature.
770 * src/macro.c (warn_builtin_concat): Likewise.
771 (expand_argument): Adjust caller.
772 * doc/m4.texinfo (Macro Arguments, Ifdef, Ifelse, Debug Output)
773 (Dnl, Improved fatal_error, Defn, Builtin, Index macro, Regexp)
774 (Substr, Translit, Patsubst, Format, Eval, Dumpdef, Include)
775 (Improved forloop, Indir, Trace, Incr): Adjust tests to match.
777 Make argument checking a bit more sane.
778 * src/builtin.c (bad_argc): Adjust signature, and don't force
779 callers to add 1. Adjust all callers.
780 (numeric_arg): Adjust signature. Adjust all callers.
782 Make dnl diagnostic print macro name.
783 * src/m4.h (skip_line): Adjust prototype.
784 * src/input.c (skip_line): Report error on behalf of caller.
785 * src/builtin.c (m4_dnl): Adjust caller.
786 (dump_args, m4_dumpdef, m4_changequote, m4_changecom)
787 (m4_changeword, m4_traceon, m4_traceoff, expand_user_macro): Use
788 ARG macro instead of open-coding.
789 * doc/m4.texinfo (Dnl): Adjust test.
791 2007-11-20 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
793 * Makefile.am (EXTRA_DIST): gendocs.sh is gone here.
795 2007-11-14 Eric Blake <ebb9@byu.net>
797 Avoid builtin concatenation in macro arguments.
798 * doc/m4.texinfo (Defn): Add tests.
799 * src/macro.c (warn_builtin_concat): New function.
800 (expand_argument): Use it to warn on more corner cases.
801 * NEWS: Mention new warning.
803 2007-11-13 Eric Blake <ebb9@byu.net>
805 Simplify previous patch.
806 * src/input.c (pop_input): Change signature.
807 (push_string_init, next_char_1): Adjust callers.
809 Note: Patches titled Stage 0 through N form a series of patches
810 which decreases the algorithmic complexity of tail recursion in
811 macro expansions from O(n^2) to O(n) in both time and memory, then
812 performs cleanups, such as handling of embedded NUL, made easier
813 by the code refactoring.
815 Stage 0: Fix memory leak in tail recursion.
816 Free expansion text in the input engine as soon as it is parsed,
817 rather than when the recursive expansion completes.
818 Memory impact: noticeable improvement, due to reduction from
819 O(n^2) to O(n) on recursion.
820 Speed impact: minor improvement, due to better memory usage.
821 * src/input.c (push_string_init): Let go of memory earlier.
822 (next_char_1): Make end of string detection reliable.
823 (match_input): Simplify use of push_string_init.
824 * NEWS: Document this fix.
826 2007-11-07 Eric Blake <ebb9@byu.net>
828 * doc/m4.texinfo (Pseudo Arguments): Test more corner cases.
830 2007-11-05 Eric Blake <ebb9@byu.net>
832 Use assert, rather than INTERNAL ERROR.
833 * src/m4.h: Include <assert.h>.
834 * src/builtin.c (m4_dumpdef, define_macro, m4_defn): Use assert.
835 * src/debug.c (trace_pre): Likewise.
836 * src/eval.c (evaluate, cmp_term, shift_term, mult_term):
838 * src/freeze.c (produce_frozen_state): Likewise.
839 * src/input.c (push_string_init, pop_input, init_macro_token)
840 (peek_input, next_char_1, set_word_regexp): Likewise.
841 * src/m4.c (main): Likewise.
842 * src/macro.c (expand_token, expand_argument, call_macro):
844 * src/output.c (make_diversion): Likewise.
845 * src/symtab.c (symtab_init): Likewise.
847 Use build-aux directory.
848 * configure.ac (PACKAGE, VERSION): Delete, since Automake does
850 (AC_CONFIG_AUX_DIR): Add, with auxiliary files in build-aux
851 instead of the top level.
852 * bootstrap: Adjust accordingly.
853 * m4/gnulib-cache.m4: Add --aux-dir option.
854 * doc/Makefile.am (m4.1): Rewrite rule to use build-aux/missing.
856 2007-11-02 Eric Blake <ebb9@byu.net>
858 Update some documentation about version control.
859 * NEWS: M4 is now stored in git.
862 * bootstrap: Likewise.
863 * commit: Delete, now that CVS commits are no longer necessary.
865 Adjust to recent gnulib change.
866 * m4/gnulib-cache.m4: Drop vasprintf-posix and xvasprintf, and use
867 xvasprintf-posix instead.
869 2007-11-01 Eric Blake <ebb9@byu.net>
871 Improve error message when early end of file occurs.
872 * doc/m4.texinfo (Macro Arguments, Changequote, Changecom)
873 (M4wrap): Adjust to new messages.
874 (Improved capitalize): Enhance test.
875 * src/m4.h (next_token): Adjust prototype.
876 * src/input.c (next_token): Add new parameter, and improve error
878 (lex_debug): Adjust callers.
879 * src/symtab.c (symtab_debug): Likewise.
880 * src/macro.c (expand_input, collect_arguments): Likewise.
881 (expand_argument): Likewise, and add parameter.
883 2007-10-31 Eric Blake <ebb9@byu.net>
885 Test more corner cases.
886 * doc/m4.texinfo (Changecom, Pseudo Arguments): Beef up tests.
887 (Improved foreach): Document alternate foreachq style.
888 * examples/foreachq3.m4: New file.
889 * examples/loop.m4: New file.
890 * examples/Makefile.am (EXTRA_DIST): Distribute them.
892 2007-10-28 Eric Blake <ebb9@byu.net>
894 More test coverage for autoconf usage patterns.
895 * doc/m4.texinfo (Inhibiting Invocation, Pseudo Arguments)
896 (Builtin): Add new undocumented tests.
897 (Shift): Document cond macro, and add new test.
899 2007-10-27 Eric Blake <ebb9@byu.net>
901 Document one use of changequote(`(',`)').
902 * doc/m4.texinfo (Changequote): Add new test, based on recent
903 autoconf addition of m4_expand.
905 2007-10-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
907 * examples/Makefile.am (EXTRA_DIST): Add capitalize2.m4.
909 2007-10-24 Eric Blake <ebb9@byu.net>
911 Reduce number of mingw testsuite failures.
912 * doc/m4.texinfo (Using frozen files): Skip test on mingw.
914 2007-10-22 Eric Blake <ebb9@byu.net>
916 Add DEBUG_REGEX debugging information.
917 * src/m4.h (DEBUG_REGEX): New debug macro.
918 * src/m4.c (main) [DEBUG_REGEX]: Open regex trace file when
920 * src/builtin.c (m4_patsubst, m4_regexp, compile_pattern)
921 [DEBUG_REGEX]: Trace regex usage.
923 Never let printf failures go undetected.
924 * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
926 * src/m4.h: Include xprintf.h.
927 * src/format.c (format): Warn on format failures.
928 * src/builtin.c (ntoa): Export.
929 (m4_errprint): Adjust all *printf callers.
930 * src/debug.c (debug_message_prefix, trace_format): Likewise.
931 * src/freeze.c (produce_frozen_state): Likewise.
932 * src/input.c [DEBUG_INPUT]: Likewise.
933 * src/m4.c (usage): Likewise.
934 * src/m4.h (DEBUG_PRINT1, DEBUG_PRINT3, DEBUG_MESSAGE)
935 (DEBUG_MESSAGE1, DEBUG_MESSAGE2): Likewise.
936 * src/output.c (m4_tmpname, shipout_text, freeze_diversione):
938 * src/path.c [DEBUG_INCL]: Likewise.
939 * src/stackovf.c (process_sigsegv) [DEBUG_STKOVF]: Likewise.
940 * src/symtab.c [DEBUG_SYM]: Likewise.
942 2007-10-17 Eric Blake <ebb9@byu.net>
944 Fix 'm4 -F file -t undefined'.
945 * src/freeze.c (produce_frozen_state): Avoid core dump.
946 * doc/m4.texinfo (Using frozen files): Test for the bug.
947 * NEWS: Mention the fix.
949 2007-10-09 Eric Blake <ebb9@byu.net>
951 * NEWS: Document recent speedups.
953 Fix regexp regression of 2007-09-29.
954 * src/builtin.c (substitute): Allow NULL regs when no
955 subexpressions were present.
956 (m4_regexp): Handle \ escapes even with empty regex.
957 * doc/m4.texinfo (Regexp, Patsubst): Catch this bug.
959 Cache regex compilation for another autoconf speedup.
960 * src/m4.h (free_macro_sequence): Rename...
961 (free_regex): ...to this.
962 * src/m4.c (main): Update caller.
963 * src/builtin.c (REGEX_CACHE_SIZE, m4_regex, regex_cache): New
965 (compile_pattern): New function; cache recent regexes.
966 (free_regex): Rename, and clean up additional memory.
967 (m4_regexp, m4_patsubst): Use new function.
969 2007-10-02 Eric Blake <ebb9@byu.net>
971 Document quoting pitfalls in capitalize.
972 * doc/m4.texinfo (Patsubst): Use the examples directory. Also
974 (Improved capitalize): New node.
975 * examples/capitalize.m4: Update to match manual.
976 * examples/capitalize2.m4: New file.
978 2007-10-01 Eric Blake <ebb9@byu.net>
980 Another Autoconf usage pattern optimization.
981 * src/builtin.c (m4_index): Optimize search for one byte.
982 * doc/m4.texinfo (Index macro, Regexp, Patsubst): Test the new
985 2007-09-29 Eric Blake <ebb9@byu.net>
987 Optimize for Autoconf usage pattern.
988 * src/builtin.c (m4_regexp, m4_patsubst): Handle empty regex
991 2007-09-24 Eric Blake <ebb9@byu.net>
993 Create .gitignore alongside .cvsignore.
994 * bootstrap (LC_ALL): Set up front.
995 (version control) Borrow idea from head, to avoid churn in
996 m4/.*ignore files modified by gnulib-tool.
998 2007-09-13 Eric Blake <ebb9@byu.net>
1000 * AUTHORS: Fix typo.
1002 2007-09-07 Eric Blake <ebb9@byu.net>
1004 * AUTHORS: Simplify, to match libtool and autoconf layout.
1005 * THANKS: Sync with head.
1007 2007-08-10 Eric Blake <ebb9@byu.net>
1009 * doc/m4.texinfo (Compatibility): Sync with head.
1011 2007-08-10 Konrad Schwarz <konrad.schwarz@siemens.com> (tiny change)
1012 and Eric Blake <ebb9@byu.net>
1014 * doc/m4.texinfo (Defn): Update wording.
1016 2007-08-09 Eric Blake <ebb9@byu.net>
1018 POSIX requires defn(`a',`b') to concatenate definitions.
1019 * src/builtin.c (m4_defn): Allow multiple arguments, but warn if
1020 trying to mix a builtin with anything else.
1021 * doc/m4.texinfo (Defn): Document a use for this POSIX
1023 (Incompatibilities): Update to match current status.
1024 * NEWS: Document this change.
1026 Reported by Konrad Schwarz.
1028 2007-08-04 Eric Blake <ebb9@byu.net>
1030 Normalize all GPL license notices.
1031 * GNUmakefile: Update license wording.
1032 * Makefile.am: Likewise.
1033 * Makefile.maint: Likewise.
1034 * bootstrap: Likewise.
1036 * configure.ac: Likewise.
1037 * checks/Makefile.in: Likewise.
1038 * doc/Makefile.am: Likewise.
1039 * examples/Makefile.am: Likewise.
1040 * src/Makefile.am: Likewise.
1041 * src/builtin.c: Likewise.
1042 * src/debug.c: Likewise.
1043 * src/eval.c: Likewise.
1044 * src/format.c: Likewise.
1045 * src/freeze.c: Likewise.
1046 * src/input.c: Likewise.
1047 * src/m4.c: Likewise.
1048 * src/m4.h: Likewise.
1049 * src/macro.c: Likewise.
1050 * src/output.c: Likewise.
1051 * src/path.c: Likewise.
1052 * src/stackovf.c: Likewise.
1053 * src/symtab.c: Likewise.
1055 2007-07-21 Eric Blake <ebb9@byu.net>
1057 Fix regression on NetBSD from 2007-05-28.
1058 * src/output.c (m4_tmpopen): Explicitly reset append-mode stream
1060 * NEWS: Document this fix.
1062 Reported by Thomas Klausner.
1064 2007-07-20 Eric Blake <ebb9@byu.net>
1066 Fix 'make distcheck' issues.
1067 * Makefile.am (EXTRA_DIST): No need to distribute
1068 gpl-3.0.texi.diff anymore.
1069 * m4/gnulib-cache.m4: Update to latest gnulib.
1071 2007-07-14 Eric Blake <ebb9@byu.net>
1073 Reflect upstream license .texi changes.
1074 * doc/m4.texinfo (Copying): Rename node...
1075 (GNU General Public License): ...to this.
1076 (GNU Free Documentation License): Adjust node location.
1077 * local/doc/gpl-3.0.texi.diff: Remove file.
1079 2007-07-10 Eric Blake <ebb9@byu.net>
1082 * configure.ac (AC_INIT): Bump version number.
1083 * NEWS: Start changes since 1.4.10.
1084 * doc/m4.texinfo (History): Mention 1.4.11.
1085 (Copying This Package, Copying This Manual): Add index entries.
1086 * local/lib/version-etc.c.diff: Delete, now that gnulib has been
1088 * Makefile.am (EXTRA_DIST): Remove dead file.
1090 2007-07-09 Eric Blake <ebb9@byu.net>
1092 Release Version 1.4.10.
1093 * doc/Makefile.am (m4_TEXINFOS): Distribute gpl-3.0.texi.
1094 * Makefile.am (EXTRA_DIST): Distribute gnulib diffs.
1095 * configure.ac (AC_INIT): Bump version number.
1096 * NEWS: Describe changes since 1.4.9.
1098 * src/format.c: Missed a GPLv3 conversion.
1100 Avoid undefined behavior of %.*c in printf.
1101 * src/format.c (format): Special case %c.
1102 * TODO: Document that more remains to be done.
1103 * NEWS: Document the fix.
1105 2007-07-05 Eric Blake <ebb9@byu.net>
1107 Fix up gnulib-tool usage.
1108 * m4/gnulib-cache.m4: Change local-dir to local, not `.'.
1109 * version-etc.c.diff: Move to...
1110 * local/lib/version-etc.c.diff: ...here.
1111 * gpl-3.0.texi.diff: Move to...
1112 * local/doc/gpl-3.0.texi.diff: ...here.
1114 2007-07-04 Eric Blake <ebb9@byu.net>
1116 Upgrade to GPL version 3 or later.
1117 * bootstrap: Pick up GPLv3.
1118 * m4/gnulib-cache.m4: Augment with 'gnulib-tool
1119 --local-dir=. --import gpl-3.0'.
1120 * doc/m4.texinfo (Copying This Package): New appendix.
1121 * NEWS: Mention this change.
1122 * README: Mention why some files still claim to be version 2.
1123 * version-etc.c.diff: New file, to make sure --version claims
1124 correct GPL version. Temporary until gnulib makes move.
1125 * gpl-3.0.texi.diff: New file, to allow inclusion of GPLv3 as
1126 appendix, rather than section, of the manual.
1127 * GNUmakefile: Update to new license.
1128 * Makefile.am: Likewise.
1129 * Makefile.maint: Likewise.
1131 * configure.ac: Likewise.
1132 * checks/Makefile.in: Likewise.
1133 * doc/Makefile.am: Likewise.
1134 * examples/Makefile.am: Likewise.
1135 * src/Makefile.am: Likewise.
1136 * src/builtin.c: Likewise.
1137 * src/debug.c: Likewise.
1138 * src/eval.c: Likewise.
1139 * src/freeze.c: Likewise.
1140 * src/input.c: Likewise.
1141 * src/m4.c: Likewise.
1142 * src/m4.h: Likewise.
1143 * src/macro.c: Likewise.
1144 * src/output.c: Likewise.
1145 * src/path.c: Likewise.
1146 * src/stackovf.c: Likewise.
1147 * src/symtab.c: Likewise.
1149 2007-06-26 Eric Blake <ebb9@byu.net>
1151 * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import assert'.
1153 2007-06-26 Karl Berry <karl@freefriends.org> (tiny change)
1155 Match Free Software Directory categories.
1156 * doc/m4.texinfo (dircategory): Update.
1158 2007-05-31 Eric Blake <ebb9@byu.net>
1160 * src/output.c (output_text): Fix regression from 2007-05-28.
1161 * doc/m4.texinfo (History): Mention 1.4.10.
1162 (Format): Make testsuite output easier to debug.
1164 2007-05-29 Eric Blake <ebb9@byu.net>
1167 * configure.ac (AC_INIT): Bump version number.
1168 * NEWS: Start changes since 1.4.9b, and fix typo.
1170 Beta Release Version 1.4.9b.
1171 * configure.ac (AC_INIT): Bump version number.
1172 * NEWS: Describe changes since 1.4.9.
1174 Improve format support.
1175 * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
1177 * src/format.c (format): Parse %'hhd, %a, %A. Avoid calling
1178 printf with too few arguments, as in format(%*.*d,-1,-1,1).
1179 * doc/m4.texinfo (Format): Expand tests, and improve
1181 * NEWS: Document this change.
1183 2007-05-28 Eric Blake <ebb9@byu.net>
1185 Fix large diversion corner cases, including 1.4.8 regression.
1186 * src/output.c (m4_tmpfile, m4_tmpopen): Simplify use of errno.
1187 (make_room_for): Use NULL, not 0, for pointers.
1188 (insert_diversion_helper): Avoid using rewind.
1189 (freeze_diversions): Allow freezing large diversions.
1190 * NEWS: Document this fix.
1192 Also run gnulib unit tests during make check.
1193 * m4/gnulib-cache.m4: Augment with 'gnulib-tool
1194 --tests-base=tests --with-tests'.
1195 * configure.ac (AC_CONFIG_FILES): Build gnulib testdir.
1196 * Makefile.am (SUBDIRS): Run gnulib tests before ours.
1198 2007-05-25 Eric Blake <ebb9@byu.net>
1200 Backport prompts in examples from head.
1201 * src/macro.c (expand_macro): Shorten message.
1202 * doc/m4.texinfo (Manual, Command line files, Comments)
1203 (Inhibiting Invocation, Macro Arguments, Macro expansion, Indir)
1204 (Builtin, Shift, Forloop, Foreach, Dumpdef, Trace, Debug Levels)
1205 (Debug Output, Include, Format, Syscmd, Mkstemp, Location)
1206 (Using frozen files, Improved forloop, Improved foreach): Add
1207 prompts to examples.
1208 * checks/get-them: Ignore prompts in examples.
1210 Fix sync line interaction with multiline comments.
1211 * doc/m4.texinfo (Other Incompatibilities): Add example, and
1212 document bug in --syncline/divert interaction.
1213 (Preprocessor features): Augment test.
1214 * src/m4.h (output_text): Export.
1215 (shipout_text, next_token): Add parameter.
1216 * src/freeze.c (reload_frozen_state): Don't interfere with
1217 synclines when reloading state.
1218 * src/output.c (output_text): Export.
1219 (shipout_text): Take new parameter for start line of token.
1220 Output at most one syncline per token.
1221 * src/input.c (next_token): Report line where multiline tokens
1223 * src/macro.c (expand_input, expand_token, expand_argument):
1224 Adjust callers so that line is passed from input to output.
1225 * NEWS: Document this fix.
1226 Reported by Sergey Poznyakoff.
1228 Test -s in testsuite.
1229 * doc/m4.texinfo (Preprocessor features): Add a test.
1230 * checks/get-them: Support extra options in testsuite.
1231 * checks/check-them (examples): Use extra options.
1233 Reported by Sergey Poznyakoff.
1235 2007-05-24 Eric Blake <ebb9@byu.net>
1237 Support POSIX flush semantics on all platforms.
1238 * m4/gnulib-cache.m4: Remove closeout, and augment with
1239 'gnulib-tool --import closein fflush'.
1240 * src/m4.h (includes): Use closein, not closeout.
1241 * src/m4.c (main): Ensure stdin is flushed when not all input is
1243 (process_file): No return needed.
1244 * src/debug.c (debug_flush_files): Rely on gnulib module, rather
1245 than excluding mingw.
1246 * NEWS: Document this change.
1248 Work around cygwin and mingw fseeko bugs.
1249 * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import fseeko'.
1250 * src/debug.c (debug_flush_files): Prefer fseeko over fseek.
1252 2007-04-25 Eric Blake <ebb9@byu.net>
1254 Fix negative division within eval, regression of 2007-01-06.
1255 * doc/m4.texinfo (Eval): Catch this bug.
1256 * src/eval.c (mult_term): Fix it.
1257 * NEWS: Document this.
1259 Reported by Cesar Strauss.
1261 2007-04-23 Eric Blake <ebb9@byu.net>
1264 * configure.ac (AC_INIT): Bump version number.
1265 * NEWS: Start changes since 1.4.9.
1267 2007-03-23 Eric Blake <ebb9@byu.net>
1270 * configure.ac (AC_INIT): Bump version number.
1271 * NEWS: Describe changes since 1.4.8b.
1273 2007-03-16 Eric Blake <ebb9@byu.net>
1275 * doc/m4.texinfo (Mkstemp): Tweak wording.
1276 * src/output.c (output_init): Adjust to latest gnulib.
1278 2007-03-15 Eric Blake <ebb9@byu.net>
1280 Avoid Tandem/NSK's broken long long (without a symmetric unsigned
1281 long long, it confuses gnulib).
1282 * configure.ac (AC_TYPE_LONG_LONG_INT): Declare long long broken
1283 if unsigned long long doesn't work.
1285 Reported by Matthew Woehlke.
1287 2007-03-07 Eric Blake <ebb9@byu.net>
1290 * doc/m4.texinfo: Minor tweaks, avoid makeinfo warning.
1292 2007-03-01 Eric Blake <ebb9@byu.net>
1294 * doc/m4.texinfo: Pick up more index entries from head. Follow
1295 more texinfo recommendations.
1296 (Sysval): Improve tests.
1298 Avoid overfull \vbox warning from texinfo, due to indices that
1299 weren't quite big enough to split across page boundaries.
1300 * doc/m4.texinfo: Add lots of concept index entries.
1301 (Concept Index): Move to be last, as recommended by texinfo
1303 (Define, Arguments, Pseudo Arguments): Add more function entries.
1305 2007-02-28 Eric Blake <ebb9@byu.net>
1307 * doc/m4.texinfo (Eval): Clean up wording to reflext POSIX XCU ERN
1309 (Pseudo Arguments): Add useful example.
1311 * doc/m4.texinfo (Pushdef, Incompatibilities): Clean up wording to
1312 reflect POSIX XCU ERN 118.
1314 * src/m4.h (DEFAULT_MACRO_SEQUENCE): Factor out from...
1315 * src/m4.c (usage): ...here,...
1316 * src/builtin.c (set_macro_sequence): ...and here.
1317 (define_user_macro): Fix typo.
1318 * doc/m4.texinfo (Preprocessor features, Arguments): Fix minor
1320 (Shift): Document composite macro argn for portably getting at
1321 positional parameters beyond 9.
1322 * configure.ac (AC_INIT): Bump version number.
1323 * NEWS: Start changes of 1.4.8c.
1325 2007-02-24 Eric Blake <ebb9@byu.net>
1327 Beta Release 1.4.8b:
1328 * configure.ac (AC_INIT): Bump version number.
1329 * NEWS: Describe changes since 1.4.8.
1331 Reserve all uses of raw ${} in macro definitions, not just
1333 * src/builtin.c (set_macro_sequence): Change default macro
1335 * doc/m4.texinfo (Operation modes): Update to match.
1336 * src/m4.c (usage): Likewise.
1339 2007-02-23 Eric Blake <ebb9@byu.net>
1341 * src/m4.h (includes): Update to latest gnulib.
1343 2007-02-08 Eric Blake <ebb9@byu.net>
1345 Rename --warn-syntax to --warn-macro-sequence[=regex], to make it
1346 more flexible, and so that autoconf can use it.
1347 * src/m4.h (set_macro_sequence, free_macro_sequence): New
1349 * src/builtin.c (macro_sequence_buf, macro_sequence_regs)
1350 (macro_sequence_inuse, set_macro_sequence, free_macro_sequence):
1351 New variables and functions.
1352 (define_user_macro): Allow flexibility in regular expression used
1354 * src/m4.c (warn_syntax): Delete.
1355 (usage, WARN_MACRO_SEQUENCE_OPTION, main): Implement changed
1356 spelling of option, along with optional argument.
1357 * doc/m4.texinfo (Operation modes, Arguments): Document this
1359 * NEWS: Document this change.
1361 2007-02-05 Eric Blake <ebb9@byu.net>
1363 * m4/gnulib-cache.m4: Module strstr no longer exists.
1365 Avoid bool bitfields, as they don't work on AIX.
1366 * src/m4.h (bool_bitfield): New typedef.
1367 (struct symbol, struct builtin): Use it.
1368 * src/input.c (struct input_block): Likewise.
1369 Reported by Albert Chin.
1371 * doc/m4.texinfo (Sysval): Avoid SIGPIPE in test as unreliable.
1372 Reported by Albert Chin.
1375 2006-06-18 Bruno Haible <bruno@clisp.org> (tiny change)
1377 * doc/m4.texinfo (Input processing): Further clarifications.
1379 2007-02-03 Eric Blake <ebb9@byu.net>
1381 * doc/m4.texinfo (Input processing, Quoting Arguments): Beef up
1383 Reported by Bruno Haible.
1385 2007-02-01 Eric Blake <ebb9@byu.net>
1387 * src/m4.c (fatal_warnings): New variable.
1388 (usage): Document new -E behavior.
1389 (main): Make -E an additive option.
1390 (m4_error, m4_error_at_line): Change exit status when required.
1391 * NEWS: Document this change.
1392 * doc/m4.texinfo (Operation modes): Likewise.
1393 Reported by Ralf Wildenhues.
1395 2007-01-27 Eric Blake <ebb9@byu.net>
1397 * src/m4.h (warn_syntax): Declare.
1398 (init_pattern_buffer): Export.
1399 * src/m4.c (warn_syntax, usage, WARN_SYNTAX_OPTIONS)
1400 (long_options, main): Implement new option.
1401 * src/builtin.c (init_pattern_buffer): Allow NULL regs argument.
1402 (define_user_macro): Warn on $11 and ${1} if requested.
1403 * src/input.c (init_pattern_buffer): Delete duplicate method.
1404 * doc/m4.texinfo (Operation modes): Document it.
1405 (Arguments): Document future direction of ${11} vs. $11.
1406 (Incompatibilities): Fix wording on POSIX limitations.
1407 * checks/get-them: Parse @{ and @} correctly.
1408 * NEWS: Document this change.
1410 2007-01-26 Eric Blake <ebb9@byu.net>
1412 * src/builtin.c (includes): Adjust to gnulib changes.
1414 2007-01-15 Eric Blake <ebb9@byu.net>
1416 * doc/m4.texinfo: Pull in various improvements from head.
1417 * src/builtin.c (include): Alter exit status on failure.
1418 * NEWS: Document this fix.
1420 2007-01-13 Eric Blake <ebb9@byu.net>
1422 * configure.ac (AC_CHECK_MEMBERS): Check for stack_t.ss_sp, and
1423 assume the fallback of ss_base for BSDI 4.0.1.
1424 * src/stackovf.c (setup_stackovf_trap) [HAVE_SIGALTSTACK &&
1425 ! HAVE_STACK_T_SS_SP]: Use this check.
1426 Reported by Chris McGuire.
1428 * NEWS: Document the improvement.
1430 2007-01-09 Eric Blake <ebb9@byu.net>
1432 * src/eval.c (ASSIGN): New enumerator.
1433 (eval_lex): Recognize '='.
1434 (equality_term): Treat '=' like '==', but warn that it is
1436 * doc/m4.texinfo (Eval): Document and test this.
1437 (Incompatibilities): Document the POSIX incompatibility.
1438 * NEWS: Document this change.
1440 2007-01-06 Eric Blake <ebb9@byu.net>
1442 * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import stdint'.
1443 * checks/check-them: Record expected exit status.
1444 * checks/get-them: Check exit status.
1445 * src/m4.h (eval_t, unsigned_eval_t): Delete, use POSIX int32_t
1447 * src/builtin.c: All users changed.
1448 * src/eval.c: Likewise. Also document where we are triggering
1449 undefined or implementation-defined behavior.
1450 (BADOP, NEGATIVE_EXPONENT, INVALID_OPERATOR, eval_lex, evaluate)
1451 (logical_or_term, logical_and_term, logical_not_term, not_term)
1452 (equality_term, unary_term): Port from head to follow POSIX
1454 (exp_term): Reject 0**0 as undefined.
1455 * doc/m4.texinfo (History): Mention 1.4.9.
1456 (Format, Incompatibilities): Update to document POSIX compliance.
1457 * NEWS: Document this change.
1459 2007-01-04 Eric Blake <ebb9@byu.net>
1461 * NEWS: Document previous fix.
1464 2007-01-04 Sami Liedes <sliedes@cc.hut.fi> (tiny change)
1466 Fix Debian bug 405594, introduced 2006-11-01 from a bad
1467 copy-n-paste from head.
1468 * src/m4.c (main): Use correct file name after --.
1470 2007-01-04 Eric Blake <ebb9@byu.net>
1472 Fix regression from 1.4.7 in large file handling on some
1473 platforms, introduced on 2006-10-13.
1474 * configure.ac (AC_LARGE_SYSFILE): Guarantee that large files
1476 * NEWS: Document this fix.
1478 2007-01-03 Eric Blake <ebb9@byu.net>
1480 * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
1482 * src/m4.c (AUTHORS, main): Use FSF wording for --version (plus
1483 it bumps the copyright year).
1485 2006-12-27 Eric Blake <ebb9@byu.net>
1487 * doc/m4.texinfo (Patsubst): Fix typo.
1489 2006-12-16 Eric Blake <ebb9@byu.net>
1491 * src/m4.c (main): Check for errors when closing stdin.
1493 2006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1495 * doc/m4.texinfo: Fix some typos.
1497 2006-12-09 Eric Blake <ebb9@byu.net>
1499 * configure.ac (AC_INIT): Bump version number.
1500 * NEWS: Start changes of 1.4.8a.
1502 2006-11-20 Eric Blake <ebb9@byu.net>
1505 * configure.ac (AC_INIT): Bump version number.
1506 * NEWS: Describe changes since 1.4.7.
1508 2006-11-16 Eric Blake <ebb9@byu.net>
1510 * doc/m4.texinfo (Include, Search Path, Diversions, Divert):
1511 Minor tweaks noticed while porting to head.
1513 2006-11-14 Eric Blake <ebb9@byu.net>
1515 * src/output.c (cleanup_tmpfile, freeze_diversions): Clean up
1517 (m4_tmpname): Avoid memory leak.
1519 2006-11-13 Eric Blake <ebb9@byu.net>
1521 * src/output.c (cleanup_tmpfile): Avoid double error message when
1522 umask is prohibitive.
1523 (m4_tmpname, m4_tmpopen, m4_tmpclose, m4_tmpremove): New
1525 (m4_tmpfile): Add parameter, move cloexec action here.
1526 (make_room_for): Adjust caller. Don't keep too many files open.
1527 (insert_diversion_helper): Unlink emptied temp files.
1528 (make_diversion): Don't keep too many files open.
1529 * doc/m4.texinfo (Diversions): Tweak wording, now that open file
1530 descriptors are no longer a limiting factor.
1531 * NEWS: Document this change.
1533 Backport sparse diversion handling from head.
1534 * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
1536 * src/output.c (struct m4_diversion): Rename from struct
1537 diversion, and update members. All users changed.
1538 (diversion_table): Change to an ordered set, instead of an array.
1539 (div0): New storage for diversion 0.
1540 (diversions): No longer needed.
1541 (free_list): New list to allow recycling diversion storage.
1542 (diversion_storage): New storage to reduce malloc overhead.
1543 (cmp_diversion_CB, threshold_diversion_CB): New callbacks.
1544 (output_init, output_exit, cleanup_tmpfile, make_room_for)
1545 (make_diversion): Handle new diversion storage scheme.
1546 (insert_diversion_helper): New function.
1547 (insert_diversion, undivert_all, freeze_diversions): Use it.
1548 * doc/m4.texinfo (Divert, Diversions): Move hidden test of memory
1549 exhaustion to visible test of large diversion numbers.
1550 * NEWS: Document this fix.
1552 2006-11-11 Eric Blake <ebb9@byu.net>
1554 * src/builtin.c (m4_translit): Slight optimization.
1556 * src/m4.h (to_uchar): Depend on HAVE_INLINE.
1558 * src/builtin.c: Remove unnecessary casts.
1559 (expand_ranges): Make 8-bit clean.
1560 * doc/m4.texinfo (Translit): Add tests and wording.
1561 * NEWS: Document this fix.
1563 2006-11-07 Eric Blake <ebb9@byu.net>
1565 * src/m4.h (output_exit): New prototype.
1566 * src/m4.c (main): Use it.
1567 * src/output.c (cleanup_tmpfile): Close files before removing
1569 (insert_diversion): Check for failure.
1570 (output_exit): Avoid memory leak.
1571 * doc/m4.texinfo (Diversions): Test this bug.
1573 * doc/m4.texinfo (Esyscmd, Errprint): Minor touchups.
1575 2006-11-01 Eric Blake <ebb9@byu.net>
1577 Allow C++ compilation on Linux, as a safety measure in type
1579 * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
1581 * src/m4.h (hack_symbol, hack_all_symbols): Use full prototype.
1582 (boolean): Kill this, and use stdbool.h instead.
1583 * src/debug.c, src/eval.c, src/input.c, src/macro.c, src/m4.c:
1584 * src/output.c, src/symtab.c: All users changed.
1585 * src/symtab.c (hack_all_symbols): Update prototype.
1586 * src/builtin.c (dump_symbol, set_trace): Update signature.
1587 (m4_dumpdef, m4_traceon, m4_traceoff): Update callers.
1588 (mkstemp_helper, m4_m4wrap, expand_ranges, m4_translit): Allow
1590 * src/debug.c (trace_flush): Likewise.
1591 * src/freeze.c (reload_frozen_state): Likewise.
1592 * src/input.c (push_file, push_string_finish, push_wrapup):
1593 (token_bottom, next_token): Likewise.
1594 * src/m4.c (main): Likewise.
1596 * doc/m4.texinfo (Invoking m4): Update according to POSIX 200x
1598 * src/m4.h (m4_path_search): Tweak signature.
1599 * src/path.c (m4_path_search): Likewise.
1600 * src/builtin.c (include): Update caller.
1601 * src/m4.c (main): Allow -D, -U, -t, and -s to be interspersed
1602 with file names. Don't write to **argv.
1603 (process_file): New helper method.
1604 * NEWS: Document this fix.
1606 2006-10-31 Eric Blake <ebb9@byu.net>
1608 * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import strstr'.
1609 * doc/m4.texinfo (Translit): Improve the documentation.
1610 * src/builtin.c (m4_translit): Optimize to O(n) instead of O(n^2)
1612 (m4_index): Simplify, and speed up slightly.
1613 * NEWS: Document this fix.
1615 2006-10-28 Eric Blake <ebb9@byu.net>
1617 * src/input.c (set_quotes): Don't allow empty end-quote with
1618 non-empty start-quote.
1619 (set_comment): Likewise for end-comment.
1620 * src/builtin.c (m4_changecom): Adjust caller.
1621 * doc/m4.texinfo (Changequote, Changecom): Update documentation to
1623 (Incompatibilities): Document another POSIX bug.
1624 * NEWS: Mention this change.
1626 2006-10-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1628 * examples/Makefile.am (EXTRA_DIST): Distribute recently-added
1631 2006-10-26 Eric Blake <ebb9@byu.net>
1633 Silence -Wwrite-strings -Wpointer-arith warnings.
1634 * src/builtin.c (define_user_macro): Allow NULL argument.
1635 (m4_builtin, m4_indir): Cast away const of "".
1636 * src/format.c (format): Likewise.
1637 * src/macro.c (collect_arguments): Likewise.
1638 (expand_macro): Avoid math on void*.
1639 * src/m4.c (main): Adjust caller.
1640 * src/output.c (freeze_diversions): Detect off_t overflow.
1642 * src/input.c (pop_input): Remove unnecessary code.
1644 2006-10-25 Eric Blake <ebb9@byu.net>
1646 * src/symtab.c (symtab_init): Avoid size_t overflow.
1647 * src/output.c (make_diversion): Avoid size_t overflow.
1648 * doc/m4.texinfo (Diversions): Test this fix.
1649 * src/input.c (input_block): Remove unused member. Reduce size
1651 (push_file, pop_input): Avoid useless assignment.
1652 * NEWS: Document the bug fix.
1654 Redo location tracking. Instead of having just files track the
1655 line to return to when popping input, now all input blocks track
1657 * src/input.c (INPUT_STRING_WRAP, INPUT_FILE_INIT): No longer
1659 (input_block): Have line and file storage for all input types, and
1660 rename some members.
1661 (input_change): New global flag.
1662 (push_file, push_macro, push_string_init, push_wrapup): Store
1664 (push_string_finish, pop_input, pop_wrapup): Notice changes in
1666 (peek_input): Adjust to new member names.
1667 (next_char, next_char1): Adjust location if needed.
1668 (skip_line): Simplify restoring location.
1669 * doc/m4.texinfo (Location): Augment the test to catch line
1670 location of expansion of multi-line arguments.
1671 Reported by Stepan Kasal.
1673 2006-10-23 Eric Blake <ebb9@byu.net>
1675 * doc/m4.texinfo (Macro Arguments): Document that leading space
1676 in argument collection stops at macro expansion.
1677 (Incompatibilities): Document POSIX whitespace wording issue.
1679 2006-10-20 Eric Blake <ebb9@byu.net>
1681 * doc/m4.texinfo: Trailing '@comment' doesn't format nicely in
1682 TeX, so recognize '@w{ }' instead. Likewise, @code{_name} at the
1683 end of a TeX line splits incorrectly.
1684 (Foreach, Improved foreach): Write these sections, borrowing ideas
1685 from CVS head and from m4sugar.
1686 * checks/get-them: Accomodate new way to show trailing space in
1688 * examples/foreach.m4: Make usable in documentation.
1689 * examples/foreachq.m4: New file.
1690 * examples/foreachq2.m4: New file.
1691 * examples/foreach2.m4: New file.
1692 * NEWS: Document the documentation updates.
1694 2006-10-19 Eric Blake <ebb9@byu.net>
1696 * src/builtin.c (mkstemp_helper, m4_mkstemp): New functions.
1697 (m4_maketemp): Provide traditional behavior.
1698 * doc/m4.texinfo (Mkstemp): Rename from Maketemp. Document the
1699 new `mkstemp' macro and the flaws of the old `maketemp'.
1700 (Incompatibilities): Move maketemp discussion to...
1701 (Extensions): ...here, since -G now supresses the GNU extension.
1702 * NEWS: Document this.
1704 * examples/forloop.m4: Simplify.
1705 * examples/forloop2.m4: New file.
1706 * examples/quote.m4: New file.
1707 * doc/m4.texinfo (Loops): Rename to...
1708 (Shift): ...this node.
1709 (Forloop, Foreach, Improved forloop, Improved foreach): New
1712 2006-10-17 Eric Blake <ebb9@byu.net>
1714 * m4/gnulib-cache.m4: Update with 'gnulib-tool --import
1716 * configure.ac (AC_CONFIG_HEADERS): Create config.h alongside
1717 gnulib headers, rather than in top directory.
1718 * src/Makefile.am (AUTOMAKE_OPTIONS): Add nostdinc, to reduce make
1721 2006-10-16 Eric Blake <ebb9@byu.net>
1723 * doc/m4.texinfo: Backport some minor cleanups from head.
1724 (Cleardivert): Rename from cleardiv.
1726 * doc/m4.texinfo (Invoking m4): Promote to a chapter, instead of
1727 a section of Preliminaries.
1728 (Operation modes, Preprocessor features, Limits control)
1729 (Frozen state, Debugging options, Command line files): Subdivide
1731 (Input processing, Quoting Arguments, Define, Arguments)
1732 (Cleardiv, Format, M4exit): Fix grammar of references.
1733 (Inhibiting Invocation, Macro Arguments, Builtin, Trace)
1734 (Debug Levels, Debug Output, Include, Search Path, Divert)
1735 (Platform macros, Syscmd, Location, Extensions): Point to new
1737 (Top, Loops, Include, Undivert, Location, Incompatibilities):
1738 Improve file references.
1740 2006-10-14 Eric Blake <ebb9@byu.net>
1742 * m4/input.c (file_clean): Don't close stdin twice, POSIX says it
1744 Reported by Ralf Wildenhues.
1746 * src/builtin.c (m4_undivert): Check for read error.
1748 2006-10-13 Eric Blake <ebb9@byu.net>
1750 * src/m4.h (UNIX, W32_NATIVE, OS2): Move platform checks after
1751 header files are included, since <unistd.h> can affect the tests.
1753 Reported by Martin Koeppe.
1755 Backport head's usage of clean-temp module, as it is cleaner than
1756 using tmpfile-safer.
1757 * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
1758 clean-temp closeout', and remove tmpfile-safer.
1759 * src/m4.h (includes): Adjust.
1760 (m4_path_search): Rename from path_search, to avoid collision
1762 * src/m4.c (main): Install closeout handler. Adjust caller.
1763 (usage): Now done by closeout module.
1764 * src/builtin.c (m4_m4exit): Likewise.
1765 (m4_undivert, include): Adjust callers.
1766 * src/freeze.c (reload_frozen_state): Likewise.
1767 * src/path.c (m4_path_search): Rename from path_search.
1768 * src/output.c (output_temp_dir): New variable.
1769 (cleanup_tmpfile, m4_tmpfile): New functions, from head.
1770 (insert_diversion, make_room_for): Use them.
1771 * doc/m4.texinfo (Diversions): Document this, and add a test.
1772 (Improved fatal_error): Fix typo.
1773 (Maketemp): Port test to mingw, and no longer hide from
1775 * NEWS: Document the change in TMPDIR behavior.
1777 * configure.ac (m4_pattern_forbid): Narrow the range of forbidden
1778 macros, to work with recent gnulib-tool update.
1780 * src/builtin.c (m4_builtin, m4_indir): Allow transparent
1781 handling of defn results.
1782 * doc/m4.texinfo (Builtin, Indir): Add test cases.
1783 * NEWS: Document this.
1785 2006-10-12 Eric Blake <ebb9@byu.net>
1787 * doc/m4.texinfo (Location): Fix typo in previous commit.
1788 (Changeword): Catch one more case.
1789 * src/input.c (skip_line): Fix case when outer file used macro to
1792 2006-10-11 Eric Blake <ebb9@byu.net>
1794 * src/input.c (enum input_type): Add additional types, to shave
1795 time off the common case.
1796 (push_wrapup): Wrapped strings remember location.
1797 (push_string_finish): Normal strings carry no location.
1798 (push_file): Start new files uninitialized.
1799 (peek_input, next_char_1): Optimize common cases by updating
1800 location only on new input types.
1801 (pop_input): Update to honor new input types.
1802 (skip_line, push_string_finish): Fix regression in previous patch
1803 when dnl is not followed by newline in included file.
1804 (push_string_init): Initialize all fields of INPUT_STRING sooner.
1805 (peek_token): Simplify.
1806 (peek_input): Don't pop input files on peek, so that __file__ and
1807 __line__ as last token of include file work correctly.
1808 * doc/m4.texinfo (History): Mention 1.4.8.
1809 (Answers): Split into sections, one per answer.
1810 (Improved exch, Improved cleardivert, Improved fatal_error): New
1812 (Dnl, M4wrap, Location, M4exit, Improved fatal_error): Update to
1813 new m4wrap location semantics.
1814 (Changeword): Add test that caught the regression.
1815 * NEWS: Document this.
1817 * src/macro.c (expand_macro): In macro expansion errors, report
1818 line number at open parenthesis.
1819 * src/input.c (next_token): Fix off-by-one bug in reporting end
1820 of file in unterminated comment and string.
1821 (file_names): New obstack, necessary since expand_macro now hangs
1822 on to file names longer than the files remain open.
1823 (input_init): Initialize new obstack.
1824 (push_file): Use new obstack. Delay updates to current_file
1825 until after expand_macro has restored state.
1826 (peek_input, next_char_1): Update current_file if necessary.
1827 (pop_wrapup): Release memory.
1828 * doc/m4.texinfo (Macro Arguments, Changequote, Changecom): Catch
1830 (Dnl): Update to the new location reporting rules.
1831 * NEWS: Document these changes.
1833 2006-10-10 Eric Blake <ebb9@byu.net>
1835 * src/macro.c (argc_stack, argv_stack): New variables for sharing
1836 obstacks across multiple macro calls.
1837 (expand_input): Initialize and tear down stack once per input
1838 file, instead of once per macro.
1839 (expand_macro): Reuse existing stacks when possible.
1840 (collect_arguments): Simplify slightly.
1842 * src/path.c (include_env_init): Fix botched patch application.
1843 Reported by Ralf Wildenhues.
1845 2006-10-09 Eric Blake <ebb9@byu.net>
1847 * src/m4.c (usage, main): Detect write failures to stderr.
1848 * src/builtin.c (m4_m4exit): Likewise.
1849 * NEWS: Document this.
1851 * src/macro.c (expand_macro): Allow --nesting-limit=0 to remove
1853 * NEWS: Document this.
1854 * doc/m4.texinfo (Invoking m4): Likewise.
1856 2006-10-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1858 * src/path.c (include_env_init): Copy the string returned
1859 by getenv before overwriting it; POSIX disallows this.
1861 2006-10-09 Eric Blake <ebb9@byu.net>
1863 * src/m4.c (main): Defer debugfile until after --help.
1864 * configure.ac (AC_INIT): Bump version number.
1865 * NEWS: Start changes of 1.4.7a.
1867 2006-09-25 Eric Blake <ebb9@byu.net>
1870 * configure.ac (AC_INIT): Bump version number.
1871 * NEWS: Describe changes since 1.4.6.
1873 2006-09-21 Eric Blake <ebb9@byu.net>
1875 * doc/m4.texinfo (Invoking m4): Add clarification on option
1876 processing behavior.
1878 Reported by Mikhail Teterin.
1880 * bootstrap: Add --force option, based on idea from coreutils.
1881 * README: Document that ./bootstrap and autoreconf are for
1882 developers, and not lightly done in tarballs.
1884 2006-09-20 Eric Blake <ebb9@byu.net>
1886 * src/m4.c (usage, OPTSTRING, main): Rename -e to -i, and give
1887 deprecation warning on -e.
1888 * doc/m4.texinfo (Invoking m4, Extensions): Document this.
1889 * NEWS: Document this.
1891 2006-09-19 Eric Blake <ebb9@byu.net>
1893 * src/m4.c (usage, long_options, main, DEBUGFILE_OPTION): Rename
1894 -o/--error-output to --debugfile, and deprecate the former. This
1895 will allow a future release to be more consistent with other GNU
1896 tools, with -o/--output affecting stdout, not debug.
1897 * doc/m4.texinfo (Invoking m4, Debug Output): Document this.
1898 * NEWS: Document this.
1900 2006-09-14 Eric Blake <ebb9@byu.net>
1902 * src/m4.c (main): Warn on deprecated options -B, -S, -T, -N,
1903 --diversions. `m4 --help --version' now displays help, not
1905 (interactive, frozen_file_to_read, frozen_file_to_write): Move to
1907 (show_help, show_version): No longer needed.
1908 (long_options, DIVERSIONS_OPTION): Backport patch from head to
1909 distinguish between -N and --diversions in warning.
1910 * doc/m4.texinfo (Invoking m4): Document this.
1913 2006-09-11 Eric Blake <ebb9@byu.net>
1915 * src/Makefile.am (m4_LDADD): Add any gnulib dependent libraries.
1916 * src/debug.c (debug_flush_files) [UNIX]: Flush stdin if it is
1918 (debug_set_file): Use STDOUT_FILENO.
1919 * src/builtin.c (m4_m4exit): Flush stdin before exiting, to comply
1920 with POSIX in regards to unread input.
1921 * NEWS: Document this fix.
1922 * doc/m4.texinfo (Syscmd, Esyscmd, M4exit): Likewise.
1924 2006-09-07 Eric Blake <ebb9@byu.net>
1926 * m4/gnulib-cache.m4: Update to newer gnulib-tool.
1927 * src/m4.h (push_file): Change prototype.
1928 * src/input.c (push_file, peek_input, next_char_1): Only call getc
1929 once at EOF, to avoid double ^D on terminal stdin; regression from
1931 (push_file, pop_file): Allow reading stdin twice.
1932 * src/m4.c (main): Likewise.
1933 * src/builtin.c (include): Update caller.
1934 * NEWS: Document this change.
1935 * doc/m4.texinfo (Invoking m4, Incompatibilities): Likewise.
1936 (Syscmd): Add a test that failed before this patch.
1938 2006-09-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1940 * checks/check-them: Quote $pwd.
1942 2006-09-05 Eric Blake <ebb9@byu.net>
1944 * src/builtin.c (define_macro): Warn on invalid macro name.
1945 * NEWS: Document this change.
1946 * doc/m4.texinfo: Fix typos.
1947 (Invoking m4, Macro Arguments, Pseudo Arguments, Defn, Indir)
1948 (Ifelse): Backport some improvements from head.
1950 2006-09-04 Eric Blake <ebb9@byu.net>
1952 * doc/m4.texinfo (Changeword): Skip test on mingw, where the
1953 native echo is braindead.
1954 * checks/check-them (strip_needed): Ignore \r in output. Now the
1955 testsuite will pass when cross-compiling from cygwin to mingw.
1957 * src/input.c (peek_input): Fix regression in handling macro
1958 without arguments as last token in file; debian bug 385720.
1959 (next_token): Always consume an input character.
1960 Reported by Andreas Schultz.
1961 * configure.ac (AC_INIT): Bump version number.
1962 * NEWS: Document this fix.
1963 * doc/m4.texinfo (History): Mention next version.
1964 (Changeword): Add example that exposes this bug.
1967 2006-08-25 Eric Blake <ebb9@byu.net>
1970 * configure.ac (AC_INIT): Bump version number.
1971 * NEWS: Describe changes since 1.4.5.
1973 * Makefile.maint (web-manual): Give up on VPATH build during
1974 distribution. But distributions are made so infrequently that
1975 this is not too much of a hardship.
1976 * Makefile.am (MAINTAINERCLEANFILES): Avoid error if lib/CVS/
1979 2006-08-24 Eric Blake <ebb9@byu.net>
1981 * src/builtin.c (m4_index, m4_substr, m4_translit): Similar to
1982 Solaris, produce output on just one argument.
1983 (m4_regexp, m4_patsubst): For consistency, do likewise.
1984 (m4_patsubst): Allow zero-length match at end of string.
1985 * doc/m4.texinfo (Sysval): Fix overfull hbox.
1986 (Bugs, Macro Arguments): Minor fixes.
1987 (Other tokens): Rearrange node order.
1988 (Index macro, Substr, Translit, Regexp, Patsubst): Add tests.
1989 * NEWS: Document these fixes.
1991 2006-08-22 Eric Blake <ebb9@byu.net>
1993 * src/input.c (pop_input): Avoid empty filename with -di option.
1994 * src/debug.c (debug_message_prefix): Put space before message.
1996 * m4/gnulib-cache.m4: We don't explicitly use alloca module.
1998 * m4/gnulib-cache.m4: Augment with gnulib-tool --import gnupload.
1999 * Makefile.maint (fetch): Simplify, now that we can use gnupload.
2001 * checks/check-them: State why a test is skipped.
2002 * doc/m4.texinfo (Changeword, Sysval, Maketemp): Likewise.
2004 * ChangeLog: Add copyright.
2005 * AUTHORS: Likewise.
2006 * BACKLOG: Likewise.
2010 * examples/COPYING: New file, add copyright for all the examples.
2011 * checks/get-them: Put copyright on testsuite files.
2013 2006-08-18 Eric Blake <ebb9@byu.net>
2015 Don't let unrelated child processes see too many files.
2016 * m4/gnulib-cache.m4: Augment with gnulib-tool --import cloexec.
2017 * src/builtin.c (m4_esyscmd, m4_regexp, m4_patsubst): Fix
2018 spelling in error message.
2019 * src/debug.c [!__STDC__]: Assume C89, and nuke old varargs.h.
2020 (debug_set_output): Close debug file on exec.
2021 * src/m4.h (includes): Add cloexec.h.
2022 * src/output.c (make_room_for): Close diversions on exec.
2023 * src/path.c (path_search): Close include files on exec.
2024 * NEWS: Document this.
2026 Regular expressions were leaking memory.
2027 * src/builtin.c (init_pattern_buffer, free_pattern_buffer): New
2029 (m4_regexp, m4_patsubst): Avoid memory leak.
2030 * src/input.c (init_pattern_buffer) [ENABLE_CHANGEWORD]: Make
2032 (set_word_regexp) [ENABLE_CHANGEWORD]: Avoid memory leak. Change
2033 from O(n^2) to O(n) for calculating word_start.
2034 (next_token, peek_token) [ENABLE_CHANGEWORD]: Treat word_start as
2035 O(1) bitmap, not O(n) search string.
2036 * NEWS: Document this fix.
2038 2006-08-17 Eric Blake <ebb9@byu.net>
2040 * NEWS: Document previous checkin.
2042 * src/builtin.c (substitute): Avoid core dump when accessing
2043 beyond bound of regular expression.
2044 Reported by Karl Nelson.
2045 * doc/m4.texinfo (Regexp): Add example that causes core dump on
2046 some architectures prior to this patch.
2049 2006-08-16 Eric Blake <ebb9@byu.net>
2051 * doc/m4.texinfo (Invoking m4, Debug Output): Fix wording to be
2052 clear that dumpdef does not always go to stderr.
2054 * src/builtin.c (m4_errprint): Flush buffers before printing to
2058 2006-08-15 Eric Blake <ebb9@byu.net>
2060 * src/builtin.c (m4_m4wrap, m4_errprint, m4_shift): Make blind,
2061 per debian bug 96075.
2062 * doc/m4.texinfo (Loops, M4wrap, Errprint): Document this change.
2063 (Changeword): Don't use shift as an example of a swallowed word.
2064 (Divert): Discuss fact that divert is an English word.
2065 Reported by Richard A Nelson.
2067 2006-08-14 Eric Blake <ebb9@byu.net>
2069 * doc/m4.texinfo (Invoking m4): Minor fixes.
2071 2006-08-12 Eric Blake <ebb9@byu.net>
2073 * doc/m4.texinfo (Arguments): Hint at better exch macro.
2074 (Answers): Provide a better definition.
2076 2006-08-09 Eric Blake <ebb9@byu.net>
2078 * doc/m4.texinfo (Incompatibilities): Document that m4 does not
2079 yet understand locales.
2080 * NEWS: Fix wording of a few items.
2082 2006-08-08 Eric Blake <ebb9@byu.net>
2084 Avoid printing `NONE:0:' in error messages.
2085 * src/m4.h (m4_error_at_line): New function.
2086 * src/m4.c (m4_error_at_line): Implement.
2087 * src/input.c (skip_line, input_init, next_token): Use "", not
2088 "NONE", for no file, since NONE can be a real file name.
2089 * src/macro.c (expand_argument): Likewise.
2090 * src/debug.c (debug_message_prefix, trace_header): Check for
2092 * doc/m4.texinfo (Dnl, M4wrap): Adjust accordingly.
2093 (Location): Document that synclines and internal message format
2094 are not impacted by redefining these macros.
2095 (M4exit): Hint at bug in fatal_error.
2096 (Answers): Provide workaround to match m4 output.
2098 * m4/gnulib-cache.m4: Augment with gnulib-tool --import verror.
2099 * src/m4.h (m4_error): New function.
2100 (M4ERROR, M4ERROR_AT_LINE): Reimplement without hacking around
2101 error module deficiencies.
2102 (reference_error, suppress_line): No longer needed.
2103 * src/m4.c (m4_error): Implement.
2104 (main): No longer need to install error callback.
2106 2006-08-04 Eric Blake <ebb9@byu.net>
2108 * src/m4.h (program_name): Declare.
2109 (suppress_line): New variable.
2110 (M4ERROR_AT_LINE): New macro.
2111 * src/m4.c (reference_error, main): Follow GNU Coding Standards
2112 for error message format.
2113 * src/input.c (skip_line, next_token): Use M4ERROR_AT_LINE.
2114 * src/macro.c (expand_argument): Likewise.
2115 * checks/check-them (examples): Adjust to new message format.
2116 * src/builtin.c (m4___program__): New builtin.
2117 * doc/m4.texinfo (Location): Split from Errprint into new node,
2118 and document __program__.
2119 (Builtin, Ifdef, Ifelse, Dumpdef, Trace, Debug Output, Dnl)
2120 (Include, Regexp, Patsubst, Incr, Eval): Adjust error message
2122 (Extensions): Document __program__.
2123 * NEWS: Document this change.
2125 2006-08-03 Eric Blake <ebb9@byu.net>
2127 Don't confuse leading `(' in comment or quote with start of
2128 argument collection.
2129 * src/m4.h (enum token_type): Add TOKEN_OPEN, TOKEN_COMMA,
2131 (peek_input): Make private to input.c.
2132 (peek_token): New prototype.
2133 * src/input.c (default_word_regexp): Reduce ifdefs.
2134 (peek_input): Make static.
2135 (next_token): Return new token types.
2136 (match_input, MATCH): Add argument consume, which controls
2137 whether match should be pushed back.
2138 (peek_token): New function.
2139 (token_type_string) [DEBUG_INPUT]: New function.
2140 * src/macro.c (expand_token, expand_argument, collect_arguments):
2141 Handle new token types.
2142 * doc/m4.texinfo (Changequote, Changecom): Document this.
2143 * NEWS: Document this.
2145 * src/stackovf.c (setup_stackovf_trap): Free memory on failure.
2147 * src/stackovf.c (setup_stackovf_trap): Gracefully avoid stack
2148 overflow detection when sigstack exists but is not implemented.
2149 Fixes debian bug 154053.
2151 Reported by David Perlin.
2153 2006-08-02 Eric Blake <ebb9@byu.net>
2155 * src/input.c (MATCH): Fix EOF detection on multi-byte comment
2158 2006-08-01 Eric Blake <ebb9@byu.net>
2160 * src/input.c (skip_line, next_token): Remember current file in
2161 case input file ends abruptly. Addresses debian bug 175365.
2162 (pop_input): Defer freeing storage that holds previous file
2164 (pop_wrapup): to here, after error message is issued.
2165 * src/macro.c (expand_argument): Remember current file in case
2166 input file ends abruptly.
2167 * doc/m4.texinfo (Macro Arguments, Dnl, Changequote, Changecom)
2168 (M4wrap): Adjust testsuite accordingly.
2169 (Errprint): Document line number limitation of m4wrap.
2170 * NEWS: Document this fix.
2173 2006-07-31 Eric Blake <ebb9@byu.net>
2175 * src/input.c (peek_input, next_char, match_input): Be eight-bit
2176 clean; fixes debian bug 311378.
2177 * doc/m4.texinfo (Syntax): Describe eight-bit handling.
2178 (Changequote, Changecom): Add examples to test this.
2179 * NEWS: Document this fix.
2181 Reported by Steven Augart.
2183 * doc/m4.texinfo: Whitespace fix.
2184 * checks/get-them: Avoid exceeding 14-char file name limit.
2187 2006-07-30 Eric Blake <ebb9@byu.net>
2189 * src/path.c (path_search): Detect allocation failure.
2191 Use native free when it is good enough.
2192 * m4/gnulib-cache.m4: Augment with gnulib-tool --import free.
2193 * src/builtin.c (define_user_macro, m4_regexp, m4_patsubst):
2195 * src/symtab.c (free_symbol): Likewise.
2196 * src/m4.c (xfree, main): Likewise.
2197 * src/m4.h (obstack_chunk_free): Likewise.
2198 * src/path.c (path_search): Likewise.
2199 * src/input.c (pop_wrapup, set_quotes, set_comment): Likewise.
2201 * doc/m4.texinfo (Errprint): Add example for last patch.
2202 * checks/check-them: Account for VPATH in latest example.
2204 2006-07-29 Eric Blake <ebb9@byu.net>
2206 * src/path.c (path_search): Add result parameter, so that
2207 -I can be accounted for. Debian bug 53685.
2208 * src/m4.h (path_search): Update prototype.
2209 * src/m4.c (main): Adjust callers.
2210 * src/freeze.c (reload_frozen_state): Likewise.
2211 * src/builtin.c (include, m4_undivert): Likewise.
2212 * NEWS: Document this change.
2213 Reported by Nicolas Lichtmaier.
2215 2006-07-28 Eric Blake <ebb9@byu.net>
2217 * Makefile.am (MAINTAINERCLEANFILES): Fix typo that tripped up
2218 several non-GNU makes.
2219 * src/stackovf.c (setup_stackovf_trap): Missed _ from yesterday.
2220 * src/m4.h: Likewise.
2221 * src/input.c (push_wrapup): Avoid compiler warning with Solaris
2224 2006-07-27 Eric Blake <ebb9@byu.net>
2226 * doc/m4.texinfo: Use @acronym{GNU} throughout.
2227 (History): Update for 1.4.6.
2229 * src/m4.h (_): Remove K&R cruft.
2230 * src/builtin.c: Likewise.
2231 * src/debug.c: Likewise.
2232 * src/eval.c: Likewise.
2233 * src/macro.c: Likewise.
2234 * src/stackovf.c: Likewise.
2236 * doc/Makefile.am (m4.1): Improve man page.
2237 * src/m4.c (usage): Improve --help output, including adding the
2238 bug reporting address.
2239 (main): Follow GNU Coding Standards for --version output.
2241 2006-07-26 Eric Blake <ebb9@byu.net>
2243 * doc/m4.texinfo: Use begin-quote, end-quote, begin-comment, and
2244 end-comment consistently, to match POSIX.
2246 * doc/m4.texinfo (Macro Arguments, Changequote, Changecom)
2247 (Dnl, M4wrap, Include): Document EOF issues, and add examples.
2248 (Incompatibilities): Document incompatibility of changecom
2249 vs. macro names, and of EOF in include.
2250 * src/input.c (next_token): Reject unterminated comments at EOF.
2251 (skip_line): Warn on unterminated dnl at EOF.
2252 * NEWS: Document these changes.
2254 2006-07-25 Eric Blake <ebb9@byu.net>
2256 * m4/gnulib-cache.m4: Update to reflect gnulib's split of
2257 stdio-safer into fopen-safer and tmpfile-safer.
2258 * src/m4.c: Remove redundant include.
2260 2006-07-24 Eric Blake <ebb9@byu.net>
2262 Fix bugs related to stream handling.
2263 * m4/gnulib-cache.m4: Augment with gnulib-tool --import
2264 unlocked-io stdio-safer stdlib-safer close-stream.
2265 * configure.ac (AC_CHECK_FUNCS_ONCE): Assume tmpfile; it can be
2266 provided by gnulib if needed.
2267 * src/output.c [! HAVE_TMPFILE]: Likewise.
2268 * src/m4.h (includes): Replace unistd, stdio, and stdlib with
2269 their safer counterparts.
2270 (retcode): New global variable.
2271 * src/input.c (pop_input): Check for read failure.
2272 * src/freeze.c (reload_frozen_state): Likewise.
2273 (produce_frozen_state): Check for write failure.
2274 * src/debug.c (debug_set_file): Likewise.
2275 * src/m4.c (usage, main): Likewise.
2276 (retcode): Make global.
2277 * src/builtin.c (m4_m4exit): Likewise. Ensure that the exit
2278 status is non-zero except when everything succeeds.
2279 * doc/m4.texinfo (M4exit): Document these changes.
2280 (Incompatibilities): Remove documentation of bug now fixed.
2281 * NEWS: Document these fixes.
2283 2006-07-22 Eric Blake <ebb9@byu.net>
2285 * src/format.c (format): Avoid compiler warning that str may be
2288 2006-07-21 Eric Blake <ebb9@byu.net>
2290 * src/m4.h [UNIX]: Add more platforms that are close enough to
2291 categorize as UNIX, but which don't predefine __unix__.
2292 Reported by Nelson H. F. Beebe.
2294 2006-07-20 Eric Blake <ebb9@byu.net>
2296 * m4/gnulib-cache.m4: gnulib-tool has changed again. Regenerate
2297 to explicitly ask for --assume-autoconf=2.60.
2299 2006-07-19 Eric Blake <ebb9@byu.net>
2301 * doc/m4.texinfo (Sysval): Avoid kill -1, since ksh traps SIGHUP
2302 and exits normally with 129.
2303 Reported by Nelson H. F. Beebe.
2306 * src/m4.h (EXIT_MISMATCH): Define.
2307 * src/freeze.c (reload_frozen_state): Detect version mismatch, by
2308 exiting with status 63.
2309 * src/m4.c (usage): Document this.
2310 * doc/m4.texinfo (Invoking m4, Using frozen files): Likewise.
2313 * doc/m4.texinfo (copying): Relax restriction on front-cover and
2316 2006-07-17 Eric Blake <ebb9@byu.net>
2318 * src/format.c (format): Support F, g, and G specifiers.
2319 * doc/m4.texinfo (Format): Document this.
2320 * NEWS: Document this addition.
2322 * doc/m4.texinfo (Builtin): Delete redundant text.
2324 * configure.ac (AC_INIT): Bump version number.
2325 * src/builtin.c (substitute): Bah. Fix buffer overrun.
2326 * NEWS: Document this fix.
2328 2006-07-15 Eric Blake <ebb9@byu.net>
2331 * configure.ac (AC_INIT): Bump version number.
2332 * NEWS: Describe changes since 1.4.4.
2334 * src/m4.c (usage): Document exit status.
2335 * doc/m4.texinfo: Use `exit status', not `exit code'.
2336 (Invoking m4): Document exit status.
2338 * bootstrap: Backport --help, --version from head.
2339 (func_update): New function, for easily grabbing up-to-date files
2341 * Makefile.maint (web-manual): Fix for VPATH builds.
2343 2006-07-14 Eric Blake <ebb9@byu.net>
2345 * doc/m4.texinfo: Global cleanup. Avoid @code{...}'d, as it
2346 looks bad in info. Use @deffn rather than @example for
2347 describing prototypes. Fix awkward wording and grammar.
2349 * src/builtin.c (substitute): Warn on bad escape sequences.
2350 Ignore trailing backslash.
2351 * doc/m4.texinfo (Regexp): Add documentation for this.
2352 * NEWS: Document this change.
2354 * src/builtin.c (m4_format, m4_indir): Warn on too few arguments.
2355 * doc/m4.texinfo (Defn, Builtin, Debug Levels, Debug Output): Add
2357 (Dnl): Update example to show side effects.
2358 * checks/get-them: Generate three digit test names.
2359 * checks/Makefile.in (CHECKS): Accomodate 100+ tests.
2361 2006-07-13 Eric Blake <ebb9@byu.net>
2363 * src/input.c (input_init): Simplify.
2364 (set_word_regexp): Treat empty string as default, since empty
2365 regexp would disable word parsing.
2366 * src/m4.c (user_word_regexp): Default to empty string.
2367 * src/builtin.c (builtin_tab): Make changeword blind.
2368 * doc/m4.texinfo (Changeword): Document this.
2369 * NEWS: Document this.
2370 * TODO: Knock off completed items.
2372 * src/builtin.c (m4_undefine, m4_popdef): Visit all arguments, not
2374 * doc/m4.texinfo (Undefine, Pushdef): Test this.
2375 * NEWS: Document this change.
2377 * src/builtin.c (numeric_arg): Treat empty string as 0, with a
2378 warning. Detect quoted leading space and overflow as warnings.
2379 (m4_eval): Treat empty radix as 10, and allow output in radix 1.
2380 Treat width as minimum number of digits, as required by POSIX.
2381 (m4_ifdef, m4_divert, m4_m4exit, m4_translit): Ignore extra
2383 (m4_substr): Likewise. Silently treat empty start as 0.
2384 (m4_undivert): Treat ` 1a' as file, not diversion 1.
2385 * src/eval.c (eval_lex): Parse radix 1 numbers.
2386 * doc/m4.texinfo (Invoking m4): Fix wording; there is more than
2387 one type of warning.
2388 (Manual): Document behavior of numeric parsing of empty string.
2389 (Divert, Incr): Document error handling.
2390 (Eval): Document radices better.
2391 (Incompatibilities): Document translit incompatibility.
2392 * NEWS: Document these changes.
2394 * Makefile.maint (fetch): Get gendocs from gnulib, not texinfo.
2395 (web-manual): Simplify.
2396 * m4/gnulib-cache.m4: Augment with gnulib-tool --import gendocs.
2397 * Makefile.am (EXTRA_DIST): Distribute gendocs.sh.
2398 (MAINTAINERCLEANFILES): Clean it as well.
2399 * doc/Makefile.am (EXTRA_DIST): Distribute gendocs_template.
2400 (MAINTAINERCLEANFILES): Clean it as well.
2402 2006-07-12 Eric Blake <ebb9@byu.net>
2404 * doc/m4.texinfo (Extensions): Document how to overcome
2405 implementation difference in > 9 positional parameters.
2407 * src/m4.c (usage): Sort within sections.
2408 (nesting_limit): Raise default from 250 to 1024.
2409 * doc/m4.texinfo: Use file name, not filename, per GNU coding
2410 standard. Use @option where appropriate.
2411 (Invoking m4): Sort to match --help output.
2412 (Debug Levels): Sort.
2413 (Frozen files): Sort and break into two nodes.
2415 * src/m4.c (nesting_limit): Raise default from 250 to 1024.
2416 * NEWS: Document raised -L limit.
2418 2006-07-11 Eric Blake <ebb9@byu.net>
2420 * Makefile.am (DISTCHECK_CONFIGURE_FLAGS): New macro, to
2421 stress-test changeword before a release.
2422 * doc/m4.texinfo: More doc cleanups.
2423 (Copying This Manual): New node; actually include the FDL in the
2425 * doc/Makefile.am (m4_TEXINFOS): Mention dependence on fdl.texi.
2426 * m4/gnulib-cache.m4: Augment with gnulib-tool --import fdl.
2427 * NEWS: Mention documentation improvements.
2429 * src/m4.h (OS2): New platform macro.
2430 * src/builtin.c (predefined_tab) [OS2]: Use it to give OS/2 a
2432 * doc/m4.texinfo (Platform macros): Document it.
2433 (Sysval): Remove non-portable test of system("").
2434 * NEWS: Document this change.
2435 Reported by Andreas Buening.
2437 2006-07-09 Eric Blake <ebb9@byu.net>
2439 * doc/m4.texinfo (Undivert): Fix typo in last commit.
2440 * src/m4.c (usage): Document M4PATH.
2441 * src/path.c (path_search): Reject empty string.
2442 * src/output.c (insert_diversion): Ignore diversion 0.
2443 * src/builtin.c (m4_undivert): Ignore empty string.
2444 * NEWS: Document this fix.
2446 2006-07-08 Eric Blake <ebb9@byu.net>
2448 * checks/get-them: Make filtering easier.
2449 * checks/check-them: Filter non-input lines, so line counts are
2450 more realistic in the documentation, and so changeword tests work
2451 even when dnl is disabled.
2452 * doc/m4.texinfo: Adjust example line numbers. Clean up
2453 front-matter, following autoconf's example.
2454 (Changeword): Enable tests, skipping if changeword not supported.
2455 (Define, Defn, Ifelse): Backport more examples from head.
2456 (Input processing, Answers): New nodes, backported from head.
2457 (Include): Expand test to cover empty filename.
2458 (Undivert): Add test of undivert(0).
2460 2006-07-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2462 * doc/m4.texinfo: Fix spelling errors.
2464 2006-07-07 Eric Blake <ebb9@byu.net>
2468 * doc/Makefile.am (m4.1): No need to go through a temporary file;
2469 this also ensures timestamps are updated.
2470 * src/m4.h (includes): Require config.h. Assume string.h,
2471 stdlib.h, errno. Include error.h, exit.h, and xalloc.h rather
2472 than prototyping ourselves.
2473 (builtin_func): Add parameter type-checking.
2474 (voidstar): Delete, now that we assume C89.
2475 * src/builtin.c, src/m4.c, src/macro.c, src/symtab.c: All users of
2477 * src/m4.c (xfree) [WITH_DMALLOC]: Avoid clash with dmalloc's
2480 2006-07-06 Eric Blake <ebb9@byu.net>
2482 * m4/gnulib-cache.m4: Augment with gnulib-tool --import
2484 * src/m4.h (includes): Add binary-io.h for O_BINARY.
2485 * src/freeze.c (produce_frozen_state): Use O_BINARY to remove
2486 #ifdef. Fixes patch from 2005-02-03 for cygwin.
2487 * NEWS: Mention this fix.
2489 * configure.ac (FUNC_SYSTEM_BROKEN): New check for OS/2 bug.
2490 * src/builtin.c (m4_syscmd): Work around OS/2 bug.
2492 * Makefile.am (SUBDIRS): Build . before src, so that autoheader
2493 runs first when needed.
2494 * doc/Makefile.am (m4.1): Backport rule from CVS head: build m4.1
2495 once in srcdir rather than multiple times in VPATH builds.
2497 2006-07-03 Eric Blake <ebb9@byu.net>
2499 * checks/check-them: Use portable = in test.
2500 * src/Makefile.am (AM_CPPFLAGS): Omit space between -I and
2501 directory, as required by Solaris cc. Include built headers, as
2502 required by Solaris make in VPATH build.
2503 * checks/Makefile.in: Use $(srcdir) where needed.
2504 (CHECKS): Factor $(srcdir) into macro.
2505 (DISTFILES): Likewise. Automake takes care of distributing
2508 (Makefile): Use modern syntax of config.status.
2509 * doc/m4.texinfo (Loops, Include, Undivert, Incompatibilities):
2510 Avoid overfull and underfull hboxes in dvi.
2512 Fix 'make check' in VPATH build. All files included by testsuite
2513 now live in a single directory. Use forloop.m4 in testsuite.
2514 * checks/incl.m4, checks/foo, checks/wrapfifo.m4: Move from
2516 * examples/incl.m4, examples/foo, examples/wrapfifo.m4: ...to
2518 * checks/Makefile.in (DISTFILES): Don't distribute moved files.
2519 * examples/Makefile.am (EXTRA_DIST): Distribute new files.
2520 * checks/check-them: Avoid s/// when filename is in pattern.
2521 * examples/forloop.m4: Fix to match documentation.
2522 * doc/m4.texinfo (Include, Undivert, Incompatibilities): Reflect
2524 (Loops, Format): Actually use forloop.m4 in tests.
2526 2006-07-02 Eric Blake <ebb9@byu.net>
2528 * checks/Makefile.in (exec_prefix, prefix): New macros, so that
2529 $(bindir) works in installcheck.
2530 (check, installcheck): No longer change directory, so that
2531 distcheck works with a read-only builddir.
2532 * checks/check-them: Work when pwd is no longer builddir.
2534 2006-07-01 Eric Blake <ebb9@byu.net>
2536 * GNUmakefile: New file, borrowed from coreutils.
2537 * Makefile.am (EXTRA_DIST): Distribute GNUmakefile.
2538 * Makefile.maint (Makefile): Delete this rule, now that
2539 GNUmakefile includes Makefile.
2541 2006-06-30 Eric Blake <ebb9@byu.net>
2543 For compatibility with other m4 implementations, sysval returns
2544 signal<<8 rather than 0 if syscmd is terminated by a signal.
2545 * configure.ac (AC_CHECK_HEADERS_ONCE): Check for sys/wait.h.
2546 * src/builtin.c (include): Include sys/wait.h when stdlib.h does
2547 not provide wait macros.
2548 (WTERMSIG, WIFSIGNALED, WIFEXITED): More fallback macros.
2549 (M4SYSVAL_EXITBITS, M4SYSVAL_TERMSIGBITS): New helper macros.
2550 (m4_esyscmd): Set sysval to -1 on failure.
2551 (m4_sysval): Print 127 on failure, and accomodate signals if they
2553 * NEWS: Document this change.
2554 * doc/m4.texinfo (Platform macros, Esyscmd, Sysval): Fix typos in
2556 * checks/check-them: Likewise.
2557 * src/debug.c (debug_set_file): Work around mingw fstat bug.
2559 * src/m4.h (UNIX, W32_NATIVE): Improve platform detection macros.
2560 * src/freeze.c (produce_frozen_state): Use new spelling of
2562 * src/builtin.c (predefined_tab): Add __windows__ on non-unix
2564 (m4_syscmd, m4_esyscmd): The empty command is successful.
2565 * doc/m4.texinfo (Shell commands): Rename from UNIX commands.
2566 Document platform-dependence of system().
2567 (Syscmd): Add example.
2568 (Esyscmd): Make example more robust, and actually demonstrate
2570 (Sysval): Expand test to cover esyscmd code path, and to check
2571 that empty command is successful. Add conditional check for
2573 (Other Incompatibilities): Move platform macros from here...
2574 (Platform macros): ...to this new node. Add windows macro.
2575 Check that exactly one platform macro is provided.
2576 * checks/check-them: Improve trap cleanup. Tolerate dirname and
2577 .exe in error messages. Allow for skipping checks.
2578 * configure.ac (HAVE_EFGCVT): Kill dead configure check.
2579 * NEWS: Document platform macros.
2581 2006-06-29 Eric Blake <ebb9@byu.net>
2583 Fix buffer overrun bug.
2584 * m4/gnulib-cache.m4: Augment with gnulib-tool --import
2586 * src/format.c [HAVE_EFGCVT]: Delete this code, and use *printf
2587 variant instead, since [efg]cvt are obsolete and our use of them
2588 was buggy (savannah sr #104303).
2589 (format): Fix buffer overflow by using xasprintf.
2590 * doc/m4.texinfo (Format): Expand format test to catch both bugs.
2591 * NEWS: Document this fix.
2593 * configure.ac (AC_CANONICAL_HOST, AC_CANONICAL_BUILD): Allow
2595 (AC_CACHE_CHECK): Cache search for ecvt.
2597 2006-06-27 Eric Blake <ebb9@byu.net>
2599 * doc/m4.texinfo (Eval): Document 32-bit signed limitations
2600 required by POSIX, and add example that exposed core dump on x86
2602 (Incompatibilities): Document incompatibility in eval precedence.
2603 * src/eval.c (shift_term): Explicitly mask, to avoid undefined
2605 (mult_term): Explicitly check for -1, to avoid SIGFPE on x86.
2606 * NEWS: Document this change.
2608 * doc/m4.texinfo: Use @noindent consistently.
2609 (Quoting Arguments): Document that unquoted parentheses group
2611 (Pseudo Arguments): Expand tests to show this.
2612 (Incompatibilities): Contrast traditional behavior of
2615 2006-06-24 Eric Blake <ebb9@byu.net>
2617 * configure.ac (AC_PREREQ): Autoconf 2.60 is now released.
2618 (AC_CHECK_HEADERS_ONCE): Use this new feature.
2619 (AC_CHECK_FUNCS_ONCE): Likewise.
2621 2006-06-23 Eric Blake <ebb9@byu.net>
2623 * doc/m4.texinfo: Quoting cleanup throughout - follow
2624 autoconf-recommended style of one level of quote per parenthesis
2625 in the normal case. Adjust error messages to match GNU coding
2626 standards (and to allow 'make check' to pass again).
2627 (Quoted strings, Inhibiting Invocation): Turn more examples into
2629 (Comments): Resolve FIXME by adding example.
2630 (Define): Add example about underquoting.
2631 (Defn): Add example about use of $0.
2632 (Indir, Format): Resolve FIXME done in last commit.
2633 (Ifelse): Add example about creating blind macro.
2634 (Debugging): Fix grammar.
2635 (Dnl): Add example about dnl with arguments.
2636 (M4wrap): Be explicit that LIFO order is non compliant, and will
2638 (Undivert): Resolve FIXME by adding example.
2639 (Frozen files): Document that m4wrap and sysval will not work
2640 consistently until m4 2.0.
2641 (Incompatibilities): Document another POSIX compliance bug, this
2642 time with changequote. Document a traditional incompatibility
2643 with partial input spanning file boundaries.
2645 Make error messages more consistent with GNU coding standards -
2646 start with lower case, and don't end sentence with punctuation.
2647 * src/debug.c (trace_pre): Update message wording.
2648 * src/eval.c (evaluate, cmp_term, shift_term, mult_term):
2650 * src/freeze.c (produce_frozen_state, issue_expect_message),
2651 (reload_frozen_state): Likewise.
2652 * src/input.c (push_string_init, pop_init, init_macro_token),
2653 (peek_input, next_char_1, set_word_regexp, next_token): Likewise.
2654 * src/m4.c (stackovf_handler, main): Likewise.
2655 * src/macro.c (expand_token, expand_argument, call_macro),
2656 (expand_macro): Likewise.
2657 * src/output.c (make_room_for, output_text, insert_file),
2658 (freeze_diversions): Likewise.
2659 * src/symtab.c (symtab_init, lookup_symbol): Likewise.
2661 * src/builtin.c (builtin_tab): Make format and indir blind.
2662 (substitute): Prefer "Warning:" vs. "ERROR:" in messages.
2663 * NEWS: Mention the change to builtins.
2665 2006-06-22 Eric Blake <ebb9@byu.net>
2667 Robustify frozen file format.
2668 * src/freeze.c (reload_frozen_state): Add GET_DIRECTIVE helper
2669 macro. Require V first, and only accept it once. For F, use
2670 placeholder if builtin is not found, rather than warning.
2671 * src/m4.h (m4_placeholder): New prototype.
2672 * src/builtin.c: Unify error message style.
2673 (m4_placeholder): New function, warn if invoked.
2674 (builtin_tab): Add m4_placeholder.
2675 (m4_defn): Warn if placeholder is encountered.
2676 (find_builtin_by_addr): Handle placeholder.
2677 (find_builtin_by_name): Return placeholder on failure.
2678 (m4_builtin): Treat placeholder as undefined.
2679 * doc/m4.texinfo (Frozen files): Document changes in V and F.
2680 * NEWS: Document this change.
2681 Reported by Bruno Haible.
2683 * doc/m4.texinfo: Whitespace cleanup. TABs are evil in texinfo.
2684 (tabchar): New macro, so that 'make check' still works.
2685 (Invoking m4): Document that ignored compatibility options -B, -S,
2686 and -T each consume an argument.
2687 * checks/get-them: Honor @tabchar{}.
2689 Avoid compiler warnings during -DDEBUG.
2690 * src/m4.h (M4_GNUC_ATTRIBUTE, M4_GNUC_UNUSED): New macros.
2691 [DEBUG]: Also imply DEBUG_OUTPUT and DEBUG_STKOVF.
2692 * src/input.c (print_token) [DEBUG_INPUT]: Use correct format.
2693 (lex_debug) [DEBUG_INPUT]: Fix to compile. Mark unused.
2694 (next_token) [DEBUG_INPUT]: Print before returning.
2695 * src/path.c (include_dump) [DEBUG_INCL]: Mark unused.
2696 * src/symtab.c (symtab_debug) [DEBUG_SYM]: Mark unused.
2698 Avoid mkstemp bugs on various platforms.
2699 * m4/gnulib-cache.c: Augment with gnulib-tool --import mkstemp.
2700 * src/output.c [! HAVE_MKSTEMP]: Delete.
2701 * configure.ac (AC_CHECK_FUNCS): Don't check for mkstemp.
2702 * src/m4.h (mkstemp) [! HAVE_MKSTEMP]: Prototype, if needed.
2703 * NEWS: Document this.
2705 * Makefile.am (EXTRA_DIST): Distribute gnulib-cache.m4.
2706 Reported by Bruno Haible.
2708 2006-06-21 Eric Blake <ebb9@byu.net>
2710 Avoid obsolete sigstack when POSIX sigaltstack is available.
2711 * src/m4.c: Blindly assume signal.h, since stackovf.c and gnulib
2713 * configure.ac (AC_CHECK_HEADERS): Likewise.
2714 (AC_CHECK_TYPES): New check for siginfo_t, since siginfo.h is
2715 obsolete and most hosts now have it in signal.h.
2716 (AC_CHECK_MEMBERS): New check for sigaction.sa_sigaction.
2717 (AC_CACHE_CHECK): Cache decision to use stackovf.
2718 (AC_EGREP_HEADER): Switch to AC_CHECK_TYPES.
2719 * src/stackovf.c (DEBUG_STACKOVF): Remove unused define.
2720 (SA_RESETHAND, SA_SIGINFO): Provide fallback definitions, to
2721 simplify later code.
2722 (PARAM_STACKOVF, PARAM_NOSTACKOVF): Move further away from NULL,
2723 in case of dereferencing a member of a NULL pointer.
2724 (sigsegv_handler) [HAVE_STRUCT_SIGACTION_SA_SIGACTION]: Define a
2726 (setup_stackovf_trap): Use NULL instead of 0 for pointers, use
2727 EXIT_FAILURE in error, indent preprocessor directives.
2728 [HAVE_SIGALTSTACK && HAVE_SIGINFO_T]: Depend on siginfo_t, not
2730 [HAVE_SIGACTION && defined SA_ONSTACK]: Prefer POSIX handler.
2731 Reported by Santiago Vila.
2733 2006-06-19 Eric Blake <ebb9@byu.net>
2737 2006-06-18 Andreas Buening <andreas.buening@nexgo.de> (tiny change)
2739 * checks/Makefile.in (PATH_SEPARATOR): New macro.
2740 (check, installcheck): Use it, for OS/2.
2742 2006-06-18 Eric Blake <ebb9@byu.net>
2744 Consistently use "GNU M4" as package name, "m4" as executable
2746 * NEWS: Document previous fix.
2748 * README: Fix grammar. Document that --enable-changeword is on
2750 * doc/m4.texinfo (Top, Changeword): Likewise.
2751 (Sysval): Enhance this test.
2752 (History): Backport this section from CVS head, and update.
2754 2006-06-18 Bruno Haible <bruno@clisp.org> (tiny change)
2755 Eric Blake <ebb9@byu.net>
2757 * src/builtin.c (WEXITSTATUS): Provide fallback definition.
2758 (m4_esyscmd): Set sysval to 0xffff, to accomodate both
2759 big-endian and little-endian wait status definitions.
2760 (m4_sysval): Use WEXITSTATUS.
2761 Reported by Andreas Buening.
2763 2006-06-18 Eric Blake <ebb9@byu.net>
2765 * configure.ac (AC_INIT): Bump version number.
2766 * NEWS: Describe changes in 1.4.4c.
2768 2006-06-17 Eric Blake <ebb9@byu.net>
2770 Beta Release 1.4.4b:
2771 * configure.ac (AC_INIT): Bump version number.
2772 * NEWS: Describe changes since 1.4.4.
2773 * Makefile.maint (cvs-news): Accomodate copyright line wrapping.
2775 * Makefile.am (MAINTAINERCLEANFILES): Clean files added by
2777 * checks/Makefile.in (maintainer-clean): Add missing target.
2778 * COPYING: Remove generated file from CVS.
2780 2006-06-16 Eric Blake <ebb9@byu.net>
2782 * checks/Makefile.in (DISTFILES): Distribute wrapfifo.m4.
2784 2006-06-15 Eric Blake <ebb9@byu.net>
2786 * checks/wrapfifo.m4: New file. Use it...
2787 * doc/m4.texinfo (Incompatibilities): here, in a new test case to
2788 demonstrate how to get POSIX behavior of m4wrap prior to m4 2.0.
2790 * src/m4.h (to_uchar): New function.
2791 * src/eval.c (eval_lex): Use it to avoid passing signed char to
2792 isdigit, isalpha, isupper, islower, isspace, isalnum.
2793 * src/builtin.c (expand_user_macro): Likewise.
2794 * src/format.c (format): Likewise.
2795 * src/macro.c (expand_argument): Likewise.
2796 * NEWS: Document this security fix.
2799 * src/symtab.c (lookup_symbol): Use invalid, not illegal.
2800 * src/freeze.c (reload_frozen_state): Fix typo in message.
2801 (produce_frozen_state): Standardize on builtin, not built-in.
2802 * src/builtin.c (numeric_arg, bad_argc): Likewise.
2804 * configure.ac (M4_EARLY, M4_INIT): Use gnulib.
2805 (AC_PROG_RANLIB, AC_AIX, AC_MINIX, AC_CHECK_HEADERS),
2806 (AC_FUNC_ALLOCA, AC_REPLACE_FUNCS): Avoid checks now done by
2808 * Makefile.am (ACLOCAL_AMFLAGS): New entry, for gnulib.
2809 * m4/gnulib-cache.m4: New file, from gnulib.
2810 * bootstrap: Invoke gnulib-tool --update.
2811 * src/m4.c (main): Cast away const.
2812 * NEWS: Document that regex is updated.
2815 2006-06-08 Eric Blake <ebb9@byu.net>
2817 * configure.ac (changeword): Work even when changeword is not a
2819 (AC_PROG_AWK, AC_PROG_INSTALL, AC_PROG_MAKE_SET, AC_HEADER_STDC):
2820 Delete; now done by automake.
2821 (AC_ISC_POSIX, AC_C_CONST): Delete; now obsolete.
2823 2006-06-07 Eric Blake <ebb9@byu.net>
2825 * lib/regex.c (bcmp_translate): Canonicalize type name.
2826 * doc/Makefile.am (MAINTAINERCLEANFILES): Fix typo.
2827 * configure.ac (changeword): Disable changeword for the creation
2828 of configure, in case of bootstrapping with an m4 configured with
2829 --enable-changeword.
2831 Distribute a rudimentary man page.
2832 * Makefile.am (SUBDIRS): Move doc after src so that 'm4 --help'
2834 * doc/Makefile.am (man_MANS, EXTRA_DIST, MAINTAINERDISTCLEAN),
2835 (SUFFIXES, m4.1): New macros and rules to build m4.1.
2837 2006-06-06 Eric Blake <ebb9@byu.net>
2839 * lib/regex.c (re_match_2_internal, bcmp_translate): Avoid
2840 compiler warnings at -O2.
2841 * lib/getopt.c (_getopt_internal): Likewise.
2843 Cleanup of previous patches.
2844 * src/input.c (struct input_block): Remove traced member.
2845 (push_macro, init_macro_token): Don't pass trace status around.
2846 * src/m4.h (struct token_data): Remove traced member.
2847 (struct symbol, struct builtin): Reduce unused space.
2848 (TOKEN_DATA_FUNC): Simplify.
2849 (TOKEN_DATA_FUNC_TRACED): Remove unused macro.
2850 (push_macro, define_builtin): Remove unused parameter.
2851 * src/builtin.c (define_builtin, builtin_init, define_macro),
2852 (m4_defn): Don't pass trace status around.
2853 * src/macro.c (expand_argument): Likewise.
2854 * src/freeze.c (reload_frozen_state): Likewise.
2855 * src/symtab.c: Whitespace cleanup.
2856 * NEWS: Clean up wording.
2857 * doc/m4.texinfo (Undefine, Dumpdef, Trace): Cleanup wording;
2858 ensure tests actually expose bugs prior to today's patches.
2860 Trace status of builtins is no longer inherited across
2861 define(...,defn(...)). Fixes bug that autom4te had been working
2863 * src/builtin.c (define_builtin): Don't override trace status.
2864 * doc/m4.texinfo (Trace): Add test for this.
2865 * NEWS: Document this.
2867 When changing macro definitions inside the arguments to the macro,
2868 consistently preserve the old definition that was in effect before
2869 argument collection, similar to the C pre-processor.
2870 Reported by John Brzustowski.
2871 * NEWS: Document this change.
2872 * doc/m4.texinfo (Macro Arguments, Undefine, Dumpdef): Document
2873 this policy, and add tests that expose core dumps prior to this
2875 * src/m4.h (struct symbol): New members to track when a symbol is
2876 still in use after removal from the symbol table.
2877 (SYMBOL_PENDING_EXPANSIONS, SYMBOL_DELETED): Define.
2878 (free_symbol): Prototype.
2879 * src/macro.c (expand_macro): Track pending expansions of a
2880 symbol. On completion, if a symbol is deleted and no longer
2881 pending, free its memory.
2882 * src/symtab.c (free_symbol): Export. Don't free memory if symbol
2884 (lookup_symbol) <SYMBOL_INSERT>: Create new entry when old entry
2886 (lookup_symbol) <SYMBOL_DELETE, SYMBOL_POPDEF>: Mark entries still
2887 in use as deleted and remove from the table without freeing
2889 (symtab_print_list) [DEBUG_SYM]: More debug output.
2891 * src/symtab.c (hack_all_symbols): Allow certain modifications of
2892 the symbol table during traversal.
2893 * src/builtin.c (set_trace): Replace SYMBOL_DELETE with
2894 SYMBOL_POPDEF, since only the latter is safe with
2897 Solve crash when passing "indir(`foo')" to "m4 -tfoo".
2898 * src/symtab.c (lookup_symbol) <SYMBOL_DELETE, SYMBOL_POPDEF>:
2899 Preserve placeholder when macro is being traced.
2900 * src/builtin.c (m4_ifdef, m4_indir): A traced but undefined
2901 symbol is not defined.
2902 (set_trace): Remove placeholder when no longer traced.
2903 (m4_traceon): On named traces, always reserve a slot in the
2905 (m4_traceoff): Don't warn about untracing a nonexistent symbol.
2906 * NEWS: Document new trace behavior.
2907 * doc/m4.texinfo (Trace): Tracing by name now consistently works
2908 no matter whether that macro is currently defined.
2909 (Incompatibilities): Document differences between traditional and
2912 2006-06-04 Paul Eggert <eggert@cs.ucla.edu> (tiny change)
2913 Eric Blake <ebb9@byu.net>
2915 * src/m4.h (hash_table_size): Now size_t instead of int.
2916 * src/m4.c (hash_table_size): Likewise.
2917 (main): Adjust to this; use atol rather than atoi.
2918 * src/symtab.c: Include <limits.h>, for CHAR_BIT.
2919 (symtab_init, lookup_symbol, hack_all_symbols):
2920 Use size_t for sizes and indexes, not int.
2921 (symtab_print_list) [DEBUG_SYM]: Likewise.
2922 (hash): Likewise. Don't case-fold in the hash function.
2923 Shift by 7, not 3, for consistency with gnulib/lib/hash.c.
2924 Don't assume hash word is 32 bits.
2925 * NEWS: Document this change.
2927 2006-06-04 Eric Blake <ebb9@byu.net>
2929 * src/symtab.c (symtab_debug, symtab_print_list) [DEBUG_SYM]: Fix
2930 to allow compilation, for use in debugger.
2931 (profiles, current_mode) [DEBUG_SYM]: New variables.
2932 (show_profile, profile_strcmp) [DEBUG_SYM]: New methods for
2933 determining hash table performance.
2935 2006-05-31 Eric Blake <ebb9@byu.net>
2936 John Brzustowski <jbrzusto@fastmail.fm>
2938 * src/input.c (input_stack): Delete; use current_input instead.
2939 (wrapup_stack): Dynamically allocate, so that recursion is handled
2941 (push_wrapup): Use current wrapup stack.
2942 (pop_wrapup): Rotate wrapup stack to current, and create new
2944 (input_init): Dynamically allocate stacks.
2945 * NEWS: Update, now that recursive m4wrap can no longer cause
2948 2006-05-31 Eric Blake <ebb9@byu.net>
2950 * lib/getopt.c: Fix copyright year.
2951 * lib/obstack.c: Ditto.
2952 * src/builtin.c: Ditto.
2954 2006-05-30 Eric Blake <ebb9@byu.net>
2956 * doc/m4.texinfo (M4wrap): Add test to expose m4wrap bug.
2957 Reported by John Brzustowski.
2958 (Incompatibilities): Document known POSIX incompatibilities.
2961 2006-05-29 Eric Blake <ebb9@byu.net>
2963 * doc/m4.texinfo (Maketemp): Work even when running 'make check'
2967 * Makefile.am: New file.
2968 * doc/Makefile.am: Ditto.
2969 * examples/Makefile.am: Ditto.
2970 * lib/Makefile.am: Ditto.
2971 * src/Makefile.am: Ditto.
2972 * acinclude.m4: New file, renamed from aclocal.m4.
2973 * configure.ac (AM_INIT_AUTOMAKE): Invoke new macro.
2974 (AC_ARG_PROGRAM): Now redundant.
2975 (STACKOVF): Turn into automake conditional.
2976 (AC_CONFIG_COMMANDS): stamp-h is a command, not a file.
2977 * checks/Makefile.in: Converting this dir to automake was not
2978 trivial; for now, just add missing targets demanded by top-level.
2979 * INSTALL: Remove files that are now generated from CVS.
2980 * Makefile.in: Ditto.
2981 * aclocal.m4: Ditto.
2982 * install-sh: Ditto.
2983 * mkinstalldirs: Ditto.
2984 * doc/Makefile.in: Ditto.
2985 * doc/texinfo.tex: Ditto.
2986 * examples/Makefile.in: Ditto.
2987 * lib/Makefile.in: Ditto.
2988 * src/Makefile.in: Ditto.
2990 * AUTHORS: Backport from CVS head, and update.
2991 * doc/m4.texinfo (Changeword): Fix examples to match behavior.
2993 2006-05-27 Eric Blake <ebb9@byu.net>
2995 * lib/regex.c (regex_compile): Kill compiler warnings.
2996 * lib/getopt.c: Likewise.
2997 * lib/obstack.c: Likewise.
2998 * src/builtin.c (builtin_init): Likewise.
2999 * src/path.c (path_search): Likewise.
3001 * doc/m4.texinfo: Fix usage of a vs. an.
3002 (Loops, Include, Cleardiv, Patsubst, Format, M4exit): Kill
3003 overfull hbox warnings.
3004 (Inhibiting Invocation, Divert, Maketemp, M4exit): Add new tests.
3006 * configure.ac: Update to autoconf 2.59. Forbid ^M4_. Fix
3008 * aclocal.m4 (fp_PROG_CC_STDC): Delete; now covered by autoconf.
3009 (fp_C_PROTOTYPES): Delete, GNU Coding Standards state we can now
3011 (M4_WITH_DMALLOC): Rename from fp_WITH_DMALLOC. Fix quoting.
3012 * src/m4.h (_): PROTOTYPES is no longer provided, assume C89.
3013 * src/Makefile.in: Delete remains of ansi2knr.
3014 * src/ansi2knr.1: Delete.
3015 * src/ansi2knr.c: Delete.
3017 2006-05-25 Eric Blake <ebb9@byu.net>
3019 * doc/m4.texinfo: Fix spelling errors. Use `invalid' instead of
3022 * doc/m4.texinfo (Francois): No longer needed as a tex variable.
3023 Reported by Karl Berry.
3025 2006-05-24 Eric Blake <ebb9@byu.net>
3027 * Makefile.in (html): New target.
3028 * doc/Makefile.in (html, m4.html): Likewise.
3029 (MAKEINFOHTML): New macro.
3030 * doc/m4.texinfo (Francois) [ifnottex]: Use newer texinfo
3032 (Regexp) [ifhtml]: Make cross-reference to emacs manual an
3034 Reported by Bob Badour.
3036 * THANKS: Update. Move reporter's email addresses here, instead
3039 2006-05-11 Eric Blake <ebb9@byu.net>
3042 * doc/m4.texinfo (Changequote): Give testsuite exposure to bug
3043 patched on 2005-12-04.
3044 Reported by Ilya N. Golubev.
3046 * bootstrap: New file, so that generated files need not be stored
3048 * Makefile.in (DISTFILES): Add bootstrap.
3050 Make testsuite less sensitive to doc changes.
3051 * doc/m4.texinfo: Use m4.input instead of filename.
3052 * checks/check-them (xerr): Turn m4.input into filename.
3053 * checks/Makefile.in (dist): Depend on stamp-checks.
3055 Portability updates for OS/2.
3056 * src/Makefile.in (EXEEXT, OBJEXT): Define.
3059 * lib/Makefile.in (OBJEXT): Define.
3061 * doc/Makefile.in (install, uninstall): Install info files into
3063 Reported by Andreas Buening.
3065 2006-05-09 Eric Blake <ebb9@byu.net>
3067 * install-sh: Update to newer upstream version.
3068 * mkinstalldirs: Likewise.
3069 Reported by Andreas Buening.
3071 * src/m4.c (main): Bump copyright year.
3072 * Makefile.in (datarootdir): Define, for autoconf 2.59c.
3073 * doc/Makefile.in (datarootdir): Likewise.
3075 2006-05-08 Eric Blake <ebb9@byu.net>
3078 * doc/m4.texinfo (Bugs): Backport bug email address from head.
3079 Reported by Stepan Kasal.
3081 2005-12-04 Ilya N. Golubev <gin@mo.msk.ru> (tiny change)
3083 * input.c (match_input): Do not pass expression with side effect
3084 to `obstack_grow'. Fix <INTERNAL ERROR: Recursive push_string!>.
3087 2005-12-04 Gary V. Vaughan <gary@gnu.org> (tiny change)
3089 * doc/m4.texinfo (How to debug macros and input): s/woould/would/
3090 Reported by Damian Menscher.
3092 2005-10-19 Gary V. Vaughan <gary@gnu.org> (tiny change)
3094 * configure.ac (AC_INIT): Bump to 1.4.4a.
3096 2005-10-19 Gary V. Vaughan <gary@gnu.org> (tiny change)
3099 * configure.ac (AC_INIT): Bump to 1.4.4.
3100 * NEWS: Describe 1.4.4's changes.
3101 * INSTALL, install-sh, doc/texinfo.tex: Updated from upstream.
3103 2005-10-17 John Gatewood Ham <zappaman@buraphalinux.org> (tiny change)
3105 * src/m4.c: fix return code when non-existent files are processed
3107 2005-10-17 John Gatewood Ham <zappaman@buraphalinux.org> (tiny change)
3109 * README: update email address for bug reports.
3111 2005-10-17 Gary V. Vaughan <gary@gnu.org>
3113 * doc/m4.info: Generated files are not kept in the repository.
3115 2005-05-01 Gary V. Vaughan <gary@gnu.org>
3117 The FSF are moving offices today. Changed their contact address
3118 in all files from `59 Temple Place, Suite 330, MA 02111-1307' to
3119 `51 Franklin Street, Fifth Floor, MA 02110-1301'.
3121 Also, some of the files here were never updated from the previous
3122 '675 Mass Ave, Cambridge, MA 02139', so changed those to the
3123 '51 Franklin Street, Fifth Floor, MA 02110-1301' address too.
3125 2005-03-31 Mike Frysinger <vapier@gentoo.org>
3127 * Makefile.in (bindir, infodir): Substitute from configure rather
3129 * doc/Makefile.in (infodir): Ditto.
3130 * src/Makefile.in (bindir): Ditto.
3133 2005-03-31 Gary V. Vaughan <gary@gnu.org>
3135 Changes needed to automate the release process for 1.4.3:
3137 * Makefile.in (dist): Make .tar.bz2 tarball too.
3138 * Makefile.maint (TSDEPS_DIST): Remove m4/libtool.m4.
3139 (cvs-news): Look 1 line further down for NEWS release number.
3140 (cvs-dist): We don't use automake, so make dist is fine.
3141 Remove double . before suffixes.
3142 (cvs-release): Don't mention manual.html.
3143 (fetch): Get latest gendocs files.
3144 (web-manual): Rewritten to use gendoc for multiformat manuals.
3145 * doc/gendocs.sh: Don't save an old version in m4 CVS!
3146 * doc/m4.texinfo (Index): HFS+ (the file system on my Mac) is case
3147 preserving, but case insensitive, so generating html docs per node
3148 clashes between Index.html, the node file, and index.html, the
3149 top-level of the document tree...
3150 (Index macro): ...so renamed to this. Changed all references.
3152 2005-03-31 Gary V. Vaughan <gary@gnu.org> (tiny change)
3154 * configure.ac (AC_INIT): Bump to 1.4.3a.
3156 2005-03-31 Gary V. Vaughan <gary@gnu.org> (tiny change)
3159 * configure.in (AC_INIT): Bump to 1.4.3.
3160 * NEWS: Describe 1.4.3's changes.
3162 2005-03-31 Gary V. Vaughan <gary@gnu.org>
3164 * Makefile.maint: New file with release rules, from CVS libtool.
3165 * Makefile.in (DISTFILES): Add Makefile.maint.
3166 * INSTALL, install-sh, doc/texinfo.tex: Updated to latest
3169 2005-03-31 Eric Blake <ebb9@byu.net> (tiny change)
3171 * doc/m4.texinfo (Patsubst): Re-add trailing space required by
3172 checks/47.patsubst, with a redundant @comment to prevent emacs
3173 from removing it accidentally again.
3174 * checks/get-them: Allow for trailing spaces tucked behind
3177 2005-03-31 Eric Blake <ebb9@byu.net> (tiny change)
3179 * doc/Makefile.in (install, uninstall): Accomodate DESTDIR.
3180 * src/Makefile.in (install, uninstall): Likewise.
3182 2005-02-07 Gary V. Vaughan <gary@gnu.org>
3184 * lib/regex.c, lib/regex.h: Reverted gnulib update, which broke
3186 Reported by Eric Blake.
3188 2005-02-04 Gary V. Vaughan <gary@gnu.org>
3190 * lib/regex.c, lib/regex.h: Updated from gnulib.
3191 * src/input.c (set_word_regexp): Don't change the word_regexp
3192 unless it compiles correctly.
3194 Reported by Frank Schwidom.
3196 * Makefile.in (stamp-h): Regenerate config.h properly.
3198 2005-02-03 Gary V. Vaughan <gary@gnu.org>
3200 * configure.ac (AC_DEFINE): Fix overquoting of description
3203 * src/m4.h (__CYGWIN__, WIN32): Canonicalise Windows and Cygwin
3205 * src/freeze.c (produce_frozen_state): Use \n line-endings even
3206 on Windows, so that the frozen file reader will work.
3207 Reported by Josef T. Burger.
3209 * src/m4.c (main): Modernise the --version output.
3211 2005-02-03 Gary V. Vaughan <gary@gnu.org>
3213 Modernise the configury a little to prevent spurious errors from
3214 Autoconf-2.59's autoreconf:
3216 * config.h.in: Renamed to...
3217 * config-h.in: ...this to better support DOS 8.3 file systems.
3218 * acconfig.h: Removed.
3219 * configure.in: Renamed to...
3220 * configure.ac: ...this, and AC_DEFINE used to declare config.h
3221 entry comments. Slight reorganisation and reformatting.
3222 * aclocal.m4: Use third argument to AC_DEFINE to declare config.h
3224 (AC_INIT): Use a modern 3 argument call.
3225 * Makefile.in, checks/Makefile.in, doc/Makefile.in,
3226 examples/Makefile.in, lib/Makefile.in, src/Makefile.in:
3227 s/PRODUCT/PACKAGE/g.
3228 * Makefile.in (DISTFILES): Removed acconfig.h, configure.in,
3229 config.h.in. Added configure.ac, config-h.in.
3230 (stamp-h.in): Removed acconfig.h from dependencies.
3231 (configure): Depends on configure.ac, not configure.in.
3232 * doc/Makefile.in (stamp-vti): Ditto.
3233 * src/freeze.c (produce_frozen_state), src/m4.c (main): Adjust for
3234 difference between PRODUCT="m4" and PACKAGE="GNU M4".
3235 * configure: Regenerated.
3237 2005-02-03 Noah Misch <noah@cs.caltech.edu>
3239 * src/output.c (mkstemp): Make non-static, and build regardless of
3240 HAVE_TMPFILE; src/builtin.c also needs this replacement.
3243 2004-09-09 Vincent Lonngren <Vincent.lonngren.759@student.lu.se>
3245 * configure.in (AC_CHECK_HEADERS): Commit works best when you save
3246 changes from your editor buffer first.
3248 * configure.in (AC_CHECK_HEADERS): Add signal.h, sys/signal.h.
3249 * src/m4.c: And include them as appropriate.
3252 2004-09-09 Andreas Schwab <schwab@suse.de>
3254 Refactoring of the string read case in next_char provides about a
3255 20% speedup of M4 as typically used by autoconf:
3257 * src/input.c (next_char_1): Renamed from next_char.
3258 (next_char): New macro.
3261 2004-08-21 Gary V. Vaughan <gary@gnu.org>
3263 * configure.in (VERSION): Bump to 1.4.2a.
3265 2004-08-19 Paul Eggert <eggert@twinsun.com>
3268 * configure.in (VERSION): Bump to 1.4.2.
3269 * News: Describe 1.4.2's changes.
3271 * src/m4.c (reference_error): Preserve errno, since M4ERROR
3273 * src/builtin.c (m4_esyscmd): Clear errno before calling popen.
3274 (m4_maketemp): Clear errno before calling mkstemp.
3275 * src/path.c (path_search): Don't let "free" trash errno when
3277 * src/output.c (insert_file): Don't assume errno has a valid
3278 value simply because fread returns zero. This fixes a
3279 portability bug reported by Marion Hakanson in
3280 <http://lists.gnu.org/archive/html/bug-m4/2004-07/msg00029.html>.
3282 2004-06-09 Gary V. Vaughan <gary@gnu.org>
3284 * configure.in (VERSION): Bump to 1.4.1a.
3285 * NEWS: Place holder for next stable release.
3287 2004-06-03 Paul Eggert <eggert@cs.ucla.edu>
3290 * configure.in (VERSION): Bump to 1.4.1.
3291 * NEWS: Describe 1.4.1's changes.
3293 * aclocal.m4 (fp_PROG_CC_STDC): Use AC_DEFUN, not define, to
3294 pacify Autoconf 2.59.
3296 * doc/m4.texinfo: Insert commas after @xref's that lack them,
3297 to pacify Texinfo 4.7.
3298 * doc/Makefile.in (info): Remove info-1, info-2, info-3.
3300 * src/m4.h, src/debug.c: Use #ifdef __STDC__, not #if __STDC__, to
3301 pacify Sun C compilers.
3303 2003-09-28 Akim Demaille <akim@epita.fr>
3305 * src/symtab.c (lookup_symbol): Fix an uninitialized-variable
3308 2003-09-03 Santiago Vila <sanvila@debian.org>
3310 * examples/stackovf.sh: Use tempfile if available.
3312 2001-04-02 Robert Bihlmeyer <robbe@orcus.priv.at>
3314 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=92629
3315 * src/output.c (m4_insert_file): Do not mix buffered and
3316 unbuffered I/O, as this breaks on the Hurd. (trivial change)
3318 2001-02-01 Santiago Vila <sanvila@debian.org>
3320 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=84451
3321 * src/m4.c (main): Fix format vulnerabilities. (trivial change)
3323 2001-02-01 Matt Kraai <kraai@debian.org>
3325 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=84416
3326 * doc/m4.texinfo (Maketemp): Change maketemp to refer to a new,
3327 empty file rather than to a nonexistent file. This closes a common
3329 * src/builtin.c (m4_maketemp): Implement the above, by using
3330 mkstemp rather than mktemp. (trivial change)
3332 2000-01-09 Akim Demaille <demaille@inf.enst.fr>
3334 * src/builtin.c (expand_ranges): Added break after trailing dash.
3335 This caused misbehaviors on some systems.
3337 Sat Nov 5 15:52:47 1994 Francois Pinard (pinard@icule)
3340 * doc/Makefile.in (realclean): Also remove stamp-vti.
3341 Reported by Eric Backus.
3343 Wed Nov 2 00:47:53 1994 Francois Pinard (pinard@icule)
3345 * src/freeze.c (produce_frozen_state): If the frozen file cannot
3346 be opened, return immediately after producing the error message.
3347 Reported by Andreas Schwab.
3349 * configure.in: Check for const only after having found possible
3350 ANSIfying compiler flags, this is of no use to check it before.
3351 Reported by Alexander Lehmann.
3353 Tue Nov 1 22:02:37 1994 Francois Pinard (pinard@icule)
3355 * src/macro.c (collect_arguments): Cast obstack arguments to
3356 (voidstar), so avoiding compiler warnings.
3357 Reported by Joseph E. Sacco.
3359 * src/freeze.c (produce_frozen_state): Cast printed lengths to
3360 (int) so they correspond to %d format items.
3361 Reported by Joseph E. Sacco.
3363 * src/m4.c (main): Cast the argument to xfree to (voidstar).
3364 * src/symtab.c (free_symbol): Idem.
3365 Reported by Karl Vogel.
3367 Mon Oct 31 02:11:19 1994 Francois Pinard (pinard@icule)
3369 * Makefile.in (DISTFILES): Distribute BACKLOG.
3371 * configure.in: Define PRODUCT and VERSION.
3372 * acconfig.h: Document PRODUCT and VERSION.
3373 * src/m4.c, src/freeze.c: Use PRODUCT and VERSION instead of the
3374 constant string m4 and variable or parameter named version.
3376 Sun Oct 30 08:13:03 1994 Francois Pinard (pinard@icule)
3378 * src/m4.h, src/debug.c: Replace all #ifdef __STDC__ by #if
3379 __STDC__. Alliant FX/2800 Concentrix 2.2 (i860-BSD4.3) compiler
3380 defines __STDC__ to 0, for indicating it is *not* ANSI!
3381 Reported by Kaveh R. Ghazi.
3383 * configure.in: Added obsolescent tests for AIX and Minix.
3385 * doc/Makefile.in (mostlyclean): Remove texclean in dependencies,
3386 which texclean does not exist anymore.
3387 Reported by Eric Backus, Jim Meyering, John David Anglin and
3390 Sat Oct 29 05:10:03 1994 Francois Pinard (pinard@icule)
3392 * aclocal.m4 (fp_C_PROTOTYPES): Force -D_HPUX_SOURCE with -Aa.
3393 Reported by John David Anglin.
3395 * src/ansi2knr.c: New version, sent by Peter Deutsch.
3396 * aclocal.m4 (fp_C_PROTOTYPES): Substitute empty or ansi2knr for
3397 ANSI2KNR, depending on the fact the compiler is ANSI or not.
3398 * src/Makefile.in: Use -Ovarargs=convert on ansi2knr calls.
3399 Remove the sed filter after ansi2knr for debug.c. Use $O instead
3400 of $U, put underline in extensions rather than in basenames. Use
3401 implicit rules, now that regularity makes this possible.
3402 Have $(OBJECTS) depend on $(ANSI2KNR), so to trigger compilation
3403 of ansi2knr whenever it is needed.
3404 * configure.in: Adjusted for correct STACKOVF substitution.
3405 * src/debug.c (trace_format): When not __STDC__, use (...) as a
3406 parameter list, so ansi2knr will convert it to (va_alist) va_dcl.
3407 Reported by David MacKenzie.
3409 * Makefile.in: Remove binprefix. Use transform_name instead.
3410 Reported by David MacKenzie.
3412 * doc/Makefile.in: Create version.texi, use it, clean it.
3413 Reported by Jim Meyering.
3415 Fri Oct 28 20:33:55 1994 Francois Pinard (pinard@icule)
3417 * Makefile.in (all, install, uninstall): Depend on Makefile.
3419 * Makefile.in: For actions invoking $(MAKE) from within compound
3420 sh statements, exit non-zero if the sub-make fails. Otherwise,
3421 the top-level make may exit successfully when it should fail.
3422 Reported by Jim Kingdon.
3424 * {,/*}Makefile.in: Use && after all cd, in case they fail.
3426 * {,*/}Makefile.in: Declare PRODUCT and VERSION macros.
3427 (dist): Use PRODUCT and VERSION instead of tricks on .fname.
3428 * configure.in: Substitute PRODUCT and VERSION.
3430 * {,*/}Makefile.in (dist): Always try a hard link before a copy.
3432 Thu Oct 27 22:32:58 1994 Francois Pinard (pinard@icule)
3434 * Makefile.in (mostlyclean-local): Do not remove *~.
3435 * */Makefile.in (mostlyclean): Idem.
3436 Reported by Robert E. Brown and Richard Stallman.
3438 Sun Oct 9 08:30:13 1994 Francois Pinard (pinard@icule)
3440 * src/m4.h: Get rid of CONFIG_BROKETS.
3442 Sun Oct 2 16:48:10 1994 Francois Pinard (pinard@icule)
3444 * configure.in: Use AC_ARG_PROGRAM.
3445 * aclocal.m4 (fp_C_PROTOTYPES): Substitute @kr@ by kr or empty.
3446 Reported by David MacKenzie.
3448 Sat Oct 1 11:22:42 1994 Francois Pinard (pinard@icule)
3450 * configure.in: Do not add -O to CFLAGS for GNU C, now that
3451 configure does it automatically.
3452 Reported by Jim Meyering.
3454 Fri Sep 23 08:16:58 1994 Francois Pinard (pinard@icule)
3456 * src/stackovf.c: Declare the handler_t typedef earlier in the
3457 code, use it for stackovf_handler.
3458 (setup_stackovf_trap): Use RETSIGTYPE instead of void while
3459 casting sigsegv_handler.
3460 Reported by Robert Bernstein.
3462 * src/m4.c (main): Initialize program_name to argv[0] without
3464 Reported by Karl Berry.
3466 Sun Sep 18 11:42:50 1994 Francois Pinard (pinard@icule)
3468 * src/Makefile.in (TAGS): Include a ../lib/TAGS reference.
3469 Reported by Karl Berry.
3471 Wed Sep 14 10:00:22 1994 Francois Pinard (pinard@icule)
3473 * lib/Makefile.in (mostlyclean): Added.
3474 (TAGS): Make in $(srcdir).
3476 * configure.in: Use `choke me' in test, like everywhere!
3478 * {doc,examples,lib,src}/Makefile.in (check): Deleted, as
3479 unreacheable and useless.
3481 * doc/Makefile.in (texclean): Deleted, merged in mostlyclean.
3483 * lib/Makefile.in (DISTFILES): Distribute TAGS.
3484 (distclean): Do not remove TAGS.
3485 (realclean): Remove it.
3486 * Makefile.in: Make TAGS in lib also, not just in src.
3487 Reported by Karl Berry.
3489 * Makefile.in (distclean, realclean): Instead of recursively
3490 calling $(MAKE) for the -local part, allow parallel execution of
3491 -recursive and -local, only delay the removal of config.status,
3492 which is repeated in both goals.
3494 Tue Sep 13 19:21:05 1994 Francois Pinard (pinard@icule)
3497 * Makefile.in: Group all *clean-recursive goals in one, using sed
3498 to remove `-recursive' while calling make recursively. Also, use
3499 a subshell for each recursive $(MAKE).
3500 Reported by Jim Meyering.
3502 * src/m4.h (memcpy): Define with bcopy for BSD systems.
3503 Reported by Kaveh R. Ghazi.
3505 * src/Makefile.in (ansi2knr): Use $(LIBS) while linking, for SunOS
3506 4.1.3 requires -ldl to link even ansik2nr, and we need a way to
3509 * configure.in: Use date instead of touch for stamp-h.
3510 * Makefile.in (stamp-h.in): Idem.
3512 * Makefile.in (distclean, realclean): Force serial execution of
3513 both goals, in case parallel makes are being used.
3514 Reported by Jim Meyering.
3516 * src/Makefile.in (DISTFILES): Distribute TAGS.
3517 (distclean): Do not remove TAGS.
3518 (realclean): Remove it.
3519 Reported by Karl Berry.
3521 Sat Sep 10 12:34:04 1994 Francois Pinard (pinard@icule)
3523 * configure.in: Use fp_ to match aclocal.m4. Revert _OS_ macros
3524 to old names, for following Autoconf.
3526 Thu Sep 8 15:07:27 1994 Francois Pinard (pinard@icule)
3528 * Makefile.in (MDEFINES): Remove INSTALL substitutions, for
3529 ./install.sh will not be correctly referred to in sub-Makefiles.
3530 Reported by John David Anglin.
3532 * doc/Makefile.in (texclean): Remove *.cps and *.fns too.
3533 Reported by Eric Backus.
3535 * Makefile.in, checks/Makefile.in, doc/Makefile.in,
3536 examples/Makefile.in, lib/Makefile.in, src/Makefile.in: Limit
3537 config.status into remaking this directory's Makefile only.
3538 * Makefile.in (stamp-h): Do not check nor touch stamp-h.
3539 * configure.in (AC_OUTPUT): Touch stamp-h if CONFIG_HEADERS.
3540 Reported by Jim Meyering.
3542 Tue Sep 6 12:07:33 1994 Francois Pinard (pinard@icule)
3544 * configure.in: Correct stack overflow detection logic, taking
3545 care of systems having only incomplete implementations (like for
3546 Pyramid 9820 OSx 5.0d).
3547 Reported by Kaveh R. Ghazi.
3549 * src/Makefile.in (TAGS): Remote -t from etags call.
3551 Fri Sep 2 10:37:10 1994 Francois Pinard (pinard@icule)
3553 * lib/Makefile.in (install): Depend on all.
3555 Wed Aug 31 11:17:21 1994 Francois Pinard (pinard@icule)
3557 * examples/Makefile.in (mostlyclean): Do not depend on texclean.
3558 Reported by Jim Meyering and John David Anglin.
3560 * Makefile.in (distclean-local): Delete config.log.
3561 Reported by Jim Meyering.
3563 Solidify frozen files with respect to -P:
3564 * src/m4.c: Have -P set prefix_all_buitins variable instead of
3565 calling a function by that name. Declare the variable.
3566 * src/m4.h: Adjust declaration for prefix_all_buitins.
3567 * src/builtin.c (builtin_init): Merge in functionality from
3568 previous prefix_all_buitins function, while making entries in the
3569 symbol table, but not modifying the builtin description itself.
3571 * src/freeze.c (reload_frozen_state): Add a useless `break;',
3572 because *many* compilers do not accept an empty `default:'.
3573 Reported by Akiko Matsushita, Eric Backus, John David Anglin,
3574 Joseph E. Sacco, Kaveh R. Ghazi, Tom McConnell and Ulrich Drepper.
3576 * configure.in: Use AC_TYPE_SIGNAL.
3577 * src/stackovf.c (setup_stackovf_trap): Use RETSIGTYPE.
3578 Reported by Robert Bernstein.
3580 * checks/Makefile.in (check): Modify PATH so check-them will find
3581 m4 in the src directory.
3582 * Makefile.in (check): Don't.
3583 Reported by Akiko Matsushita and Jim Meyering.
3585 * src/output.c (make_room_for, output_character_helper): New
3586 functions, for implementing a global MAXIMUM_TOTAL_SIZE instead of
3587 a per buffer MAXIMUM_BUFFER_SIZE.
3589 * src/output.c (output_text): New function, for optimizing the
3590 output of strings of characters. Use it.
3592 Tue Aug 30 01:44:29 1994 Francois Pinard (pinard@icule)
3594 * doc, src: New directories reorganizing the distribution.
3595 * doc/Makefile.in, src/Makefile.in, examples/Makefile.in: New
3597 * Makefile.in: Adjusted.
3598 * configure.in: Configure new Makefiles.
3600 * m4.h: Declare STRING typedef. Use it for comment and quote
3601 strings, adjusting all references. (This is the rudiments of a
3602 beginning for the eventual withdrawal of NUL terminated strings.)
3603 * output.c (shipout_text): Accept a length parameter, and use it.
3604 All callers adjusted.
3606 Mon Aug 29 12:27:19 1994 Francois Pinard (pinard@icule)
3608 * m4.h: Include <unistd.h> if it exists.
3609 * stackovf.c: Don't.
3611 Clean up for current_diversion variable:
3612 * output.c: Move current_diversion from builtin.c.
3613 * m4.h: Declare current_diversion so builtin.c can access it.
3614 * output.c (output_init, make_diversion): Initialize or update
3616 * builtin.c (builtin_init, m4_divert): Leave current_diversion
3619 Remove limit on number of diversions:
3620 * output.c: Replace ndiversion by diversions, declare it.
3621 (output_init): Allocate only diversion 0.
3622 (make_diversion): Allocate new diversions as needed.
3623 * m4.h, m4.c: Remove NDIVERSIONS and ndiversion related stuff.
3624 * m4.c: Still accept -N, but do nothing with it.
3625 Reported by David MacKenzie.
3628 * output.c (freeze_diversions): New function.
3629 * m4.h: Declare freeze_diversions.
3630 * freeze.c: Document frozen file format, revise it, call
3631 freeze_diversions to add diversions to frozen format, and code to
3632 reload them properly.
3633 * m4.c: Do not undivert automatically at end when status being
3634 frozen. Do not call builtin_init when reloading frozen state.
3636 Speed up diversion processing:
3637 * output.c: Add INITIAL_BUFFER_SIZE, MAXIMUM_BUFFER_SIZE,
3638 COPY_BUFFER_SIZE, in-memory diversion buffers, struct diversion
3639 structure and variables, cached variables out of output_diversion,
3640 reallocate_diversion_for and OUTPUT_CHARACTER.
3641 (shipout_text, make_diversion, insert_diversion): Adapted to new
3643 (insert_file): Use better buffering.
3644 Reported by David MacKenzie.
3646 Sun Aug 28 05:20:02 1994 Francois Pinard (pinard@icule)
3648 * Makefile.in, lib/Makefile.in, checks/Makefile.in: Arrange so
3649 dist works from another build directory.
3651 Sat Aug 27 14:32:45 1994 Francois Pinard (pinard@icule)
3653 * symtab.c (hack_all_symbols): Use hash_table_size instead of
3654 constant HASHMAX, for -H option to work better.
3656 * builtin.c (DECLARE): Simplify by using _ ().
3658 * freeze.c: New file.
3659 * Makefile.in: Compile it, distribute it.
3660 * m4.c: Recognize, document and process --freeze-state (-F) and
3661 --reload-state (-R) options. Pass a true flag to builtin_init
3662 only if no reloading some state.
3663 * builtin.c (define_builtin): Remove static specifier.
3664 (find_builtin_by_name): Remove static specifier.
3665 (builtin_init): Accept and obey a flag argument.
3666 * m4.h: Add declarations for freeze.c, changes for builtin.c.
3668 Wed Aug 24 16:14:19 1994 Francois Pinard (pinard@icule)
3670 * builtin.c (dumpdef_cmp): Rewrite so the cast protect the const
3673 * configure.in: Implement --with-dmalloc.
3674 * acconfig.h: Document WITH_DMALLOC.
3675 * m4.h: Add code for when WITH_DMALLOC.
3677 Mon Aug 15 12:38:05 1994 Francois Pinard (pinard@icule)
3679 * m4.c (long_options): Use "error-output", the dash was missing.
3680 Reported by Akiko Matsushita.
3682 Fri Aug 12 16:38:01 1994 Francois Pinard (pinard@icule)
3684 * m4.h: Include <sys/types.h>.
3685 * builtin.c, debug.c, m4.c, output.c, stackovf.c: Don't.
3686 * m4.h: Declare len_lquote and len_rquote as size_t, not int.
3688 * input.c: Declare len_lquote, len_rquote, len_bcomm and len_ecomm
3690 * builtin.c (dump_args): Declare len as size_t, not int.
3692 * debug.c: Prototype the forward declaration of debug_set_file.
3694 * builtin.c (m4_undivert): Replace div by file, for avoiding the
3695 shadowing of this variable.
3696 * output.c (insert_diversion): Idem.
3698 * input.c: Delete def_rquote, def_lquote, def_bcomm and def_ecomm.
3699 (input_init): Duplicate default quote and comment strings.
3700 (set_quotes): Free previous quote strings in all cases. Duplicate
3701 even default quote strings.
3702 (set_comment): Free previous comment strings in all cases.
3703 Duplicate even default comment strings.
3705 * configure.in: Updated for Autoconf 2.0.
3706 * Makefile.in (distclean-local): Also delete config.cache.
3708 * m4.c (usage): Reorganize the --help output by topic. Include a
3709 description for debugging flags.
3711 Fri Jul 29 10:15:52 1994 Francois Pinard (pinard@icule)
3713 * configure.in: If sigaction is available and SA_ONSTACK defined,
3714 use sigaction. Otherwise, if sigvec is available and SV_ONSTACK
3715 defined, use sigvec. Else don't compile stackovf.c.
3716 * stackovf.c (setup_stackovf_trap): Idem.
3717 Reported by Jim Avera, Karl Berry, Kaveh R. Ghazi, Matthias Rabe
3720 Thu Jul 21 22:43:17 1994 Francois Pinard (pinard@icule)
3722 * m4.c (usage): Replace printf par fputs.
3724 Mon Jul 18 23:48:23 1994 Francois Pinard (pinard@icule)
3728 Sun Jul 17 08:08:25 1994 Francois Pinard (pinard@icule)
3730 * configure.in: Check for sigaction and sigvec. Add a new delayed
3731 check for RLIMIT_STACK, combine in the checking for getrlimit.
3732 All those things are not universally available.
3733 * stackovf.c: Split setting up the trap handler and catching
3734 signals, for better taking care of various configure outcomes.
3735 * examples/stackovf.sh: Correct a typo.
3736 Reported by Eric Backus, Jim Avera and Jim Meyering.
3738 Sat Jul 16 20:36:19 1994 Francois Pinard (pinard@icule)
3740 * ansi2knr.c: New version sent by its author, Peter Deutsch.
3742 Fri Jul 15 14:36:21 1994 Francois Pinard (pinard@icule)
3744 * Makefile.in: Modify so parallel make will not try making
3745 lib/libm4.a twice simultaneously.
3746 Reported by Jim Meyering.
3748 Thu Jul 14 17:23:17 1994 Francois Pinard (pinard@icule)
3750 * stackovf.c (setup_stackovf_trap): Replace "Don't" by "Do not" in
3751 error message, for when no code possibility exists. Even if this
3752 line is completely #ifdef'ed out, it brings a syntax error.
3753 Reported by Andreas Schwab, Jim Meyering and Joseph E. Sacco.
3755 * Makefile.in (install): Have install depend on all too, for lib
3756 to be remade as needed.
3758 * examples/stackovf.sh: Try ksh, bsh and bash for shells
3759 providing ulimit, instead of using only ksh.
3760 Reported by Jim Avera and Joseph E. Sacco.
3762 Tue Jul 12 06:54:31 1994 Francois Pinard (pinard@icule)
3764 * Makefile.in (check): Have it depend on all instead of m4. In
3765 this way, a change in lib will be detected and processed.
3767 * builtin.c (numeric_arg): Use strtol and verify the conversion,
3768 instead of using sscanf which stops as soon as there is a
3769 non-digit in the input. Previously, incr(1xyzzy), eval(1,2xyzzy)
3770 and divert(1xyzzy) were all accepted without any warning or error
3772 * m4.h: Declare strtol as long if not including stdlib.h.
3773 * configure.in: Check for limits.h, and replace strtol if missing.
3774 * lib/Makefile.in: Substitute LIBOBJS. Distribute strtol.c.
3775 * lib/strtol.c: New file, from elsewhere.
3776 Reported by Andreas Schwab.
3778 Thu Jul 7 22:38:10 1994 Francois Pinard (pinard@icule)
3780 * macro.c (expand_macro): Cast value to (boolean) prior to
3781 assigning it to traced.
3782 Reported by Tom McConnell.
3784 * Makefile.in (m4): Always make all in lib first.
3785 Reported by Jim Meyering.
3787 Wed Jul 6 13:16:31 1994 Jim Avera (jima@netcom.com)
3789 * stackovf.c: Isolated OS-dependent sections; Improved portability,
3790 adding support for SunOS/BSD (sigvec, sigstack, and 4-parameter signal
3791 handlers), and a default error message if the fault address is not
3792 available (when neither siginfo.h nor BSD sigcontext are supported).
3793 * configure.in: Changes for stackovf.h: Check for sigcontext,
3794 sigaction, sigstack, and define rlim_t as int if necessary.
3795 * acconfig.h: Added HAVE_SIGCONTEXT and rlim_t.
3796 * examples/stackovf.sh: Run m4 -L99999999 to allow stack overflow.
3797 * ansi2knr.c: Fix for func-ptr args; convert "..." to varargs syntax.
3799 Tue Jul 5 19:13:54 1994 Francois Pinard (pinard@icule)
3801 * configure.in: Use AC_SET_MAKE.
3802 * Makefile.in: Use @SET_MAKE@.
3803 Reported by Jim Meyering.
3805 * checks/check-them: Do not trap on SIGQUIT or SIGALRM.
3806 Reported by Ian Taylor.
3808 Sat Jul 2 00:58:47 1994 Francois Pinard (pinard@icule)
3810 * configure.in: Remove dependency of USE_STACKOVF on STDC_HEADERS,
3811 because siginfo.h is unrelated to standard headers, and siginfo.h
3812 is already checked for.
3813 Reported by Joseph E. Sacco.
3815 * acconfig.h, aclocal.m4, m4.h: Replace HAVE_PROTOTYPES by
3817 * aclocal.m4, configure.in: Replace AC_HAVE_PROTOTYPES by
3820 Wed Jun 29 22:41:53 1994 Francois Pinard (pinard@icule)
3822 * builtin.c (substitute): Use \& to represent this part of the
3823 string which was matched by the whole regexp, instead of
3824 representing the whole string. Any usage of \0 issues a warning
3825 and acts like \&, it will disappear in some subsequent release.
3827 Mon Jun 27 14:24:23 1994 Francois Pinard (pinard@icule)
3829 * m4.c: Complete prototype for forwarded declaration of usage.
3831 * input.c (init_macro_token): Correct own reference in error
3832 message. Previous name get_macro_func was referred to instead.
3833 (next_char): Correct own reference in error message. Previous
3834 name advance_input was referred to instead.
3836 * m4.h: Declare eval_t and unsigned_eval_t typedefs to 32 bits.
3837 * eval.c (logical_or_term, logical_and_term, or_term, xor_term,
3838 and_term, not_term, logical_not_term, cmp_term, shift_term,
3839 add_term, mult_term, exp_term, unary_term, simple_term): Add
3840 prototype to forwarded declarations. Declare parameter v1 as
3841 eval_t * instead of int *. Same for local variable v2 in dyadic
3842 functions. Same for result in exp_term.
3843 * builtin.c (m4_eval): Declare value as eval_t instead of int.
3844 (ntoa): Declare value as eval_t instead of int. Declare uvalue as
3845 unsigned_eval_t instead of unsigned int. Change casts accordingly.
3846 (shipout_int): Cast first argument of ntoa to eval_t.
3847 Reported by Thorsten Ohl.
3849 * macro.c: Complete the prototypes of forwarded expand_macro and
3851 Reported by Thorsten Ohl.
3853 * m4.h: Define voidstar as void * or char * depending on __STDC__.
3854 The Ultrix 3.1 compiler cannot do much with void pointers.
3856 * builtin.c (dumpdef_cmp): Replace void * by voidstar.
3857 * m4.c (xfree): Replace void * by voidstar.
3858 Reported by Tom McConnell.
3860 * ansi2knr.1: New, from elsewhere.
3861 * Makefile.in (DISTFILES): Distribute ansi2knr.1
3863 * Makefile.in (stamp-h.in): Avoid running ./config.status if
3864 stamp-h does not exist yet. This avoids running it a second time
3865 just after the initial ./configure.
3866 Reported by David MacKenzie and Tom McConnell.
3868 * m4.h: Replace the enum debug_info declaration with a series of
3869 #define's. The Ultrix 3.1 compiler would otherwise need casting
3870 (int) to most references, when used in expressions.
3871 Reported by Tom McConnell.
3873 Sat Jun 25 00:10:05 1994 Francois Pinard (pinard@icule)
3875 * aclocal.m4: Replace FP_PROTOTYPES by AC_HAVE_PROTOTYPES,
3876 following an idea from Brook G. Milligan. AC_HAVE_PROTOTYPES
3877 calls the compiler. Previously, FP_PROTOTYPES was only calling
3878 the preprocessor; by not being subject to CFLAGS, this was
3879 discouraging those flags asking for ANSI compilation.
3880 * acconfig.h: Document HAVE_PROTOTYPES.
3881 * configure.in: Use AC_HAVE_PROTOTYPES instead of FP_PROTOTYPES.
3882 * m4.h: Define _() according to HAVE_PROTOTYPES, not __STDC__.
3883 Reported by Eric Backus.
3885 * configure.in: Substitute CFLAGS and LDFLAGS, taking their value
3886 from the environment. Default CFLAGS to -g if not set.
3887 * Makefile.in: Have CFLAGS and LDFLAGS substituted from configure.
3888 * lib/Makefile.in: Have CFLAGS substituted from configure.
3889 Reported by Eric Backus and Tom McConnell.
3891 * configure.in: m4_undefine changeword before using AC_ENABLE.
3893 * m4.h: Declare prototypes for error (for ANSI compilers only),
3894 prefix_all_builtins and reference_error.
3895 Reported by Tom McConnell.
3897 * input.c (set_word_regexp): Do not try to initialize the array
3898 test from a string, this does not work with non-ANSI compilers.
3899 Reported by Eric Backus.
3901 * Makefile.in (dist): Clean examples/ before saving it.
3902 (distclean-local): Also remove stamp-h.
3903 Reported by Eric Backus.
3905 * Makefile.in (_stackovf.c): Goal for compiling stacokovf.c with
3907 Reported by Tom McConnell.
3909 * checks/Makefile.in (clean): Depends on mostlyclean.
3910 (mostlyclean): New goal.
3912 Fri Jun 24 23:30:31 1994 Francois Pinard (pinard@icule)
3914 * Makefile.in (DISTFILES): Distribute install.sh.
3915 * install.sh: New file, copied from elsewhere.
3916 Reported by Assar Westerlund and Kaveh R. Ghazi.
3918 Thu Jun 23 00:00:30 1994 Francois Pinard (pinard@icule)
3920 * configure.in: Define ENABLE_CHANGEWORD if --enable-changeword.
3921 * acconfig.h: Explain ENABLE_CHANGEWORD.
3923 [These modifs all depend upon ENABLE_CHANGEWORD and are adapted
3924 from code provided by Pete Chown]
3925 * m4.h: Add original_text field to u_t variant of union u.
3926 Declare TOKEN_DATA_FUNC macro.
3927 * builtin.c: Declare changeword.
3928 (m4_changeword): New function.
3929 * input.c: Include "regex.h", define variables with word regexps.
3930 (input_init): Initialize the word regexp.
3931 (set_word_regexp): New.
3932 (next_token): Declare local variables, use the previous code if
3933 default_word_regexp is true. Else, match using a new code. Save
3935 * macro.c (expand_token): Ship out original text if not a macro
3937 Reported by Krste Asanovic and Pete Chown.
3939 [These modifs all depend upon ENABLE_CHANGEWORD]
3940 * m4.h: Declare external user_word_regexp.
3941 * m4.c: Declare user_word_regexp, and initialize it from
3942 --word-regexp or -W, or NULL if not specified.
3943 * input.c: Use user_word_regexp if specified, instead of
3944 DEFAULT_WORD_REGEXP.
3946 * Makefile.in (m4): Revert Jan 3 1994 change. I'm unable to
3949 * Makefile.in, lib/Makefile.in: Limit suffixes to .c and .o.
3950 * checks/Makefile.in: Empty the suffix list.
3951 Reported by Geoff Russell, Joel Sherrill and Roland McGrath.
3953 * m4.c: Declare nesting_limit and initialize it to 250.
3954 Implement -LNUMBER or --nesting-limit=NUMBER to change its
3956 * m4.h: Declare nesting_limit as external.
3957 * macro.c (expand_macro): Stop execution whenever nesting limit
3959 Reported by Bengt Mertensson.
3961 * eval.c (evaluate): Diagnose excess characters in eval input.
3962 Things like `eval(08)' used to return 0 with no diagnostic.
3964 * m4.h: Capitalize first letter of all macro arguments in
3967 * m4.c: Declare warning_status, initialize it to 0. Add new
3968 option -E, or --fatal-warnings, which sets warning_status to
3969 EXIT_FAILURE instead.
3970 * m4.h: Declare external warning_status. Define EXIT_SUCCESS and
3971 EXIT_FAILURE if not otherwise done by header files.
3972 * m4.c: Delete declarations for EXIT_SUCCESS and EXIT_FAILURE.
3973 * m4.c, input.c, output.c, symtab.c, builtin.c, macro.c, debug.c,
3974 eval.c: Replace 0 by warning_status and 1 by EXIT_FAILURE in first
3975 argument of all M4ERROR calls.
3976 Reported by Noah Friedman.
3978 * examples/incl-test.m4: Renamed from incl_test.m4.
3979 * examples/include.m4: Include incl-test.m4 instead of
3981 * examples/multiquotes.m4: Renamed from multi-quotes.m.
3983 Wed Jun 22 21:58:54 1994 Francois Pinard (pinard@icule)
3985 * configure.in: Avoid USE_STACKOVF if <siginfo.h> not found. Note
3986 that Jim developped stackovf.c on a 486 running SVR4.0 (ESIX), and
3987 also tested it on a Sun Sparc workstation running SunOS 4.x.
3989 * format.c (format): When not HAVE_EFGCVT, m4 was failing the
3990 49.format check, abusing a `union values' argument with sprintf
3991 without selecting the proper field. Now, save the formatting type
3992 first, delaying the fetch of the corresponding argument.
3993 Reported by Joseph E. Sacco and Tom Quinn.
3995 * format.c (format): Remove const from char *fmt declaration when
3996 not HAVE_EFGCVT, because a NUL may be forced into it.
3998 * m4.h: Declare atof() when not STDC_HEADERS.
3999 Reported by Joseph E. Sacco.
4001 * Regenerate configure using Autoconf 1.11, this corrects a
4002 problem about an incorrect cpp seting on NeXT 3.1.
4003 Reported by Alexander Lehmann.
4005 Sun Jun 5 16:25:19 1994 Francois Pinard (pinard@icule)
4007 * m4.h (_): Change argument from `x' to `Args'.
4009 Wed May 4 23:59:39 1994 Francois Pinard (pinard@icule)
4011 * Makefile.in: Remove all occurrences of $(MFLAGS), which were
4012 bringing more evil than good on a few systems.
4013 Reported by Greg A. Woods.
4015 Fri Apr 22 15:59:35 1994 Francois Pinard (pinard@icule)
4017 * m4.h: Rename Args() to _().
4018 * m4.h: Remove extern specifier from all function declarations.
4020 Fri Apr 22 15:51:21 1994 Jim Avera (jima@netcom.com)
4022 * stackovf.c: New file implementing stack-overflow detection.
4023 * configure.in: Check for getrlimit, sigaction. If all of
4024 standard headers, getrlimit and sigaction, define USE_STACKOVF and
4025 substitute ${U}stackovf.o for STACKOVF.
4026 * acconfig.h: Declare USE_STACKOVF.
4027 * Makefile.in: Distribute stackovf.c, link with $(STACKOVF).
4028 * m4.h: Declare setup_stackovf_trap().
4029 * m4.c: Call setup_stackovf_trap().
4030 * tests/stackovf_test.sh: New file.
4032 Wed Apr 13 14:10:30 1994 Francois Pinard (pinard@icule)
4034 * checks/Makefile.in: Rename .all-stamp to stamp-checks.
4036 * Makefile.in (Makefile, etc.): Adapt for Autoconf 1.8.
4038 Sun Jan 30 14:24:19 1994 (pinard at icule)
4040 * m4.h: Remove definition of volatile, not used anymore.
4041 Reported by Jim Meyering and Joseph E. Sacco.
4043 * m4.h: Consistently use `do { ... } while (0)' in macros, instead
4044 of `if ... else /* nothing */' for if macros.
4045 Reported by Jim Meyering.
4047 * builtin.c (m4_regexp): Reorganize the code for avoiding a
4048 warning from gcc about `repl' possibly used before defined.
4049 Reported by Jim Meyering.
4051 * m4.h: Avoid a pre-ANSI <memory.h> together with <string.h>.
4052 Reported by Jim Meyering.
4054 Tue Jan 25 18:39:37 1994 Francois Pinard (pinard at icule)
4056 * m4.h: Move the conditional definition of volatile after the
4057 inclusion of system files, because they may define it first.
4059 Tue Jan 4 19:46:50 1994 Francois Pinard (pinard@icule)
4061 * checks/Makefile.in (CHECKS): Add a useless `*' before `[', to
4062 get around a problem with Alpha make seeing a syntax error, there.
4063 Reported by Vern Paxson.
4065 Mon Jan 3 00:21:45 1994 Francois Pinard (pinard@icule)
4067 * Makefile.in: Do not define LDFLAGS, use CFLAGS on link calls.
4068 Reported by Richard Stallman.
4070 Sat Dec 25 08:06:05 1993 Francois Pinard (pinard@icule)
4072 * configure.in: Correct test for strerror, AC_FUNC_CHECK was used
4073 instead of AC_HAVE_FUNCS.
4074 Reported by Noah Friedman.
4076 Wed Dec 1 09:37:53 1993 Francois Pinard (pinard@icule)
4078 * m4.c: Initialize show_help and show_version to zero.
4080 * m4.c: Ensure EXIT_SUCCESS and EXIT_FAILURE are defined.
4081 Use them in exit() and usage() calls.
4083 Sat Nov 27 10:43:24 1993 Francois Pinard (pinard@icule)
4085 * m4.h: Delete extern sys_nerr, sys_errlist declarations, and
4086 syserr() macro. Delete errref, add reference_error and M4ERROR.
4087 * m4.c: Replace errref, which was returning an input reference
4088 string, with reference_error, which prints it on standard error.
4089 * builtin.c, output.c: Use errno as second parameter to error,
4090 instead of using syserr() with %s.
4091 * *.c: Use M4ERROR instead of error: no more errref() with %s.
4092 Doing so, the program name appears after the input reference
4093 instead of before, which eases M-x next-error processing.
4095 Wed Nov 24 22:16:15 1993 Francois Pinard (pinard@icule)
4097 * checks/get-them: Escape braces with backslashes in patterns,
4098 because HPUX-9.01 awk needs this.
4099 Reported by Jim Meyering.
4101 Mon Nov 22 10:55:52 1993 Francois Pinard (pinard@icule)
4103 * builtin.c: Declare "FILE *popen ();".
4105 * m4.h: Remove MESSAGE{,1,2}, WARNING1, FATAL{,1}, INTERNAL_ERROR
4106 macros, replace error_message_prefix() declaration by errref()'s.
4107 Declare xrealloc, for use in errref().
4108 * m4.c: Delete error_message_prefix() function, add errref().
4109 * *.c: Use error() systematically in place of all error macros,
4110 now that error() flushes stdout first. Make needed adjustments.
4112 * m4.h: Remove const in sys_errlist[] declaration, it creates
4113 conflicts on SGI and Alpha.
4114 Reported by Kaveh R. Ghazi.
4116 Sat Nov 20 08:26:15 1993 Francois Pinard (pinard@icule)
4118 * m4.c: Include <getopt.h> instead of "getopt.h".
4120 * configure.in: Output to config.h. Use HAVE_FUNCS preferably.
4121 * acconfig.h: New, for documenting HAVE_EFGCVT.
4122 * Makefile.in: Distribute acconfig.h, .stamp-h.in and config.h.in,
4123 use them wherever appropriate. Also use -I. for compilations.
4124 * lib/Makefile.in: Use -I.. for compilations.
4125 * *.c: Include <config.h> or "config.h".
4127 * m4.h: Test for HAVE_MEMORY_H instead of NEED_MEMORY_H.
4128 * configure.in: Use AC_HAVE_HEADERS(memory.h), delete AC_MEMORY_H.
4130 Wed Nov 17 09:34:55 1993 Francois Pinard (pinard@icule)
4132 * builtin.c (m4_eval): Cast strlen to (int) before comparing.
4134 * input.c (input_init): Initialize quote and comment strings
4135 explicitely instead of calling set_quotes and set_comment: by
4136 doing so, we ensure we do not free uninitialized variables.
4138 * checks/check-them: Reverse arguments to both diff, so the
4139 expected is on the left and the obtained on the right.
4141 * m4.h: Add MESSAGE{,1,2}, WARNING1, FATAL{,1} and INTERNAL_ERROR
4142 macros. Delete declarations for m4error, warning, fatal and
4143 internal_error, add declaration for error_message_prefix.
4144 * m4.c: Delete m4error, warning, fatal and internal_error
4145 routines, add error_message_prefix routine.
4146 * *.c: Replace m4error routine calls with MESSAGE* macro calls,
4147 warning with WARNING*, fatal with FATAL* and internal_error with
4149 * Makefile.in (_m4.c): Do not adjust ansi2knr output for va_alist,
4150 this is not needed anymore.
4152 * m4.h: Declare extern FILE *debug. Add DEBUG_PRINT{1,3} and
4153 DEBUG_MESSAGE{,1,2} macros. Delete declarations for debug_print
4154 and debug_message, add declaration for debug_message_prefix.
4155 * debug.c: Remove static specifier for FILE *debug declaration.
4156 Delete debug_print and debug_message routines, add
4157 debug_message_prefix routine.
4158 * builtin.c, debug.c: Replace debug_print routine calls with
4159 DEBUG_PRINT* macro calls.
4160 * input.c, path.c: Replace debug_message routine calls with
4161 DEBUG_MESSAGE* macro calls.
4163 * m4.h: Remove inclusion of <varargs.h>.
4164 * debug.c: Include <stdarg.h> or <varargs.h>.
4165 (trace_format): Use stdarg instead of varargs if __STDC__.
4167 * configure.in: Remove checks for vfprintf and _doprnt. These
4168 implementations use varargs tricks which are not portable enough.
4169 * lib/vfprintf.c: Deleted.
4170 * lib/_doprnt.c: Deleted.
4171 * lib/Makefile.in: Adjusted accordingly. Remove LIBOBJS.
4172 Reported by Joel Sherrill.
4174 * path.c (add_include_directory): Use xstrdup.
4176 * builtin.c (find_builtin_by_name): Declare static.
4178 * *.[ch]: Add const to a few "char *" declarations.
4180 * configure.in: Remove commented tests for fileno() and fstat().
4181 * debug.c: Remove comments about HAVE_FILENO and HAVE_FSTAT.
4183 * debug.c (debug_flush_files): New.
4184 * m4.h: Declares it.
4185 * builtin.c (m4_syscmd, m4_esyscmd): Use it.
4186 Reported by Nicolas Pioch.
4188 Fri Nov 12 10:02:26 1993 Francois Pinard (pinard@icule)
4190 * Makefile.in (m4.dvi): Use m4.texinfo instead of m4.texi.
4191 Reported by Joel Sherrill.
4193 * builtin.c (prefix_all_builtins): Instead of the table size, use
4194 the null entry at end for stopping the loop. It was overwritten.
4195 Reported by Andreas Schwab and Jim Meyering.
4197 * builtin.c (prefix_all_builtins): Cast xmalloc to (char *).
4198 Reported by Kaveh R. Ghazi.
4200 * macro.c (call_macro): Add * in (*SYMBOL_FUNC (sym)) (...).
4201 Reported by Karl Vogel.
4203 Tue Nov 9 09:31:47 1993 Francois Pinard (pinard@icule)
4205 * m4.h: Do not define volatile if already defined.
4206 Reported by Rene' Seindal.
4208 * lib/Makefile.in: Add a forgotten ALLOCA=@ALLOCA@. Grrr!
4210 Reported by Bernhard Daeubler, Eric Backus, Hal Peterson, Hoang
4211 Uong, Ian Taylor, Kaveh R. Ghazi, Tom McConnell and Walter Wong.
4213 Mon Nov 8 21:11:44 1993 Francois Pinard (pinard@icule)
4215 * m4.h: Define strchr and strrchr in terms of index and rindex,
4216 instead of the other way around.
4217 * builtin.c, m4.c, path.c: Use strchr instead of index.
4219 * input.c (next_char): Remove a "break;" after a "return ...;".
4220 Reported by Tom McConnell.
4222 Mon Nov 8 12:45:34 1993 Francois Pinard (pinard@icule)
4226 * configure.in: Do not copy check files in the build hierarchy.
4227 * checks/check-them: Identify the m4 version being checked. For
4228 finding m4, look in $PATH instead of in the parent directory.
4229 * Makefile.in (check): Prepend `pwd` to $PATH before checking.
4230 * checks/Makefile.in (.all-stamp): Always create check files in
4231 the source hierarchy, not anymore in the build hierarchy.
4232 (check): cd to the source hierarchy before performing checks.
4233 Do not copy nor clean COPYING anymore, take it from `..'.
4234 Reported by Tom McConnell.
4236 * Makefile.in (Makefile): Use $(SHELL).
4237 (config.status): Use $(SHELL). Use "config.status --recheck"
4238 instead of "configure --no-create", which is obsolete.
4239 Reported by Tom McConnell.
4241 Fri Nov 5 09:49:30 1993 Francois Pinard (pinard@compy.IRO.UMontreal.CA)
4243 * m4.c (usage): Use "%s" instead of "m4" in format string.
4244 Reported by Jim Meyering.
4246 * Makefile.in: Distribute mkinstalldirs.
4247 Reported by Pierre Gaumond.
4248 Reported by Jim Meyering.
4249 Reported by Tom McConnell.
4250 Reported by Andreas Gustafsson.
4252 * checks/check-them: Renamed from checks/check_them.
4253 * checks/get-them: Renamed from checks/get_them.
4254 * checks/.all-stamp: Renamed from checks/.all_stamp.
4255 * checks/Makefile.in: Changed accordingly.
4256 Reported by Jim Meyering.
4258 Thu Nov 4 13:50:52 1993 Francois Pinard (pinard@lagrande.IRO.UMontreal.CA)
4260 * lib/Makefile.in (dist): Correct permissions on files.
4262 * output.c: Declare tmpfile, some systems don't.
4264 Wed Nov 3 09:09:16 1993 Francois Pinard (pinard@icule)
4266 * checks/Makefile.in (dist): Correct permissions on files.
4268 * Makefile.in (dist): Ensure recursive linking for subdirectory
4269 `examples', also set read/write permissions on all its files.
4271 * mkinstalldirs: New, from elsewhere.
4272 * Makefile.in: Use it.
4274 * debug.c: Synchronize debug messages and regular output when
4275 the debug file and stdout are redirected to the same file.
4276 * configure.in: Add (commented) checks for fileno and fstat.
4277 Reported by Jim Avera.
4279 * builtin.c (m4_ifelse): Diagnose excess arguments if 5, 8, 11,
4280 etc., arguments, then ignore the superfluous one. m4 used to
4281 diagnose missing arguments and return the empty string.
4282 Reported by Nick S. Kanakakorn.
4284 Tue Nov 2 00:55:41 1993 Francois Pinard (pinard@icule)
4286 * m4.c (main): At end of all input, ensure all undiverted text
4287 goes to the main output stream.
4288 Reported by Andreas Gustafsson.
4290 * m4.c (main): exit (0), instead of return 0.
4292 * m4.c: Implement -P and --prefix-builtins.
4293 * builtin.c: Delete const specifier on builtin_tab.
4294 (prefix_all_builtins): New.
4295 Reported by Noah Friedman.
4296 Reported by Scott Bartram.
4298 * c-boxes.el: New, from elsewhere.
4299 * Makefile.in: Distribute it.
4301 * m4.h: Do not define bcopy if <string.h> defines it.
4302 Reported by Stephen Perkins.
4304 * builtin.c (define_macro): Allow a missing second argument, in
4305 which case it is implied empty. Affects define and pushdef.
4306 Reported by Eric Allman.
4308 Mon Nov 1 07:45:24 1993 Francois Pinard (pinard@icule)
4310 * m4.h: Add blind_if_no_args in struct builtin, blind_no_args in
4311 struct symbol adn SYMBOL_BLIND_NO_ARGS macro.
4312 * builtin.c: Initialize all the blindness fields in builtin_tab.
4313 (define_builtin): Copy the blindness of a builtin into its symbol.
4314 * macro.c (expand_token): Avoid processing a blind builtin if the
4315 next character is not an opening parenthesis.
4316 Reported by David MacKenzie.
4317 Reported by Noah Friedman.
4319 * configure.in: Ensure an exit status of 0 on completion.
4320 Reported by Vivek P. Singhal.
4322 * eval.c (eval_lex): Admit both lower and upper case letters for
4323 bases greater than 10. Only lower case letters were accepted.
4325 * eval.c (eval_lex): Recognize 0bDIGITS and 0rRADIX:DIGITS syntax.
4326 Reported by Krste Asanovic.
4328 * eval.c: Rename NOT to LNOT. Add XOR, NOT, LSHIFT and RSHIFT.
4329 * eval.c (logical_not_term): New name for not_term.
4330 * eval.c (xor_term): New, between or_term and and_term.
4331 * eval.c (not_term): New, between and_term and logical_not_term.
4332 * eval.c (shift_term): New, between cmp_term and add_term.
4333 Reported by Krste Asanovic: ~, ^, <<, >>.
4334 Reported by Ben A. Mesander: ** vs ^.
4336 * m4.c: Delete xmalloc.c, xrealloc.c, xstrdup.c.
4337 * m4.h: Delete xrealloc.c.
4338 * lib/xmalloc.c: New, from elsewhere.
4339 * lib/xstrdup.c: New, from elsewhere.
4340 * lib/Makefile.in: Distribute and compile them.
4342 * m4.c: Change progname to program_name.
4343 * builtin.c, eval.c, m4.c, m4.h: Rename error to m4error.
4344 * lib/error.c: New, from elsewhere.
4345 * lib/Makefile.in: Distribute and compile error.c.
4346 * configure.in: Check AC_VPRINTF and for strerror.
4347 * m4.c: Delete cmd_error. Use error instead.
4348 * m4.c: Change label capitalisation to "ERROR", "Warning", etc.
4350 * m4.h: Delete #define const, let Autoconf takes care of this.
4352 * m4.c: Remove all code conditionalized by IMPLEMENT_M4OPTS.
4353 Merge parse_args into main. Declare argv to be `char *const *',
4354 then remove superfluous casts.
4356 * m4.c: Rename --no-gnu-extensions to --traditional.
4357 Reported by Ben A. Mesander.
4359 * m4.c (usage): Add a status parameter. Supply one in various
4360 calls. Add --help processing. Remove -V for --version.
4362 * lib/Makefile.in: Put $(CFLAGS) last in .c.o rule.
4364 * lib/Makefile.in: Have an AR=ar declaration.
4365 Reported by Eric Backus.
4366 Reported by Bjorn R. Bjornsson.
4367 Reported by Tom Tromey.
4368 Reported by Kristine Lund.
4369 Reported by Marion Hakanson.
4371 Sat Oct 30 12:51:47 1993 Francois Pinard (pinard@icule)
4373 * Makefile.in (m4.info): Use -I$(srcdir) on $(MAKEINFO).
4374 Reported by Noah Friedman.
4376 Mon Oct 25 14:58:48 1993 Francois Pinard (pinard@icule)
4378 * Makefile.in: Remove MDEFINES and cleanup.
4380 Wed Jun 9 14:59:46 1993 Francois Pinard (pinard@icule)
4382 * Makefile.in (dist): Replace "echo `pwd`" by a mere "pwd".
4385 Sat Feb 6 14:59:22 1993 Francois Pinard (pinard@icule)
4387 * Makefile.in, lib/Makefile.in, check/Makefile.in: In dist goals,
4388 ensure 777 mode for directories, so older tar's will restore file
4391 Sun Jan 17 15:38:05 1993 Francois Pinard (pinard@icule)
4393 * Makefile.in, lib/Makefile.in: Put $(CFLAGS) after $(CPPFLAGS),
4394 so the installer can override automatically configured choices.
4395 Reported by Karl Berry.
4397 Fri Jan 15 16:07:00 1993 Francois Pinard (pinard@icule)
4399 * lib/vfprintf.c: Stolen from Oleo distribution and adapted. The
4400 previous version was not working properly on m68k-hp-bsd4.3.
4401 Reported by Roland McGrath.
4403 * lib/_doprnt.c: Stolen from Oleo distribution.
4404 * configure.in: Check for _doprnt.c if vfprintf.c selected.
4405 * lib/Makefile.in: Distribute _doprnt.c.
4406 Do not distribute regex.[ch].old anymore.
4408 Fri Jan 1 19:42:23 1993 Francois Pinard (pinard at icule)
4410 * Makefile.in, lib/Makefile.in: Reinstate $(CPPFLAGS), use it.
4411 Richard wants it there.
4413 Sun Dec 27 07:01:54 1992 Francois Pinard (pinard at icule)
4415 * Makefile.in: Add DEFS to MDEFINES.
4416 * lib/Makefile.in (.c.o): Remove $(CPPFLAGS).
4417 (libm4.a): Remove the library before creating it.
4418 (distclean): Remove tags and TAGS too.
4420 Wed Dec 23 12:46:55 1992 Francois Pinard (pinard at icule)
4422 * Makefile.in (dvi, m4.dvi): New goals.
4424 * builtin.c, eval.c, format.c, input.c, m4.[ch], m4.texinfo,
4425 macro.c, output.c, path.c, symtab.c: Change Copyright from
4426 1989-1992 to the explicit enumeration 1989, 1990, 1991, 1992.
4428 * examples/divert.m4: Deleted, this bug has been corrected.
4430 * Makefile.in (texclean, mostlyclean): New goals.
4432 * Makefile.in (clean): Remove clutter from ansi2knr.
4433 Reported by Pierre Gaumond.
4434 Reported by Greg A. Woods.
4436 Sun Dec 20 10:40:20 1992 Francois Pinard (pinard at icule)
4438 * Makefile.in: Remove $(CPPFLAGS) from the .c.o rule. The user
4439 might well use CFLAGS is s/he needs it.
4441 * Makefile.in: Allow installation of info files from a separate
4443 Reported by Jason Merrill.
4444 Reported by David MacKenzie.
4445 Reported by Skip Montanaro.
4446 Reported by Erez Zadok.
4447 Reported by Assar Westerlund.
4449 Sat Dec 19 08:21:34 1992 Francois Pinard (pinard at icule)
4452 This is still a beta release for the future GNU m4 version 1.1.
4454 * lib/alloca.c: New, from elsewhere.
4455 * lib/Makefile.in: Distribute it. Define and use $(ALLOCA).
4457 * m4.h: Do not define index/rindex if already defined. If
4458 FALSE/TRUE are already defined, do not redefine them, but merely
4459 define boolean typedef to int.
4461 * Makefile.in: Use $(DEFS) while compiling ansi2knr.
4462 * ansi2knr.c: Rewrite #ifdef HAVE_STRING_H || STDC_HEADERS,
4463 because some C compilers do not like connectives with #ifdef.
4464 * m4.h: Define `volatile' only if __GNUC__, instead of once for
4465 __GNUC__ and once for __STDC__.
4466 * lib/regex.h: Leave const alone, AC_CONST will take care of it.
4468 * checks/Makefile.in: Use .all_stamp instead of $(CHECKS) for
4469 Makefile dependencies. Without it, make keeps destroying and
4470 remaking $(CHECKS) in a loop (why?). Distribute .all_stamp.
4472 * m4.h, m4.c, builtin.c, output.c: Change all divertion/DIVERTION
4473 to diversion/DIVERSION, this was a spelling error.
4475 * m4.c: Declare version[], remove #include "version.h".
4476 * version.h: Deleted.
4477 * Makefile.in: Remove references to version.h.
4479 * output.c (shipout_text): Centralize all `#line NUM ["FILE"]'
4480 production, by using a simpler and more robust algorithm. This
4481 solves the problem of synclines sometimes written in the middle of
4482 an output line. Delete sync_line() and output_lines variable.
4483 * m4.h: Remove sync_line prototype and output_lines declaration.
4484 * input.c (next_char), output.c (shipout_text): Remove references
4486 * input.c (push_file, pop_file): Merely put the value -1 in
4487 output_current_line instead of calling sync_line, for delaying a
4488 single `#line NUM FILE' before next output line. Do not test
4489 for sync_output, because this is unnecessary clutter.
4490 * output.c (make_divertion, insert_divertion): Idem.
4491 * input.c: Rename must_advance_line to start_of_input_line, for
4494 * debug.c (trace_header): Select a new debug line format, which
4495 better complies with GNU standards for formatting error messages.
4496 With option `-dfl', M-x next-error might be used on the output.
4497 * m4.c (vmesg): Adjust format of error output to GNU standards.
4498 * m4.texinfo: Adjust examples for `make check' to work.
4500 * m4.h, builtin.c, debug.c, input.c, macro.c, path.c: Use upper
4501 case for enum debug_info constants, which were all lower case.
4503 * builtin.c (m4_regexp, m4_patsubst): Use re_search instead of
4505 * lib/regex.[ch]: Use new version from textutils 1.3.6, with some
4506 collected patches. I tried a few times using newer regex.[ch], it
4507 mysteriously stopped aborting with this one. Insecure feeling...
4508 * lib/Makefile.in: Distribute regex.[ch].old, just in case!
4510 Fri Dec 18 11:08:03 1992 Francois Pinard (pinard at icule)
4512 * m4.c: Change `--no-warnings' to `--silent'.
4513 Reported by David MacKenzie.
4515 * m4.c: Put all M4OPTS code upon IMPLEMENT_M4OPTS control, and
4516 leave it off for now. See comment in m4.c for justification.
4517 Reported by David MacKenzie.
4519 * configure.in: Replace AC_USG by AC_HAVE_HEADERS(string.h).
4520 * m4.h, ansi2knr.c, lib/regex.h: Replace USG by HAVE_STRING_H.
4522 * Makefile.in: Add a new `info' goal. Use macro MAKEINFO.
4524 * Makefile.in: Ensure recursive cleaning is done before local
4525 cleaning for all clean goals.
4527 * builtin.c (ntoa): Ensure the value is always interpreted as a
4528 signed quantity, whatever the radix is.
4530 Wed Nov 18 07:57:19 1992 Jim Meyering (meyering@idefix)
4532 * builtin.c, format.c, input.c: Split long lines.
4533 * m4.c: Use typedef macro_definition instead of struct
4535 * symtab.c: Use typedef symbol instead of struct symbol.
4537 Tue Nov 17 01:58:40 1992 Francois Pinard (pinard at icule)
4539 * *.[ch]: Remove all trailing whitespace, in code and comments.
4541 * configure.in: Find some awk.
4542 * Makefile.in: Add $(AWK) to MDEFINES.
4543 * checks/Makefile.in: Transmit $(AWK) to get_them.
4544 * checks/get_them: Use $AWK instead of gawk. Add a close in the
4545 awk script when switching files, because without this, mawk runs
4546 out of file descriptors.
4548 Mon Nov 16 20:42:56 1992 Francois Pinard (pinard at icule)
4550 * Makefile.in (realclean): Delete m4.info*.
4551 Reported by Jim Meyering.
4553 * Makefile.in: Adjust and link with checks/Makefile.
4554 * checks/Makefile.in: New.
4555 * configure.in: Output checks/Makefile.
4557 * checks/get_them: Have the dnl header of each test more
4558 recognizable by next-error, also use a better message.
4560 Mon Nov 16 07:48:52 1992 Jim Meyering (meyering@idefix)
4562 * m4.h [__GNUC__]: Use __volatile__ instead of `volatile.'
4563 And use that only if __GNUC__ since we're using it's GCC-specific
4564 semantics that tell the compiler the associated function doesn't
4567 * builtin.c (substitute): Don't use character as an array index.
4568 (dumpdef_cmp): Make formal arguments `const void *' to avoid
4569 warnings with gcc -W -Wall on systems with qsort prototype.
4570 (m4_errprint): Cast obstack_finish to `char *' to avoid warnings
4573 * eval.c (most functions): Add parentheses to assignments used
4574 as truth values go avoid warnings from gcc -Wall.
4576 * input.c, m4.c, output.c, path.c, symtab.c: Declare static
4577 any functions that don't need external scope.
4579 * builtin.c, debug.c, format.c, m4.c, m4.h, macro.c, symtab.c
4580 (many functions and arrays): Declare `const'.
4582 Sun Nov 15 09:42:09 1992 Francois Pinard (pinard at icule)
4584 * *.[ch]: Rename nil to NULL, using the declaration from <stdio.h>,
4585 removing the declaration from m4.h. Also rename false to FALSE
4588 * lib/Makefile.in (Makefile): New goal.
4590 * Makefile.in, lib/Makefile.in: Add a .c.o rule, so CFLAGS is not
4591 so heavily loaded. It gets more easily overridable, calling make.
4592 Reported by Jim Meyering.
4594 * Makefile.in (dist): Get .fname from the current directory name,
4595 instead of from version.h. I need updating many files manually,
4596 when the version changes, version.h is just one of them.
4598 Sat Nov 14 11:01:20 1992 Francois Pinard (pinard at icule)
4600 * m4.h: Remove the tag `boolean' on the enum introducing typedef
4601 `boolean'. This tag conflicts with <sys/types.h> on SVR4.
4602 Reported by Tom McConnell.
4604 Fri Nov 13 00:12:50 1992 Francois Pinard (pinard at icule)
4606 * m4.texinfo: Correct the examples for 33.divert, 38.divnum,
4607 39.cleardiv, which were describing missing or spurious newlines.
4608 Modify examples 52.eval, 53.esyscmd and 54.sysval so the results
4609 do not depend on machine word size, `/bin/false' implementation,
4610 or `wc' output format. `make check' is more dependable, now.
4612 * checks/check_them: Summarize the failed tests by listing their
4613 name, at end. If none, issue `All checks successful'. Output
4614 `Checking' instead of `Input file:'.
4616 * checks/get_them, checks/check_them: Reindented.
4618 * Makefile.in (dist): chmod a+r before making the tar file.
4620 Thu Nov 12 14:42:57 1992 Francois Pinard (pinard at icule)
4622 * builtin.c (m4_dnl): Diagnose any parameter to `dnl'.
4624 * input.c (next_token): Reinitialize token_buttom just after using
4625 it as a watermark with obstack_free. Or else, a future token, big
4626 enough for triggering reallocation of the obstack chunk, could
4627 void the initialized value of token_buttom, later causing panic in
4628 obstack_free. Rename token_buttom to token_bottom everywhere.
4630 * m4.h: Before declaring errno, first include <errno.h> and
4631 ensure that it does not define errno.
4632 Reported by Richard Stallman.
4634 Wed Nov 11 17:40:35 1992 Francois Pinard (pinard at icule)
4636 * builtin.c: Define and use DECLARE macro for builtins.
4638 * builtin.c (m4_ifelse): Avoid any diagnostic when exactly one
4639 argument, this is a common idiom for introducing long comments.
4641 * builtin.c (m4_ifelse): If 3n + 2 arguments, diagnose missing
4642 arguments. The last argument was silently ignored.
4644 * m4.c (cmd_error): Add a missing semicolon before va_end().
4646 Tue Nov 10 08:57:05 1992 Francois Pinard (pinard at icule)
4648 * Makefile.in: Now handle protoized sources. Define and use U.
4649 Compile and use ansi2knr with old compilers. Update DISTFILES.
4650 Add `aclocal.m4' to `configure' dependencies.
4651 * ansi2knr.c: New, from Ghostscript distribution.
4652 * configure.in: Define U through FP_PROTOTYPES for old compilers.
4653 Add AC_ISC_POSIX, AC_CONST, AC_SIZE_T.
4654 * aclocal.m4: New, provide FP_PROTOTYPES.
4655 * m4.h: Conditionnaly protoized through Args, save for varags.
4656 * builtin.c: Protoized. Then:
4657 Include <sys/types.h> if size_t is not defined, before "regex.h".
4658 (m4_ifelse): Fetch built-in name properly for diagnostic.
4659 (m4_dumpdef): Remove wrong (char *) cast calling dump_symbol.
4660 (m4_regexp): Add const to `msg' declaration.
4661 (m4_patsubst): Add const to `msg' declaration.
4662 * debug.c: Protoized, save for varargs.
4663 * eval.c: Protoized.
4664 * format.c: Protoized.
4665 * input.c: Protoized.
4666 * m4.c: Protoized, save for varargs. Then:
4667 (xfree): Accept void * instead of char *.
4668 (xmalloc): Return void * instead of char *.
4669 (xrealloc): Accept and return void * instead of char *.
4670 * macro.c: Protoized.
4671 * output.c: Protoized.
4672 * path.c: Protoized. Then cast some (char *) over xmalloc's.
4673 * symtab.c: Protoized.
4675 Fri Nov 6 02:05:21 1992 Francois Pinard (pinard at icule)
4677 * m4.texinfo: Remove directory from diagnostics in 30.include,
4678 51.eval, 56.errprint and 57.m4exit tests.
4680 * m4.h: Remove declarations for int or void system functions, they
4681 cause more conflicting trouble than they make good.
4683 * configure.in: Avoid configuration header file. Add some tests.
4684 * m4.h: Remove #include "config.h".
4685 * Makefile.in, lib/Makefile.in: Implement Autoconf interface.
4686 Then, rewritten for better compliance with GNU standards.
4688 Thu Nov 5 12:37:13 1992 Francois Pinard (pinard at icule)
4690 * format.c (format): Avoid syntax error if not HAVE_EFGCVT,
4691 because of a misplaced #endif.
4693 * Many *.[hc] files: Correct intra-line spacing here and there,
4694 according to GNU indent 1.6 advice.
4696 * configure.in: New, using Autoconf 1.2.
4697 * m4.h: Reverse NO_MEMORY_H to NEED_MEMORY_H.
4698 * Delete old configure.in, configure, etc/configure.in,
4699 etc/configure, lib/configure.in, lib/configure and config/*.
4700 Reported by Jason Merrill.
4702 * symtab.c (hash): Change (char) NULL to '\0'.
4703 Reported by Jason Merrill.
4705 * Delete .vers, etc/newdist.sh, etc/newvers.sh and
4706 etc/nextvers.sh. Release numbers will be edited `by hand'.
4707 * version.h: De-automatize, force value in.
4709 * m4.c: Changes in order to use a newer getopt.h.
4710 Reported by David MacKenzie.
4712 * checks/: New name for examples/.
4713 * checks/get_them: New location for etc/get_examples.
4714 * checks/check_them: New location for etc/check_examples.
4715 * Makefile.in, checks/get_them, checks/check_them: Adjust.
4716 * lib/vfprintf.c: New location for etc/vfprintf.c.
4717 * Delete empty etc/.
4718 * examples/: New name for test/.
4720 Tue Mar 10 00:29:46 1992 Francois Pinard (pinard at icule)
4722 * Makefile.in (check): Add m4 as dependency.
4724 * m4.c: Accept --no-warnings instead of --no_warnings, and
4725 --no-gnu-extensions instead of --no_gnu_extensions. Make the
4726 usage message more informative.
4727 Reported by David MacKenzie.
4729 Mon Mar 9 14:53:40 1992 Francois Pinard (pinard at icule)
4731 * etc/check_examples: New name for check_examples.sh.
4732 * etc/get_examples: New name for get_examples.sh.
4733 * Makefile.in, etc/Makefile.in: Use new names.
4735 * Makefile.in: Transmit $(CC) while making in lib.
4737 * Many *.[hc] files: GNU indent'ed, with further fine tuning of
4738 code disposition by hand.
4740 Sun Mar 8 11:01:55 1992 Francois Pinard (pinard at icule)
4742 * m4.h: Delete definitions for abort() and exit().
4743 Reported by Richard Stallman.
4745 * config/hmake-unicos, config/s-unicos.h: New files.
4746 Reported by Hal Peterson.
4748 * eval.c (exp_term): Have N^0 return 1.
4749 Reported by Michael Fetterman.
4751 * eval.c, input.c, m4.h: Remove last comma in enums.
4752 Reported by Mike Lijewski.
4754 * Transfer of maintenance duties from Rene' to Franc,ois.
4756 Thu Oct 24 15:18:46 1991 Rene' Seindal (seindal at diku.dk)
4758 * Release 1.0. Many thanks to those, who provided me with bug
4759 reports and feedback.
4761 * Uses GNU configure, taken from the gdb distribution.
4763 * Uses GNU getopt(), with long option names.
4765 * The -Q/+quiet option is added, which suppresses warnings about
4766 missing or superflous arguments to built-in macros.
4768 * Added default options via the M4OPTS environment variable.
4770 * The built-in format can now be configured to use sprintf as
4771 the formatting engine, for systems without [efg]cvt(3).
4773 * GNU library code is moved to the ./lib subdirectory; other
4774 utility files are now in ./etc.
4776 * Several minor bugs have been fixed.
4778 Fri Jul 26 15:28:42 1991 Rene' Seindal (seindal at diku.dk)
4780 * Fixed various bugs. Release 0.99, manual 0.09. Many thanks to
4781 Francois Pinard and Roland H. Pesch for providing me with reports.
4783 * The builtins incr and decr are now implemented without use of
4786 * The builtin indir is added, to allow for indirect macro calls
4787 (allows use of "illegal" macro names).
4789 * The debugging and tracing facilities has been enhanced
4790 considerably. See the manual for details.
4792 * The -tMACRO option is added, marks MACRO for tracing as soon
4795 * Builtins are traced after renaming iff they were before.
4797 * Named files can now be undiverted.
4799 * The -Nnum option can be used to increase the number of
4800 divertions available.
4802 * Calling changecom without arguments now disables all comment
4805 * The function m4_patsubst() is now consistently declared
4808 * A bug in dnl is fixed.
4810 * A bug in the multi-character quoting code is fixed.
4812 * Several typos in the manual has been corrected. More probably
4815 * The m4.info file is now installed along with the program.
4817 Thu Nov 15 21:51:06 1990 Rene' Seindal (seindal at diku.dk)
4819 * Updated and enhanced version. Release 0.75, manual 0.07.
4821 * Implemented search path for include files (-I option and
4822 M4PATH envronment variable).
4824 * Implemented builtin "format" for printf-like formatting.
4826 * Implemented builtin "regexp" for searching for regular
4829 * Implemented builtin "patsubst" for substitution with regular
4832 * Implemented builtin "esyscmd", which expands to a shell
4835 * Implemented "__file__" and "__line__" for use in error
4838 * Implemented character ranges in "translit".
4840 * Implemented control over debugging output.
4842 * Implemented multi-character quotes.
4844 * Implemented multi-character comment delimiters.
4846 * Changed predefined macro "gnu" to "__gnu__".
4848 * Changed predefined macro "unix" to "__unix__", when the -G
4849 option is not used. With -G, "unix" is still defined.
4851 * Changed "shift", "$@" and "$*" to not insert spaces afters
4854 * Added program name to error messages.
4856 * Fixed two missing null bytes bugs.
4858 Mon Jan 22 21:08:52 1990 Rene' Seindal (seindal at diku.dk)
4860 * Initial beta release. Release 0.50, manual 0.05.
4870 Copyright (C) 1990, 1991, 1992, 1993, 1994, 2000, 2001, 2003,
4871 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
4873 Copying and distribution of this file, with or without
4874 modification, are permitted provided the copyright notice
4875 and this notice are preserved.