1 2007-12-21 Eric Blake <ebb9@byu.net>
3 Stage 9: share rather than copy single-arg refs.
4 * m4/gnulib-cache.m4: Import quote and memmem modules.
5 * src/m4.h (arg_scratch): New prototype.
6 * src/input.c (INPUT_INLINE_THRESHOLD): New define.
7 (push_token): Use it to inline short text, and save references to
9 (input_init, next_token): Simplify obstack handling.
10 * src/macro.c (expand_argument): Likewise.
11 (expand_macro): Track scratch space.
12 (arg_scratch): New function.
13 (make_argv_ref): Use it.
14 (push_args): Likewise, and simplify comma handling, since most
15 separators are short enough to be inlined.
16 * src/builtin.c (builtin_init): Avoid cast.
17 (m4_errprint, m4_index): Transparently support NUL.
18 (m4_translit): Use scratch space, rather than leaking memory on
20 * doc/m4.texinfo (Syntax): Add new test of embedded NUL.
21 * checks/get-them: Extract test that uses external files.
22 * checks/check-them: Run the new test. Use unified diff if
23 possible, and force text mode when debugging NUL handling.
24 * examples/null.m4: New file.
25 * examples/null.out: Likewise.
26 * examples/null.err: Likewise.
27 * examples/Makefile.am (EXTRA_FILES): Distribute these files.
28 * .gitattributes: Treat new files as text, in spite of embedded
31 2007-12-18 Eric Blake <ebb9@byu.net>
33 Stage 8: extend life of references into argv.
34 * src/m4.h (obstack_regrow): Delete, now that it is unused.
35 (struct token_chain): Add level field.
36 (push_token): Adjust prototype.
37 (adjust_refcount): New prototype.
38 * src/macro.c [DEBUG_MACRO]: Add debugging hooks for $@ reference
40 (argc_stack, argv_stack): Delete, replaced by...
41 (struct macro_arg_stacks, stacks, stacks_count): ...these new
42 structure for tracking $@ references.
43 (expand_input): Initialize new structure.
44 (collect_arguments): Alter signature.
45 (expand_macro): Rework obstack handling, in order to keep $@
46 references alive until they have been rescanned.
47 (adjust_refcount, arg_mark): New functions.
48 (make_argv_ref): Use new field.
49 (push_arg, push_args): Update callers.
50 * src/input.c (make_text_link): Use new field.
51 (push_token): Change signature.
52 (pop_input, next_char_1): Call new function.
53 * doc/m4.texinfo: Clean up some examples of -d option usage.
54 (Ifelse): Add some stress tests.
56 2007-12-13 Eric Blake <ebb9@byu.net>
59 * doc/m4.texinfo (Inhibiting Invocation): Missed one instance in
64 2007-12-13 Paolo Bonzini <bonzini@gnu.org> (tiny change)
66 * doc/m4.texinfo (Inhibiting Invocation): Fix quoting of a quoting
68 Reported by Giovanni Toffetti.
70 2007-12-11 Eric Blake <ebb9@byu.net>
72 Stage 7: add chained token support to input parser.
73 * src/m4.h (struct token_chain): Add const safety.
74 (push_token): New prototype.
75 * src/input.c (INPUT_CHAIN): New enumerator.
76 (struct input_block): Add new input type u_c, and change u_s to
77 length-based processing.
78 (make_text_link): New helper function.
79 (push_token): New function.
80 (push_string_finish): Use it.
81 (pop_input, input_print, peek_input, next_char, next_char_1):
82 Adjust to handle new input type.
83 * src/macro.c (push_arg, push_args): Use new function.
85 2007-12-10 Eric Blake <ebb9@byu.net>
87 Stage 6: convert builtins to push arg at a time.
88 * src/m4.h (includes): Include <limits.h> here, instead of in
90 (input_block): New typedef.
91 (trace_pre, trace_post, push_string_finish): Update prototypes.
92 (obstack_print, input_print, push_arg, push_args): New
94 * src/input.c (push_string_finish): Change return type.
95 (input_print): New function.
96 * src/debug.c (trace_format): Add %B specifier, and use new
98 (trace_pre): Remove redundant argc parameter.
99 (trace_post): Likewise, and change signature.
100 (obstack_print): New function.
101 * src/macro.c (expand_macro): Update caller.
102 (push_arg, push_args): New functions.
103 * src/builtin.c (m4_ifdef, m4_ifelse, m4_shift, m4_substr)
104 (m4_patsubst, expand_user_macro): Use new functions.
105 (mkstemp_helper, m4_maketemp): Avoid extra trailing NULs.
106 * src/m4.c (max_debug_argument_length, main): Set to INT_MAX, not
108 * src/output.c: Update includes.
109 * src/symtab.c: Likewise.
111 2007-12-07 Eric Blake <ebb9@byu.net>
113 Minor security fix: Quote output of mkstemp.
114 * src/builtin.c (mkstemp_helper): Produce quoted output.
115 * doc/m4.texinfo (Mkstemp): Update the documentation and tests.
116 * NEWS: Document this change.
118 Stage 5: add notion of quote age.
119 * src/input.c: Comment cleanups.
120 (current_quote_age): New global variable.
121 (set_quote_age): New helper function.
122 (input_init, set_word_regexp): Use it.
123 (set_quotes, set_comment): Likewise, and detect no-op changes.
124 (quote_age, safe_quotes): New functions.
125 (next_token): Track quote age.
126 * src/m4.h (struct token_data): Add quote_age member.
127 (TOKEN_DATA_QUOTE_AGE, quote_age, safe_quotes): New prototypes.
128 * src/macro.c (struct macro_arguments): Add quote_age member.
129 (expand_token): Alter signature and track quote age.
130 (expand_input, expand_argument): All callers changed.
131 (collect_arguments, make_argv_ref): Track quote age.
132 (arg_text, arg_len, arg_func): Detect type mismatch.
133 * doc/m4.texinfo (Ifelse, Changequote): Add more tests.
134 (Incompatibilities): Fix typo.
135 * examples/wraplifo.m4: New file.
136 * examples/Makefile.am (EXTRA_DIST): Distribute it.
138 2007-12-04 Eric Blake <ebb9@byu.net>
140 Fix builds with OpenBSD make.
141 * doc/Makefile.am (HELP2MAN): New macro.
142 (man_MANS, m4.1): Fix rules for building m4.1 into srcdir.
143 * README: Update copyright.
144 * HACKING: Mention help2man and makeinfo dependencies.
146 2007-11-29 Eric Blake <ebb9@byu.net>
148 Stage 4: route indir, builtin through ref; make argv opaque.
149 * src/m4.h (obstack_regrow): Borrow definition from head.
150 (struct token_chain): Add flatten and len members.
151 (arg_equal, arg_empty, make_argv_ref): New prototypes.
152 (struct macro_arguments): Move...
153 * src/macro.c (struct macro_arguments): ...here, making it
154 opaque. Add has_ref member.
155 (empty_token): New placeholder, for optimizing comparison with
157 (collect_arguments): Change signature, and populate new fields.
158 (expand_macro): Alter handling of obstacks.
159 (arg_token): New helper method.
160 (arg_equal, arg_empty, make_argv_ref): New methods.
161 (arg_type, arg_text, arg_len, arg_func): Use new methods.
162 * src/builtin.c (m4_ifelse, m4_builtin, m4_indir, m4_eval):
164 * src/format.c (format): Likewise.
166 Stage 3: cache length, rather than computing it.
167 * src/input.c (next_token): Grab length from obstack rather than
169 * src/m4.h (token_data, macro_arguments): Add length field.
170 (TOKEN_DATA_LEN): New accessor.
171 (define_user_macro): Add parameter.
172 * src/builtin.c (define_user_macro, mkstemp_helper): Use
174 (builtin_init, define_macro, m4_maketemp, m4_mkstemp): Adjust
176 (dump_args, m4_ifdef, m4_ifelse, m4_builtin, m4_indir, m4_eval)
177 (m4_len, m4_substr, m4_translit, m4_regexp, m4_patsubst)
178 (expand_user_macro): Use cached lengths.
179 * src/freeze.c (reload_frozen_state): Adjust callers.
180 * src/m4.c (main): Likewise.
181 * src/macro.c (expand_token, expand_argument, collect_arguments)
182 (arg_len): Use cached length.
183 * doc/m4.texinfo (Mkstemp): Ensure mkstemp does not produce NUL.
185 2007-11-27 Eric Blake <ebb9@byu.net>
187 Stage 2: use accessors, not direct reference, into argv.
188 * src/m4.h (TOKEN_EOF): Alter value, to ease debugging.
189 (arg_argc, arg_type, arg_text, arg_len, arg_func): New
191 * src/macro.c (arg_argc, arg_type, arg_text, arg_len, arg_func):
192 New accessor functions.
193 * src/builtin.c (ARG, dump_args, define_macro, m4_builtin)
194 (m4_indir): Use new accessors.
195 * src/debug.c (trace_pre): Likewise.
196 * src/format.c (ARG_INT, ARG_LONG, ARG_STR, ARG_DOUBLE):
199 2007-11-24 Eric Blake <ebb9@byu.net>
201 Stage 1: convert token_data** into new object.
202 * m4/gnulib-cache.m4: Import flexmember module.
203 * src/m4.h (struct macro_arguments, struct token_chain): New
205 (builtin_func): Alter signature.
206 (token_data): Add new TOKEN_COMP alternative.
207 * src/builtin.c: All builtins changed.
208 (ARG, dump_args, define_macro, expand_user_macro): Update to use
210 * src/debug.c (trace_pre, trace_post): Likewise.
211 * src/format.c (ARG_INT, ARG_LONG, ARG_STR, ARG_DOUBLE, format):
213 * src/macro.c (collect_arguments): Build new struct.
214 (call_macro, expand_macro): Update to use new struct.
216 2007-11-22 Eric Blake <ebb9@byu.net>
218 More error messages tied to macro names.
219 * src/input.c (set_word_regexp): Take additional parameter.
220 (input_init): Adjust caller.
221 * src/debug.c (debug_set_file, debug_set_output): Take additional
223 (debug_init): Adjust caller.
224 (expansion_level): Move declaration...
225 * src/m4.h (expansion_level): ...here.
226 (debug_set_output, set_word_regexp): Adjust prototypes.
227 * src/builtin.c (m4_changeword, m4_m4exit, m4_debugfile): Adjust
229 * src/m4.c (main): Likewise.
231 Refactor error messages to avoid macros.
232 * src/m4.h (_): Define, as a placeholder for now.
233 (M4ERROR, M4ERROR_AT_LINE): Delete.
234 (m4_error, m4_error_at_line): Change prototype.
235 (m4_warn, m4_warn_at_line): New prototypes.
236 * src/m4.c (m4_verror_at_line): New helper function.
237 (m4_error, m4_error_at_line): Use new function, and properly call
239 (m4_warn, m4_warn_at_line): New functions.
240 (stackovf_handler, main): All callers changed.
241 * src/builtin.c: Likewise.
242 * src/debug.c: Likewise.
243 * src/eval.c: Likewise.
244 * src/format.c: Likewise.
245 * src/freeze.c: Likewise.
246 * src/input.c: Likewise.
247 * src/macro.c: Likewise.
248 * doc/m4.texinfo (Indir, Builtin, Dumpdef, Incr, Eval, Substr)
249 (Improved forloop): Adjust tests accordingly.
251 Security fix: avoid arbitrary code execution with 'm4 -F'.
252 * src/freeze.c (produce_frozen_state): Never pass raw file name as
254 * NEWS: Document this fix.
256 2007-11-21 Eric Blake <ebb9@byu.net>
258 Consistently report macro name first in messages.
259 * src/m4.h (evaluate): Adjust prototype.
260 * src/builtin.c (bad_argc, numeric_arg, m4_placeholder): Alter
261 wording to match head.
262 (mkstemp_helper, substitute): Adjust signature. All callers
264 (m4_dumpdef, m4_builtin, m4_indir, m4_defn, m4_esyscmd, m4_eval)
265 (m4_undivert, m4_maketemp, m4_m4exit, m4_debugmode)
266 (m4_debugfile, m4_regexp, m4_patsubst): Mention macro name in
268 (m4_format): Adjust call.
269 * src/format.c (format): No longer skip argv[0].
270 * src/eval.c (evaluate): Mention macro name in message.
271 (logical_or_term, logical_and_term, or_term, xor_term, and_term)
272 (equality_term, cmp_term, shift_term, add_term, mult_term)
273 (exp_term, unary_term, simple_term): Adjust signature.
274 * src/macro.c (warn_builtin_concat): Likewise.
275 (expand_argument): Adjust caller.
276 * doc/m4.texinfo (Macro Arguments, Ifdef, Ifelse, Debug Output)
277 (Dnl, Improved fatal_error, Defn, Builtin, Index macro, Regexp)
278 (Substr, Translit, Patsubst, Format, Eval, Dumpdef, Include)
279 (Improved forloop, Indir, Trace, Incr): Adjust tests to match.
281 Make argument checking a bit more sane.
282 * src/builtin.c (bad_argc): Adjust signature, and don't force
283 callers to add 1. Adjust all callers.
284 (numeric_arg): Adjust signature. Adjust all callers.
286 Make dnl diagnostic print macro name.
287 * src/m4.h (skip_line): Adjust prototype.
288 * src/input.c (skip_line): Report error on behalf of caller.
289 * src/builtin.c (m4_dnl): Adjust caller.
290 (dump_args, m4_dumpdef, m4_changequote, m4_changecom)
291 (m4_changeword, m4_traceon, m4_traceoff, expand_user_macro): Use
292 ARG macro instead of open-coding.
293 * doc/m4.texinfo (Dnl): Adjust test.
295 2007-11-20 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
297 * Makefile.am (EXTRA_DIST): gendocs.sh is gone here.
299 2007-11-14 Eric Blake <ebb9@byu.net>
301 Avoid builtin concatenation in macro arguments.
302 * doc/m4.texinfo (Defn): Add tests.
303 * src/macro.c (warn_builtin_concat): New function.
304 (expand_argument): Use it to warn on more corner cases.
305 * NEWS: Mention new warning.
307 2007-11-13 Eric Blake <ebb9@byu.net>
309 Simplify previous patch.
310 * src/input.c (pop_input): Change signature.
311 (push_string_init, next_char_1): Adjust callers.
313 Fix memory leak in tail recursion.
314 * src/input.c (push_string_init): Let go of memory earlier.
315 (next_char_1): Make end of string detection reliable.
316 (match_input): Simplify use of push_string_init.
317 * NEWS: Document this fix.
319 2007-11-07 Eric Blake <ebb9@byu.net>
321 * doc/m4.texinfo (Pseudo Arguments): Test more corner cases.
323 2007-11-05 Eric Blake <ebb9@byu.net>
325 Use assert, rather than INTERNAL ERROR.
326 * src/m4.h: Include <assert.h>.
327 * src/builtin.c (m4_dumpdef, define_macro, m4_defn): Use assert.
328 * src/debug.c (trace_pre): Likewise.
329 * src/eval.c (evaluate, cmp_term, shift_term, mult_term):
331 * src/freeze.c (produce_frozen_state): Likewise.
332 * src/input.c (push_string_init, pop_input, init_macro_token)
333 (peek_input, next_char_1, set_word_regexp): Likewise.
334 * src/m4.c (main): Likewise.
335 * src/macro.c (expand_token, expand_argument, call_macro):
337 * src/output.c (make_diversion): Likewise.
338 * src/symtab.c (symtab_init): Likewise.
340 Use build-aux directory.
341 * configure.ac (PACKAGE, VERSION): Delete, since Automake does
343 (AC_CONFIG_AUX_DIR): Add, with auxiliary files in build-aux
344 instead of the top level.
345 * bootstrap: Adjust accordingly.
346 * m4/gnulib-cache.m4: Add --aux-dir option.
347 * doc/Makefile.am (m4.1): Rewrite rule to use build-aux/missing.
349 2007-11-02 Eric Blake <ebb9@byu.net>
351 Update some documentation about version control.
352 * NEWS: M4 is now stored in git.
355 * bootstrap: Likewise.
356 * commit: Delete, now that CVS commits are no longer necessary.
358 Adjust to recent gnulib change.
359 * m4/gnulib-cache.m4: Drop vasprintf-posix and xvasprintf, and use
360 xvasprintf-posix instead.
362 2007-11-01 Eric Blake <ebb9@byu.net>
364 Improve error message when early end of file occurs.
365 * doc/m4.texinfo (Macro Arguments, Changequote, Changecom)
366 (M4wrap): Adjust to new messages.
367 (Improved capitalize): Enhance test.
368 * src/m4.h (next_token): Adjust prototype.
369 * src/input.c (next_token): Add new parameter, and improve error
371 (lex_debug): Adjust callers.
372 * src/symtab.c (symtab_debug): Likewise.
373 * src/macro.c (expand_input, collect_arguments): Likewise.
374 (expand_argument): Likewise, and add parameter.
376 2007-10-31 Eric Blake <ebb9@byu.net>
378 Test more corner cases.
379 * doc/m4.texinfo (Changecom, Pseudo Arguments): Beef up tests.
380 (Improved foreach): Document alternate foreachq style.
381 * examples/foreachq3.m4: New file.
382 * examples/loop.m4: New file.
383 * examples/Makefile.am (EXTRA_DIST): Distribute them.
385 2007-10-28 Eric Blake <ebb9@byu.net>
387 More test coverage for autoconf usage patterns.
388 * doc/m4.texinfo (Inhibiting Invocation, Pseudo Arguments)
389 (Builtin): Add new undocumented tests.
390 (Shift): Document cond macro, and add new test.
392 2007-10-27 Eric Blake <ebb9@byu.net>
394 Document one use of changequote(`(',`)').
395 * doc/m4.texinfo (Changequote): Add new test, based on recent
396 autoconf addition of m4_expand.
398 2007-10-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
400 * examples/Makefile.am (EXTRA_DIST): Add capitalize2.m4.
402 2007-10-24 Eric Blake <ebb9@byu.net>
404 Reduce number of mingw testsuite failures.
405 * doc/m4.texinfo (Using frozen files): Skip test on mingw.
407 2007-10-22 Eric Blake <ebb9@byu.net>
409 Add DEBUG_REGEX debugging information.
410 * src/m4.h (DEBUG_REGEX): New debug macro.
411 * src/m4.c (main) [DEBUG_REGEX]: Open regex trace file when
413 * src/builtin.c (m4_patsubst, m4_regexp, compile_pattern)
414 [DEBUG_REGEX]: Trace regex usage.
416 Never let printf failures go undetected.
417 * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
419 * src/m4.h: Include xprintf.h.
420 * src/format.c (format): Warn on format failures.
421 * src/builtin.c (ntoa): Export.
422 (m4_errprint): Adjust all *printf callers.
423 * src/debug.c (debug_message_prefix, trace_format): Likewise.
424 * src/freeze.c (produce_frozen_state): Likewise.
425 * src/input.c [DEBUG_INPUT]: Likewise.
426 * src/m4.c (usage): Likewise.
427 * src/m4.h (DEBUG_PRINT1, DEBUG_PRINT3, DEBUG_MESSAGE)
428 (DEBUG_MESSAGE1, DEBUG_MESSAGE2): Likewise.
429 * src/output.c (m4_tmpname, shipout_text, freeze_diversione):
431 * src/path.c [DEBUG_INCL]: Likewise.
432 * src/stackovf.c (process_sigsegv) [DEBUG_STKOVF]: Likewise.
433 * src/symtab.c [DEBUG_SYM]: Likewise.
435 2007-10-17 Eric Blake <ebb9@byu.net>
437 Fix 'm4 -F file -t undefined'.
438 * src/freeze.c (produce_frozen_state): Avoid core dump.
439 * doc/m4.texinfo (Using frozen files): Test for the bug.
440 * NEWS: Mention the fix.
442 2007-10-09 Eric Blake <ebb9@byu.net>
444 * NEWS: Document recent speedups.
446 Fix regexp regression of 2007-09-29.
447 * src/builtin.c (substitute): Allow NULL regs when no
448 subexpressions were present.
449 (m4_regexp): Handle \ escapes even with empty regex.
450 * doc/m4.texinfo (Regexp, Patsubst): Catch this bug.
452 Cache regex compilation for another autoconf speedup.
453 * src/m4.h (free_macro_sequence): Rename...
454 (free_regex): ...to this.
455 * src/m4.c (main): Update caller.
456 * src/builtin.c (REGEX_CACHE_SIZE, m4_regex, regex_cache): New
458 (compile_pattern): New function; cache recent regexes.
459 (free_regex): Rename, and clean up additional memory.
460 (m4_regexp, m4_patsubst): Use new function.
462 2007-10-02 Eric Blake <ebb9@byu.net>
464 Document quoting pitfalls in capitalize.
465 * doc/m4.texinfo (Patsubst): Use the examples directory. Also
467 (Improved capitalize): New node.
468 * examples/capitalize.m4: Update to match manual.
469 * examples/capitalize2.m4: New file.
471 2007-10-01 Eric Blake <ebb9@byu.net>
473 Another Autoconf usage pattern optimization.
474 * src/builtin.c (m4_index): Optimize search for one byte.
475 * doc/m4.texinfo (Index macro, Regexp, Patsubst): Test the new
478 2007-09-29 Eric Blake <ebb9@byu.net>
480 Optimize for Autoconf usage pattern.
481 * src/builtin.c (m4_regexp, m4_patsubst): Handle empty regex
484 2007-09-24 Eric Blake <ebb9@byu.net>
486 Create .gitignore alongside .cvsignore.
487 * bootstrap (LC_ALL): Set up front.
488 (version control) Borrow idea from head, to avoid churn in
489 m4/.*ignore files modified by gnulib-tool.
491 2007-09-13 Eric Blake <ebb9@byu.net>
495 2007-09-07 Eric Blake <ebb9@byu.net>
497 * AUTHORS: Simplify, to match libtool and autoconf layout.
498 * THANKS: Sync with head.
500 2007-08-10 Eric Blake <ebb9@byu.net>
502 * doc/m4.texinfo (Compatibility): Sync with head.
504 2007-08-10 Konrad Schwarz <konrad.schwarz@siemens.com> (tiny change)
505 and Eric Blake <ebb9@byu.net>
507 * doc/m4.texinfo (Defn): Update wording.
509 2007-08-09 Eric Blake <ebb9@byu.net>
511 POSIX requires defn(`a',`b') to concatenate definitions.
512 * src/builtin.c (m4_defn): Allow multiple arguments, but warn if
513 trying to mix a builtin with anything else.
514 * doc/m4.texinfo (Defn): Document a use for this POSIX
516 (Incompatibilities): Update to match current status.
517 * NEWS: Document this change.
519 Reported by Konrad Schwarz.
521 2007-08-04 Eric Blake <ebb9@byu.net>
523 Normalize all GPL license notices.
524 * GNUmakefile: Update license wording.
525 * Makefile.am: Likewise.
526 * Makefile.maint: Likewise.
527 * bootstrap: Likewise.
529 * configure.ac: Likewise.
530 * checks/Makefile.in: Likewise.
531 * doc/Makefile.am: Likewise.
532 * examples/Makefile.am: Likewise.
533 * src/Makefile.am: Likewise.
534 * src/builtin.c: Likewise.
535 * src/debug.c: Likewise.
536 * src/eval.c: Likewise.
537 * src/format.c: Likewise.
538 * src/freeze.c: Likewise.
539 * src/input.c: Likewise.
540 * src/m4.c: Likewise.
541 * src/m4.h: Likewise.
542 * src/macro.c: Likewise.
543 * src/output.c: Likewise.
544 * src/path.c: Likewise.
545 * src/stackovf.c: Likewise.
546 * src/symtab.c: Likewise.
548 2007-07-21 Eric Blake <ebb9@byu.net>
550 Fix regression on NetBSD from 2007-05-28.
551 * src/output.c (m4_tmpopen): Explicitly reset append-mode stream
553 * NEWS: Document this fix.
555 Reported by Thomas Klausner.
557 2007-07-20 Eric Blake <ebb9@byu.net>
559 Fix 'make distcheck' issues.
560 * Makefile.am (EXTRA_DIST): No need to distribute
561 gpl-3.0.texi.diff anymore.
562 * m4/gnulib-cache.m4: Update to latest gnulib.
564 2007-07-14 Eric Blake <ebb9@byu.net>
566 Reflect upstream license .texi changes.
567 * doc/m4.texinfo (Copying): Rename node...
568 (GNU General Public License): ...to this.
569 (GNU Free Documentation License): Adjust node location.
570 * local/doc/gpl-3.0.texi.diff: Remove file.
572 2007-07-10 Eric Blake <ebb9@byu.net>
575 * configure.ac (AC_INIT): Bump version number.
576 * NEWS: Start changes since 1.4.10.
577 * doc/m4.texinfo (History): Mention 1.4.11.
578 (Copying This Package, Copying This Manual): Add index entries.
579 * local/lib/version-etc.c.diff: Delete, now that gnulib has been
581 * Makefile.am (EXTRA_DIST): Remove dead file.
583 2007-07-09 Eric Blake <ebb9@byu.net>
586 * doc/Makefile.am (m4_TEXINFOS): Distribute gpl-3.0.texi.
587 * Makefile.am (EXTRA_DIST): Distribute gnulib diffs.
588 * configure.ac (AC_INIT): Bump version number.
589 * NEWS: Describe changes since 1.4.9.
591 * src/format.c: Missed a GPLv3 conversion.
593 Avoid undefined behavior of %.*c in printf.
594 * src/format.c (format): Special case %c.
595 * TODO: Document that more remains to be done.
596 * NEWS: Document the fix.
598 2007-07-05 Eric Blake <ebb9@byu.net>
600 Fix up gnulib-tool usage.
601 * m4/gnulib-cache.m4: Change local-dir to local, not `.'.
602 * version-etc.c.diff: Move to...
603 * local/lib/version-etc.c.diff: ...here.
604 * gpl-3.0.texi.diff: Move to...
605 * local/doc/gpl-3.0.texi.diff: ...here.
607 2007-07-04 Eric Blake <ebb9@byu.net>
609 Upgrade to GPL version 3 or later.
610 * bootstrap: Pick up GPLv3.
611 * m4/gnulib-cache.m4: Augment with 'gnulib-tool
612 --local-dir=. --import gpl-3.0'.
613 * doc/m4.texinfo (Copying This Package): New appendix.
614 * NEWS: Mention this change.
615 * README: Mention why some files still claim to be version 2.
616 * version-etc.c.diff: New file, to make sure --version claims
617 correct GPL version. Temporary until gnulib makes move.
618 * gpl-3.0.texi.diff: New file, to allow inclusion of GPLv3 as
619 appendix, rather than section, of the manual.
620 * GNUmakefile: Update to new license.
621 * Makefile.am: Likewise.
622 * Makefile.maint: Likewise.
624 * configure.ac: Likewise.
625 * checks/Makefile.in: Likewise.
626 * doc/Makefile.am: Likewise.
627 * examples/Makefile.am: Likewise.
628 * src/Makefile.am: Likewise.
629 * src/builtin.c: Likewise.
630 * src/debug.c: Likewise.
631 * src/eval.c: Likewise.
632 * src/freeze.c: Likewise.
633 * src/input.c: Likewise.
634 * src/m4.c: Likewise.
635 * src/m4.h: Likewise.
636 * src/macro.c: Likewise.
637 * src/output.c: Likewise.
638 * src/path.c: Likewise.
639 * src/stackovf.c: Likewise.
640 * src/symtab.c: Likewise.
642 2007-06-26 Eric Blake <ebb9@byu.net>
644 * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import assert'.
646 2007-06-26 Karl Berry <karl@freefriends.org> (tiny change)
648 Match Free Software Directory categories.
649 * doc/m4.texinfo (dircategory): Update.
651 2007-05-31 Eric Blake <ebb9@byu.net>
653 * src/output.c (output_text): Fix regression from 2007-05-28.
654 * doc/m4.texinfo (History): Mention 1.4.10.
655 (Format): Make testsuite output easier to debug.
657 2007-05-29 Eric Blake <ebb9@byu.net>
660 * configure.ac (AC_INIT): Bump version number.
661 * NEWS: Start changes since 1.4.9b, and fix typo.
664 * configure.ac (AC_INIT): Bump version number.
665 * NEWS: Describe changes since 1.4.9.
667 Improve format support.
668 * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
670 * src/format.c (format): Parse %'hhd, %a, %A. Avoid calling
671 printf with too few arguments, as in format(%*.*d,-1,-1,1).
672 * doc/m4.texinfo (Format): Expand tests, and improve
674 * NEWS: Document this change.
676 2007-05-28 Eric Blake <ebb9@byu.net>
678 Fix large diversion corner cases, including 1.4.8 regression.
679 * src/output.c (m4_tmpfile, m4_tmpopen): Simplify use of errno.
680 (make_room_for): Use NULL, not 0, for pointers.
681 (insert_diversion_helper): Avoid using rewind.
682 (freeze_diversions): Allow freezing large diversions.
683 * NEWS: Document this fix.
685 Also run gnulib unit tests during make check.
686 * m4/gnulib-cache.m4: Augment with 'gnulib-tool
687 --tests-base=tests --with-tests'.
688 * configure.ac (AC_CONFIG_FILES): Build gnulib testdir.
689 * Makefile.am (SUBDIRS): Run gnulib tests before ours.
691 2007-05-25 Eric Blake <ebb9@byu.net>
693 Backport prompts in examples from head.
694 * src/macro.c (expand_macro): Shorten message.
695 * doc/m4.texinfo (Manual, Command line files, Comments)
696 (Inhibiting Invocation, Macro Arguments, Macro expansion, Indir)
697 (Builtin, Shift, Forloop, Foreach, Dumpdef, Trace, Debug Levels)
698 (Debug Output, Include, Format, Syscmd, Mkstemp, Location)
699 (Using frozen files, Improved forloop, Improved foreach): Add
701 * checks/get-them: Ignore prompts in examples.
703 Fix sync line interaction with multiline comments.
704 * doc/m4.texinfo (Other Incompatibilities): Add example, and
705 document bug in --syncline/divert interaction.
706 (Preprocessor features): Augment test.
707 * src/m4.h (output_text): Export.
708 (shipout_text, next_token): Add parameter.
709 * src/freeze.c (reload_frozen_state): Don't interfere with
710 synclines when reloading state.
711 * src/output.c (output_text): Export.
712 (shipout_text): Take new parameter for start line of token.
713 Output at most one syncline per token.
714 * src/input.c (next_token): Report line where multiline tokens
716 * src/macro.c (expand_input, expand_token, expand_argument):
717 Adjust callers so that line is passed from input to output.
718 * NEWS: Document this fix.
719 Reported by Sergey Poznyakoff.
721 Test -s in testsuite.
722 * doc/m4.texinfo (Preprocessor features): Add a test.
723 * checks/get-them: Support extra options in testsuite.
724 * checks/check-them (examples): Use extra options.
726 Reported by Sergey Poznyakoff.
728 2007-05-24 Eric Blake <ebb9@byu.net>
730 Support POSIX flush semantics on all platforms.
731 * m4/gnulib-cache.m4: Remove closeout, and augment with
732 'gnulib-tool --import closein fflush'.
733 * src/m4.h (includes): Use closein, not closeout.
734 * src/m4.c (main): Ensure stdin is flushed when not all input is
736 (process_file): No return needed.
737 * src/debug.c (debug_flush_files): Rely on gnulib module, rather
738 than excluding mingw.
739 * NEWS: Document this change.
741 Work around cygwin and mingw fseeko bugs.
742 * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import fseeko'.
743 * src/debug.c (debug_flush_files): Prefer fseeko over fseek.
745 2007-04-25 Eric Blake <ebb9@byu.net>
747 Fix negative division within eval, regression of 2007-01-06.
748 * doc/m4.texinfo (Eval): Catch this bug.
749 * src/eval.c (mult_term): Fix it.
750 * NEWS: Document this.
752 Reported by Cesar Strauss.
754 2007-04-23 Eric Blake <ebb9@byu.net>
757 * configure.ac (AC_INIT): Bump version number.
758 * NEWS: Start changes since 1.4.9.
760 2007-03-23 Eric Blake <ebb9@byu.net>
763 * configure.ac (AC_INIT): Bump version number.
764 * NEWS: Describe changes since 1.4.8b.
766 2007-03-16 Eric Blake <ebb9@byu.net>
768 * doc/m4.texinfo (Mkstemp): Tweak wording.
769 * src/output.c (output_init): Adjust to latest gnulib.
771 2007-03-15 Eric Blake <ebb9@byu.net>
773 Avoid Tandem/NSK's broken long long (without a symmetric unsigned
774 long long, it confuses gnulib).
775 * configure.ac (AC_TYPE_LONG_LONG_INT): Declare long long broken
776 if unsigned long long doesn't work.
778 Reported by Matthew Woehlke.
780 2007-03-07 Eric Blake <ebb9@byu.net>
783 * doc/m4.texinfo: Minor tweaks, avoid makeinfo warning.
785 2007-03-01 Eric Blake <ebb9@byu.net>
787 * doc/m4.texinfo: Pick up more index entries from head. Follow
788 more texinfo recommendations.
789 (Sysval): Improve tests.
791 Avoid overfull \vbox warning from texinfo, due to indices that
792 weren't quite big enough to split across page boundaries.
793 * doc/m4.texinfo: Add lots of concept index entries.
794 (Concept Index): Move to be last, as recommended by texinfo
796 (Define, Arguments, Pseudo Arguments): Add more function entries.
798 2007-02-28 Eric Blake <ebb9@byu.net>
800 * doc/m4.texinfo (Eval): Clean up wording to reflext POSIX XCU ERN
802 (Pseudo Arguments): Add useful example.
804 * doc/m4.texinfo (Pushdef, Incompatibilities): Clean up wording to
805 reflect POSIX XCU ERN 118.
807 * src/m4.h (DEFAULT_MACRO_SEQUENCE): Factor out from...
808 * src/m4.c (usage): ...here,...
809 * src/builtin.c (set_macro_sequence): ...and here.
810 (define_user_macro): Fix typo.
811 * doc/m4.texinfo (Preprocessor features, Arguments): Fix minor
813 (Shift): Document composite macro argn for portably getting at
814 positional parameters beyond 9.
815 * configure.ac (AC_INIT): Bump version number.
816 * NEWS: Start changes of 1.4.8c.
818 2007-02-24 Eric Blake <ebb9@byu.net>
821 * configure.ac (AC_INIT): Bump version number.
822 * NEWS: Describe changes since 1.4.8.
824 Reserve all uses of raw ${} in macro definitions, not just
826 * src/builtin.c (set_macro_sequence): Change default macro
828 * doc/m4.texinfo (Operation modes): Update to match.
829 * src/m4.c (usage): Likewise.
832 2007-02-23 Eric Blake <ebb9@byu.net>
834 * src/m4.h (includes): Update to latest gnulib.
836 2007-02-08 Eric Blake <ebb9@byu.net>
838 Rename --warn-syntax to --warn-macro-sequence[=regex], to make it
839 more flexible, and so that autoconf can use it.
840 * src/m4.h (set_macro_sequence, free_macro_sequence): New
842 * src/builtin.c (macro_sequence_buf, macro_sequence_regs)
843 (macro_sequence_inuse, set_macro_sequence, free_macro_sequence):
844 New variables and functions.
845 (define_user_macro): Allow flexibility in regular expression used
847 * src/m4.c (warn_syntax): Delete.
848 (usage, WARN_MACRO_SEQUENCE_OPTION, main): Implement changed
849 spelling of option, along with optional argument.
850 * doc/m4.texinfo (Operation modes, Arguments): Document this
852 * NEWS: Document this change.
854 2007-02-05 Eric Blake <ebb9@byu.net>
856 * m4/gnulib-cache.m4: Module strstr no longer exists.
858 Avoid bool bitfields, as they don't work on AIX.
859 * src/m4.h (bool_bitfield): New typedef.
860 (struct symbol, struct builtin): Use it.
861 * src/input.c (struct input_block): Likewise.
862 Reported by Albert Chin.
864 * doc/m4.texinfo (Sysval): Avoid SIGPIPE in test as unreliable.
865 Reported by Albert Chin.
868 2006-06-18 Bruno Haible <bruno@clisp.org> (tiny change)
870 * doc/m4.texinfo (Input processing): Further clarifications.
872 2007-02-03 Eric Blake <ebb9@byu.net>
874 * doc/m4.texinfo (Input processing, Quoting Arguments): Beef up
876 Reported by Bruno Haible.
878 2007-02-01 Eric Blake <ebb9@byu.net>
880 * src/m4.c (fatal_warnings): New variable.
881 (usage): Document new -E behavior.
882 (main): Make -E an additive option.
883 (m4_error, m4_error_at_line): Change exit status when required.
884 * NEWS: Document this change.
885 * doc/m4.texinfo (Operation modes): Likewise.
886 Reported by Ralf Wildenhues.
888 2007-01-27 Eric Blake <ebb9@byu.net>
890 * src/m4.h (warn_syntax): Declare.
891 (init_pattern_buffer): Export.
892 * src/m4.c (warn_syntax, usage, WARN_SYNTAX_OPTIONS)
893 (long_options, main): Implement new option.
894 * src/builtin.c (init_pattern_buffer): Allow NULL regs argument.
895 (define_user_macro): Warn on $11 and ${1} if requested.
896 * src/input.c (init_pattern_buffer): Delete duplicate method.
897 * doc/m4.texinfo (Operation modes): Document it.
898 (Arguments): Document future direction of ${11} vs. $11.
899 (Incompatibilities): Fix wording on POSIX limitations.
900 * checks/get-them: Parse @{ and @} correctly.
901 * NEWS: Document this change.
903 2007-01-26 Eric Blake <ebb9@byu.net>
905 * src/builtin.c (includes): Adjust to gnulib changes.
907 2007-01-15 Eric Blake <ebb9@byu.net>
909 * doc/m4.texinfo: Pull in various improvements from head.
910 * src/builtin.c (include): Alter exit status on failure.
911 * NEWS: Document this fix.
913 2007-01-13 Eric Blake <ebb9@byu.net>
915 * configure.ac (AC_CHECK_MEMBERS): Check for stack_t.ss_sp, and
916 assume the fallback of ss_base for BSDI 4.0.1.
917 * src/stackovf.c (setup_stackovf_trap) [HAVE_SIGALTSTACK &&
918 ! HAVE_STACK_T_SS_SP]: Use this check.
919 Reported by Chris McGuire.
921 * NEWS: Document the improvement.
923 2007-01-09 Eric Blake <ebb9@byu.net>
925 * src/eval.c (ASSIGN): New enumerator.
926 (eval_lex): Recognize '='.
927 (equality_term): Treat '=' like '==', but warn that it is
929 * doc/m4.texinfo (Eval): Document and test this.
930 (Incompatibilities): Document the POSIX incompatibility.
931 * NEWS: Document this change.
933 2007-01-06 Eric Blake <ebb9@byu.net>
935 * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import stdint'.
936 * checks/check-them: Record expected exit status.
937 * checks/get-them: Check exit status.
938 * src/m4.h (eval_t, unsigned_eval_t): Delete, use POSIX int32_t
940 * src/builtin.c: All users changed.
941 * src/eval.c: Likewise. Also document where we are triggering
942 undefined or implementation-defined behavior.
943 (BADOP, NEGATIVE_EXPONENT, INVALID_OPERATOR, eval_lex, evaluate)
944 (logical_or_term, logical_and_term, logical_not_term, not_term)
945 (equality_term, unary_term): Port from head to follow POSIX
947 (exp_term): Reject 0**0 as undefined.
948 * doc/m4.texinfo (History): Mention 1.4.9.
949 (Format, Incompatibilities): Update to document POSIX compliance.
950 * NEWS: Document this change.
952 2007-01-04 Eric Blake <ebb9@byu.net>
954 * NEWS: Document previous fix.
957 2007-01-04 Sami Liedes <sliedes@cc.hut.fi> (tiny change)
959 Fix Debian bug 405594, introduced 2006-11-01 from a bad
960 copy-n-paste from head.
961 * src/m4.c (main): Use correct file name after --.
963 2007-01-04 Eric Blake <ebb9@byu.net>
965 Fix regression from 1.4.7 in large file handling on some
966 platforms, introduced on 2006-10-13.
967 * configure.ac (AC_LARGE_SYSFILE): Guarantee that large files
969 * NEWS: Document this fix.
971 2007-01-03 Eric Blake <ebb9@byu.net>
973 * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
975 * src/m4.c (AUTHORS, main): Use FSF wording for --version (plus
976 it bumps the copyright year).
978 2006-12-27 Eric Blake <ebb9@byu.net>
980 * doc/m4.texinfo (Patsubst): Fix typo.
982 2006-12-16 Eric Blake <ebb9@byu.net>
984 * src/m4.c (main): Check for errors when closing stdin.
986 2006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
988 * doc/m4.texinfo: Fix some typos.
990 2006-12-09 Eric Blake <ebb9@byu.net>
992 * configure.ac (AC_INIT): Bump version number.
993 * NEWS: Start changes of 1.4.8a.
995 2006-11-20 Eric Blake <ebb9@byu.net>
998 * configure.ac (AC_INIT): Bump version number.
999 * NEWS: Describe changes since 1.4.7.
1001 2006-11-16 Eric Blake <ebb9@byu.net>
1003 * doc/m4.texinfo (Include, Search Path, Diversions, Divert):
1004 Minor tweaks noticed while porting to head.
1006 2006-11-14 Eric Blake <ebb9@byu.net>
1008 * src/output.c (cleanup_tmpfile, freeze_diversions): Clean up
1010 (m4_tmpname): Avoid memory leak.
1012 2006-11-13 Eric Blake <ebb9@byu.net>
1014 * src/output.c (cleanup_tmpfile): Avoid double error message when
1015 umask is prohibitive.
1016 (m4_tmpname, m4_tmpopen, m4_tmpclose, m4_tmpremove): New
1018 (m4_tmpfile): Add parameter, move cloexec action here.
1019 (make_room_for): Adjust caller. Don't keep too many files open.
1020 (insert_diversion_helper): Unlink emptied temp files.
1021 (make_diversion): Don't keep too many files open.
1022 * doc/m4.texinfo (Diversions): Tweak wording, now that open file
1023 descriptors are no longer a limiting factor.
1024 * NEWS: Document this change.
1026 Backport sparse diversion handling from head.
1027 * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
1029 * src/output.c (struct m4_diversion): Rename from struct
1030 diversion, and update members. All users changed.
1031 (diversion_table): Change to an ordered set, instead of an array.
1032 (div0): New storage for diversion 0.
1033 (diversions): No longer needed.
1034 (free_list): New list to allow recycling diversion storage.
1035 (diversion_storage): New storage to reduce malloc overhead.
1036 (cmp_diversion_CB, threshold_diversion_CB): New callbacks.
1037 (output_init, output_exit, cleanup_tmpfile, make_room_for)
1038 (make_diversion): Handle new diversion storage scheme.
1039 (insert_diversion_helper): New function.
1040 (insert_diversion, undivert_all, freeze_diversions): Use it.
1041 * doc/m4.texinfo (Divert, Diversions): Move hidden test of memory
1042 exhaustion to visible test of large diversion numbers.
1043 * NEWS: Document this fix.
1045 2006-11-11 Eric Blake <ebb9@byu.net>
1047 * src/builtin.c (m4_translit): Slight optimization.
1049 * src/m4.h (to_uchar): Depend on HAVE_INLINE.
1051 * src/builtin.c: Remove unnecessary casts.
1052 (expand_ranges): Make 8-bit clean.
1053 * doc/m4.texinfo (Translit): Add tests and wording.
1054 * NEWS: Document this fix.
1056 2006-11-07 Eric Blake <ebb9@byu.net>
1058 * src/m4.h (output_exit): New prototype.
1059 * src/m4.c (main): Use it.
1060 * src/output.c (cleanup_tmpfile): Close files before removing
1062 (insert_diversion): Check for failure.
1063 (output_exit): Avoid memory leak.
1064 * doc/m4.texinfo (Diversions): Test this bug.
1066 * doc/m4.texinfo (Esyscmd, Errprint): Minor touchups.
1068 2006-11-01 Eric Blake <ebb9@byu.net>
1070 Allow C++ compilation on Linux, as a safety measure in type
1072 * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
1074 * src/m4.h (hack_symbol, hack_all_symbols): Use full prototype.
1075 (boolean): Kill this, and use stdbool.h instead.
1076 * src/debug.c, src/eval.c, src/input.c, src/macro.c, src/m4.c:
1077 * src/output.c, src/symtab.c: All users changed.
1078 * src/symtab.c (hack_all_symbols): Update prototype.
1079 * src/builtin.c (dump_symbol, set_trace): Update signature.
1080 (m4_dumpdef, m4_traceon, m4_traceoff): Update callers.
1081 (mkstemp_helper, m4_m4wrap, expand_ranges, m4_translit): Allow
1083 * src/debug.c (trace_flush): Likewise.
1084 * src/freeze.c (reload_frozen_state): Likewise.
1085 * src/input.c (push_file, push_string_finish, push_wrapup):
1086 (token_bottom, next_token): Likewise.
1087 * src/m4.c (main): Likewise.
1089 * doc/m4.texinfo (Invoking m4): Update according to POSIX 200x
1091 * src/m4.h (m4_path_search): Tweak signature.
1092 * src/path.c (m4_path_search): Likewise.
1093 * src/builtin.c (include): Update caller.
1094 * src/m4.c (main): Allow -D, -U, -t, and -s to be interspersed
1095 with file names. Don't write to **argv.
1096 (process_file): New helper method.
1097 * NEWS: Document this fix.
1099 2006-10-31 Eric Blake <ebb9@byu.net>
1101 * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import strstr'.
1102 * doc/m4.texinfo (Translit): Improve the documentation.
1103 * src/builtin.c (m4_translit): Optimize to O(n) instead of O(n^2)
1105 (m4_index): Simplify, and speed up slightly.
1106 * NEWS: Document this fix.
1108 2006-10-28 Eric Blake <ebb9@byu.net>
1110 * src/input.c (set_quotes): Don't allow empty end-quote with
1111 non-empty start-quote.
1112 (set_comment): Likewise for end-comment.
1113 * src/builtin.c (m4_changecom): Adjust caller.
1114 * doc/m4.texinfo (Changequote, Changecom): Update documentation to
1116 (Incompatibilities): Document another POSIX bug.
1117 * NEWS: Mention this change.
1119 2006-10-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1121 * examples/Makefile.am (EXTRA_DIST): Distribute recently-added
1124 2006-10-26 Eric Blake <ebb9@byu.net>
1126 Silence -Wwrite-strings -Wpointer-arith warnings.
1127 * src/builtin.c (define_user_macro): Allow NULL argument.
1128 (m4_builtin, m4_indir): Cast away const of "".
1129 * src/format.c (format): Likewise.
1130 * src/macro.c (collect_arguments): Likewise.
1131 (expand_macro): Avoid math on void*.
1132 * src/m4.c (main): Adjust caller.
1133 * src/output.c (freeze_diversions): Detect off_t overflow.
1135 * src/input.c (pop_input): Remove unnecessary code.
1137 2006-10-25 Eric Blake <ebb9@byu.net>
1139 * src/symtab.c (symtab_init): Avoid size_t overflow.
1140 * src/output.c (make_diversion): Avoid size_t overflow.
1141 * doc/m4.texinfo (Diversions): Test this fix.
1142 * src/input.c (input_block): Remove unused member. Reduce size
1144 (push_file, pop_input): Avoid useless assignment.
1145 * NEWS: Document the bug fix.
1147 Redo location tracking. Instead of having just files track the
1148 line to return to when popping input, now all input blocks track
1150 * src/input.c (INPUT_STRING_WRAP, INPUT_FILE_INIT): No longer
1152 (input_block): Have line and file storage for all input types, and
1153 rename some members.
1154 (input_change): New global flag.
1155 (push_file, push_macro, push_string_init, push_wrapup): Store
1157 (push_string_finish, pop_input, pop_wrapup): Notice changes in
1159 (peek_input): Adjust to new member names.
1160 (next_char, next_char1): Adjust location if needed.
1161 (skip_line): Simplify restoring location.
1162 * doc/m4.texinfo (Location): Augment the test to catch line
1163 location of expansion of multi-line arguments.
1164 Reported by Stepan Kasal.
1166 2006-10-23 Eric Blake <ebb9@byu.net>
1168 * doc/m4.texinfo (Macro Arguments): Document that leading space
1169 in argument collection stops at macro expansion.
1170 (Incompatibilities): Document POSIX whitespace wording issue.
1172 2006-10-20 Eric Blake <ebb9@byu.net>
1174 * doc/m4.texinfo: Trailing '@comment' doesn't format nicely in
1175 TeX, so recognize '@w{ }' instead. Likewise, @code{_name} at the
1176 end of a TeX line splits incorrectly.
1177 (Foreach, Improved foreach): Write these sections, borrowing ideas
1178 from CVS head and from m4sugar.
1179 * checks/get-them: Accomodate new way to show trailing space in
1181 * examples/foreach.m4: Make usable in documentation.
1182 * examples/foreachq.m4: New file.
1183 * examples/foreachq2.m4: New file.
1184 * examples/foreach2.m4: New file.
1185 * NEWS: Document the documentation updates.
1187 2006-10-19 Eric Blake <ebb9@byu.net>
1189 * src/builtin.c (mkstemp_helper, m4_mkstemp): New functions.
1190 (m4_maketemp): Provide traditional behavior.
1191 * doc/m4.texinfo (Mkstemp): Rename from Maketemp. Document the
1192 new `mkstemp' macro and the flaws of the old `maketemp'.
1193 (Incompatibilities): Move maketemp discussion to...
1194 (Extensions): ...here, since -G now supresses the GNU extension.
1195 * NEWS: Document this.
1197 * examples/forloop.m4: Simplify.
1198 * examples/forloop2.m4: New file.
1199 * examples/quote.m4: New file.
1200 * doc/m4.texinfo (Loops): Rename to...
1201 (Shift): ...this node.
1202 (Forloop, Foreach, Improved forloop, Improved foreach): New
1205 2006-10-17 Eric Blake <ebb9@byu.net>
1207 * m4/gnulib-cache.m4: Update with 'gnulib-tool --import
1209 * configure.ac (AC_CONFIG_HEADERS): Create config.h alongside
1210 gnulib headers, rather than in top directory.
1211 * src/Makefile.am (AUTOMAKE_OPTIONS): Add nostdinc, to reduce make
1214 2006-10-16 Eric Blake <ebb9@byu.net>
1216 * doc/m4.texinfo: Backport some minor cleanups from head.
1217 (Cleardivert): Rename from cleardiv.
1219 * doc/m4.texinfo (Invoking m4): Promote to a chapter, instead of
1220 a section of Preliminaries.
1221 (Operation modes, Preprocessor features, Limits control)
1222 (Frozen state, Debugging options, Command line files): Subdivide
1224 (Input processing, Quoting Arguments, Define, Arguments)
1225 (Cleardiv, Format, M4exit): Fix grammar of references.
1226 (Inhibiting Invocation, Macro Arguments, Builtin, Trace)
1227 (Debug Levels, Debug Output, Include, Search Path, Divert)
1228 (Platform macros, Syscmd, Location, Extensions): Point to new
1230 (Top, Loops, Include, Undivert, Location, Incompatibilities):
1231 Improve file references.
1233 2006-10-14 Eric Blake <ebb9@byu.net>
1235 * m4/input.c (file_clean): Don't close stdin twice, POSIX says it
1237 Reported by Ralf Wildenhues.
1239 * src/builtin.c (m4_undivert): Check for read error.
1241 2006-10-13 Eric Blake <ebb9@byu.net>
1243 * src/m4.h (UNIX, W32_NATIVE, OS2): Move platform checks after
1244 header files are included, since <unistd.h> can affect the tests.
1246 Reported by Martin Koeppe.
1248 Backport head's usage of clean-temp module, as it is cleaner than
1249 using tmpfile-safer.
1250 * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
1251 clean-temp closeout', and remove tmpfile-safer.
1252 * src/m4.h (includes): Adjust.
1253 (m4_path_search): Rename from path_search, to avoid collision
1255 * src/m4.c (main): Install closeout handler. Adjust caller.
1256 (usage): Now done by closeout module.
1257 * src/builtin.c (m4_m4exit): Likewise.
1258 (m4_undivert, include): Adjust callers.
1259 * src/freeze.c (reload_frozen_state): Likewise.
1260 * src/path.c (m4_path_search): Rename from path_search.
1261 * src/output.c (output_temp_dir): New variable.
1262 (cleanup_tmpfile, m4_tmpfile): New functions, from head.
1263 (insert_diversion, make_room_for): Use them.
1264 * doc/m4.texinfo (Diversions): Document this, and add a test.
1265 (Improved fatal_error): Fix typo.
1266 (Maketemp): Port test to mingw, and no longer hide from
1268 * NEWS: Document the change in TMPDIR behavior.
1270 * configure.ac (m4_pattern_forbid): Narrow the range of forbidden
1271 macros, to work with recent gnulib-tool update.
1273 * src/builtin.c (m4_builtin, m4_indir): Allow transparent
1274 handling of defn results.
1275 * doc/m4.texinfo (Builtin, Indir): Add test cases.
1276 * NEWS: Document this.
1278 2006-10-12 Eric Blake <ebb9@byu.net>
1280 * doc/m4.texinfo (Location): Fix typo in previous commit.
1281 (Changeword): Catch one more case.
1282 * src/input.c (skip_line): Fix case when outer file used macro to
1285 2006-10-11 Eric Blake <ebb9@byu.net>
1287 * src/input.c (enum input_type): Add additional types, to shave
1288 time off the common case.
1289 (push_wrapup): Wrapped strings remember location.
1290 (push_string_finish): Normal strings carry no location.
1291 (push_file): Start new files uninitialized.
1292 (peek_input, next_char_1): Optimize common cases by updating
1293 location only on new input types.
1294 (pop_input): Update to honor new input types.
1295 (skip_line, push_string_finish): Fix regression in previous patch
1296 when dnl is not followed by newline in included file.
1297 (push_string_init): Initialize all fields of INPUT_STRING sooner.
1298 (peek_token): Simplify.
1299 (peek_input): Don't pop input files on peek, so that __file__ and
1300 __line__ as last token of include file work correctly.
1301 * doc/m4.texinfo (History): Mention 1.4.8.
1302 (Answers): Split into sections, one per answer.
1303 (Improved exch, Improved cleardivert, Improved fatal_error): New
1305 (Dnl, M4wrap, Location, M4exit, Improved fatal_error): Update to
1306 new m4wrap location semantics.
1307 (Changeword): Add test that caught the regression.
1308 * NEWS: Document this.
1310 * src/macro.c (expand_macro): In macro expansion errors, report
1311 line number at open parenthesis.
1312 * src/input.c (next_token): Fix off-by-one bug in reporting end
1313 of file in unterminated comment and string.
1314 (file_names): New obstack, necessary since expand_macro now hangs
1315 on to file names longer than the files remain open.
1316 (input_init): Initialize new obstack.
1317 (push_file): Use new obstack. Delay updates to current_file
1318 until after expand_macro has restored state.
1319 (peek_input, next_char_1): Update current_file if necessary.
1320 (pop_wrapup): Release memory.
1321 * doc/m4.texinfo (Macro Arguments, Changequote, Changecom): Catch
1323 (Dnl): Update to the new location reporting rules.
1324 * NEWS: Document these changes.
1326 2006-10-10 Eric Blake <ebb9@byu.net>
1328 * src/macro.c (argc_stack, argv_stack): New variables for sharing
1329 obstacks across multiple macro calls.
1330 (expand_input): Initialize and tear down stack once per input
1331 file, instead of once per macro.
1332 (expand_macro): Reuse existing stacks when possible.
1333 (collect_arguments): Simplify slightly.
1335 * src/path.c (include_env_init): Fix botched patch application.
1336 Reported by Ralf Wildenhues.
1338 2006-10-09 Eric Blake <ebb9@byu.net>
1340 * src/m4.c (usage, main): Detect write failures to stderr.
1341 * src/builtin.c (m4_m4exit): Likewise.
1342 * NEWS: Document this.
1344 * src/macro.c (expand_macro): Allow --nesting-limit=0 to remove
1346 * NEWS: Document this.
1347 * doc/m4.texinfo (Invoking m4): Likewise.
1349 2006-10-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1351 * src/path.c (include_env_init): Copy the string returned
1352 by getenv before overwriting it; POSIX disallows this.
1354 2006-10-09 Eric Blake <ebb9@byu.net>
1356 * src/m4.c (main): Defer debugfile until after --help.
1357 * configure.ac (AC_INIT): Bump version number.
1358 * NEWS: Start changes of 1.4.7a.
1360 2006-09-25 Eric Blake <ebb9@byu.net>
1363 * configure.ac (AC_INIT): Bump version number.
1364 * NEWS: Describe changes since 1.4.6.
1366 2006-09-21 Eric Blake <ebb9@byu.net>
1368 * doc/m4.texinfo (Invoking m4): Add clarification on option
1369 processing behavior.
1371 Reported by Mikhail Teterin.
1373 * bootstrap: Add --force option, based on idea from coreutils.
1374 * README: Document that ./bootstrap and autoreconf are for
1375 developers, and not lightly done in tarballs.
1377 2006-09-20 Eric Blake <ebb9@byu.net>
1379 * src/m4.c (usage, OPTSTRING, main): Rename -e to -i, and give
1380 deprecation warning on -e.
1381 * doc/m4.texinfo (Invoking m4, Extensions): Document this.
1382 * NEWS: Document this.
1384 2006-09-19 Eric Blake <ebb9@byu.net>
1386 * src/m4.c (usage, long_options, main, DEBUGFILE_OPTION): Rename
1387 -o/--error-output to --debugfile, and deprecate the former. This
1388 will allow a future release to be more consistent with other GNU
1389 tools, with -o/--output affecting stdout, not debug.
1390 * doc/m4.texinfo (Invoking m4, Debug Output): Document this.
1391 * NEWS: Document this.
1393 2006-09-14 Eric Blake <ebb9@byu.net>
1395 * src/m4.c (main): Warn on deprecated options -B, -S, -T, -N,
1396 --diversions. `m4 --help --version' now displays help, not
1398 (interactive, frozen_file_to_read, frozen_file_to_write): Move to
1400 (show_help, show_version): No longer needed.
1401 (long_options, DIVERSIONS_OPTION): Backport patch from head to
1402 distinguish between -N and --diversions in warning.
1403 * doc/m4.texinfo (Invoking m4): Document this.
1406 2006-09-11 Eric Blake <ebb9@byu.net>
1408 * src/Makefile.am (m4_LDADD): Add any gnulib dependent libraries.
1409 * src/debug.c (debug_flush_files) [UNIX]: Flush stdin if it is
1411 (debug_set_file): Use STDOUT_FILENO.
1412 * src/builtin.c (m4_m4exit): Flush stdin before exiting, to comply
1413 with POSIX in regards to unread input.
1414 * NEWS: Document this fix.
1415 * doc/m4.texinfo (Syscmd, Esyscmd, M4exit): Likewise.
1417 2006-09-07 Eric Blake <ebb9@byu.net>
1419 * m4/gnulib-cache.m4: Update to newer gnulib-tool.
1420 * src/m4.h (push_file): Change prototype.
1421 * src/input.c (push_file, peek_input, next_char_1): Only call getc
1422 once at EOF, to avoid double ^D on terminal stdin; regression from
1424 (push_file, pop_file): Allow reading stdin twice.
1425 * src/m4.c (main): Likewise.
1426 * src/builtin.c (include): Update caller.
1427 * NEWS: Document this change.
1428 * doc/m4.texinfo (Invoking m4, Incompatibilities): Likewise.
1429 (Syscmd): Add a test that failed before this patch.
1431 2006-09-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1433 * checks/check-them: Quote $pwd.
1435 2006-09-05 Eric Blake <ebb9@byu.net>
1437 * src/builtin.c (define_macro): Warn on invalid macro name.
1438 * NEWS: Document this change.
1439 * doc/m4.texinfo: Fix typos.
1440 (Invoking m4, Macro Arguments, Pseudo Arguments, Defn, Indir)
1441 (Ifelse): Backport some improvements from head.
1443 2006-09-04 Eric Blake <ebb9@byu.net>
1445 * doc/m4.texinfo (Changeword): Skip test on mingw, where the
1446 native echo is braindead.
1447 * checks/check-them (strip_needed): Ignore \r in output. Now the
1448 testsuite will pass when cross-compiling from cygwin to mingw.
1450 * src/input.c (peek_input): Fix regression in handling macro
1451 without arguments as last token in file; debian bug 385720.
1452 (next_token): Always consume an input character.
1453 Reported by Andreas Schultz.
1454 * configure.ac (AC_INIT): Bump version number.
1455 * NEWS: Document this fix.
1456 * doc/m4.texinfo (History): Mention next version.
1457 (Changeword): Add example that exposes this bug.
1460 2006-08-25 Eric Blake <ebb9@byu.net>
1463 * configure.ac (AC_INIT): Bump version number.
1464 * NEWS: Describe changes since 1.4.5.
1466 * Makefile.maint (web-manual): Give up on VPATH build during
1467 distribution. But distributions are made so infrequently that
1468 this is not too much of a hardship.
1469 * Makefile.am (MAINTAINERCLEANFILES): Avoid error if lib/CVS/
1472 2006-08-24 Eric Blake <ebb9@byu.net>
1474 * src/builtin.c (m4_index, m4_substr, m4_translit): Similar to
1475 Solaris, produce output on just one argument.
1476 (m4_regexp, m4_patsubst): For consistency, do likewise.
1477 (m4_patsubst): Allow zero-length match at end of string.
1478 * doc/m4.texinfo (Sysval): Fix overfull hbox.
1479 (Bugs, Macro Arguments): Minor fixes.
1480 (Other tokens): Rearrange node order.
1481 (Index macro, Substr, Translit, Regexp, Patsubst): Add tests.
1482 * NEWS: Document these fixes.
1484 2006-08-22 Eric Blake <ebb9@byu.net>
1486 * src/input.c (pop_input): Avoid empty filename with -di option.
1487 * src/debug.c (debug_message_prefix): Put space before message.
1489 * m4/gnulib-cache.m4: We don't explicitly use alloca module.
1491 * m4/gnulib-cache.m4: Augment with gnulib-tool --import gnupload.
1492 * Makefile.maint (fetch): Simplify, now that we can use gnupload.
1494 * checks/check-them: State why a test is skipped.
1495 * doc/m4.texinfo (Changeword, Sysval, Maketemp): Likewise.
1497 * ChangeLog: Add copyright.
1498 * AUTHORS: Likewise.
1499 * BACKLOG: Likewise.
1503 * examples/COPYING: New file, add copyright for all the examples.
1504 * checks/get-them: Put copyright on testsuite files.
1506 2006-08-18 Eric Blake <ebb9@byu.net>
1508 Don't let unrelated child processes see too many files.
1509 * m4/gnulib-cache.m4: Augment with gnulib-tool --import cloexec.
1510 * src/builtin.c (m4_esyscmd, m4_regexp, m4_patsubst): Fix
1511 spelling in error message.
1512 * src/debug.c [!__STDC__]: Assume C89, and nuke old varargs.h.
1513 (debug_set_output): Close debug file on exec.
1514 * src/m4.h (includes): Add cloexec.h.
1515 * src/output.c (make_room_for): Close diversions on exec.
1516 * src/path.c (path_search): Close include files on exec.
1517 * NEWS: Document this.
1519 Regular expressions were leaking memory.
1520 * src/builtin.c (init_pattern_buffer, free_pattern_buffer): New
1522 (m4_regexp, m4_patsubst): Avoid memory leak.
1523 * src/input.c (init_pattern_buffer) [ENABLE_CHANGEWORD]: Make
1525 (set_word_regexp) [ENABLE_CHANGEWORD]: Avoid memory leak. Change
1526 from O(n^2) to O(n) for calculating word_start.
1527 (next_token, peek_token) [ENABLE_CHANGEWORD]: Treat word_start as
1528 O(1) bitmap, not O(n) search string.
1529 * NEWS: Document this fix.
1531 2006-08-17 Eric Blake <ebb9@byu.net>
1533 * NEWS: Document previous checkin.
1535 * src/builtin.c (substitute): Avoid core dump when accessing
1536 beyond bound of regular expression.
1537 Reported by Karl Nelson.
1538 * doc/m4.texinfo (Regexp): Add example that causes core dump on
1539 some architectures prior to this patch.
1542 2006-08-16 Eric Blake <ebb9@byu.net>
1544 * doc/m4.texinfo (Invoking m4, Debug Output): Fix wording to be
1545 clear that dumpdef does not always go to stderr.
1547 * src/builtin.c (m4_errprint): Flush buffers before printing to
1551 2006-08-15 Eric Blake <ebb9@byu.net>
1553 * src/builtin.c (m4_m4wrap, m4_errprint, m4_shift): Make blind,
1554 per debian bug 96075.
1555 * doc/m4.texinfo (Loops, M4wrap, Errprint): Document this change.
1556 (Changeword): Don't use shift as an example of a swallowed word.
1557 (Divert): Discuss fact that divert is an English word.
1558 Reported by Richard A Nelson.
1560 2006-08-14 Eric Blake <ebb9@byu.net>
1562 * doc/m4.texinfo (Invoking m4): Minor fixes.
1564 2006-08-12 Eric Blake <ebb9@byu.net>
1566 * doc/m4.texinfo (Arguments): Hint at better exch macro.
1567 (Answers): Provide a better definition.
1569 2006-08-09 Eric Blake <ebb9@byu.net>
1571 * doc/m4.texinfo (Incompatibilities): Document that m4 does not
1572 yet understand locales.
1573 * NEWS: Fix wording of a few items.
1575 2006-08-08 Eric Blake <ebb9@byu.net>
1577 Avoid printing `NONE:0:' in error messages.
1578 * src/m4.h (m4_error_at_line): New function.
1579 * src/m4.c (m4_error_at_line): Implement.
1580 * src/input.c (skip_line, input_init, next_token): Use "", not
1581 "NONE", for no file, since NONE can be a real file name.
1582 * src/macro.c (expand_argument): Likewise.
1583 * src/debug.c (debug_message_prefix, trace_header): Check for
1585 * doc/m4.texinfo (Dnl, M4wrap): Adjust accordingly.
1586 (Location): Document that synclines and internal message format
1587 are not impacted by redefining these macros.
1588 (M4exit): Hint at bug in fatal_error.
1589 (Answers): Provide workaround to match m4 output.
1591 * m4/gnulib-cache.m4: Augment with gnulib-tool --import verror.
1592 * src/m4.h (m4_error): New function.
1593 (M4ERROR, M4ERROR_AT_LINE): Reimplement without hacking around
1594 error module deficiencies.
1595 (reference_error, suppress_line): No longer needed.
1596 * src/m4.c (m4_error): Implement.
1597 (main): No longer need to install error callback.
1599 2006-08-04 Eric Blake <ebb9@byu.net>
1601 * src/m4.h (program_name): Declare.
1602 (suppress_line): New variable.
1603 (M4ERROR_AT_LINE): New macro.
1604 * src/m4.c (reference_error, main): Follow GNU Coding Standards
1605 for error message format.
1606 * src/input.c (skip_line, next_token): Use M4ERROR_AT_LINE.
1607 * src/macro.c (expand_argument): Likewise.
1608 * checks/check-them (examples): Adjust to new message format.
1609 * src/builtin.c (m4___program__): New builtin.
1610 * doc/m4.texinfo (Location): Split from Errprint into new node,
1611 and document __program__.
1612 (Builtin, Ifdef, Ifelse, Dumpdef, Trace, Debug Output, Dnl)
1613 (Include, Regexp, Patsubst, Incr, Eval): Adjust error message
1615 (Extensions): Document __program__.
1616 * NEWS: Document this change.
1618 2006-08-03 Eric Blake <ebb9@byu.net>
1620 Don't confuse leading `(' in comment or quote with start of
1621 argument collection.
1622 * src/m4.h (enum token_type): Add TOKEN_OPEN, TOKEN_COMMA,
1624 (peek_input): Make private to input.c.
1625 (peek_token): New prototype.
1626 * src/input.c (default_word_regexp): Reduce ifdefs.
1627 (peek_input): Make static.
1628 (next_token): Return new token types.
1629 (match_input, MATCH): Add argument consume, which controls
1630 whether match should be pushed back.
1631 (peek_token): New function.
1632 (token_type_string) [DEBUG_INPUT]: New function.
1633 * src/macro.c (expand_token, expand_argument, collect_arguments):
1634 Handle new token types.
1635 * doc/m4.texinfo (Changequote, Changecom): Document this.
1636 * NEWS: Document this.
1638 * src/stackovf.c (setup_stackovf_trap): Free memory on failure.
1640 * src/stackovf.c (setup_stackovf_trap): Gracefully avoid stack
1641 overflow detection when sigstack exists but is not implemented.
1642 Fixes debian bug 154053.
1644 Reported by David Perlin.
1646 2006-08-02 Eric Blake <ebb9@byu.net>
1648 * src/input.c (MATCH): Fix EOF detection on multi-byte comment
1651 2006-08-01 Eric Blake <ebb9@byu.net>
1653 * src/input.c (skip_line, next_token): Remember current file in
1654 case input file ends abruptly. Addresses debian bug 175365.
1655 (pop_input): Defer freeing storage that holds previous file
1657 (pop_wrapup): to here, after error message is issued.
1658 * src/macro.c (expand_argument): Remember current file in case
1659 input file ends abruptly.
1660 * doc/m4.texinfo (Macro Arguments, Dnl, Changequote, Changecom)
1661 (M4wrap): Adjust testsuite accordingly.
1662 (Errprint): Document line number limitation of m4wrap.
1663 * NEWS: Document this fix.
1666 2006-07-31 Eric Blake <ebb9@byu.net>
1668 * src/input.c (peek_input, next_char, match_input): Be eight-bit
1669 clean; fixes debian bug 311378.
1670 * doc/m4.texinfo (Syntax): Describe eight-bit handling.
1671 (Changequote, Changecom): Add examples to test this.
1672 * NEWS: Document this fix.
1674 Reported by Steven Augart.
1676 * doc/m4.texinfo: Whitespace fix.
1677 * checks/get-them: Avoid exceeding 14-char file name limit.
1680 2006-07-30 Eric Blake <ebb9@byu.net>
1682 * src/path.c (path_search): Detect allocation failure.
1684 Use native free when it is good enough.
1685 * m4/gnulib-cache.m4: Augment with gnulib-tool --import free.
1686 * src/builtin.c (define_user_macro, m4_regexp, m4_patsubst):
1688 * src/symtab.c (free_symbol): Likewise.
1689 * src/m4.c (xfree, main): Likewise.
1690 * src/m4.h (obstack_chunk_free): Likewise.
1691 * src/path.c (path_search): Likewise.
1692 * src/input.c (pop_wrapup, set_quotes, set_comment): Likewise.
1694 * doc/m4.texinfo (Errprint): Add example for last patch.
1695 * checks/check-them: Account for VPATH in latest example.
1697 2006-07-29 Eric Blake <ebb9@byu.net>
1699 * src/path.c (path_search): Add result parameter, so that
1700 -I can be accounted for. Debian bug 53685.
1701 * src/m4.h (path_search): Update prototype.
1702 * src/m4.c (main): Adjust callers.
1703 * src/freeze.c (reload_frozen_state): Likewise.
1704 * src/builtin.c (include, m4_undivert): Likewise.
1705 * NEWS: Document this change.
1706 Reported by Nicolas Lichtmaier.
1708 2006-07-28 Eric Blake <ebb9@byu.net>
1710 * Makefile.am (MAINTAINERCLEANFILES): Fix typo that tripped up
1711 several non-GNU makes.
1712 * src/stackovf.c (setup_stackovf_trap): Missed _ from yesterday.
1713 * src/m4.h: Likewise.
1714 * src/input.c (push_wrapup): Avoid compiler warning with Solaris
1717 2006-07-27 Eric Blake <ebb9@byu.net>
1719 * doc/m4.texinfo: Use @acronym{GNU} throughout.
1720 (History): Update for 1.4.6.
1722 * src/m4.h (_): Remove K&R cruft.
1723 * src/builtin.c: Likewise.
1724 * src/debug.c: Likewise.
1725 * src/eval.c: Likewise.
1726 * src/macro.c: Likewise.
1727 * src/stackovf.c: Likewise.
1729 * doc/Makefile.am (m4.1): Improve man page.
1730 * src/m4.c (usage): Improve --help output, including adding the
1731 bug reporting address.
1732 (main): Follow GNU Coding Standards for --version output.
1734 2006-07-26 Eric Blake <ebb9@byu.net>
1736 * doc/m4.texinfo: Use begin-quote, end-quote, begin-comment, and
1737 end-comment consistently, to match POSIX.
1739 * doc/m4.texinfo (Macro Arguments, Changequote, Changecom)
1740 (Dnl, M4wrap, Include): Document EOF issues, and add examples.
1741 (Incompatibilities): Document incompatibility of changecom
1742 vs. macro names, and of EOF in include.
1743 * src/input.c (next_token): Reject unterminated comments at EOF.
1744 (skip_line): Warn on unterminated dnl at EOF.
1745 * NEWS: Document these changes.
1747 2006-07-25 Eric Blake <ebb9@byu.net>
1749 * m4/gnulib-cache.m4: Update to reflect gnulib's split of
1750 stdio-safer into fopen-safer and tmpfile-safer.
1751 * src/m4.c: Remove redundant include.
1753 2006-07-24 Eric Blake <ebb9@byu.net>
1755 Fix bugs related to stream handling.
1756 * m4/gnulib-cache.m4: Augment with gnulib-tool --import
1757 unlocked-io stdio-safer stdlib-safer close-stream.
1758 * configure.ac (AC_CHECK_FUNCS_ONCE): Assume tmpfile; it can be
1759 provided by gnulib if needed.
1760 * src/output.c [! HAVE_TMPFILE]: Likewise.
1761 * src/m4.h (includes): Replace unistd, stdio, and stdlib with
1762 their safer counterparts.
1763 (retcode): New global variable.
1764 * src/input.c (pop_input): Check for read failure.
1765 * src/freeze.c (reload_frozen_state): Likewise.
1766 (produce_frozen_state): Check for write failure.
1767 * src/debug.c (debug_set_file): Likewise.
1768 * src/m4.c (usage, main): Likewise.
1769 (retcode): Make global.
1770 * src/builtin.c (m4_m4exit): Likewise. Ensure that the exit
1771 status is non-zero except when everything succeeds.
1772 * doc/m4.texinfo (M4exit): Document these changes.
1773 (Incompatibilities): Remove documentation of bug now fixed.
1774 * NEWS: Document these fixes.
1776 2006-07-22 Eric Blake <ebb9@byu.net>
1778 * src/format.c (format): Avoid compiler warning that str may be
1781 2006-07-21 Eric Blake <ebb9@byu.net>
1783 * src/m4.h [UNIX]: Add more platforms that are close enough to
1784 categorize as UNIX, but which don't predefine __unix__.
1785 Reported by Nelson H. F. Beebe.
1787 2006-07-20 Eric Blake <ebb9@byu.net>
1789 * m4/gnulib-cache.m4: gnulib-tool has changed again. Regenerate
1790 to explicitly ask for --assume-autoconf=2.60.
1792 2006-07-19 Eric Blake <ebb9@byu.net>
1794 * doc/m4.texinfo (Sysval): Avoid kill -1, since ksh traps SIGHUP
1795 and exits normally with 129.
1796 Reported by Nelson H. F. Beebe.
1799 * src/m4.h (EXIT_MISMATCH): Define.
1800 * src/freeze.c (reload_frozen_state): Detect version mismatch, by
1801 exiting with status 63.
1802 * src/m4.c (usage): Document this.
1803 * doc/m4.texinfo (Invoking m4, Using frozen files): Likewise.
1806 * doc/m4.texinfo (copying): Relax restriction on front-cover and
1809 2006-07-17 Eric Blake <ebb9@byu.net>
1811 * src/format.c (format): Support F, g, and G specifiers.
1812 * doc/m4.texinfo (Format): Document this.
1813 * NEWS: Document this addition.
1815 * doc/m4.texinfo (Builtin): Delete redundant text.
1817 * configure.ac (AC_INIT): Bump version number.
1818 * src/builtin.c (substitute): Bah. Fix buffer overrun.
1819 * NEWS: Document this fix.
1821 2006-07-15 Eric Blake <ebb9@byu.net>
1824 * configure.ac (AC_INIT): Bump version number.
1825 * NEWS: Describe changes since 1.4.4.
1827 * src/m4.c (usage): Document exit status.
1828 * doc/m4.texinfo: Use `exit status', not `exit code'.
1829 (Invoking m4): Document exit status.
1831 * bootstrap: Backport --help, --version from head.
1832 (func_update): New function, for easily grabbing up-to-date files
1834 * Makefile.maint (web-manual): Fix for VPATH builds.
1836 2006-07-14 Eric Blake <ebb9@byu.net>
1838 * doc/m4.texinfo: Global cleanup. Avoid @code{...}'d, as it
1839 looks bad in info. Use @deffn rather than @example for
1840 describing prototypes. Fix awkward wording and grammar.
1842 * src/builtin.c (substitute): Warn on bad escape sequences.
1843 Ignore trailing backslash.
1844 * doc/m4.texinfo (Regexp): Add documentation for this.
1845 * NEWS: Document this change.
1847 * src/builtin.c (m4_format, m4_indir): Warn on too few arguments.
1848 * doc/m4.texinfo (Defn, Builtin, Debug Levels, Debug Output): Add
1850 (Dnl): Update example to show side effects.
1851 * checks/get-them: Generate three digit test names.
1852 * checks/Makefile.in (CHECKS): Accomodate 100+ tests.
1854 2006-07-13 Eric Blake <ebb9@byu.net>
1856 * src/input.c (input_init): Simplify.
1857 (set_word_regexp): Treat empty string as default, since empty
1858 regexp would disable word parsing.
1859 * src/m4.c (user_word_regexp): Default to empty string.
1860 * src/builtin.c (builtin_tab): Make changeword blind.
1861 * doc/m4.texinfo (Changeword): Document this.
1862 * NEWS: Document this.
1863 * TODO: Knock off completed items.
1865 * src/builtin.c (m4_undefine, m4_popdef): Visit all arguments, not
1867 * doc/m4.texinfo (Undefine, Pushdef): Test this.
1868 * NEWS: Document this change.
1870 * src/builtin.c (numeric_arg): Treat empty string as 0, with a
1871 warning. Detect quoted leading space and overflow as warnings.
1872 (m4_eval): Treat empty radix as 10, and allow output in radix 1.
1873 Treat width as minimum number of digits, as required by POSIX.
1874 (m4_ifdef, m4_divert, m4_m4exit, m4_translit): Ignore extra
1876 (m4_substr): Likewise. Silently treat empty start as 0.
1877 (m4_undivert): Treat ` 1a' as file, not diversion 1.
1878 * src/eval.c (eval_lex): Parse radix 1 numbers.
1879 * doc/m4.texinfo (Invoking m4): Fix wording; there is more than
1880 one type of warning.
1881 (Manual): Document behavior of numeric parsing of empty string.
1882 (Divert, Incr): Document error handling.
1883 (Eval): Document radices better.
1884 (Incompatibilities): Document translit incompatibility.
1885 * NEWS: Document these changes.
1887 * Makefile.maint (fetch): Get gendocs from gnulib, not texinfo.
1888 (web-manual): Simplify.
1889 * m4/gnulib-cache.m4: Augment with gnulib-tool --import gendocs.
1890 * Makefile.am (EXTRA_DIST): Distribute gendocs.sh.
1891 (MAINTAINERCLEANFILES): Clean it as well.
1892 * doc/Makefile.am (EXTRA_DIST): Distribute gendocs_template.
1893 (MAINTAINERCLEANFILES): Clean it as well.
1895 2006-07-12 Eric Blake <ebb9@byu.net>
1897 * doc/m4.texinfo (Extensions): Document how to overcome
1898 implementation difference in > 9 positional parameters.
1900 * src/m4.c (usage): Sort within sections.
1901 (nesting_limit): Raise default from 250 to 1024.
1902 * doc/m4.texinfo: Use file name, not filename, per GNU coding
1903 standard. Use @option where appropriate.
1904 (Invoking m4): Sort to match --help output.
1905 (Debug Levels): Sort.
1906 (Frozen files): Sort and break into two nodes.
1908 * src/m4.c (nesting_limit): Raise default from 250 to 1024.
1909 * NEWS: Document raised -L limit.
1911 2006-07-11 Eric Blake <ebb9@byu.net>
1913 * Makefile.am (DISTCHECK_CONFIGURE_FLAGS): New macro, to
1914 stress-test changeword before a release.
1915 * doc/m4.texinfo: More doc cleanups.
1916 (Copying This Manual): New node; actually include the FDL in the
1918 * doc/Makefile.am (m4_TEXINFOS): Mention dependence on fdl.texi.
1919 * m4/gnulib-cache.m4: Augment with gnulib-tool --import fdl.
1920 * NEWS: Mention documentation improvements.
1922 * src/m4.h (OS2): New platform macro.
1923 * src/builtin.c (predefined_tab) [OS2]: Use it to give OS/2 a
1925 * doc/m4.texinfo (Platform macros): Document it.
1926 (Sysval): Remove non-portable test of system("").
1927 * NEWS: Document this change.
1928 Reported by Andreas Buening.
1930 2006-07-09 Eric Blake <ebb9@byu.net>
1932 * doc/m4.texinfo (Undivert): Fix typo in last commit.
1933 * src/m4.c (usage): Document M4PATH.
1934 * src/path.c (path_search): Reject empty string.
1935 * src/output.c (insert_diversion): Ignore diversion 0.
1936 * src/builtin.c (m4_undivert): Ignore empty string.
1937 * NEWS: Document this fix.
1939 2006-07-08 Eric Blake <ebb9@byu.net>
1941 * checks/get-them: Make filtering easier.
1942 * checks/check-them: Filter non-input lines, so line counts are
1943 more realistic in the documentation, and so changeword tests work
1944 even when dnl is disabled.
1945 * doc/m4.texinfo: Adjust example line numbers. Clean up
1946 front-matter, following autoconf's example.
1947 (Changeword): Enable tests, skipping if changeword not supported.
1948 (Define, Defn, Ifelse): Backport more examples from head.
1949 (Input processing, Answers): New nodes, backported from head.
1950 (Include): Expand test to cover empty filename.
1951 (Undivert): Add test of undivert(0).
1953 2006-07-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1955 * doc/m4.texinfo: Fix spelling errors.
1957 2006-07-07 Eric Blake <ebb9@byu.net>
1961 * doc/Makefile.am (m4.1): No need to go through a temporary file;
1962 this also ensures timestamps are updated.
1963 * src/m4.h (includes): Require config.h. Assume string.h,
1964 stdlib.h, errno. Include error.h, exit.h, and xalloc.h rather
1965 than prototyping ourselves.
1966 (builtin_func): Add parameter type-checking.
1967 (voidstar): Delete, now that we assume C89.
1968 * src/builtin.c, src/m4.c, src/macro.c, src/symtab.c: All users of
1970 * src/m4.c (xfree) [WITH_DMALLOC]: Avoid clash with dmalloc's
1973 2006-07-06 Eric Blake <ebb9@byu.net>
1975 * m4/gnulib-cache.m4: Augment with gnulib-tool --import
1977 * src/m4.h (includes): Add binary-io.h for O_BINARY.
1978 * src/freeze.c (produce_frozen_state): Use O_BINARY to remove
1979 #ifdef. Fixes patch from 2005-02-03 for cygwin.
1980 * NEWS: Mention this fix.
1982 * configure.ac (FUNC_SYSTEM_BROKEN): New check for OS/2 bug.
1983 * src/builtin.c (m4_syscmd): Work around OS/2 bug.
1985 * Makefile.am (SUBDIRS): Build . before src, so that autoheader
1986 runs first when needed.
1987 * doc/Makefile.am (m4.1): Backport rule from CVS head: build m4.1
1988 once in srcdir rather than multiple times in VPATH builds.
1990 2006-07-03 Eric Blake <ebb9@byu.net>
1992 * checks/check-them: Use portable = in test.
1993 * src/Makefile.am (AM_CPPFLAGS): Omit space between -I and
1994 directory, as required by Solaris cc. Include built headers, as
1995 required by Solaris make in VPATH build.
1996 * checks/Makefile.in: Use $(srcdir) where needed.
1997 (CHECKS): Factor $(srcdir) into macro.
1998 (DISTFILES): Likewise. Automake takes care of distributing
2001 (Makefile): Use modern syntax of config.status.
2002 * doc/m4.texinfo (Loops, Include, Undivert, Incompatibilities):
2003 Avoid overfull and underfull hboxes in dvi.
2005 Fix 'make check' in VPATH build. All files included by testsuite
2006 now live in a single directory. Use forloop.m4 in testsuite.
2007 * checks/incl.m4, checks/foo, checks/wrapfifo.m4: Move from
2009 * examples/incl.m4, examples/foo, examples/wrapfifo.m4: ...to
2011 * checks/Makefile.in (DISTFILES): Don't distribute moved files.
2012 * examples/Makefile.am (EXTRA_DIST): Distribute new files.
2013 * checks/check-them: Avoid s/// when filename is in pattern.
2014 * examples/forloop.m4: Fix to match documentation.
2015 * doc/m4.texinfo (Include, Undivert, Incompatibilities): Reflect
2017 (Loops, Format): Actually use forloop.m4 in tests.
2019 2006-07-02 Eric Blake <ebb9@byu.net>
2021 * checks/Makefile.in (exec_prefix, prefix): New macros, so that
2022 $(bindir) works in installcheck.
2023 (check, installcheck): No longer change directory, so that
2024 distcheck works with a read-only builddir.
2025 * checks/check-them: Work when pwd is no longer builddir.
2027 2006-07-01 Eric Blake <ebb9@byu.net>
2029 * GNUmakefile: New file, borrowed from coreutils.
2030 * Makefile.am (EXTRA_DIST): Distribute GNUmakefile.
2031 * Makefile.maint (Makefile): Delete this rule, now that
2032 GNUmakefile includes Makefile.
2034 2006-06-30 Eric Blake <ebb9@byu.net>
2036 For compatibility with other m4 implementations, sysval returns
2037 signal<<8 rather than 0 if syscmd is terminated by a signal.
2038 * configure.ac (AC_CHECK_HEADERS_ONCE): Check for sys/wait.h.
2039 * src/builtin.c (include): Include sys/wait.h when stdlib.h does
2040 not provide wait macros.
2041 (WTERMSIG, WIFSIGNALED, WIFEXITED): More fallback macros.
2042 (M4SYSVAL_EXITBITS, M4SYSVAL_TERMSIGBITS): New helper macros.
2043 (m4_esyscmd): Set sysval to -1 on failure.
2044 (m4_sysval): Print 127 on failure, and accomodate signals if they
2046 * NEWS: Document this change.
2047 * doc/m4.texinfo (Platform macros, Esyscmd, Sysval): Fix typos in
2049 * checks/check-them: Likewise.
2050 * src/debug.c (debug_set_file): Work around mingw fstat bug.
2052 * src/m4.h (UNIX, W32_NATIVE): Improve platform detection macros.
2053 * src/freeze.c (produce_frozen_state): Use new spelling of
2055 * src/builtin.c (predefined_tab): Add __windows__ on non-unix
2057 (m4_syscmd, m4_esyscmd): The empty command is successful.
2058 * doc/m4.texinfo (Shell commands): Rename from UNIX commands.
2059 Document platform-dependence of system().
2060 (Syscmd): Add example.
2061 (Esyscmd): Make example more robust, and actually demonstrate
2063 (Sysval): Expand test to cover esyscmd code path, and to check
2064 that empty command is successful. Add conditional check for
2066 (Other Incompatibilities): Move platform macros from here...
2067 (Platform macros): ...to this new node. Add windows macro.
2068 Check that exactly one platform macro is provided.
2069 * checks/check-them: Improve trap cleanup. Tolerate dirname and
2070 .exe in error messages. Allow for skipping checks.
2071 * configure.ac (HAVE_EFGCVT): Kill dead configure check.
2072 * NEWS: Document platform macros.
2074 2006-06-29 Eric Blake <ebb9@byu.net>
2076 Fix buffer overrun bug.
2077 * m4/gnulib-cache.m4: Augment with gnulib-tool --import
2079 * src/format.c [HAVE_EFGCVT]: Delete this code, and use *printf
2080 variant instead, since [efg]cvt are obsolete and our use of them
2081 was buggy (savannah sr #104303).
2082 (format): Fix buffer overflow by using xasprintf.
2083 * doc/m4.texinfo (Format): Expand format test to catch both bugs.
2084 * NEWS: Document this fix.
2086 * configure.ac (AC_CANONICAL_HOST, AC_CANONICAL_BUILD): Allow
2088 (AC_CACHE_CHECK): Cache search for ecvt.
2090 2006-06-27 Eric Blake <ebb9@byu.net>
2092 * doc/m4.texinfo (Eval): Document 32-bit signed limitations
2093 required by POSIX, and add example that exposed core dump on x86
2095 (Incompatibilities): Document incompatibility in eval precedence.
2096 * src/eval.c (shift_term): Explicitly mask, to avoid undefined
2098 (mult_term): Explicitly check for -1, to avoid SIGFPE on x86.
2099 * NEWS: Document this change.
2101 * doc/m4.texinfo: Use @noindent consistently.
2102 (Quoting Arguments): Document that unquoted parentheses group
2104 (Pseudo Arguments): Expand tests to show this.
2105 (Incompatibilities): Contrast traditional behavior of
2108 2006-06-24 Eric Blake <ebb9@byu.net>
2110 * configure.ac (AC_PREREQ): Autoconf 2.60 is now released.
2111 (AC_CHECK_HEADERS_ONCE): Use this new feature.
2112 (AC_CHECK_FUNCS_ONCE): Likewise.
2114 2006-06-23 Eric Blake <ebb9@byu.net>
2116 * doc/m4.texinfo: Quoting cleanup throughout - follow
2117 autoconf-recommended style of one level of quote per parenthesis
2118 in the normal case. Adjust error messages to match GNU coding
2119 standards (and to allow 'make check' to pass again).
2120 (Quoted strings, Inhibiting Invocation): Turn more examples into
2122 (Comments): Resolve FIXME by adding example.
2123 (Define): Add example about underquoting.
2124 (Defn): Add example about use of $0.
2125 (Indir, Format): Resolve FIXME done in last commit.
2126 (Ifelse): Add example about creating blind macro.
2127 (Debugging): Fix grammar.
2128 (Dnl): Add example about dnl with arguments.
2129 (M4wrap): Be explicit that LIFO order is non compliant, and will
2131 (Undivert): Resolve FIXME by adding example.
2132 (Frozen files): Document that m4wrap and sysval will not work
2133 consistently until m4 2.0.
2134 (Incompatibilities): Document another POSIX compliance bug, this
2135 time with changequote. Document a traditional incompatibility
2136 with partial input spanning file boundaries.
2138 Make error messages more consistent with GNU coding standards -
2139 start with lower case, and don't end sentence with punctuation.
2140 * src/debug.c (trace_pre): Update message wording.
2141 * src/eval.c (evaluate, cmp_term, shift_term, mult_term):
2143 * src/freeze.c (produce_frozen_state, issue_expect_message),
2144 (reload_frozen_state): Likewise.
2145 * src/input.c (push_string_init, pop_init, init_macro_token),
2146 (peek_input, next_char_1, set_word_regexp, next_token): Likewise.
2147 * src/m4.c (stackovf_handler, main): Likewise.
2148 * src/macro.c (expand_token, expand_argument, call_macro),
2149 (expand_macro): Likewise.
2150 * src/output.c (make_room_for, output_text, insert_file),
2151 (freeze_diversions): Likewise.
2152 * src/symtab.c (symtab_init, lookup_symbol): Likewise.
2154 * src/builtin.c (builtin_tab): Make format and indir blind.
2155 (substitute): Prefer "Warning:" vs. "ERROR:" in messages.
2156 * NEWS: Mention the change to builtins.
2158 2006-06-22 Eric Blake <ebb9@byu.net>
2160 Robustify frozen file format.
2161 * src/freeze.c (reload_frozen_state): Add GET_DIRECTIVE helper
2162 macro. Require V first, and only accept it once. For F, use
2163 placeholder if builtin is not found, rather than warning.
2164 * src/m4.h (m4_placeholder): New prototype.
2165 * src/builtin.c: Unify error message style.
2166 (m4_placeholder): New function, warn if invoked.
2167 (builtin_tab): Add m4_placeholder.
2168 (m4_defn): Warn if placeholder is encountered.
2169 (find_builtin_by_addr): Handle placeholder.
2170 (find_builtin_by_name): Return placeholder on failure.
2171 (m4_builtin): Treat placeholder as undefined.
2172 * doc/m4.texinfo (Frozen files): Document changes in V and F.
2173 * NEWS: Document this change.
2174 Reported by Bruno Haible.
2176 * doc/m4.texinfo: Whitespace cleanup. TABs are evil in texinfo.
2177 (tabchar): New macro, so that 'make check' still works.
2178 (Invoking m4): Document that ignored compatibility options -B, -S,
2179 and -T each consume an argument.
2180 * checks/get-them: Honor @tabchar{}.
2182 Avoid compiler warnings during -DDEBUG.
2183 * src/m4.h (M4_GNUC_ATTRIBUTE, M4_GNUC_UNUSED): New macros.
2184 [DEBUG]: Also imply DEBUG_OUTPUT and DEBUG_STKOVF.
2185 * src/input.c (print_token) [DEBUG_INPUT]: Use correct format.
2186 (lex_debug) [DEBUG_INPUT]: Fix to compile. Mark unused.
2187 (next_token) [DEBUG_INPUT]: Print before returning.
2188 * src/path.c (include_dump) [DEBUG_INCL]: Mark unused.
2189 * src/symtab.c (symtab_debug) [DEBUG_SYM]: Mark unused.
2191 Avoid mkstemp bugs on various platforms.
2192 * m4/gnulib-cache.c: Augment with gnulib-tool --import mkstemp.
2193 * src/output.c [! HAVE_MKSTEMP]: Delete.
2194 * configure.ac (AC_CHECK_FUNCS): Don't check for mkstemp.
2195 * src/m4.h (mkstemp) [! HAVE_MKSTEMP]: Prototype, if needed.
2196 * NEWS: Document this.
2198 * Makefile.am (EXTRA_DIST): Distribute gnulib-cache.m4.
2199 Reported by Bruno Haible.
2201 2006-06-21 Eric Blake <ebb9@byu.net>
2203 Avoid obsolete sigstack when POSIX sigaltstack is available.
2204 * src/m4.c: Blindly assume signal.h, since stackovf.c and gnulib
2206 * configure.ac (AC_CHECK_HEADERS): Likewise.
2207 (AC_CHECK_TYPES): New check for siginfo_t, since siginfo.h is
2208 obsolete and most hosts now have it in signal.h.
2209 (AC_CHECK_MEMBERS): New check for sigaction.sa_sigaction.
2210 (AC_CACHE_CHECK): Cache decision to use stackovf.
2211 (AC_EGREP_HEADER): Switch to AC_CHECK_TYPES.
2212 * src/stackovf.c (DEBUG_STACKOVF): Remove unused define.
2213 (SA_RESETHAND, SA_SIGINFO): Provide fallback definitions, to
2214 simplify later code.
2215 (PARAM_STACKOVF, PARAM_NOSTACKOVF): Move further away from NULL,
2216 in case of dereferencing a member of a NULL pointer.
2217 (sigsegv_handler) [HAVE_STRUCT_SIGACTION_SA_SIGACTION]: Define a
2219 (setup_stackovf_trap): Use NULL instead of 0 for pointers, use
2220 EXIT_FAILURE in error, indent preprocessor directives.
2221 [HAVE_SIGALTSTACK && HAVE_SIGINFO_T]: Depend on siginfo_t, not
2223 [HAVE_SIGACTION && defined SA_ONSTACK]: Prefer POSIX handler.
2224 Reported by Santiago Vila.
2226 2006-06-19 Eric Blake <ebb9@byu.net>
2230 2006-06-18 Andreas Buening <andreas.buening@nexgo.de> (tiny change)
2232 * checks/Makefile.in (PATH_SEPARATOR): New macro.
2233 (check, installcheck): Use it, for OS/2.
2235 2006-06-18 Eric Blake <ebb9@byu.net>
2237 Consistently use "GNU M4" as package name, "m4" as executable
2239 * NEWS: Document previous fix.
2241 * README: Fix grammar. Document that --enable-changeword is on
2243 * doc/m4.texinfo (Top, Changeword): Likewise.
2244 (Sysval): Enhance this test.
2245 (History): Backport this section from CVS head, and update.
2247 2006-06-18 Bruno Haible <bruno@clisp.org> (tiny change)
2248 Eric Blake <ebb9@byu.net>
2250 * src/builtin.c (WEXITSTATUS): Provide fallback definition.
2251 (m4_esyscmd): Set sysval to 0xffff, to accomodate both
2252 big-endian and little-endian wait status definitions.
2253 (m4_sysval): Use WEXITSTATUS.
2254 Reported by Andreas Buening.
2256 2006-06-18 Eric Blake <ebb9@byu.net>
2258 * configure.ac (AC_INIT): Bump version number.
2259 * NEWS: Describe changes in 1.4.4c.
2261 2006-06-17 Eric Blake <ebb9@byu.net>
2263 Beta Release 1.4.4b:
2264 * configure.ac (AC_INIT): Bump version number.
2265 * NEWS: Describe changes since 1.4.4.
2266 * Makefile.maint (cvs-news): Accomodate copyright line wrapping.
2268 * Makefile.am (MAINTAINERCLEANFILES): Clean files added by
2270 * checks/Makefile.in (maintainer-clean): Add missing target.
2271 * COPYING: Remove generated file from CVS.
2273 2006-06-16 Eric Blake <ebb9@byu.net>
2275 * checks/Makefile.in (DISTFILES): Distribute wrapfifo.m4.
2277 2006-06-15 Eric Blake <ebb9@byu.net>
2279 * checks/wrapfifo.m4: New file. Use it...
2280 * doc/m4.texinfo (Incompatibilities): here, in a new test case to
2281 demonstrate how to get POSIX behavior of m4wrap prior to m4 2.0.
2283 * src/m4.h (to_uchar): New function.
2284 * src/eval.c (eval_lex): Use it to avoid passing signed char to
2285 isdigit, isalpha, isupper, islower, isspace, isalnum.
2286 * src/builtin.c (expand_user_macro): Likewise.
2287 * src/format.c (format): Likewise.
2288 * src/macro.c (expand_argument): Likewise.
2289 * NEWS: Document this security fix.
2292 * src/symtab.c (lookup_symbol): Use invalid, not illegal.
2293 * src/freeze.c (reload_frozen_state): Fix typo in message.
2294 (produce_frozen_state): Standardize on builtin, not built-in.
2295 * src/builtin.c (numeric_arg, bad_argc): Likewise.
2297 * configure.ac (M4_EARLY, M4_INIT): Use gnulib.
2298 (AC_PROG_RANLIB, AC_AIX, AC_MINIX, AC_CHECK_HEADERS),
2299 (AC_FUNC_ALLOCA, AC_REPLACE_FUNCS): Avoid checks now done by
2301 * Makefile.am (ACLOCAL_AMFLAGS): New entry, for gnulib.
2302 * m4/gnulib-cache.m4: New file, from gnulib.
2303 * bootstrap: Invoke gnulib-tool --update.
2304 * src/m4.c (main): Cast away const.
2305 * NEWS: Document that regex is updated.
2308 2006-06-08 Eric Blake <ebb9@byu.net>
2310 * configure.ac (changeword): Work even when changeword is not a
2312 (AC_PROG_AWK, AC_PROG_INSTALL, AC_PROG_MAKE_SET, AC_HEADER_STDC):
2313 Delete; now done by automake.
2314 (AC_ISC_POSIX, AC_C_CONST): Delete; now obsolete.
2316 2006-06-07 Eric Blake <ebb9@byu.net>
2318 * lib/regex.c (bcmp_translate): Canonicalize type name.
2319 * doc/Makefile.am (MAINTAINERCLEANFILES): Fix typo.
2320 * configure.ac (changeword): Disable changeword for the creation
2321 of configure, in case of bootstrapping with an m4 configured with
2322 --enable-changeword.
2324 Distribute a rudimentary man page.
2325 * Makefile.am (SUBDIRS): Move doc after src so that 'm4 --help'
2327 * doc/Makefile.am (man_MANS, EXTRA_DIST, MAINTAINERDISTCLEAN),
2328 (SUFFIXES, m4.1): New macros and rules to build m4.1.
2330 2006-06-06 Eric Blake <ebb9@byu.net>
2332 * lib/regex.c (re_match_2_internal, bcmp_translate): Avoid
2333 compiler warnings at -O2.
2334 * lib/getopt.c (_getopt_internal): Likewise.
2336 Cleanup of previous patches.
2337 * src/input.c (struct input_block): Remove traced member.
2338 (push_macro, init_macro_token): Don't pass trace status around.
2339 * src/m4.h (struct token_data): Remove traced member.
2340 (struct symbol, struct builtin): Reduce unused space.
2341 (TOKEN_DATA_FUNC): Simplify.
2342 (TOKEN_DATA_FUNC_TRACED): Remove unused macro.
2343 (push_macro, define_builtin): Remove unused parameter.
2344 * src/builtin.c (define_builtin, builtin_init, define_macro),
2345 (m4_defn): Don't pass trace status around.
2346 * src/macro.c (expand_argument): Likewise.
2347 * src/freeze.c (reload_frozen_state): Likewise.
2348 * src/symtab.c: Whitespace cleanup.
2349 * NEWS: Clean up wording.
2350 * doc/m4.texinfo (Undefine, Dumpdef, Trace): Cleanup wording;
2351 ensure tests actually expose bugs prior to today's patches.
2353 Trace status of builtins is no longer inherited across
2354 define(...,defn(...)). Fixes bug that autom4te had been working
2356 * src/builtin.c (define_builtin): Don't override trace status.
2357 * doc/m4.texinfo (Trace): Add test for this.
2358 * NEWS: Document this.
2360 When changing macro definitions inside the arguments to the macro,
2361 consistently preserve the old definition that was in effect before
2362 argument collection, similar to the C pre-processor.
2363 Reported by John Brzustowski.
2364 * NEWS: Document this change.
2365 * doc/m4.texinfo (Macro Arguments, Undefine, Dumpdef): Document
2366 this policy, and add tests that expose core dumps prior to this
2368 * src/m4.h (struct symbol): New members to track when a symbol is
2369 still in use after removal from the symbol table.
2370 (SYMBOL_PENDING_EXPANSIONS, SYMBOL_DELETED): Define.
2371 (free_symbol): Prototype.
2372 * src/macro.c (expand_macro): Track pending expansions of a
2373 symbol. On completion, if a symbol is deleted and no longer
2374 pending, free its memory.
2375 * src/symtab.c (free_symbol): Export. Don't free memory if symbol
2377 (lookup_symbol) <SYMBOL_INSERT>: Create new entry when old entry
2379 (lookup_symbol) <SYMBOL_DELETE, SYMBOL_POPDEF>: Mark entries still
2380 in use as deleted and remove from the table without freeing
2382 (symtab_print_list) [DEBUG_SYM]: More debug output.
2384 * src/symtab.c (hack_all_symbols): Allow certain modifications of
2385 the symbol table during traversal.
2386 * src/builtin.c (set_trace): Replace SYMBOL_DELETE with
2387 SYMBOL_POPDEF, since only the latter is safe with
2390 Solve crash when passing "indir(`foo')" to "m4 -tfoo".
2391 * src/symtab.c (lookup_symbol) <SYMBOL_DELETE, SYMBOL_POPDEF>:
2392 Preserve placeholder when macro is being traced.
2393 * src/builtin.c (m4_ifdef, m4_indir): A traced but undefined
2394 symbol is not defined.
2395 (set_trace): Remove placeholder when no longer traced.
2396 (m4_traceon): On named traces, always reserve a slot in the
2398 (m4_traceoff): Don't warn about untracing a nonexistent symbol.
2399 * NEWS: Document new trace behavior.
2400 * doc/m4.texinfo (Trace): Tracing by name now consistently works
2401 no matter whether that macro is currently defined.
2402 (Incompatibilities): Document differences between traditional and
2405 2006-06-04 Paul Eggert <eggert@cs.ucla.edu> (tiny change)
2406 Eric Blake <ebb9@byu.net>
2408 * src/m4.h (hash_table_size): Now size_t instead of int.
2409 * src/m4.c (hash_table_size): Likewise.
2410 (main): Adjust to this; use atol rather than atoi.
2411 * src/symtab.c: Include <limits.h>, for CHAR_BIT.
2412 (symtab_init, lookup_symbol, hack_all_symbols):
2413 Use size_t for sizes and indexes, not int.
2414 (symtab_print_list) [DEBUG_SYM]: Likewise.
2415 (hash): Likewise. Don't case-fold in the hash function.
2416 Shift by 7, not 3, for consistency with gnulib/lib/hash.c.
2417 Don't assume hash word is 32 bits.
2418 * NEWS: Document this change.
2420 2006-06-04 Eric Blake <ebb9@byu.net>
2422 * src/symtab.c (symtab_debug, symtab_print_list) [DEBUG_SYM]: Fix
2423 to allow compilation, for use in debugger.
2424 (profiles, current_mode) [DEBUG_SYM]: New variables.
2425 (show_profile, profile_strcmp) [DEBUG_SYM]: New methods for
2426 determining hash table performance.
2428 2006-05-31 Eric Blake <ebb9@byu.net>
2429 John Brzustowski <jbrzusto@fastmail.fm>
2431 * src/input.c (input_stack): Delete; use current_input instead.
2432 (wrapup_stack): Dynamically allocate, so that recursion is handled
2434 (push_wrapup): Use current wrapup stack.
2435 (pop_wrapup): Rotate wrapup stack to current, and create new
2437 (input_init): Dynamically allocate stacks.
2438 * NEWS: Update, now that recursive m4wrap can no longer cause
2441 2006-05-31 Eric Blake <ebb9@byu.net>
2443 * lib/getopt.c: Fix copyright year.
2444 * lib/obstack.c: Ditto.
2445 * src/builtin.c: Ditto.
2447 2006-05-30 Eric Blake <ebb9@byu.net>
2449 * doc/m4.texinfo (M4wrap): Add test to expose m4wrap bug.
2450 Reported by John Brzustowski.
2451 (Incompatibilities): Document known POSIX incompatibilities.
2454 2006-05-29 Eric Blake <ebb9@byu.net>
2456 * doc/m4.texinfo (Maketemp): Work even when running 'make check'
2460 * Makefile.am: New file.
2461 * doc/Makefile.am: Ditto.
2462 * examples/Makefile.am: Ditto.
2463 * lib/Makefile.am: Ditto.
2464 * src/Makefile.am: Ditto.
2465 * acinclude.m4: New file, renamed from aclocal.m4.
2466 * configure.ac (AM_INIT_AUTOMAKE): Invoke new macro.
2467 (AC_ARG_PROGRAM): Now redundant.
2468 (STACKOVF): Turn into automake conditional.
2469 (AC_CONFIG_COMMANDS): stamp-h is a command, not a file.
2470 * checks/Makefile.in: Converting this dir to automake was not
2471 trivial; for now, just add missing targets demanded by top-level.
2472 * INSTALL: Remove files that are now generated from CVS.
2473 * Makefile.in: Ditto.
2474 * aclocal.m4: Ditto.
2475 * install-sh: Ditto.
2476 * mkinstalldirs: Ditto.
2477 * doc/Makefile.in: Ditto.
2478 * doc/texinfo.tex: Ditto.
2479 * examples/Makefile.in: Ditto.
2480 * lib/Makefile.in: Ditto.
2481 * src/Makefile.in: Ditto.
2483 * AUTHORS: Backport from CVS head, and update.
2484 * doc/m4.texinfo (Changeword): Fix examples to match behavior.
2486 2006-05-27 Eric Blake <ebb9@byu.net>
2488 * lib/regex.c (regex_compile): Kill compiler warnings.
2489 * lib/getopt.c: Likewise.
2490 * lib/obstack.c: Likewise.
2491 * src/builtin.c (builtin_init): Likewise.
2492 * src/path.c (path_search): Likewise.
2494 * doc/m4.texinfo: Fix usage of a vs. an.
2495 (Loops, Include, Cleardiv, Patsubst, Format, M4exit): Kill
2496 overfull hbox warnings.
2497 (Inhibiting Invocation, Divert, Maketemp, M4exit): Add new tests.
2499 * configure.ac: Update to autoconf 2.59. Forbid ^M4_. Fix
2501 * aclocal.m4 (fp_PROG_CC_STDC): Delete; now covered by autoconf.
2502 (fp_C_PROTOTYPES): Delete, GNU Coding Standards state we can now
2504 (M4_WITH_DMALLOC): Rename from fp_WITH_DMALLOC. Fix quoting.
2505 * src/m4.h (_): PROTOTYPES is no longer provided, assume C89.
2506 * src/Makefile.in: Delete remains of ansi2knr.
2507 * src/ansi2knr.1: Delete.
2508 * src/ansi2knr.c: Delete.
2510 2006-05-25 Eric Blake <ebb9@byu.net>
2512 * doc/m4.texinfo: Fix spelling errors. Use `invalid' instead of
2515 * doc/m4.texinfo (Francois): No longer needed as a tex variable.
2516 Reported by Karl Berry.
2518 2006-05-24 Eric Blake <ebb9@byu.net>
2520 * Makefile.in (html): New target.
2521 * doc/Makefile.in (html, m4.html): Likewise.
2522 (MAKEINFOHTML): New macro.
2523 * doc/m4.texinfo (Francois) [ifnottex]: Use newer texinfo
2525 (Regexp) [ifhtml]: Make cross-reference to emacs manual an
2527 Reported by Bob Badour.
2529 * THANKS: Update. Move reporter's email addresses here, instead
2532 2006-05-11 Eric Blake <ebb9@byu.net>
2535 * doc/m4.texinfo (Changequote): Give testsuite exposure to bug
2536 patched on 2005-12-04.
2537 Reported by Ilya N. Golubev.
2539 * bootstrap: New file, so that generated files need not be stored
2541 * Makefile.in (DISTFILES): Add bootstrap.
2543 Make testsuite less sensitive to doc changes.
2544 * doc/m4.texinfo: Use m4.input instead of filename.
2545 * checks/check-them (xerr): Turn m4.input into filename.
2546 * checks/Makefile.in (dist): Depend on stamp-checks.
2548 Portability updates for OS/2.
2549 * src/Makefile.in (EXEEXT, OBJEXT): Define.
2552 * lib/Makefile.in (OBJEXT): Define.
2554 * doc/Makefile.in (install, uninstall): Install info files into
2556 Reported by Andreas Buening.
2558 2006-05-09 Eric Blake <ebb9@byu.net>
2560 * install-sh: Update to newer upstream version.
2561 * mkinstalldirs: Likewise.
2562 Reported by Andreas Buening.
2564 * src/m4.c (main): Bump copyright year.
2565 * Makefile.in (datarootdir): Define, for autoconf 2.59c.
2566 * doc/Makefile.in (datarootdir): Likewise.
2568 2006-05-08 Eric Blake <ebb9@byu.net>
2571 * doc/m4.texinfo (Bugs): Backport bug email address from head.
2572 Reported by Stepan Kasal.
2574 2005-12-04 Ilya N. Golubev <gin@mo.msk.ru> (tiny change)
2576 * input.c (match_input): Do not pass expression with side effect
2577 to `obstack_grow'. Fix <INTERNAL ERROR: Recursive push_string!>.
2580 2005-12-04 Gary V. Vaughan <gary@gnu.org> (tiny change)
2582 * doc/m4.texinfo (How to debug macros and input): s/woould/would/
2583 Reported by Damian Menscher.
2585 2005-10-19 Gary V. Vaughan <gary@gnu.org> (tiny change)
2587 * configure.ac (AC_INIT): Bump to 1.4.4a.
2589 2005-10-19 Gary V. Vaughan <gary@gnu.org> (tiny change)
2592 * configure.ac (AC_INIT): Bump to 1.4.4.
2593 * NEWS: Describe 1.4.4's changes.
2594 * INSTALL, install-sh, doc/texinfo.tex: Updated from upstream.
2596 2005-10-17 John Gatewood Ham <zappaman@buraphalinux.org> (tiny change)
2598 * src/m4.c: fix return code when non-existent files are processed
2600 2005-10-17 John Gatewood Ham <zappaman@buraphalinux.org> (tiny change)
2602 * README: update email address for bug reports.
2604 2005-10-17 Gary V. Vaughan <gary@gnu.org>
2606 * doc/m4.info: Generated files are not kept in the repository.
2608 2005-05-01 Gary V. Vaughan <gary@gnu.org>
2610 The FSF are moving offices today. Changed their contact address
2611 in all files from `59 Temple Place, Suite 330, MA 02111-1307' to
2612 `51 Franklin Street, Fifth Floor, MA 02110-1301'.
2614 Also, some of the files here were never updated from the previous
2615 '675 Mass Ave, Cambridge, MA 02139', so changed those to the
2616 '51 Franklin Street, Fifth Floor, MA 02110-1301' address too.
2618 2005-03-31 Mike Frysinger <vapier@gentoo.org>
2620 * Makefile.in (bindir, infodir): Substitute from configure rather
2622 * doc/Makefile.in (infodir): Ditto.
2623 * src/Makefile.in (bindir): Ditto.
2626 2005-03-31 Gary V. Vaughan <gary@gnu.org>
2628 Changes needed to automate the release process for 1.4.3:
2630 * Makefile.in (dist): Make .tar.bz2 tarball too.
2631 * Makefile.maint (TSDEPS_DIST): Remove m4/libtool.m4.
2632 (cvs-news): Look 1 line further down for NEWS release number.
2633 (cvs-dist): We don't use automake, so make dist is fine.
2634 Remove double . before suffixes.
2635 (cvs-release): Don't mention manual.html.
2636 (fetch): Get latest gendocs files.
2637 (web-manual): Rewritten to use gendoc for multiformat manuals.
2638 * doc/gendocs.sh: Don't save an old version in m4 CVS!
2639 * doc/m4.texinfo (Index): HFS+ (the file system on my Mac) is case
2640 preserving, but case insensitive, so generating html docs per node
2641 clashes between Index.html, the node file, and index.html, the
2642 top-level of the document tree...
2643 (Index macro): ...so renamed to this. Changed all references.
2645 2005-03-31 Gary V. Vaughan <gary@gnu.org> (tiny change)
2647 * configure.ac (AC_INIT): Bump to 1.4.3a.
2649 2005-03-31 Gary V. Vaughan <gary@gnu.org> (tiny change)
2652 * configure.in (AC_INIT): Bump to 1.4.3.
2653 * NEWS: Describe 1.4.3's changes.
2655 2005-03-31 Gary V. Vaughan <gary@gnu.org>
2657 * Makefile.maint: New file with release rules, from CVS libtool.
2658 * Makefile.in (DISTFILES): Add Makefile.maint.
2659 * INSTALL, install-sh, doc/texinfo.tex: Updated to latest
2662 2005-03-31 Eric Blake <ebb9@byu.net> (tiny change)
2664 * doc/m4.texinfo (Patsubst): Re-add trailing space required by
2665 checks/47.patsubst, with a redundant @comment to prevent emacs
2666 from removing it accidentally again.
2667 * checks/get-them: Allow for trailing spaces tucked behind
2670 2005-03-31 Eric Blake <ebb9@byu.net> (tiny change)
2672 * doc/Makefile.in (install, uninstall): Accomodate DESTDIR.
2673 * src/Makefile.in (install, uninstall): Likewise.
2675 2005-02-07 Gary V. Vaughan <gary@gnu.org>
2677 * lib/regex.c, lib/regex.h: Reverted gnulib update, which broke
2679 Reported by Eric Blake.
2681 2005-02-04 Gary V. Vaughan <gary@gnu.org>
2683 * lib/regex.c, lib/regex.h: Updated from gnulib.
2684 * src/input.c (set_word_regexp): Don't change the word_regexp
2685 unless it compiles correctly.
2687 Reported by Frank Schwidom.
2689 * Makefile.in (stamp-h): Regenerate config.h properly.
2691 2005-02-03 Gary V. Vaughan <gary@gnu.org>
2693 * configure.ac (AC_DEFINE): Fix overquoting of description
2696 * src/m4.h (__CYGWIN__, WIN32): Canonicalise Windows and Cygwin
2698 * src/freeze.c (produce_frozen_state): Use \n line-endings even
2699 on Windows, so that the frozen file reader will work.
2700 Reported by Josef T. Burger.
2702 * src/m4.c (main): Modernise the --version output.
2704 2005-02-03 Gary V. Vaughan <gary@gnu.org>
2706 Modernise the configury a little to prevent spurious errors from
2707 Autoconf-2.59's autoreconf:
2709 * config.h.in: Renamed to...
2710 * config-h.in: ...this to better support DOS 8.3 file systems.
2711 * acconfig.h: Removed.
2712 * configure.in: Renamed to...
2713 * configure.ac: ...this, and AC_DEFINE used to declare config.h
2714 entry comments. Slight reorganisation and reformatting.
2715 * aclocal.m4: Use third argument to AC_DEFINE to declare config.h
2717 (AC_INIT): Use a modern 3 argument call.
2718 * Makefile.in, checks/Makefile.in, doc/Makefile.in,
2719 examples/Makefile.in, lib/Makefile.in, src/Makefile.in:
2720 s/PRODUCT/PACKAGE/g.
2721 * Makefile.in (DISTFILES): Removed acconfig.h, configure.in,
2722 config.h.in. Added configure.ac, config-h.in.
2723 (stamp-h.in): Removed acconfig.h from dependencies.
2724 (configure): Depends on configure.ac, not configure.in.
2725 * doc/Makefile.in (stamp-vti): Ditto.
2726 * src/freeze.c (produce_frozen_state), src/m4.c (main): Adjust for
2727 difference between PRODUCT="m4" and PACKAGE="GNU M4".
2728 * configure: Regenerated.
2730 2005-02-03 Noah Misch <noah@cs.caltech.edu>
2732 * src/output.c (mkstemp): Make non-static, and build regardless of
2733 HAVE_TMPFILE; src/builtin.c also needs this replacement.
2736 2004-09-09 Vincent Lonngren <Vincent.lonngren.759@student.lu.se>
2738 * configure.in (AC_CHECK_HEADERS): Commit works best when you save
2739 changes from your editor buffer first.
2741 * configure.in (AC_CHECK_HEADERS): Add signal.h, sys/signal.h.
2742 * src/m4.c: And include them as appropriate.
2745 2004-09-09 Andreas Schwab <schwab@suse.de>
2747 Refactoring of the string read case in next_char provides about a
2748 20% speedup of M4 as typically used by autoconf:
2750 * src/input.c (next_char_1): Renamed from next_char.
2751 (next_char): New macro.
2754 2004-08-21 Gary V. Vaughan <gary@gnu.org>
2756 * configure.in (VERSION): Bump to 1.4.2a.
2758 2004-08-19 Paul Eggert <eggert@twinsun.com>
2761 * configure.in (VERSION): Bump to 1.4.2.
2762 * News: Describe 1.4.2's changes.
2764 * src/m4.c (reference_error): Preserve errno, since M4ERROR
2766 * src/builtin.c (m4_esyscmd): Clear errno before calling popen.
2767 (m4_maketemp): Clear errno before calling mkstemp.
2768 * src/path.c (path_search): Don't let "free" trash errno when
2770 * src/output.c (insert_file): Don't assume errno has a valid
2771 value simply because fread returns zero. This fixes a
2772 portability bug reported by Marion Hakanson in
2773 <http://lists.gnu.org/archive/html/bug-m4/2004-07/msg00029.html>.
2775 2004-06-09 Gary V. Vaughan <gary@gnu.org>
2777 * configure.in (VERSION): Bump to 1.4.1a.
2778 * NEWS: Place holder for next stable release.
2780 2004-06-03 Paul Eggert <eggert@cs.ucla.edu>
2783 * configure.in (VERSION): Bump to 1.4.1.
2784 * NEWS: Describe 1.4.1's changes.
2786 * aclocal.m4 (fp_PROG_CC_STDC): Use AC_DEFUN, not define, to
2787 pacify Autoconf 2.59.
2789 * doc/m4.texinfo: Insert commas after @xref's that lack them,
2790 to pacify Texinfo 4.7.
2791 * doc/Makefile.in (info): Remove info-1, info-2, info-3.
2793 * src/m4.h, src/debug.c: Use #ifdef __STDC__, not #if __STDC__, to
2794 pacify Sun C compilers.
2796 2003-09-28 Akim Demaille <akim@epita.fr>
2798 * src/symtab.c (lookup_symbol): Fix an uninitialized-variable
2801 2003-09-03 Santiago Vila <sanvila@debian.org>
2803 * examples/stackovf.sh: Use tempfile if available.
2805 2001-04-02 Robert Bihlmeyer <robbe@orcus.priv.at>
2807 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=92629
2808 * src/output.c (m4_insert_file): Do not mix buffered and
2809 unbuffered I/O, as this breaks on the Hurd. (trivial change)
2811 2001-02-01 Santiago Vila <sanvila@debian.org>
2813 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=84451
2814 * src/m4.c (main): Fix format vulnerabilities. (trivial change)
2816 2001-02-01 Matt Kraai <kraai@debian.org>
2818 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=84416
2819 * doc/m4.texinfo (Maketemp): Change maketemp to refer to a new,
2820 empty file rather than to a nonexistent file. This closes a common
2822 * src/builtin.c (m4_maketemp): Implement the above, by using
2823 mkstemp rather than mktemp. (trivial change)
2825 2000-01-09 Akim Demaille <demaille@inf.enst.fr>
2827 * src/builtin.c (expand_ranges): Added break after trailing dash.
2828 This caused misbehaviors on some systems.
2830 Sat Nov 5 15:52:47 1994 Francois Pinard (pinard@icule)
2833 * doc/Makefile.in (realclean): Also remove stamp-vti.
2834 Reported by Eric Backus.
2836 Wed Nov 2 00:47:53 1994 Francois Pinard (pinard@icule)
2838 * src/freeze.c (produce_frozen_state): If the frozen file cannot
2839 be opened, return immediately after producing the error message.
2840 Reported by Andreas Schwab.
2842 * configure.in: Check for const only after having found possible
2843 ANSIfying compiler flags, this is of no use to check it before.
2844 Reported by Alexander Lehmann.
2846 Tue Nov 1 22:02:37 1994 Francois Pinard (pinard@icule)
2848 * src/macro.c (collect_arguments): Cast obstack arguments to
2849 (voidstar), so avoiding compiler warnings.
2850 Reported by Joseph E. Sacco.
2852 * src/freeze.c (produce_frozen_state): Cast printed lengths to
2853 (int) so they correspond to %d format items.
2854 Reported by Joseph E. Sacco.
2856 * src/m4.c (main): Cast the argument to xfree to (voidstar).
2857 * src/symtab.c (free_symbol): Idem.
2858 Reported by Karl Vogel.
2860 Mon Oct 31 02:11:19 1994 Francois Pinard (pinard@icule)
2862 * Makefile.in (DISTFILES): Distribute BACKLOG.
2864 * configure.in: Define PRODUCT and VERSION.
2865 * acconfig.h: Document PRODUCT and VERSION.
2866 * src/m4.c, src/freeze.c: Use PRODUCT and VERSION instead of the
2867 constant string m4 and variable or parameter named version.
2869 Sun Oct 30 08:13:03 1994 Francois Pinard (pinard@icule)
2871 * src/m4.h, src/debug.c: Replace all #ifdef __STDC__ by #if
2872 __STDC__. Alliant FX/2800 Concentrix 2.2 (i860-BSD4.3) compiler
2873 defines __STDC__ to 0, for indicating it is *not* ANSI!
2874 Reported by Kaveh R. Ghazi.
2876 * configure.in: Added obsolescent tests for AIX and Minix.
2878 * doc/Makefile.in (mostlyclean): Remove texclean in dependencies,
2879 which texclean does not exist anymore.
2880 Reported by Eric Backus, Jim Meyering, John David Anglin and
2883 Sat Oct 29 05:10:03 1994 Francois Pinard (pinard@icule)
2885 * aclocal.m4 (fp_C_PROTOTYPES): Force -D_HPUX_SOURCE with -Aa.
2886 Reported by John David Anglin.
2888 * src/ansi2knr.c: New version, sent by Peter Deutsch.
2889 * aclocal.m4 (fp_C_PROTOTYPES): Substitute empty or ansi2knr for
2890 ANSI2KNR, depending on the fact the compiler is ANSI or not.
2891 * src/Makefile.in: Use -Ovarargs=convert on ansi2knr calls.
2892 Remove the sed filter after ansi2knr for debug.c. Use $O instead
2893 of $U, put underline in extensions rather than in basenames. Use
2894 implicit rules, now that regularity makes this possible.
2895 Have $(OBJECTS) depend on $(ANSI2KNR), so to trigger compilation
2896 of ansi2knr whenever it is needed.
2897 * configure.in: Adjusted for correct STACKOVF substitution.
2898 * src/debug.c (trace_format): When not __STDC__, use (...) as a
2899 parameter list, so ansi2knr will convert it to (va_alist) va_dcl.
2900 Reported by David MacKenzie.
2902 * Makefile.in: Remove binprefix. Use transform_name instead.
2903 Reported by David MacKenzie.
2905 * doc/Makefile.in: Create version.texi, use it, clean it.
2906 Reported by Jim Meyering.
2908 Fri Oct 28 20:33:55 1994 Francois Pinard (pinard@icule)
2910 * Makefile.in (all, install, uninstall): Depend on Makefile.
2912 * Makefile.in: For actions invoking $(MAKE) from within compound
2913 sh statements, exit non-zero if the sub-make fails. Otherwise,
2914 the top-level make may exit successfully when it should fail.
2915 Reported by Jim Kingdon.
2917 * {,/*}Makefile.in: Use && after all cd, in case they fail.
2919 * {,*/}Makefile.in: Declare PRODUCT and VERSION macros.
2920 (dist): Use PRODUCT and VERSION instead of tricks on .fname.
2921 * configure.in: Substitute PRODUCT and VERSION.
2923 * {,*/}Makefile.in (dist): Always try a hard link before a copy.
2925 Thu Oct 27 22:32:58 1994 Francois Pinard (pinard@icule)
2927 * Makefile.in (mostlyclean-local): Do not remove *~.
2928 * */Makefile.in (mostlyclean): Idem.
2929 Reported by Robert E. Brown and Richard Stallman.
2931 Sun Oct 9 08:30:13 1994 Francois Pinard (pinard@icule)
2933 * src/m4.h: Get rid of CONFIG_BROKETS.
2935 Sun Oct 2 16:48:10 1994 Francois Pinard (pinard@icule)
2937 * configure.in: Use AC_ARG_PROGRAM.
2938 * aclocal.m4 (fp_C_PROTOTYPES): Substitute @kr@ by kr or empty.
2939 Reported by David MacKenzie.
2941 Sat Oct 1 11:22:42 1994 Francois Pinard (pinard@icule)
2943 * configure.in: Do not add -O to CFLAGS for GNU C, now that
2944 configure does it automatically.
2945 Reported by Jim Meyering.
2947 Fri Sep 23 08:16:58 1994 Francois Pinard (pinard@icule)
2949 * src/stackovf.c: Declare the handler_t typedef earlier in the
2950 code, use it for stackovf_handler.
2951 (setup_stackovf_trap): Use RETSIGTYPE instead of void while
2952 casting sigsegv_handler.
2953 Reported by Robert Bernstein.
2955 * src/m4.c (main): Initialize program_name to argv[0] without
2957 Reported by Karl Berry.
2959 Sun Sep 18 11:42:50 1994 Francois Pinard (pinard@icule)
2961 * src/Makefile.in (TAGS): Include a ../lib/TAGS reference.
2962 Reported by Karl Berry.
2964 Wed Sep 14 10:00:22 1994 Francois Pinard (pinard@icule)
2966 * lib/Makefile.in (mostlyclean): Added.
2967 (TAGS): Make in $(srcdir).
2969 * configure.in: Use `choke me' in test, like everywhere!
2971 * {doc,examples,lib,src}/Makefile.in (check): Deleted, as
2972 unreacheable and useless.
2974 * doc/Makefile.in (texclean): Deleted, merged in mostlyclean.
2976 * lib/Makefile.in (DISTFILES): Distribute TAGS.
2977 (distclean): Do not remove TAGS.
2978 (realclean): Remove it.
2979 * Makefile.in: Make TAGS in lib also, not just in src.
2980 Reported by Karl Berry.
2982 * Makefile.in (distclean, realclean): Instead of recursively
2983 calling $(MAKE) for the -local part, allow parallel execution of
2984 -recursive and -local, only delay the removal of config.status,
2985 which is repeated in both goals.
2987 Tue Sep 13 19:21:05 1994 Francois Pinard (pinard@icule)
2990 * Makefile.in: Group all *clean-recursive goals in one, using sed
2991 to remove `-recursive' while calling make recursively. Also, use
2992 a subshell for each recursive $(MAKE).
2993 Reported by Jim Meyering.
2995 * src/m4.h (memcpy): Define with bcopy for BSD systems.
2996 Reported by Kaveh R. Ghazi.
2998 * src/Makefile.in (ansi2knr): Use $(LIBS) while linking, for SunOS
2999 4.1.3 requires -ldl to link even ansik2nr, and we need a way to
3002 * configure.in: Use date instead of touch for stamp-h.
3003 * Makefile.in (stamp-h.in): Idem.
3005 * Makefile.in (distclean, realclean): Force serial execution of
3006 both goals, in case parallel makes are being used.
3007 Reported by Jim Meyering.
3009 * src/Makefile.in (DISTFILES): Distribute TAGS.
3010 (distclean): Do not remove TAGS.
3011 (realclean): Remove it.
3012 Reported by Karl Berry.
3014 Sat Sep 10 12:34:04 1994 Francois Pinard (pinard@icule)
3016 * configure.in: Use fp_ to match aclocal.m4. Revert _OS_ macros
3017 to old names, for following Autoconf.
3019 Thu Sep 8 15:07:27 1994 Francois Pinard (pinard@icule)
3021 * Makefile.in (MDEFINES): Remove INSTALL substitutions, for
3022 ./install.sh will not be correctly referred to in sub-Makefiles.
3023 Reported by John David Anglin.
3025 * doc/Makefile.in (texclean): Remove *.cps and *.fns too.
3026 Reported by Eric Backus.
3028 * Makefile.in, checks/Makefile.in, doc/Makefile.in,
3029 examples/Makefile.in, lib/Makefile.in, src/Makefile.in: Limit
3030 config.status into remaking this directory's Makefile only.
3031 * Makefile.in (stamp-h): Do not check nor touch stamp-h.
3032 * configure.in (AC_OUTPUT): Touch stamp-h if CONFIG_HEADERS.
3033 Reported by Jim Meyering.
3035 Tue Sep 6 12:07:33 1994 Francois Pinard (pinard@icule)
3037 * configure.in: Correct stack overflow detection logic, taking
3038 care of systems having only incomplete implementations (like for
3039 Pyramid 9820 OSx 5.0d).
3040 Reported by Kaveh R. Ghazi.
3042 * src/Makefile.in (TAGS): Remote -t from etags call.
3044 Fri Sep 2 10:37:10 1994 Francois Pinard (pinard@icule)
3046 * lib/Makefile.in (install): Depend on all.
3048 Wed Aug 31 11:17:21 1994 Francois Pinard (pinard@icule)
3050 * examples/Makefile.in (mostlyclean): Do not depend on texclean.
3051 Reported by Jim Meyering and John David Anglin.
3053 * Makefile.in (distclean-local): Delete config.log.
3054 Reported by Jim Meyering.
3056 Solidify frozen files with respect to -P:
3057 * src/m4.c: Have -P set prefix_all_buitins variable instead of
3058 calling a function by that name. Declare the variable.
3059 * src/m4.h: Adjust declaration for prefix_all_buitins.
3060 * src/builtin.c (builtin_init): Merge in functionality from
3061 previous prefix_all_buitins function, while making entries in the
3062 symbol table, but not modifying the builtin description itself.
3064 * src/freeze.c (reload_frozen_state): Add a useless `break;',
3065 because *many* compilers do not accept an empty `default:'.
3066 Reported by Akiko Matsushita, Eric Backus, John David Anglin,
3067 Joseph E. Sacco, Kaveh R. Ghazi, Tom McConnell and Ulrich Drepper.
3069 * configure.in: Use AC_TYPE_SIGNAL.
3070 * src/stackovf.c (setup_stackovf_trap): Use RETSIGTYPE.
3071 Reported by Robert Bernstein.
3073 * checks/Makefile.in (check): Modify PATH so check-them will find
3074 m4 in the src directory.
3075 * Makefile.in (check): Don't.
3076 Reported by Akiko Matsushita and Jim Meyering.
3078 * src/output.c (make_room_for, output_character_helper): New
3079 functions, for implementing a global MAXIMUM_TOTAL_SIZE instead of
3080 a per buffer MAXIMUM_BUFFER_SIZE.
3082 * src/output.c (output_text): New function, for optimizing the
3083 output of strings of characters. Use it.
3085 Tue Aug 30 01:44:29 1994 Francois Pinard (pinard@icule)
3087 * doc, src: New directories reorganizing the distribution.
3088 * doc/Makefile.in, src/Makefile.in, examples/Makefile.in: New
3090 * Makefile.in: Adjusted.
3091 * configure.in: Configure new Makefiles.
3093 * m4.h: Declare STRING typedef. Use it for comment and quote
3094 strings, adjusting all references. (This is the rudiments of a
3095 beginning for the eventual withdrawal of NUL terminated strings.)
3096 * output.c (shipout_text): Accept a length parameter, and use it.
3097 All callers adjusted.
3099 Mon Aug 29 12:27:19 1994 Francois Pinard (pinard@icule)
3101 * m4.h: Include <unistd.h> if it exists.
3102 * stackovf.c: Don't.
3104 Clean up for current_diversion variable:
3105 * output.c: Move current_diversion from builtin.c.
3106 * m4.h: Declare current_diversion so builtin.c can access it.
3107 * output.c (output_init, make_diversion): Initialize or update
3109 * builtin.c (builtin_init, m4_divert): Leave current_diversion
3112 Remove limit on number of diversions:
3113 * output.c: Replace ndiversion by diversions, declare it.
3114 (output_init): Allocate only diversion 0.
3115 (make_diversion): Allocate new diversions as needed.
3116 * m4.h, m4.c: Remove NDIVERSIONS and ndiversion related stuff.
3117 * m4.c: Still accept -N, but do nothing with it.
3118 Reported by David MacKenzie.
3121 * output.c (freeze_diversions): New function.
3122 * m4.h: Declare freeze_diversions.
3123 * freeze.c: Document frozen file format, revise it, call
3124 freeze_diversions to add diversions to frozen format, and code to
3125 reload them properly.
3126 * m4.c: Do not undivert automatically at end when status being
3127 frozen. Do not call builtin_init when reloading frozen state.
3129 Speed up diversion processing:
3130 * output.c: Add INITIAL_BUFFER_SIZE, MAXIMUM_BUFFER_SIZE,
3131 COPY_BUFFER_SIZE, in-memory diversion buffers, struct diversion
3132 structure and variables, cached variables out of output_diversion,
3133 reallocate_diversion_for and OUTPUT_CHARACTER.
3134 (shipout_text, make_diversion, insert_diversion): Adapted to new
3136 (insert_file): Use better buffering.
3137 Reported by David MacKenzie.
3139 Sun Aug 28 05:20:02 1994 Francois Pinard (pinard@icule)
3141 * Makefile.in, lib/Makefile.in, checks/Makefile.in: Arrange so
3142 dist works from another build directory.
3144 Sat Aug 27 14:32:45 1994 Francois Pinard (pinard@icule)
3146 * symtab.c (hack_all_symbols): Use hash_table_size instead of
3147 constant HASHMAX, for -H option to work better.
3149 * builtin.c (DECLARE): Simplify by using _ ().
3151 * freeze.c: New file.
3152 * Makefile.in: Compile it, distribute it.
3153 * m4.c: Recognize, document and process --freeze-state (-F) and
3154 --reload-state (-R) options. Pass a true flag to builtin_init
3155 only if no reloading some state.
3156 * builtin.c (define_builtin): Remove static specifier.
3157 (find_builtin_by_name): Remove static specifier.
3158 (builtin_init): Accept and obey a flag argument.
3159 * m4.h: Add declarations for freeze.c, changes for builtin.c.
3161 Wed Aug 24 16:14:19 1994 Francois Pinard (pinard@icule)
3163 * builtin.c (dumpdef_cmp): Rewrite so the cast protect the const
3166 * configure.in: Implement --with-dmalloc.
3167 * acconfig.h: Document WITH_DMALLOC.
3168 * m4.h: Add code for when WITH_DMALLOC.
3170 Mon Aug 15 12:38:05 1994 Francois Pinard (pinard@icule)
3172 * m4.c (long_options): Use "error-output", the dash was missing.
3173 Reported by Akiko Matsushita.
3175 Fri Aug 12 16:38:01 1994 Francois Pinard (pinard@icule)
3177 * m4.h: Include <sys/types.h>.
3178 * builtin.c, debug.c, m4.c, output.c, stackovf.c: Don't.
3179 * m4.h: Declare len_lquote and len_rquote as size_t, not int.
3181 * input.c: Declare len_lquote, len_rquote, len_bcomm and len_ecomm
3183 * builtin.c (dump_args): Declare len as size_t, not int.
3185 * debug.c: Prototype the forward declaration of debug_set_file.
3187 * builtin.c (m4_undivert): Replace div by file, for avoiding the
3188 shadowing of this variable.
3189 * output.c (insert_diversion): Idem.
3191 * input.c: Delete def_rquote, def_lquote, def_bcomm and def_ecomm.
3192 (input_init): Duplicate default quote and comment strings.
3193 (set_quotes): Free previous quote strings in all cases. Duplicate
3194 even default quote strings.
3195 (set_comment): Free previous comment strings in all cases.
3196 Duplicate even default comment strings.
3198 * configure.in: Updated for Autoconf 2.0.
3199 * Makefile.in (distclean-local): Also delete config.cache.
3201 * m4.c (usage): Reorganize the --help output by topic. Include a
3202 description for debugging flags.
3204 Fri Jul 29 10:15:52 1994 Francois Pinard (pinard@icule)
3206 * configure.in: If sigaction is available and SA_ONSTACK defined,
3207 use sigaction. Otherwise, if sigvec is available and SV_ONSTACK
3208 defined, use sigvec. Else don't compile stackovf.c.
3209 * stackovf.c (setup_stackovf_trap): Idem.
3210 Reported by Jim Avera, Karl Berry, Kaveh R. Ghazi, Matthias Rabe
3213 Thu Jul 21 22:43:17 1994 Francois Pinard (pinard@icule)
3215 * m4.c (usage): Replace printf par fputs.
3217 Mon Jul 18 23:48:23 1994 Francois Pinard (pinard@icule)
3221 Sun Jul 17 08:08:25 1994 Francois Pinard (pinard@icule)
3223 * configure.in: Check for sigaction and sigvec. Add a new delayed
3224 check for RLIMIT_STACK, combine in the checking for getrlimit.
3225 All those things are not universally available.
3226 * stackovf.c: Split setting up the trap handler and catching
3227 signals, for better taking care of various configure outcomes.
3228 * examples/stackovf.sh: Correct a typo.
3229 Reported by Eric Backus, Jim Avera and Jim Meyering.
3231 Sat Jul 16 20:36:19 1994 Francois Pinard (pinard@icule)
3233 * ansi2knr.c: New version sent by its author, Peter Deutsch.
3235 Fri Jul 15 14:36:21 1994 Francois Pinard (pinard@icule)
3237 * Makefile.in: Modify so parallel make will not try making
3238 lib/libm4.a twice simultaneously.
3239 Reported by Jim Meyering.
3241 Thu Jul 14 17:23:17 1994 Francois Pinard (pinard@icule)
3243 * stackovf.c (setup_stackovf_trap): Replace "Don't" by "Do not" in
3244 error message, for when no code possibility exists. Even if this
3245 line is completely #ifdef'ed out, it brings a syntax error.
3246 Reported by Andreas Schwab, Jim Meyering and Joseph E. Sacco.
3248 * Makefile.in (install): Have install depend on all too, for lib
3249 to be remade as needed.
3251 * examples/stackovf.sh: Try ksh, bsh and bash for shells
3252 providing ulimit, instead of using only ksh.
3253 Reported by Jim Avera and Joseph E. Sacco.
3255 Tue Jul 12 06:54:31 1994 Francois Pinard (pinard@icule)
3257 * Makefile.in (check): Have it depend on all instead of m4. In
3258 this way, a change in lib will be detected and processed.
3260 * builtin.c (numeric_arg): Use strtol and verify the conversion,
3261 instead of using sscanf which stops as soon as there is a
3262 non-digit in the input. Previously, incr(1xyzzy), eval(1,2xyzzy)
3263 and divert(1xyzzy) were all accepted without any warning or error
3265 * m4.h: Declare strtol as long if not including stdlib.h.
3266 * configure.in: Check for limits.h, and replace strtol if missing.
3267 * lib/Makefile.in: Substitute LIBOBJS. Distribute strtol.c.
3268 * lib/strtol.c: New file, from elsewhere.
3269 Reported by Andreas Schwab.
3271 Thu Jul 7 22:38:10 1994 Francois Pinard (pinard@icule)
3273 * macro.c (expand_macro): Cast value to (boolean) prior to
3274 assigning it to traced.
3275 Reported by Tom McConnell.
3277 * Makefile.in (m4): Always make all in lib first.
3278 Reported by Jim Meyering.
3280 Wed Jul 6 13:16:31 1994 Jim Avera (jima@netcom.com)
3282 * stackovf.c: Isolated OS-dependent sections; Improved portability,
3283 adding support for SunOS/BSD (sigvec, sigstack, and 4-parameter signal
3284 handlers), and a default error message if the fault address is not
3285 available (when neither siginfo.h nor BSD sigcontext are supported).
3286 * configure.in: Changes for stackovf.h: Check for sigcontext,
3287 sigaction, sigstack, and define rlim_t as int if necessary.
3288 * acconfig.h: Added HAVE_SIGCONTEXT and rlim_t.
3289 * examples/stackovf.sh: Run m4 -L99999999 to allow stack overflow.
3290 * ansi2knr.c: Fix for func-ptr args; convert "..." to varargs syntax.
3292 Tue Jul 5 19:13:54 1994 Francois Pinard (pinard@icule)
3294 * configure.in: Use AC_SET_MAKE.
3295 * Makefile.in: Use @SET_MAKE@.
3296 Reported by Jim Meyering.
3298 * checks/check-them: Do not trap on SIGQUIT or SIGALRM.
3299 Reported by Ian Taylor.
3301 Sat Jul 2 00:58:47 1994 Francois Pinard (pinard@icule)
3303 * configure.in: Remove dependency of USE_STACKOVF on STDC_HEADERS,
3304 because siginfo.h is unrelated to standard headers, and siginfo.h
3305 is already checked for.
3306 Reported by Joseph E. Sacco.
3308 * acconfig.h, aclocal.m4, m4.h: Replace HAVE_PROTOTYPES by
3310 * aclocal.m4, configure.in: Replace AC_HAVE_PROTOTYPES by
3313 Wed Jun 29 22:41:53 1994 Francois Pinard (pinard@icule)
3315 * builtin.c (substitute): Use \& to represent this part of the
3316 string which was matched by the whole regexp, instead of
3317 representing the whole string. Any usage of \0 issues a warning
3318 and acts like \&, it will disappear in some subsequent release.
3320 Mon Jun 27 14:24:23 1994 Francois Pinard (pinard@icule)
3322 * m4.c: Complete prototype for forwarded declaration of usage.
3324 * input.c (init_macro_token): Correct own reference in error
3325 message. Previous name get_macro_func was referred to instead.
3326 (next_char): Correct own reference in error message. Previous
3327 name advance_input was referred to instead.
3329 * m4.h: Declare eval_t and unsigned_eval_t typedefs to 32 bits.
3330 * eval.c (logical_or_term, logical_and_term, or_term, xor_term,
3331 and_term, not_term, logical_not_term, cmp_term, shift_term,
3332 add_term, mult_term, exp_term, unary_term, simple_term): Add
3333 prototype to forwarded declarations. Declare parameter v1 as
3334 eval_t * instead of int *. Same for local variable v2 in dyadic
3335 functions. Same for result in exp_term.
3336 * builtin.c (m4_eval): Declare value as eval_t instead of int.
3337 (ntoa): Declare value as eval_t instead of int. Declare uvalue as
3338 unsigned_eval_t instead of unsigned int. Change casts accordingly.
3339 (shipout_int): Cast first argument of ntoa to eval_t.
3340 Reported by Thorsten Ohl.
3342 * macro.c: Complete the prototypes of forwarded expand_macro and
3344 Reported by Thorsten Ohl.
3346 * m4.h: Define voidstar as void * or char * depending on __STDC__.
3347 The Ultrix 3.1 compiler cannot do much with void pointers.
3349 * builtin.c (dumpdef_cmp): Replace void * by voidstar.
3350 * m4.c (xfree): Replace void * by voidstar.
3351 Reported by Tom McConnell.
3353 * ansi2knr.1: New, from elsewhere.
3354 * Makefile.in (DISTFILES): Distribute ansi2knr.1
3356 * Makefile.in (stamp-h.in): Avoid running ./config.status if
3357 stamp-h does not exist yet. This avoids running it a second time
3358 just after the initial ./configure.
3359 Reported by David MacKenzie and Tom McConnell.
3361 * m4.h: Replace the enum debug_info declaration with a series of
3362 #define's. The Ultrix 3.1 compiler would otherwise need casting
3363 (int) to most references, when used in expressions.
3364 Reported by Tom McConnell.
3366 Sat Jun 25 00:10:05 1994 Francois Pinard (pinard@icule)
3368 * aclocal.m4: Replace FP_PROTOTYPES by AC_HAVE_PROTOTYPES,
3369 following an idea from Brook G. Milligan. AC_HAVE_PROTOTYPES
3370 calls the compiler. Previously, FP_PROTOTYPES was only calling
3371 the preprocessor; by not being subject to CFLAGS, this was
3372 discouraging those flags asking for ANSI compilation.
3373 * acconfig.h: Document HAVE_PROTOTYPES.
3374 * configure.in: Use AC_HAVE_PROTOTYPES instead of FP_PROTOTYPES.
3375 * m4.h: Define _() according to HAVE_PROTOTYPES, not __STDC__.
3376 Reported by Eric Backus.
3378 * configure.in: Substitute CFLAGS and LDFLAGS, taking their value
3379 from the environment. Default CFLAGS to -g if not set.
3380 * Makefile.in: Have CFLAGS and LDFLAGS substituted from configure.
3381 * lib/Makefile.in: Have CFLAGS substituted from configure.
3382 Reported by Eric Backus and Tom McConnell.
3384 * configure.in: m4_undefine changeword before using AC_ENABLE.
3386 * m4.h: Declare prototypes for error (for ANSI compilers only),
3387 prefix_all_builtins and reference_error.
3388 Reported by Tom McConnell.
3390 * input.c (set_word_regexp): Do not try to initialize the array
3391 test from a string, this does not work with non-ANSI compilers.
3392 Reported by Eric Backus.
3394 * Makefile.in (dist): Clean examples/ before saving it.
3395 (distclean-local): Also remove stamp-h.
3396 Reported by Eric Backus.
3398 * Makefile.in (_stackovf.c): Goal for compiling stacokovf.c with
3400 Reported by Tom McConnell.
3402 * checks/Makefile.in (clean): Depends on mostlyclean.
3403 (mostlyclean): New goal.
3405 Fri Jun 24 23:30:31 1994 Francois Pinard (pinard@icule)
3407 * Makefile.in (DISTFILES): Distribute install.sh.
3408 * install.sh: New file, copied from elsewhere.
3409 Reported by Assar Westerlund and Kaveh R. Ghazi.
3411 Thu Jun 23 00:00:30 1994 Francois Pinard (pinard@icule)
3413 * configure.in: Define ENABLE_CHANGEWORD if --enable-changeword.
3414 * acconfig.h: Explain ENABLE_CHANGEWORD.
3416 [These modifs all depend upon ENABLE_CHANGEWORD and are adapted
3417 from code provided by Pete Chown]
3418 * m4.h: Add original_text field to u_t variant of union u.
3419 Declare TOKEN_DATA_FUNC macro.
3420 * builtin.c: Declare changeword.
3421 (m4_changeword): New function.
3422 * input.c: Include "regex.h", define variables with word regexps.
3423 (input_init): Initialize the word regexp.
3424 (set_word_regexp): New.
3425 (next_token): Declare local variables, use the previous code if
3426 default_word_regexp is true. Else, match using a new code. Save
3428 * macro.c (expand_token): Ship out original text if not a macro
3430 Reported by Krste Asanovic and Pete Chown.
3432 [These modifs all depend upon ENABLE_CHANGEWORD]
3433 * m4.h: Declare external user_word_regexp.
3434 * m4.c: Declare user_word_regexp, and initialize it from
3435 --word-regexp or -W, or NULL if not specified.
3436 * input.c: Use user_word_regexp if specified, instead of
3437 DEFAULT_WORD_REGEXP.
3439 * Makefile.in (m4): Revert Jan 3 1994 change. I'm unable to
3442 * Makefile.in, lib/Makefile.in: Limit suffixes to .c and .o.
3443 * checks/Makefile.in: Empty the suffix list.
3444 Reported by Geoff Russell, Joel Sherrill and Roland McGrath.
3446 * m4.c: Declare nesting_limit and initialize it to 250.
3447 Implement -LNUMBER or --nesting-limit=NUMBER to change its
3449 * m4.h: Declare nesting_limit as external.
3450 * macro.c (expand_macro): Stop execution whenever nesting limit
3452 Reported by Bengt Mertensson.
3454 * eval.c (evaluate): Diagnose excess characters in eval input.
3455 Things like `eval(08)' used to return 0 with no diagnostic.
3457 * m4.h: Capitalize first letter of all macro arguments in
3460 * m4.c: Declare warning_status, initialize it to 0. Add new
3461 option -E, or --fatal-warnings, which sets warning_status to
3462 EXIT_FAILURE instead.
3463 * m4.h: Declare external warning_status. Define EXIT_SUCCESS and
3464 EXIT_FAILURE if not otherwise done by header files.
3465 * m4.c: Delete declarations for EXIT_SUCCESS and EXIT_FAILURE.
3466 * m4.c, input.c, output.c, symtab.c, builtin.c, macro.c, debug.c,
3467 eval.c: Replace 0 by warning_status and 1 by EXIT_FAILURE in first
3468 argument of all M4ERROR calls.
3469 Reported by Noah Friedman.
3471 * examples/incl-test.m4: Renamed from incl_test.m4.
3472 * examples/include.m4: Include incl-test.m4 instead of
3474 * examples/multiquotes.m4: Renamed from multi-quotes.m.
3476 Wed Jun 22 21:58:54 1994 Francois Pinard (pinard@icule)
3478 * configure.in: Avoid USE_STACKOVF if <siginfo.h> not found. Note
3479 that Jim developped stackovf.c on a 486 running SVR4.0 (ESIX), and
3480 also tested it on a Sun Sparc workstation running SunOS 4.x.
3482 * format.c (format): When not HAVE_EFGCVT, m4 was failing the
3483 49.format check, abusing a `union values' argument with sprintf
3484 without selecting the proper field. Now, save the formatting type
3485 first, delaying the fetch of the corresponding argument.
3486 Reported by Joseph E. Sacco and Tom Quinn.
3488 * format.c (format): Remove const from char *fmt declaration when
3489 not HAVE_EFGCVT, because a NUL may be forced into it.
3491 * m4.h: Declare atof() when not STDC_HEADERS.
3492 Reported by Joseph E. Sacco.
3494 * Regenerate configure using Autoconf 1.11, this corrects a
3495 problem about an incorrect cpp seting on NeXT 3.1.
3496 Reported by Alexander Lehmann.
3498 Sun Jun 5 16:25:19 1994 Francois Pinard (pinard@icule)
3500 * m4.h (_): Change argument from `x' to `Args'.
3502 Wed May 4 23:59:39 1994 Francois Pinard (pinard@icule)
3504 * Makefile.in: Remove all occurrences of $(MFLAGS), which were
3505 bringing more evil than good on a few systems.
3506 Reported by Greg A. Woods.
3508 Fri Apr 22 15:59:35 1994 Francois Pinard (pinard@icule)
3510 * m4.h: Rename Args() to _().
3511 * m4.h: Remove extern specifier from all function declarations.
3513 Fri Apr 22 15:51:21 1994 Jim Avera (jima@netcom.com)
3515 * stackovf.c: New file implementing stack-overflow detection.
3516 * configure.in: Check for getrlimit, sigaction. If all of
3517 standard headers, getrlimit and sigaction, define USE_STACKOVF and
3518 substitute ${U}stackovf.o for STACKOVF.
3519 * acconfig.h: Declare USE_STACKOVF.
3520 * Makefile.in: Distribute stackovf.c, link with $(STACKOVF).
3521 * m4.h: Declare setup_stackovf_trap().
3522 * m4.c: Call setup_stackovf_trap().
3523 * tests/stackovf_test.sh: New file.
3525 Wed Apr 13 14:10:30 1994 Francois Pinard (pinard@icule)
3527 * checks/Makefile.in: Rename .all-stamp to stamp-checks.
3529 * Makefile.in (Makefile, etc.): Adapt for Autoconf 1.8.
3531 Sun Jan 30 14:24:19 1994 (pinard at icule)
3533 * m4.h: Remove definition of volatile, not used anymore.
3534 Reported by Jim Meyering and Joseph E. Sacco.
3536 * m4.h: Consistently use `do { ... } while (0)' in macros, instead
3537 of `if ... else /* nothing */' for if macros.
3538 Reported by Jim Meyering.
3540 * builtin.c (m4_regexp): Reorganize the code for avoiding a
3541 warning from gcc about `repl' possibly used before defined.
3542 Reported by Jim Meyering.
3544 * m4.h: Avoid a pre-ANSI <memory.h> together with <string.h>.
3545 Reported by Jim Meyering.
3547 Tue Jan 25 18:39:37 1994 Francois Pinard (pinard at icule)
3549 * m4.h: Move the conditional definition of volatile after the
3550 inclusion of system files, because they may define it first.
3552 Tue Jan 4 19:46:50 1994 Francois Pinard (pinard@icule)
3554 * checks/Makefile.in (CHECKS): Add a useless `*' before `[', to
3555 get around a problem with Alpha make seeing a syntax error, there.
3556 Reported by Vern Paxson.
3558 Mon Jan 3 00:21:45 1994 Francois Pinard (pinard@icule)
3560 * Makefile.in: Do not define LDFLAGS, use CFLAGS on link calls.
3561 Reported by Richard Stallman.
3563 Sat Dec 25 08:06:05 1993 Francois Pinard (pinard@icule)
3565 * configure.in: Correct test for strerror, AC_FUNC_CHECK was used
3566 instead of AC_HAVE_FUNCS.
3567 Reported by Noah Friedman.
3569 Wed Dec 1 09:37:53 1993 Francois Pinard (pinard@icule)
3571 * m4.c: Initialize show_help and show_version to zero.
3573 * m4.c: Ensure EXIT_SUCCESS and EXIT_FAILURE are defined.
3574 Use them in exit() and usage() calls.
3576 Sat Nov 27 10:43:24 1993 Francois Pinard (pinard@icule)
3578 * m4.h: Delete extern sys_nerr, sys_errlist declarations, and
3579 syserr() macro. Delete errref, add reference_error and M4ERROR.
3580 * m4.c: Replace errref, which was returning an input reference
3581 string, with reference_error, which prints it on standard error.
3582 * builtin.c, output.c: Use errno as second parameter to error,
3583 instead of using syserr() with %s.
3584 * *.c: Use M4ERROR instead of error: no more errref() with %s.
3585 Doing so, the program name appears after the input reference
3586 instead of before, which eases M-x next-error processing.
3588 Wed Nov 24 22:16:15 1993 Francois Pinard (pinard@icule)
3590 * checks/get-them: Escape braces with backslashes in patterns,
3591 because HPUX-9.01 awk needs this.
3592 Reported by Jim Meyering.
3594 Mon Nov 22 10:55:52 1993 Francois Pinard (pinard@icule)
3596 * builtin.c: Declare "FILE *popen ();".
3598 * m4.h: Remove MESSAGE{,1,2}, WARNING1, FATAL{,1}, INTERNAL_ERROR
3599 macros, replace error_message_prefix() declaration by errref()'s.
3600 Declare xrealloc, for use in errref().
3601 * m4.c: Delete error_message_prefix() function, add errref().
3602 * *.c: Use error() systematically in place of all error macros,
3603 now that error() flushes stdout first. Make needed adjustments.
3605 * m4.h: Remove const in sys_errlist[] declaration, it creates
3606 conflicts on SGI and Alpha.
3607 Reported by Kaveh R. Ghazi.
3609 Sat Nov 20 08:26:15 1993 Francois Pinard (pinard@icule)
3611 * m4.c: Include <getopt.h> instead of "getopt.h".
3613 * configure.in: Output to config.h. Use HAVE_FUNCS preferably.
3614 * acconfig.h: New, for documenting HAVE_EFGCVT.
3615 * Makefile.in: Distribute acconfig.h, .stamp-h.in and config.h.in,
3616 use them wherever appropriate. Also use -I. for compilations.
3617 * lib/Makefile.in: Use -I.. for compilations.
3618 * *.c: Include <config.h> or "config.h".
3620 * m4.h: Test for HAVE_MEMORY_H instead of NEED_MEMORY_H.
3621 * configure.in: Use AC_HAVE_HEADERS(memory.h), delete AC_MEMORY_H.
3623 Wed Nov 17 09:34:55 1993 Francois Pinard (pinard@icule)
3625 * builtin.c (m4_eval): Cast strlen to (int) before comparing.
3627 * input.c (input_init): Initialize quote and comment strings
3628 explicitely instead of calling set_quotes and set_comment: by
3629 doing so, we ensure we do not free uninitialized variables.
3631 * checks/check-them: Reverse arguments to both diff, so the
3632 expected is on the left and the obtained on the right.
3634 * m4.h: Add MESSAGE{,1,2}, WARNING1, FATAL{,1} and INTERNAL_ERROR
3635 macros. Delete declarations for m4error, warning, fatal and
3636 internal_error, add declaration for error_message_prefix.
3637 * m4.c: Delete m4error, warning, fatal and internal_error
3638 routines, add error_message_prefix routine.
3639 * *.c: Replace m4error routine calls with MESSAGE* macro calls,
3640 warning with WARNING*, fatal with FATAL* and internal_error with
3642 * Makefile.in (_m4.c): Do not adjust ansi2knr output for va_alist,
3643 this is not needed anymore.
3645 * m4.h: Declare extern FILE *debug. Add DEBUG_PRINT{1,3} and
3646 DEBUG_MESSAGE{,1,2} macros. Delete declarations for debug_print
3647 and debug_message, add declaration for debug_message_prefix.
3648 * debug.c: Remove static specifier for FILE *debug declaration.
3649 Delete debug_print and debug_message routines, add
3650 debug_message_prefix routine.
3651 * builtin.c, debug.c: Replace debug_print routine calls with
3652 DEBUG_PRINT* macro calls.
3653 * input.c, path.c: Replace debug_message routine calls with
3654 DEBUG_MESSAGE* macro calls.
3656 * m4.h: Remove inclusion of <varargs.h>.
3657 * debug.c: Include <stdarg.h> or <varargs.h>.
3658 (trace_format): Use stdarg instead of varargs if __STDC__.
3660 * configure.in: Remove checks for vfprintf and _doprnt. These
3661 implementations use varargs tricks which are not portable enough.
3662 * lib/vfprintf.c: Deleted.
3663 * lib/_doprnt.c: Deleted.
3664 * lib/Makefile.in: Adjusted accordingly. Remove LIBOBJS.
3665 Reported by Joel Sherrill.
3667 * path.c (add_include_directory): Use xstrdup.
3669 * builtin.c (find_builtin_by_name): Declare static.
3671 * *.[ch]: Add const to a few "char *" declarations.
3673 * configure.in: Remove commented tests for fileno() and fstat().
3674 * debug.c: Remove comments about HAVE_FILENO and HAVE_FSTAT.
3676 * debug.c (debug_flush_files): New.
3677 * m4.h: Declares it.
3678 * builtin.c (m4_syscmd, m4_esyscmd): Use it.
3679 Reported by Nicolas Pioch.
3681 Fri Nov 12 10:02:26 1993 Francois Pinard (pinard@icule)
3683 * Makefile.in (m4.dvi): Use m4.texinfo instead of m4.texi.
3684 Reported by Joel Sherrill.
3686 * builtin.c (prefix_all_builtins): Instead of the table size, use
3687 the null entry at end for stopping the loop. It was overwritten.
3688 Reported by Andreas Schwab and Jim Meyering.
3690 * builtin.c (prefix_all_builtins): Cast xmalloc to (char *).
3691 Reported by Kaveh R. Ghazi.
3693 * macro.c (call_macro): Add * in (*SYMBOL_FUNC (sym)) (...).
3694 Reported by Karl Vogel.
3696 Tue Nov 9 09:31:47 1993 Francois Pinard (pinard@icule)
3698 * m4.h: Do not define volatile if already defined.
3699 Reported by Rene' Seindal.
3701 * lib/Makefile.in: Add a forgotten ALLOCA=@ALLOCA@. Grrr!
3703 Reported by Bernhard Daeubler, Eric Backus, Hal Peterson, Hoang
3704 Uong, Ian Taylor, Kaveh R. Ghazi, Tom McConnell and Walter Wong.
3706 Mon Nov 8 21:11:44 1993 Francois Pinard (pinard@icule)
3708 * m4.h: Define strchr and strrchr in terms of index and rindex,
3709 instead of the other way around.
3710 * builtin.c, m4.c, path.c: Use strchr instead of index.
3712 * input.c (next_char): Remove a "break;" after a "return ...;".
3713 Reported by Tom McConnell.
3715 Mon Nov 8 12:45:34 1993 Francois Pinard (pinard@icule)
3719 * configure.in: Do not copy check files in the build hierarchy.
3720 * checks/check-them: Identify the m4 version being checked. For
3721 finding m4, look in $PATH instead of in the parent directory.
3722 * Makefile.in (check): Prepend `pwd` to $PATH before checking.
3723 * checks/Makefile.in (.all-stamp): Always create check files in
3724 the source hierarchy, not anymore in the build hierarchy.
3725 (check): cd to the source hierarchy before performing checks.
3726 Do not copy nor clean COPYING anymore, take it from `..'.
3727 Reported by Tom McConnell.
3729 * Makefile.in (Makefile): Use $(SHELL).
3730 (config.status): Use $(SHELL). Use "config.status --recheck"
3731 instead of "configure --no-create", which is obsolete.
3732 Reported by Tom McConnell.
3734 Fri Nov 5 09:49:30 1993 Francois Pinard (pinard@compy.IRO.UMontreal.CA)
3736 * m4.c (usage): Use "%s" instead of "m4" in format string.
3737 Reported by Jim Meyering.
3739 * Makefile.in: Distribute mkinstalldirs.
3740 Reported by Pierre Gaumond.
3741 Reported by Jim Meyering.
3742 Reported by Tom McConnell.
3743 Reported by Andreas Gustafsson.
3745 * checks/check-them: Renamed from checks/check_them.
3746 * checks/get-them: Renamed from checks/get_them.
3747 * checks/.all-stamp: Renamed from checks/.all_stamp.
3748 * checks/Makefile.in: Changed accordingly.
3749 Reported by Jim Meyering.
3751 Thu Nov 4 13:50:52 1993 Francois Pinard (pinard@lagrande.IRO.UMontreal.CA)
3753 * lib/Makefile.in (dist): Correct permissions on files.
3755 * output.c: Declare tmpfile, some systems don't.
3757 Wed Nov 3 09:09:16 1993 Francois Pinard (pinard@icule)
3759 * checks/Makefile.in (dist): Correct permissions on files.
3761 * Makefile.in (dist): Ensure recursive linking for subdirectory
3762 `examples', also set read/write permissions on all its files.
3764 * mkinstalldirs: New, from elsewhere.
3765 * Makefile.in: Use it.
3767 * debug.c: Synchronize debug messages and regular output when
3768 the debug file and stdout are redirected to the same file.
3769 * configure.in: Add (commented) checks for fileno and fstat.
3770 Reported by Jim Avera.
3772 * builtin.c (m4_ifelse): Diagnose excess arguments if 5, 8, 11,
3773 etc., arguments, then ignore the superfluous one. m4 used to
3774 diagnose missing arguments and return the empty string.
3775 Reported by Nick S. Kanakakorn.
3777 Tue Nov 2 00:55:41 1993 Francois Pinard (pinard@icule)
3779 * m4.c (main): At end of all input, ensure all undiverted text
3780 goes to the main output stream.
3781 Reported by Andreas Gustafsson.
3783 * m4.c (main): exit (0), instead of return 0.
3785 * m4.c: Implement -P and --prefix-builtins.
3786 * builtin.c: Delete const specifier on builtin_tab.
3787 (prefix_all_builtins): New.
3788 Reported by Noah Friedman.
3789 Reported by Scott Bartram.
3791 * c-boxes.el: New, from elsewhere.
3792 * Makefile.in: Distribute it.
3794 * m4.h: Do not define bcopy if <string.h> defines it.
3795 Reported by Stephen Perkins.
3797 * builtin.c (define_macro): Allow a missing second argument, in
3798 which case it is implied empty. Affects define and pushdef.
3799 Reported by Eric Allman.
3801 Mon Nov 1 07:45:24 1993 Francois Pinard (pinard@icule)
3803 * m4.h: Add blind_if_no_args in struct builtin, blind_no_args in
3804 struct symbol adn SYMBOL_BLIND_NO_ARGS macro.
3805 * builtin.c: Initialize all the blindness fields in builtin_tab.
3806 (define_builtin): Copy the blindness of a builtin into its symbol.
3807 * macro.c (expand_token): Avoid processing a blind builtin if the
3808 next character is not an opening parenthesis.
3809 Reported by David MacKenzie.
3810 Reported by Noah Friedman.
3812 * configure.in: Ensure an exit status of 0 on completion.
3813 Reported by Vivek P. Singhal.
3815 * eval.c (eval_lex): Admit both lower and upper case letters for
3816 bases greater than 10. Only lower case letters were accepted.
3818 * eval.c (eval_lex): Recognize 0bDIGITS and 0rRADIX:DIGITS syntax.
3819 Reported by Krste Asanovic.
3821 * eval.c: Rename NOT to LNOT. Add XOR, NOT, LSHIFT and RSHIFT.
3822 * eval.c (logical_not_term): New name for not_term.
3823 * eval.c (xor_term): New, between or_term and and_term.
3824 * eval.c (not_term): New, between and_term and logical_not_term.
3825 * eval.c (shift_term): New, between cmp_term and add_term.
3826 Reported by Krste Asanovic: ~, ^, <<, >>.
3827 Reported by Ben A. Mesander: ** vs ^.
3829 * m4.c: Delete xmalloc.c, xrealloc.c, xstrdup.c.
3830 * m4.h: Delete xrealloc.c.
3831 * lib/xmalloc.c: New, from elsewhere.
3832 * lib/xstrdup.c: New, from elsewhere.
3833 * lib/Makefile.in: Distribute and compile them.
3835 * m4.c: Change progname to program_name.
3836 * builtin.c, eval.c, m4.c, m4.h: Rename error to m4error.
3837 * lib/error.c: New, from elsewhere.
3838 * lib/Makefile.in: Distribute and compile error.c.
3839 * configure.in: Check AC_VPRINTF and for strerror.
3840 * m4.c: Delete cmd_error. Use error instead.
3841 * m4.c: Change label capitalisation to "ERROR", "Warning", etc.
3843 * m4.h: Delete #define const, let Autoconf takes care of this.
3845 * m4.c: Remove all code conditionalized by IMPLEMENT_M4OPTS.
3846 Merge parse_args into main. Declare argv to be `char *const *',
3847 then remove superfluous casts.
3849 * m4.c: Rename --no-gnu-extensions to --traditional.
3850 Reported by Ben A. Mesander.
3852 * m4.c (usage): Add a status parameter. Supply one in various
3853 calls. Add --help processing. Remove -V for --version.
3855 * lib/Makefile.in: Put $(CFLAGS) last in .c.o rule.
3857 * lib/Makefile.in: Have an AR=ar declaration.
3858 Reported by Eric Backus.
3859 Reported by Bjorn R. Bjornsson.
3860 Reported by Tom Tromey.
3861 Reported by Kristine Lund.
3862 Reported by Marion Hakanson.
3864 Sat Oct 30 12:51:47 1993 Francois Pinard (pinard@icule)
3866 * Makefile.in (m4.info): Use -I$(srcdir) on $(MAKEINFO).
3867 Reported by Noah Friedman.
3869 Mon Oct 25 14:58:48 1993 Francois Pinard (pinard@icule)
3871 * Makefile.in: Remove MDEFINES and cleanup.
3873 Wed Jun 9 14:59:46 1993 Francois Pinard (pinard@icule)
3875 * Makefile.in (dist): Replace "echo `pwd`" by a mere "pwd".
3878 Sat Feb 6 14:59:22 1993 Francois Pinard (pinard@icule)
3880 * Makefile.in, lib/Makefile.in, check/Makefile.in: In dist goals,
3881 ensure 777 mode for directories, so older tar's will restore file
3884 Sun Jan 17 15:38:05 1993 Francois Pinard (pinard@icule)
3886 * Makefile.in, lib/Makefile.in: Put $(CFLAGS) after $(CPPFLAGS),
3887 so the installer can override automatically configured choices.
3888 Reported by Karl Berry.
3890 Fri Jan 15 16:07:00 1993 Francois Pinard (pinard@icule)
3892 * lib/vfprintf.c: Stolen from Oleo distribution and adapted. The
3893 previous version was not working properly on m68k-hp-bsd4.3.
3894 Reported by Roland McGrath.
3896 * lib/_doprnt.c: Stolen from Oleo distribution.
3897 * configure.in: Check for _doprnt.c if vfprintf.c selected.
3898 * lib/Makefile.in: Distribute _doprnt.c.
3899 Do not distribute regex.[ch].old anymore.
3901 Fri Jan 1 19:42:23 1993 Francois Pinard (pinard at icule)
3903 * Makefile.in, lib/Makefile.in: Reinstate $(CPPFLAGS), use it.
3904 Richard wants it there.
3906 Sun Dec 27 07:01:54 1992 Francois Pinard (pinard at icule)
3908 * Makefile.in: Add DEFS to MDEFINES.
3909 * lib/Makefile.in (.c.o): Remove $(CPPFLAGS).
3910 (libm4.a): Remove the library before creating it.
3911 (distclean): Remove tags and TAGS too.
3913 Wed Dec 23 12:46:55 1992 Francois Pinard (pinard at icule)
3915 * Makefile.in (dvi, m4.dvi): New goals.
3917 * builtin.c, eval.c, format.c, input.c, m4.[ch], m4.texinfo,
3918 macro.c, output.c, path.c, symtab.c: Change Copyright from
3919 1989-1992 to the explicit enumeration 1989, 1990, 1991, 1992.
3921 * examples/divert.m4: Deleted, this bug has been corrected.
3923 * Makefile.in (texclean, mostlyclean): New goals.
3925 * Makefile.in (clean): Remove clutter from ansi2knr.
3926 Reported by Pierre Gaumond.
3927 Reported by Greg A. Woods.
3929 Sun Dec 20 10:40:20 1992 Francois Pinard (pinard at icule)
3931 * Makefile.in: Remove $(CPPFLAGS) from the .c.o rule. The user
3932 might well use CFLAGS is s/he needs it.
3934 * Makefile.in: Allow installation of info files from a separate
3936 Reported by Jason Merrill.
3937 Reported by David MacKenzie.
3938 Reported by Skip Montanaro.
3939 Reported by Erez Zadok.
3940 Reported by Assar Westerlund.
3942 Sat Dec 19 08:21:34 1992 Francois Pinard (pinard at icule)
3945 This is still a beta release for the future GNU m4 version 1.1.
3947 * lib/alloca.c: New, from elsewhere.
3948 * lib/Makefile.in: Distribute it. Define and use $(ALLOCA).
3950 * m4.h: Do not define index/rindex if already defined. If
3951 FALSE/TRUE are already defined, do not redefine them, but merely
3952 define boolean typedef to int.
3954 * Makefile.in: Use $(DEFS) while compiling ansi2knr.
3955 * ansi2knr.c: Rewrite #ifdef HAVE_STRING_H || STDC_HEADERS,
3956 because some C compilers do not like connectives with #ifdef.
3957 * m4.h: Define `volatile' only if __GNUC__, instead of once for
3958 __GNUC__ and once for __STDC__.
3959 * lib/regex.h: Leave const alone, AC_CONST will take care of it.
3961 * checks/Makefile.in: Use .all_stamp instead of $(CHECKS) for
3962 Makefile dependencies. Without it, make keeps destroying and
3963 remaking $(CHECKS) in a loop (why?). Distribute .all_stamp.
3965 * m4.h, m4.c, builtin.c, output.c: Change all divertion/DIVERTION
3966 to diversion/DIVERSION, this was a spelling error.
3968 * m4.c: Declare version[], remove #include "version.h".
3969 * version.h: Deleted.
3970 * Makefile.in: Remove references to version.h.
3972 * output.c (shipout_text): Centralize all `#line NUM ["FILE"]'
3973 production, by using a simpler and more robust algorithm. This
3974 solves the problem of synclines sometimes written in the middle of
3975 an output line. Delete sync_line() and output_lines variable.
3976 * m4.h: Remove sync_line prototype and output_lines declaration.
3977 * input.c (next_char), output.c (shipout_text): Remove references
3979 * input.c (push_file, pop_file): Merely put the value -1 in
3980 output_current_line instead of calling sync_line, for delaying a
3981 single `#line NUM FILE' before next output line. Do not test
3982 for sync_output, because this is unnecessary clutter.
3983 * output.c (make_divertion, insert_divertion): Idem.
3984 * input.c: Rename must_advance_line to start_of_input_line, for
3987 * debug.c (trace_header): Select a new debug line format, which
3988 better complies with GNU standards for formatting error messages.
3989 With option `-dfl', M-x next-error might be used on the output.
3990 * m4.c (vmesg): Adjust format of error output to GNU standards.
3991 * m4.texinfo: Adjust examples for `make check' to work.
3993 * m4.h, builtin.c, debug.c, input.c, macro.c, path.c: Use upper
3994 case for enum debug_info constants, which were all lower case.
3996 * builtin.c (m4_regexp, m4_patsubst): Use re_search instead of
3998 * lib/regex.[ch]: Use new version from textutils 1.3.6, with some
3999 collected patches. I tried a few times using newer regex.[ch], it
4000 mysteriously stopped aborting with this one. Insecure feeling...
4001 * lib/Makefile.in: Distribute regex.[ch].old, just in case!
4003 Fri Dec 18 11:08:03 1992 Francois Pinard (pinard at icule)
4005 * m4.c: Change `--no-warnings' to `--silent'.
4006 Reported by David MacKenzie.
4008 * m4.c: Put all M4OPTS code upon IMPLEMENT_M4OPTS control, and
4009 leave it off for now. See comment in m4.c for justification.
4010 Reported by David MacKenzie.
4012 * configure.in: Replace AC_USG by AC_HAVE_HEADERS(string.h).
4013 * m4.h, ansi2knr.c, lib/regex.h: Replace USG by HAVE_STRING_H.
4015 * Makefile.in: Add a new `info' goal. Use macro MAKEINFO.
4017 * Makefile.in: Ensure recursive cleaning is done before local
4018 cleaning for all clean goals.
4020 * builtin.c (ntoa): Ensure the value is always interpreted as a
4021 signed quantity, whatever the radix is.
4023 Wed Nov 18 07:57:19 1992 Jim Meyering (meyering@idefix)
4025 * builtin.c, format.c, input.c: Split long lines.
4026 * m4.c: Use typedef macro_definition instead of struct
4028 * symtab.c: Use typedef symbol instead of struct symbol.
4030 Tue Nov 17 01:58:40 1992 Francois Pinard (pinard at icule)
4032 * *.[ch]: Remove all trailing whitespace, in code and comments.
4034 * configure.in: Find some awk.
4035 * Makefile.in: Add $(AWK) to MDEFINES.
4036 * checks/Makefile.in: Transmit $(AWK) to get_them.
4037 * checks/get_them: Use $AWK instead of gawk. Add a close in the
4038 awk script when switching files, because without this, mawk runs
4039 out of file descriptors.
4041 Mon Nov 16 20:42:56 1992 Francois Pinard (pinard at icule)
4043 * Makefile.in (realclean): Delete m4.info*.
4044 Reported by Jim Meyering.
4046 * Makefile.in: Adjust and link with checks/Makefile.
4047 * checks/Makefile.in: New.
4048 * configure.in: Output checks/Makefile.
4050 * checks/get_them: Have the dnl header of each test more
4051 recognizable by next-error, also use a better message.
4053 Mon Nov 16 07:48:52 1992 Jim Meyering (meyering@idefix)
4055 * m4.h [__GNUC__]: Use __volatile__ instead of `volatile.'
4056 And use that only if __GNUC__ since we're using it's GCC-specific
4057 semantics that tell the compiler the associated function doesn't
4060 * builtin.c (substitute): Don't use character as an array index.
4061 (dumpdef_cmp): Make formal arguments `const void *' to avoid
4062 warnings with gcc -W -Wall on systems with qsort prototype.
4063 (m4_errprint): Cast obstack_finish to `char *' to avoid warnings
4066 * eval.c (most functions): Add parentheses to assignments used
4067 as truth values go avoid warnings from gcc -Wall.
4069 * input.c, m4.c, output.c, path.c, symtab.c: Declare static
4070 any functions that don't need external scope.
4072 * builtin.c, debug.c, format.c, m4.c, m4.h, macro.c, symtab.c
4073 (many functions and arrays): Declare `const'.
4075 Sun Nov 15 09:42:09 1992 Francois Pinard (pinard at icule)
4077 * *.[ch]: Rename nil to NULL, using the declaration from <stdio.h>,
4078 removing the declaration from m4.h. Also rename false to FALSE
4081 * lib/Makefile.in (Makefile): New goal.
4083 * Makefile.in, lib/Makefile.in: Add a .c.o rule, so CFLAGS is not
4084 so heavily loaded. It gets more easily overridable, calling make.
4085 Reported by Jim Meyering.
4087 * Makefile.in (dist): Get .fname from the current directory name,
4088 instead of from version.h. I need updating many files manually,
4089 when the version changes, version.h is just one of them.
4091 Sat Nov 14 11:01:20 1992 Francois Pinard (pinard at icule)
4093 * m4.h: Remove the tag `boolean' on the enum introducing typedef
4094 `boolean'. This tag conflicts with <sys/types.h> on SVR4.
4095 Reported by Tom McConnell.
4097 Fri Nov 13 00:12:50 1992 Francois Pinard (pinard at icule)
4099 * m4.texinfo: Correct the examples for 33.divert, 38.divnum,
4100 39.cleardiv, which were describing missing or spurious newlines.
4101 Modify examples 52.eval, 53.esyscmd and 54.sysval so the results
4102 do not depend on machine word size, `/bin/false' implementation,
4103 or `wc' output format. `make check' is more dependable, now.
4105 * checks/check_them: Summarize the failed tests by listing their
4106 name, at end. If none, issue `All checks successful'. Output
4107 `Checking' instead of `Input file:'.
4109 * checks/get_them, checks/check_them: Reindented.
4111 * Makefile.in (dist): chmod a+r before making the tar file.
4113 Thu Nov 12 14:42:57 1992 Francois Pinard (pinard at icule)
4115 * builtin.c (m4_dnl): Diagnose any parameter to `dnl'.
4117 * input.c (next_token): Reinitialize token_buttom just after using
4118 it as a watermark with obstack_free. Or else, a future token, big
4119 enough for triggering reallocation of the obstack chunk, could
4120 void the initialized value of token_buttom, later causing panic in
4121 obstack_free. Rename token_buttom to token_bottom everywhere.
4123 * m4.h: Before declaring errno, first include <errno.h> and
4124 ensure that it does not define errno.
4125 Reported by Richard Stallman.
4127 Wed Nov 11 17:40:35 1992 Francois Pinard (pinard at icule)
4129 * builtin.c: Define and use DECLARE macro for builtins.
4131 * builtin.c (m4_ifelse): Avoid any diagnostic when exactly one
4132 argument, this is a common idiom for introducing long comments.
4134 * builtin.c (m4_ifelse): If 3n + 2 arguments, diagnose missing
4135 arguments. The last argument was silently ignored.
4137 * m4.c (cmd_error): Add a missing semicolon before va_end().
4139 Tue Nov 10 08:57:05 1992 Francois Pinard (pinard at icule)
4141 * Makefile.in: Now handle protoized sources. Define and use U.
4142 Compile and use ansi2knr with old compilers. Update DISTFILES.
4143 Add `aclocal.m4' to `configure' dependencies.
4144 * ansi2knr.c: New, from Ghostscript distribution.
4145 * configure.in: Define U through FP_PROTOTYPES for old compilers.
4146 Add AC_ISC_POSIX, AC_CONST, AC_SIZE_T.
4147 * aclocal.m4: New, provide FP_PROTOTYPES.
4148 * m4.h: Conditionnaly protoized through Args, save for varags.
4149 * builtin.c: Protoized. Then:
4150 Include <sys/types.h> if size_t is not defined, before "regex.h".
4151 (m4_ifelse): Fetch built-in name properly for diagnostic.
4152 (m4_dumpdef): Remove wrong (char *) cast calling dump_symbol.
4153 (m4_regexp): Add const to `msg' declaration.
4154 (m4_patsubst): Add const to `msg' declaration.
4155 * debug.c: Protoized, save for varargs.
4156 * eval.c: Protoized.
4157 * format.c: Protoized.
4158 * input.c: Protoized.
4159 * m4.c: Protoized, save for varargs. Then:
4160 (xfree): Accept void * instead of char *.
4161 (xmalloc): Return void * instead of char *.
4162 (xrealloc): Accept and return void * instead of char *.
4163 * macro.c: Protoized.
4164 * output.c: Protoized.
4165 * path.c: Protoized. Then cast some (char *) over xmalloc's.
4166 * symtab.c: Protoized.
4168 Fri Nov 6 02:05:21 1992 Francois Pinard (pinard at icule)
4170 * m4.texinfo: Remove directory from diagnostics in 30.include,
4171 51.eval, 56.errprint and 57.m4exit tests.
4173 * m4.h: Remove declarations for int or void system functions, they
4174 cause more conflicting trouble than they make good.
4176 * configure.in: Avoid configuration header file. Add some tests.
4177 * m4.h: Remove #include "config.h".
4178 * Makefile.in, lib/Makefile.in: Implement Autoconf interface.
4179 Then, rewritten for better compliance with GNU standards.
4181 Thu Nov 5 12:37:13 1992 Francois Pinard (pinard at icule)
4183 * format.c (format): Avoid syntax error if not HAVE_EFGCVT,
4184 because of a misplaced #endif.
4186 * Many *.[hc] files: Correct intra-line spacing here and there,
4187 according to GNU indent 1.6 advice.
4189 * configure.in: New, using Autoconf 1.2.
4190 * m4.h: Reverse NO_MEMORY_H to NEED_MEMORY_H.
4191 * Delete old configure.in, configure, etc/configure.in,
4192 etc/configure, lib/configure.in, lib/configure and config/*.
4193 Reported by Jason Merrill.
4195 * symtab.c (hash): Change (char) NULL to '\0'.
4196 Reported by Jason Merrill.
4198 * Delete .vers, etc/newdist.sh, etc/newvers.sh and
4199 etc/nextvers.sh. Release numbers will be edited `by hand'.
4200 * version.h: De-automatize, force value in.
4202 * m4.c: Changes in order to use a newer getopt.h.
4203 Reported by David MacKenzie.
4205 * checks/: New name for examples/.
4206 * checks/get_them: New location for etc/get_examples.
4207 * checks/check_them: New location for etc/check_examples.
4208 * Makefile.in, checks/get_them, checks/check_them: Adjust.
4209 * lib/vfprintf.c: New location for etc/vfprintf.c.
4210 * Delete empty etc/.
4211 * examples/: New name for test/.
4213 Tue Mar 10 00:29:46 1992 Francois Pinard (pinard at icule)
4215 * Makefile.in (check): Add m4 as dependency.
4217 * m4.c: Accept --no-warnings instead of --no_warnings, and
4218 --no-gnu-extensions instead of --no_gnu_extensions. Make the
4219 usage message more informative.
4220 Reported by David MacKenzie.
4222 Mon Mar 9 14:53:40 1992 Francois Pinard (pinard at icule)
4224 * etc/check_examples: New name for check_examples.sh.
4225 * etc/get_examples: New name for get_examples.sh.
4226 * Makefile.in, etc/Makefile.in: Use new names.
4228 * Makefile.in: Transmit $(CC) while making in lib.
4230 * Many *.[hc] files: GNU indent'ed, with further fine tuning of
4231 code disposition by hand.
4233 Sun Mar 8 11:01:55 1992 Francois Pinard (pinard at icule)
4235 * m4.h: Delete definitions for abort() and exit().
4236 Reported by Richard Stallman.
4238 * config/hmake-unicos, config/s-unicos.h: New files.
4239 Reported by Hal Peterson.
4241 * eval.c (exp_term): Have N^0 return 1.
4242 Reported by Michael Fetterman.
4244 * eval.c, input.c, m4.h: Remove last comma in enums.
4245 Reported by Mike Lijewski.
4247 * Transfer of maintenance duties from Rene' to Franc,ois.
4249 Thu Oct 24 15:18:46 1991 Rene' Seindal (seindal at diku.dk)
4251 * Release 1.0. Many thanks to those, who provided me with bug
4252 reports and feedback.
4254 * Uses GNU configure, taken from the gdb distribution.
4256 * Uses GNU getopt(), with long option names.
4258 * The -Q/+quiet option is added, which suppresses warnings about
4259 missing or superflous arguments to built-in macros.
4261 * Added default options via the M4OPTS environment variable.
4263 * The built-in format can now be configured to use sprintf as
4264 the formatting engine, for systems without [efg]cvt(3).
4266 * GNU library code is moved to the ./lib subdirectory; other
4267 utility files are now in ./etc.
4269 * Several minor bugs have been fixed.
4271 Fri Jul 26 15:28:42 1991 Rene' Seindal (seindal at diku.dk)
4273 * Fixed various bugs. Release 0.99, manual 0.09. Many thanks to
4274 Francois Pinard and Roland H. Pesch for providing me with reports.
4276 * The builtins incr and decr are now implemented without use of
4279 * The builtin indir is added, to allow for indirect macro calls
4280 (allows use of "illegal" macro names).
4282 * The debugging and tracing facilities has been enhanced
4283 considerably. See the manual for details.
4285 * The -tMACRO option is added, marks MACRO for tracing as soon
4288 * Builtins are traced after renaming iff they were before.
4290 * Named files can now be undiverted.
4292 * The -Nnum option can be used to increase the number of
4293 divertions available.
4295 * Calling changecom without arguments now disables all comment
4298 * The function m4_patsubst() is now consistently declared
4301 * A bug in dnl is fixed.
4303 * A bug in the multi-character quoting code is fixed.
4305 * Several typos in the manual has been corrected. More probably
4308 * The m4.info file is now installed along with the program.
4310 Thu Nov 15 21:51:06 1990 Rene' Seindal (seindal at diku.dk)
4312 * Updated and enhanced version. Release 0.75, manual 0.07.
4314 * Implemented search path for include files (-I option and
4315 M4PATH envronment variable).
4317 * Implemented builtin "format" for printf-like formatting.
4319 * Implemented builtin "regexp" for searching for regular
4322 * Implemented builtin "patsubst" for substitution with regular
4325 * Implemented builtin "esyscmd", which expands to a shell
4328 * Implemented "__file__" and "__line__" for use in error
4331 * Implemented character ranges in "translit".
4333 * Implemented control over debugging output.
4335 * Implemented multi-character quotes.
4337 * Implemented multi-character comment delimiters.
4339 * Changed predefined macro "gnu" to "__gnu__".
4341 * Changed predefined macro "unix" to "__unix__", when the -G
4342 option is not used. With -G, "unix" is still defined.
4344 * Changed "shift", "$@" and "$*" to not insert spaces afters
4347 * Added program name to error messages.
4349 * Fixed two missing null bytes bugs.
4351 Mon Jan 22 21:08:52 1990 Rene' Seindal (seindal at diku.dk)
4353 * Initial beta release. Release 0.50, manual 0.05.
4363 Copyright (C) 1990, 1991, 1992, 1993, 1994, 2000, 2001, 2003,
4364 2005, 2006, 2007 Free Software Foundation, Inc.
4366 Copying and distribution of this file, with or without
4367 modification, are permitted provided the copyright notice
4368 and this notice are preserved.