1 2007-12-18 Eric Blake <ebb9@byu.net>
3 Stage 8: extend life of references into argv.
4 * src/m4.h (obstack_regrow): Delete, now that it is unused.
5 (struct token_chain): Add level field.
6 (push_token): Adjust prototype.
7 (adjust_refcount): New prototype.
8 * src/macro.c [DEBUG_MACRO]: Add debugging hooks for $@ reference
10 (argc_stack, argv_stack): Delete, replaced by...
11 (struct macro_arg_stacks, stacks, stacks_count): ...these new
12 structure for tracking $@ references.
13 (expand_input): Initialize new structure.
14 (collect_arguments): Alter signature.
15 (expand_macro): Rework obstack handling, in order to keep $@
16 references alive until they have been rescanned.
17 (adjust_refcount, arg_mark): New functions.
18 (make_argv_ref): Use new field.
19 (push_arg, push_args): Update callers.
20 * src/input.c (make_text_link): Use new field.
21 (push_token): Change signature.
22 (pop_input, next_char_1): Call new function.
23 * doc/m4.texinfo: Clean up some examples of -d option usage.
24 (Ifelse): Add some stress tests.
26 2007-12-13 Eric Blake <ebb9@byu.net>
29 * doc/m4.texinfo (Inhibiting Invocation): Missed one instance in
34 2007-12-13 Paolo Bonzini <bonzini@gnu.org> (tiny change)
36 * doc/m4.texinfo (Inhibiting Invocation): Fix quoting of a quoting
38 Reported by Giovanni Toffetti.
40 2007-12-11 Eric Blake <ebb9@byu.net>
42 Stage 7: add chained token support to input parser.
43 * src/m4.h (struct token_chain): Add const safety.
44 (push_token): New prototype.
45 * src/input.c (INPUT_CHAIN): New enumerator.
46 (struct input_block): Add new input type u_c, and change u_s to
47 length-based processing.
48 (make_text_link): New helper function.
49 (push_token): New function.
50 (push_string_finish): Use it.
51 (pop_input, input_print, peek_input, next_char, next_char_1):
52 Adjust to handle new input type.
53 * src/macro.c (push_arg, push_args): Use new function.
55 2007-12-10 Eric Blake <ebb9@byu.net>
57 Stage 6: convert builtins to push arg at a time.
58 * src/m4.h (includes): Include <limits.h> here, instead of in
60 (input_block): New typedef.
61 (trace_pre, trace_post, push_string_finish): Update prototypes.
62 (obstack_print, input_print, push_arg, push_args): New
64 * src/input.c (push_string_finish): Change return type.
65 (input_print): New function.
66 * src/debug.c (trace_format): Add %B specifier, and use new
68 (trace_pre): Remove redundant argc parameter.
69 (trace_post): Likewise, and change signature.
70 (obstack_print): New function.
71 * src/macro.c (expand_macro): Update caller.
72 (push_arg, push_args): New functions.
73 * src/builtin.c (m4_ifdef, m4_ifelse, m4_shift, m4_substr)
74 (m4_patsubst, expand_user_macro): Use new functions.
75 (mkstemp_helper, m4_maketemp): Avoid extra trailing NULs.
76 * src/m4.c (max_debug_argument_length, main): Set to INT_MAX, not
78 * src/output.c: Update includes.
79 * src/symtab.c: Likewise.
81 2007-12-07 Eric Blake <ebb9@byu.net>
83 Minor security fix: Quote output of mkstemp.
84 * src/builtin.c (mkstemp_helper): Produce quoted output.
85 * doc/m4.texinfo (Mkstemp): Update the documentation and tests.
86 * NEWS: Document this change.
88 Stage 5: add notion of quote age.
89 * src/input.c: Comment cleanups.
90 (current_quote_age): New global variable.
91 (set_quote_age): New helper function.
92 (input_init, set_word_regexp): Use it.
93 (set_quotes, set_comment): Likewise, and detect no-op changes.
94 (quote_age, safe_quotes): New functions.
95 (next_token): Track quote age.
96 * src/m4.h (struct token_data): Add quote_age member.
97 (TOKEN_DATA_QUOTE_AGE, quote_age, safe_quotes): New prototypes.
98 * src/macro.c (struct macro_arguments): Add quote_age member.
99 (expand_token): Alter signature and track quote age.
100 (expand_input, expand_argument): All callers changed.
101 (collect_arguments, make_argv_ref): Track quote age.
102 (arg_text, arg_len, arg_func): Detect type mismatch.
103 * doc/m4.texinfo (Ifelse, Changequote): Add more tests.
104 (Incompatibilities): Fix typo.
105 * examples/wraplifo.m4: New file.
106 * examples/Makefile.am (EXTRA_DIST): Distribute it.
108 2007-12-04 Eric Blake <ebb9@byu.net>
110 Fix builds with OpenBSD make.
111 * doc/Makefile.am (HELP2MAN): New macro.
112 (man_MANS, m4.1): Fix rules for building m4.1 into srcdir.
113 * README: Update copyright.
114 * HACKING: Mention help2man and makeinfo dependencies.
116 2007-11-29 Eric Blake <ebb9@byu.net>
118 Stage 4: route indir, builtin through ref; make argv opaque.
119 * src/m4.h (obstack_regrow): Borrow definition from head.
120 (struct token_chain): Add flatten and len members.
121 (arg_equal, arg_empty, make_argv_ref): New prototypes.
122 (struct macro_arguments): Move...
123 * src/macro.c (struct macro_arguments): ...here, making it
124 opaque. Add has_ref member.
125 (empty_token): New placeholder, for optimizing comparison with
127 (collect_arguments): Change signature, and populate new fields.
128 (expand_macro): Alter handling of obstacks.
129 (arg_token): New helper method.
130 (arg_equal, arg_empty, make_argv_ref): New methods.
131 (arg_type, arg_text, arg_len, arg_func): Use new methods.
132 * src/builtin.c (m4_ifelse, m4_builtin, m4_indir, m4_eval):
134 * src/format.c (format): Likewise.
136 Stage 3: cache length, rather than computing it.
137 * src/input.c (next_token): Grab length from obstack rather than
139 * src/m4.h (token_data, macro_arguments): Add length field.
140 (TOKEN_DATA_LEN): New accessor.
141 (define_user_macro): Add parameter.
142 * src/builtin.c (define_user_macro, mkstemp_helper): Use
144 (builtin_init, define_macro, m4_maketemp, m4_mkstemp): Adjust
146 (dump_args, m4_ifdef, m4_ifelse, m4_builtin, m4_indir, m4_eval)
147 (m4_len, m4_substr, m4_translit, m4_regexp, m4_patsubst)
148 (expand_user_macro): Use cached lengths.
149 * src/freeze.c (reload_frozen_state): Adjust callers.
150 * src/m4.c (main): Likewise.
151 * src/macro.c (expand_token, expand_argument, collect_arguments)
152 (arg_len): Use cached length.
153 * doc/m4.texinfo (Mkstemp): Ensure mkstemp does not produce NUL.
155 2007-11-27 Eric Blake <ebb9@byu.net>
157 Stage 2: use accessors, not direct reference, into argv.
158 * src/m4.h (TOKEN_EOF): Alter value, to ease debugging.
159 (arg_argc, arg_type, arg_text, arg_len, arg_func): New
161 * src/macro.c (arg_argc, arg_type, arg_text, arg_len, arg_func):
162 New accessor functions.
163 * src/builtin.c (ARG, dump_args, define_macro, m4_builtin)
164 (m4_indir): Use new accessors.
165 * src/debug.c (trace_pre): Likewise.
166 * src/format.c (ARG_INT, ARG_LONG, ARG_STR, ARG_DOUBLE):
169 2007-11-24 Eric Blake <ebb9@byu.net>
171 Stage 1: convert token_data** into new object.
172 * m4/gnulib-cache.m4: Import flexmember module.
173 * src/m4.h (struct macro_arguments, struct token_chain): New
175 (builtin_func): Alter signature.
176 (token_data): Add new TOKEN_COMP alternative.
177 * src/builtin.c: All builtins changed.
178 (ARG, dump_args, define_macro, expand_user_macro): Update to use
180 * src/debug.c (trace_pre, trace_post): Likewise.
181 * src/format.c (ARG_INT, ARG_LONG, ARG_STR, ARG_DOUBLE, format):
183 * src/macro.c (collect_arguments): Build new struct.
184 (call_macro, expand_macro): Update to use new struct.
186 2007-11-22 Eric Blake <ebb9@byu.net>
188 More error messages tied to macro names.
189 * src/input.c (set_word_regexp): Take additional parameter.
190 (input_init): Adjust caller.
191 * src/debug.c (debug_set_file, debug_set_output): Take additional
193 (debug_init): Adjust caller.
194 (expansion_level): Move declaration...
195 * src/m4.h (expansion_level): ...here.
196 (debug_set_output, set_word_regexp): Adjust prototypes.
197 * src/builtin.c (m4_changeword, m4_m4exit, m4_debugfile): Adjust
199 * src/m4.c (main): Likewise.
201 Refactor error messages to avoid macros.
202 * src/m4.h (_): Define, as a placeholder for now.
203 (M4ERROR, M4ERROR_AT_LINE): Delete.
204 (m4_error, m4_error_at_line): Change prototype.
205 (m4_warn, m4_warn_at_line): New prototypes.
206 * src/m4.c (m4_verror_at_line): New helper function.
207 (m4_error, m4_error_at_line): Use new function, and properly call
209 (m4_warn, m4_warn_at_line): New functions.
210 (stackovf_handler, main): All callers changed.
211 * src/builtin.c: Likewise.
212 * src/debug.c: Likewise.
213 * src/eval.c: Likewise.
214 * src/format.c: Likewise.
215 * src/freeze.c: Likewise.
216 * src/input.c: Likewise.
217 * src/macro.c: Likewise.
218 * doc/m4.texinfo (Indir, Builtin, Dumpdef, Incr, Eval, Substr)
219 (Improved forloop): Adjust tests accordingly.
221 Security fix: avoid arbitrary code execution with 'm4 -F'.
222 * src/freeze.c (produce_frozen_state): Never pass raw file name as
224 * NEWS: Document this fix.
226 2007-11-21 Eric Blake <ebb9@byu.net>
228 Consistently report macro name first in messages.
229 * src/m4.h (evaluate): Adjust prototype.
230 * src/builtin.c (bad_argc, numeric_arg, m4_placeholder): Alter
231 wording to match head.
232 (mkstemp_helper, substitute): Adjust signature. All callers
234 (m4_dumpdef, m4_builtin, m4_indir, m4_defn, m4_esyscmd, m4_eval)
235 (m4_undivert, m4_maketemp, m4_m4exit, m4_debugmode)
236 (m4_debugfile, m4_regexp, m4_patsubst): Mention macro name in
238 (m4_format): Adjust call.
239 * src/format.c (format): No longer skip argv[0].
240 * src/eval.c (evaluate): Mention macro name in message.
241 (logical_or_term, logical_and_term, or_term, xor_term, and_term)
242 (equality_term, cmp_term, shift_term, add_term, mult_term)
243 (exp_term, unary_term, simple_term): Adjust signature.
244 * src/macro.c (warn_builtin_concat): Likewise.
245 (expand_argument): Adjust caller.
246 * doc/m4.texinfo (Macro Arguments, Ifdef, Ifelse, Debug Output)
247 (Dnl, Improved fatal_error, Defn, Builtin, Index macro, Regexp)
248 (Substr, Translit, Patsubst, Format, Eval, Dumpdef, Include)
249 (Improved forloop, Indir, Trace, Incr): Adjust tests to match.
251 Make argument checking a bit more sane.
252 * src/builtin.c (bad_argc): Adjust signature, and don't force
253 callers to add 1. Adjust all callers.
254 (numeric_arg): Adjust signature. Adjust all callers.
256 Make dnl diagnostic print macro name.
257 * src/m4.h (skip_line): Adjust prototype.
258 * src/input.c (skip_line): Report error on behalf of caller.
259 * src/builtin.c (m4_dnl): Adjust caller.
260 (dump_args, m4_dumpdef, m4_changequote, m4_changecom)
261 (m4_changeword, m4_traceon, m4_traceoff, expand_user_macro): Use
262 ARG macro instead of open-coding.
263 * doc/m4.texinfo (Dnl): Adjust test.
265 2007-11-20 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
267 * Makefile.am (EXTRA_DIST): gendocs.sh is gone here.
269 2007-11-14 Eric Blake <ebb9@byu.net>
271 Avoid builtin concatenation in macro arguments.
272 * doc/m4.texinfo (Defn): Add tests.
273 * src/macro.c (warn_builtin_concat): New function.
274 (expand_argument): Use it to warn on more corner cases.
275 * NEWS: Mention new warning.
277 2007-11-13 Eric Blake <ebb9@byu.net>
279 Simplify previous patch.
280 * src/input.c (pop_input): Change signature.
281 (push_string_init, next_char_1): Adjust callers.
283 Fix memory leak in tail recursion.
284 * src/input.c (push_string_init): Let go of memory earlier.
285 (next_char_1): Make end of string detection reliable.
286 (match_input): Simplify use of push_string_init.
287 * NEWS: Document this fix.
289 2007-11-07 Eric Blake <ebb9@byu.net>
291 * doc/m4.texinfo (Pseudo Arguments): Test more corner cases.
293 2007-11-05 Eric Blake <ebb9@byu.net>
295 Use assert, rather than INTERNAL ERROR.
296 * src/m4.h: Include <assert.h>.
297 * src/builtin.c (m4_dumpdef, define_macro, m4_defn): Use assert.
298 * src/debug.c (trace_pre): Likewise.
299 * src/eval.c (evaluate, cmp_term, shift_term, mult_term):
301 * src/freeze.c (produce_frozen_state): Likewise.
302 * src/input.c (push_string_init, pop_input, init_macro_token)
303 (peek_input, next_char_1, set_word_regexp): Likewise.
304 * src/m4.c (main): Likewise.
305 * src/macro.c (expand_token, expand_argument, call_macro):
307 * src/output.c (make_diversion): Likewise.
308 * src/symtab.c (symtab_init): Likewise.
310 Use build-aux directory.
311 * configure.ac (PACKAGE, VERSION): Delete, since Automake does
313 (AC_CONFIG_AUX_DIR): Add, with auxiliary files in build-aux
314 instead of the top level.
315 * bootstrap: Adjust accordingly.
316 * m4/gnulib-cache.m4: Add --aux-dir option.
317 * doc/Makefile.am (m4.1): Rewrite rule to use build-aux/missing.
319 2007-11-02 Eric Blake <ebb9@byu.net>
321 Update some documentation about version control.
322 * NEWS: M4 is now stored in git.
325 * bootstrap: Likewise.
326 * commit: Delete, now that CVS commits are no longer necessary.
328 Adjust to recent gnulib change.
329 * m4/gnulib-cache.m4: Drop vasprintf-posix and xvasprintf, and use
330 xvasprintf-posix instead.
332 2007-11-01 Eric Blake <ebb9@byu.net>
334 Improve error message when early end of file occurs.
335 * doc/m4.texinfo (Macro Arguments, Changequote, Changecom)
336 (M4wrap): Adjust to new messages.
337 (Improved capitalize): Enhance test.
338 * src/m4.h (next_token): Adjust prototype.
339 * src/input.c (next_token): Add new parameter, and improve error
341 (lex_debug): Adjust callers.
342 * src/symtab.c (symtab_debug): Likewise.
343 * src/macro.c (expand_input, collect_arguments): Likewise.
344 (expand_argument): Likewise, and add parameter.
346 2007-10-31 Eric Blake <ebb9@byu.net>
348 Test more corner cases.
349 * doc/m4.texinfo (Changecom, Pseudo Arguments): Beef up tests.
350 (Improved foreach): Document alternate foreachq style.
351 * examples/foreachq3.m4: New file.
352 * examples/loop.m4: New file.
353 * examples/Makefile.am (EXTRA_DIST): Distribute them.
355 2007-10-28 Eric Blake <ebb9@byu.net>
357 More test coverage for autoconf usage patterns.
358 * doc/m4.texinfo (Inhibiting Invocation, Pseudo Arguments)
359 (Builtin): Add new undocumented tests.
360 (Shift): Document cond macro, and add new test.
362 2007-10-27 Eric Blake <ebb9@byu.net>
364 Document one use of changequote(`(',`)').
365 * doc/m4.texinfo (Changequote): Add new test, based on recent
366 autoconf addition of m4_expand.
368 2007-10-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
370 * examples/Makefile.am (EXTRA_DIST): Add capitalize2.m4.
372 2007-10-24 Eric Blake <ebb9@byu.net>
374 Reduce number of mingw testsuite failures.
375 * doc/m4.texinfo (Using frozen files): Skip test on mingw.
377 2007-10-22 Eric Blake <ebb9@byu.net>
379 Add DEBUG_REGEX debugging information.
380 * src/m4.h (DEBUG_REGEX): New debug macro.
381 * src/m4.c (main) [DEBUG_REGEX]: Open regex trace file when
383 * src/builtin.c (m4_patsubst, m4_regexp, compile_pattern)
384 [DEBUG_REGEX]: Trace regex usage.
386 Never let printf failures go undetected.
387 * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
389 * src/m4.h: Include xprintf.h.
390 * src/format.c (format): Warn on format failures.
391 * src/builtin.c (ntoa): Export.
392 (m4_errprint): Adjust all *printf callers.
393 * src/debug.c (debug_message_prefix, trace_format): Likewise.
394 * src/freeze.c (produce_frozen_state): Likewise.
395 * src/input.c [DEBUG_INPUT]: Likewise.
396 * src/m4.c (usage): Likewise.
397 * src/m4.h (DEBUG_PRINT1, DEBUG_PRINT3, DEBUG_MESSAGE)
398 (DEBUG_MESSAGE1, DEBUG_MESSAGE2): Likewise.
399 * src/output.c (m4_tmpname, shipout_text, freeze_diversione):
401 * src/path.c [DEBUG_INCL]: Likewise.
402 * src/stackovf.c (process_sigsegv) [DEBUG_STKOVF]: Likewise.
403 * src/symtab.c [DEBUG_SYM]: Likewise.
405 2007-10-17 Eric Blake <ebb9@byu.net>
407 Fix 'm4 -F file -t undefined'.
408 * src/freeze.c (produce_frozen_state): Avoid core dump.
409 * doc/m4.texinfo (Using frozen files): Test for the bug.
410 * NEWS: Mention the fix.
412 2007-10-09 Eric Blake <ebb9@byu.net>
414 * NEWS: Document recent speedups.
416 Fix regexp regression of 2007-09-29.
417 * src/builtin.c (substitute): Allow NULL regs when no
418 subexpressions were present.
419 (m4_regexp): Handle \ escapes even with empty regex.
420 * doc/m4.texinfo (Regexp, Patsubst): Catch this bug.
422 Cache regex compilation for another autoconf speedup.
423 * src/m4.h (free_macro_sequence): Rename...
424 (free_regex): ...to this.
425 * src/m4.c (main): Update caller.
426 * src/builtin.c (REGEX_CACHE_SIZE, m4_regex, regex_cache): New
428 (compile_pattern): New function; cache recent regexes.
429 (free_regex): Rename, and clean up additional memory.
430 (m4_regexp, m4_patsubst): Use new function.
432 2007-10-02 Eric Blake <ebb9@byu.net>
434 Document quoting pitfalls in capitalize.
435 * doc/m4.texinfo (Patsubst): Use the examples directory. Also
437 (Improved capitalize): New node.
438 * examples/capitalize.m4: Update to match manual.
439 * examples/capitalize2.m4: New file.
441 2007-10-01 Eric Blake <ebb9@byu.net>
443 Another Autoconf usage pattern optimization.
444 * src/builtin.c (m4_index): Optimize search for one byte.
445 * doc/m4.texinfo (Index macro, Regexp, Patsubst): Test the new
448 2007-09-29 Eric Blake <ebb9@byu.net>
450 Optimize for Autoconf usage pattern.
451 * src/builtin.c (m4_regexp, m4_patsubst): Handle empty regex
454 2007-09-24 Eric Blake <ebb9@byu.net>
456 Create .gitignore alongside .cvsignore.
457 * bootstrap (LC_ALL): Set up front.
458 (version control) Borrow idea from head, to avoid churn in
459 m4/.*ignore files modified by gnulib-tool.
461 2007-09-13 Eric Blake <ebb9@byu.net>
465 2007-09-07 Eric Blake <ebb9@byu.net>
467 * AUTHORS: Simplify, to match libtool and autoconf layout.
468 * THANKS: Sync with head.
470 2007-08-10 Eric Blake <ebb9@byu.net>
472 * doc/m4.texinfo (Compatibility): Sync with head.
474 2007-08-10 Konrad Schwarz <konrad.schwarz@siemens.com> (tiny change)
475 and Eric Blake <ebb9@byu.net>
477 * doc/m4.texinfo (Defn): Update wording.
479 2007-08-09 Eric Blake <ebb9@byu.net>
481 POSIX requires defn(`a',`b') to concatenate definitions.
482 * src/builtin.c (m4_defn): Allow multiple arguments, but warn if
483 trying to mix a builtin with anything else.
484 * doc/m4.texinfo (Defn): Document a use for this POSIX
486 (Incompatibilities): Update to match current status.
487 * NEWS: Document this change.
489 Reported by Konrad Schwarz.
491 2007-08-04 Eric Blake <ebb9@byu.net>
493 Normalize all GPL license notices.
494 * GNUmakefile: Update license wording.
495 * Makefile.am: Likewise.
496 * Makefile.maint: Likewise.
497 * bootstrap: Likewise.
499 * configure.ac: Likewise.
500 * checks/Makefile.in: Likewise.
501 * doc/Makefile.am: Likewise.
502 * examples/Makefile.am: Likewise.
503 * src/Makefile.am: Likewise.
504 * src/builtin.c: Likewise.
505 * src/debug.c: Likewise.
506 * src/eval.c: Likewise.
507 * src/format.c: Likewise.
508 * src/freeze.c: Likewise.
509 * src/input.c: Likewise.
510 * src/m4.c: Likewise.
511 * src/m4.h: Likewise.
512 * src/macro.c: Likewise.
513 * src/output.c: Likewise.
514 * src/path.c: Likewise.
515 * src/stackovf.c: Likewise.
516 * src/symtab.c: Likewise.
518 2007-07-21 Eric Blake <ebb9@byu.net>
520 Fix regression on NetBSD from 2007-05-28.
521 * src/output.c (m4_tmpopen): Explicitly reset append-mode stream
523 * NEWS: Document this fix.
525 Reported by Thomas Klausner.
527 2007-07-20 Eric Blake <ebb9@byu.net>
529 Fix 'make distcheck' issues.
530 * Makefile.am (EXTRA_DIST): No need to distribute
531 gpl-3.0.texi.diff anymore.
532 * m4/gnulib-cache.m4: Update to latest gnulib.
534 2007-07-14 Eric Blake <ebb9@byu.net>
536 Reflect upstream license .texi changes.
537 * doc/m4.texinfo (Copying): Rename node...
538 (GNU General Public License): ...to this.
539 (GNU Free Documentation License): Adjust node location.
540 * local/doc/gpl-3.0.texi.diff: Remove file.
542 2007-07-10 Eric Blake <ebb9@byu.net>
545 * configure.ac (AC_INIT): Bump version number.
546 * NEWS: Start changes since 1.4.10.
547 * doc/m4.texinfo (History): Mention 1.4.11.
548 (Copying This Package, Copying This Manual): Add index entries.
549 * local/lib/version-etc.c.diff: Delete, now that gnulib has been
551 * Makefile.am (EXTRA_DIST): Remove dead file.
553 2007-07-09 Eric Blake <ebb9@byu.net>
556 * doc/Makefile.am (m4_TEXINFOS): Distribute gpl-3.0.texi.
557 * Makefile.am (EXTRA_DIST): Distribute gnulib diffs.
558 * configure.ac (AC_INIT): Bump version number.
559 * NEWS: Describe changes since 1.4.9.
561 * src/format.c: Missed a GPLv3 conversion.
563 Avoid undefined behavior of %.*c in printf.
564 * src/format.c (format): Special case %c.
565 * TODO: Document that more remains to be done.
566 * NEWS: Document the fix.
568 2007-07-05 Eric Blake <ebb9@byu.net>
570 Fix up gnulib-tool usage.
571 * m4/gnulib-cache.m4: Change local-dir to local, not `.'.
572 * version-etc.c.diff: Move to...
573 * local/lib/version-etc.c.diff: ...here.
574 * gpl-3.0.texi.diff: Move to...
575 * local/doc/gpl-3.0.texi.diff: ...here.
577 2007-07-04 Eric Blake <ebb9@byu.net>
579 Upgrade to GPL version 3 or later.
580 * bootstrap: Pick up GPLv3.
581 * m4/gnulib-cache.m4: Augment with 'gnulib-tool
582 --local-dir=. --import gpl-3.0'.
583 * doc/m4.texinfo (Copying This Package): New appendix.
584 * NEWS: Mention this change.
585 * README: Mention why some files still claim to be version 2.
586 * version-etc.c.diff: New file, to make sure --version claims
587 correct GPL version. Temporary until gnulib makes move.
588 * gpl-3.0.texi.diff: New file, to allow inclusion of GPLv3 as
589 appendix, rather than section, of the manual.
590 * GNUmakefile: Update to new license.
591 * Makefile.am: Likewise.
592 * Makefile.maint: Likewise.
594 * configure.ac: Likewise.
595 * checks/Makefile.in: Likewise.
596 * doc/Makefile.am: Likewise.
597 * examples/Makefile.am: Likewise.
598 * src/Makefile.am: Likewise.
599 * src/builtin.c: Likewise.
600 * src/debug.c: Likewise.
601 * src/eval.c: Likewise.
602 * src/freeze.c: Likewise.
603 * src/input.c: Likewise.
604 * src/m4.c: Likewise.
605 * src/m4.h: Likewise.
606 * src/macro.c: Likewise.
607 * src/output.c: Likewise.
608 * src/path.c: Likewise.
609 * src/stackovf.c: Likewise.
610 * src/symtab.c: Likewise.
612 2007-06-26 Eric Blake <ebb9@byu.net>
614 * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import assert'.
616 2007-06-26 Karl Berry <karl@freefriends.org> (tiny change)
618 Match Free Software Directory categories.
619 * doc/m4.texinfo (dircategory): Update.
621 2007-05-31 Eric Blake <ebb9@byu.net>
623 * src/output.c (output_text): Fix regression from 2007-05-28.
624 * doc/m4.texinfo (History): Mention 1.4.10.
625 (Format): Make testsuite output easier to debug.
627 2007-05-29 Eric Blake <ebb9@byu.net>
630 * configure.ac (AC_INIT): Bump version number.
631 * NEWS: Start changes since 1.4.9b, and fix typo.
634 * configure.ac (AC_INIT): Bump version number.
635 * NEWS: Describe changes since 1.4.9.
637 Improve format support.
638 * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
640 * src/format.c (format): Parse %'hhd, %a, %A. Avoid calling
641 printf with too few arguments, as in format(%*.*d,-1,-1,1).
642 * doc/m4.texinfo (Format): Expand tests, and improve
644 * NEWS: Document this change.
646 2007-05-28 Eric Blake <ebb9@byu.net>
648 Fix large diversion corner cases, including 1.4.8 regression.
649 * src/output.c (m4_tmpfile, m4_tmpopen): Simplify use of errno.
650 (make_room_for): Use NULL, not 0, for pointers.
651 (insert_diversion_helper): Avoid using rewind.
652 (freeze_diversions): Allow freezing large diversions.
653 * NEWS: Document this fix.
655 Also run gnulib unit tests during make check.
656 * m4/gnulib-cache.m4: Augment with 'gnulib-tool
657 --tests-base=tests --with-tests'.
658 * configure.ac (AC_CONFIG_FILES): Build gnulib testdir.
659 * Makefile.am (SUBDIRS): Run gnulib tests before ours.
661 2007-05-25 Eric Blake <ebb9@byu.net>
663 Backport prompts in examples from head.
664 * src/macro.c (expand_macro): Shorten message.
665 * doc/m4.texinfo (Manual, Command line files, Comments)
666 (Inhibiting Invocation, Macro Arguments, Macro expansion, Indir)
667 (Builtin, Shift, Forloop, Foreach, Dumpdef, Trace, Debug Levels)
668 (Debug Output, Include, Format, Syscmd, Mkstemp, Location)
669 (Using frozen files, Improved forloop, Improved foreach): Add
671 * checks/get-them: Ignore prompts in examples.
673 Fix sync line interaction with multiline comments.
674 * doc/m4.texinfo (Other Incompatibilities): Add example, and
675 document bug in --syncline/divert interaction.
676 (Preprocessor features): Augment test.
677 * src/m4.h (output_text): Export.
678 (shipout_text, next_token): Add parameter.
679 * src/freeze.c (reload_frozen_state): Don't interfere with
680 synclines when reloading state.
681 * src/output.c (output_text): Export.
682 (shipout_text): Take new parameter for start line of token.
683 Output at most one syncline per token.
684 * src/input.c (next_token): Report line where multiline tokens
686 * src/macro.c (expand_input, expand_token, expand_argument):
687 Adjust callers so that line is passed from input to output.
688 * NEWS: Document this fix.
689 Reported by Sergey Poznyakoff.
691 Test -s in testsuite.
692 * doc/m4.texinfo (Preprocessor features): Add a test.
693 * checks/get-them: Support extra options in testsuite.
694 * checks/check-them (examples): Use extra options.
696 Reported by Sergey Poznyakoff.
698 2007-05-24 Eric Blake <ebb9@byu.net>
700 Support POSIX flush semantics on all platforms.
701 * m4/gnulib-cache.m4: Remove closeout, and augment with
702 'gnulib-tool --import closein fflush'.
703 * src/m4.h (includes): Use closein, not closeout.
704 * src/m4.c (main): Ensure stdin is flushed when not all input is
706 (process_file): No return needed.
707 * src/debug.c (debug_flush_files): Rely on gnulib module, rather
708 than excluding mingw.
709 * NEWS: Document this change.
711 Work around cygwin and mingw fseeko bugs.
712 * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import fseeko'.
713 * src/debug.c (debug_flush_files): Prefer fseeko over fseek.
715 2007-04-25 Eric Blake <ebb9@byu.net>
717 Fix negative division within eval, regression of 2007-01-06.
718 * doc/m4.texinfo (Eval): Catch this bug.
719 * src/eval.c (mult_term): Fix it.
720 * NEWS: Document this.
722 Reported by Cesar Strauss.
724 2007-04-23 Eric Blake <ebb9@byu.net>
727 * configure.ac (AC_INIT): Bump version number.
728 * NEWS: Start changes since 1.4.9.
730 2007-03-23 Eric Blake <ebb9@byu.net>
733 * configure.ac (AC_INIT): Bump version number.
734 * NEWS: Describe changes since 1.4.8b.
736 2007-03-16 Eric Blake <ebb9@byu.net>
738 * doc/m4.texinfo (Mkstemp): Tweak wording.
739 * src/output.c (output_init): Adjust to latest gnulib.
741 2007-03-15 Eric Blake <ebb9@byu.net>
743 Avoid Tandem/NSK's broken long long (without a symmetric unsigned
744 long long, it confuses gnulib).
745 * configure.ac (AC_TYPE_LONG_LONG_INT): Declare long long broken
746 if unsigned long long doesn't work.
748 Reported by Matthew Woehlke.
750 2007-03-07 Eric Blake <ebb9@byu.net>
753 * doc/m4.texinfo: Minor tweaks, avoid makeinfo warning.
755 2007-03-01 Eric Blake <ebb9@byu.net>
757 * doc/m4.texinfo: Pick up more index entries from head. Follow
758 more texinfo recommendations.
759 (Sysval): Improve tests.
761 Avoid overfull \vbox warning from texinfo, due to indices that
762 weren't quite big enough to split across page boundaries.
763 * doc/m4.texinfo: Add lots of concept index entries.
764 (Concept Index): Move to be last, as recommended by texinfo
766 (Define, Arguments, Pseudo Arguments): Add more function entries.
768 2007-02-28 Eric Blake <ebb9@byu.net>
770 * doc/m4.texinfo (Eval): Clean up wording to reflext POSIX XCU ERN
772 (Pseudo Arguments): Add useful example.
774 * doc/m4.texinfo (Pushdef, Incompatibilities): Clean up wording to
775 reflect POSIX XCU ERN 118.
777 * src/m4.h (DEFAULT_MACRO_SEQUENCE): Factor out from...
778 * src/m4.c (usage): ...here,...
779 * src/builtin.c (set_macro_sequence): ...and here.
780 (define_user_macro): Fix typo.
781 * doc/m4.texinfo (Preprocessor features, Arguments): Fix minor
783 (Shift): Document composite macro argn for portably getting at
784 positional parameters beyond 9.
785 * configure.ac (AC_INIT): Bump version number.
786 * NEWS: Start changes of 1.4.8c.
788 2007-02-24 Eric Blake <ebb9@byu.net>
791 * configure.ac (AC_INIT): Bump version number.
792 * NEWS: Describe changes since 1.4.8.
794 Reserve all uses of raw ${} in macro definitions, not just
796 * src/builtin.c (set_macro_sequence): Change default macro
798 * doc/m4.texinfo (Operation modes): Update to match.
799 * src/m4.c (usage): Likewise.
802 2007-02-23 Eric Blake <ebb9@byu.net>
804 * src/m4.h (includes): Update to latest gnulib.
806 2007-02-08 Eric Blake <ebb9@byu.net>
808 Rename --warn-syntax to --warn-macro-sequence[=regex], to make it
809 more flexible, and so that autoconf can use it.
810 * src/m4.h (set_macro_sequence, free_macro_sequence): New
812 * src/builtin.c (macro_sequence_buf, macro_sequence_regs)
813 (macro_sequence_inuse, set_macro_sequence, free_macro_sequence):
814 New variables and functions.
815 (define_user_macro): Allow flexibility in regular expression used
817 * src/m4.c (warn_syntax): Delete.
818 (usage, WARN_MACRO_SEQUENCE_OPTION, main): Implement changed
819 spelling of option, along with optional argument.
820 * doc/m4.texinfo (Operation modes, Arguments): Document this
822 * NEWS: Document this change.
824 2007-02-05 Eric Blake <ebb9@byu.net>
826 * m4/gnulib-cache.m4: Module strstr no longer exists.
828 Avoid bool bitfields, as they don't work on AIX.
829 * src/m4.h (bool_bitfield): New typedef.
830 (struct symbol, struct builtin): Use it.
831 * src/input.c (struct input_block): Likewise.
832 Reported by Albert Chin.
834 * doc/m4.texinfo (Sysval): Avoid SIGPIPE in test as unreliable.
835 Reported by Albert Chin.
838 2006-06-18 Bruno Haible <bruno@clisp.org> (tiny change)
840 * doc/m4.texinfo (Input processing): Further clarifications.
842 2007-02-03 Eric Blake <ebb9@byu.net>
844 * doc/m4.texinfo (Input processing, Quoting Arguments): Beef up
846 Reported by Bruno Haible.
848 2007-02-01 Eric Blake <ebb9@byu.net>
850 * src/m4.c (fatal_warnings): New variable.
851 (usage): Document new -E behavior.
852 (main): Make -E an additive option.
853 (m4_error, m4_error_at_line): Change exit status when required.
854 * NEWS: Document this change.
855 * doc/m4.texinfo (Operation modes): Likewise.
856 Reported by Ralf Wildenhues.
858 2007-01-27 Eric Blake <ebb9@byu.net>
860 * src/m4.h (warn_syntax): Declare.
861 (init_pattern_buffer): Export.
862 * src/m4.c (warn_syntax, usage, WARN_SYNTAX_OPTIONS)
863 (long_options, main): Implement new option.
864 * src/builtin.c (init_pattern_buffer): Allow NULL regs argument.
865 (define_user_macro): Warn on $11 and ${1} if requested.
866 * src/input.c (init_pattern_buffer): Delete duplicate method.
867 * doc/m4.texinfo (Operation modes): Document it.
868 (Arguments): Document future direction of ${11} vs. $11.
869 (Incompatibilities): Fix wording on POSIX limitations.
870 * checks/get-them: Parse @{ and @} correctly.
871 * NEWS: Document this change.
873 2007-01-26 Eric Blake <ebb9@byu.net>
875 * src/builtin.c (includes): Adjust to gnulib changes.
877 2007-01-15 Eric Blake <ebb9@byu.net>
879 * doc/m4.texinfo: Pull in various improvements from head.
880 * src/builtin.c (include): Alter exit status on failure.
881 * NEWS: Document this fix.
883 2007-01-13 Eric Blake <ebb9@byu.net>
885 * configure.ac (AC_CHECK_MEMBERS): Check for stack_t.ss_sp, and
886 assume the fallback of ss_base for BSDI 4.0.1.
887 * src/stackovf.c (setup_stackovf_trap) [HAVE_SIGALTSTACK &&
888 ! HAVE_STACK_T_SS_SP]: Use this check.
889 Reported by Chris McGuire.
891 * NEWS: Document the improvement.
893 2007-01-09 Eric Blake <ebb9@byu.net>
895 * src/eval.c (ASSIGN): New enumerator.
896 (eval_lex): Recognize '='.
897 (equality_term): Treat '=' like '==', but warn that it is
899 * doc/m4.texinfo (Eval): Document and test this.
900 (Incompatibilities): Document the POSIX incompatibility.
901 * NEWS: Document this change.
903 2007-01-06 Eric Blake <ebb9@byu.net>
905 * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import stdint'.
906 * checks/check-them: Record expected exit status.
907 * checks/get-them: Check exit status.
908 * src/m4.h (eval_t, unsigned_eval_t): Delete, use POSIX int32_t
910 * src/builtin.c: All users changed.
911 * src/eval.c: Likewise. Also document where we are triggering
912 undefined or implementation-defined behavior.
913 (BADOP, NEGATIVE_EXPONENT, INVALID_OPERATOR, eval_lex, evaluate)
914 (logical_or_term, logical_and_term, logical_not_term, not_term)
915 (equality_term, unary_term): Port from head to follow POSIX
917 (exp_term): Reject 0**0 as undefined.
918 * doc/m4.texinfo (History): Mention 1.4.9.
919 (Format, Incompatibilities): Update to document POSIX compliance.
920 * NEWS: Document this change.
922 2007-01-04 Eric Blake <ebb9@byu.net>
924 * NEWS: Document previous fix.
927 2007-01-04 Sami Liedes <sliedes@cc.hut.fi> (tiny change)
929 Fix Debian bug 405594, introduced 2006-11-01 from a bad
930 copy-n-paste from head.
931 * src/m4.c (main): Use correct file name after --.
933 2007-01-04 Eric Blake <ebb9@byu.net>
935 Fix regression from 1.4.7 in large file handling on some
936 platforms, introduced on 2006-10-13.
937 * configure.ac (AC_LARGE_SYSFILE): Guarantee that large files
939 * NEWS: Document this fix.
941 2007-01-03 Eric Blake <ebb9@byu.net>
943 * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
945 * src/m4.c (AUTHORS, main): Use FSF wording for --version (plus
946 it bumps the copyright year).
948 2006-12-27 Eric Blake <ebb9@byu.net>
950 * doc/m4.texinfo (Patsubst): Fix typo.
952 2006-12-16 Eric Blake <ebb9@byu.net>
954 * src/m4.c (main): Check for errors when closing stdin.
956 2006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
958 * doc/m4.texinfo: Fix some typos.
960 2006-12-09 Eric Blake <ebb9@byu.net>
962 * configure.ac (AC_INIT): Bump version number.
963 * NEWS: Start changes of 1.4.8a.
965 2006-11-20 Eric Blake <ebb9@byu.net>
968 * configure.ac (AC_INIT): Bump version number.
969 * NEWS: Describe changes since 1.4.7.
971 2006-11-16 Eric Blake <ebb9@byu.net>
973 * doc/m4.texinfo (Include, Search Path, Diversions, Divert):
974 Minor tweaks noticed while porting to head.
976 2006-11-14 Eric Blake <ebb9@byu.net>
978 * src/output.c (cleanup_tmpfile, freeze_diversions): Clean up
980 (m4_tmpname): Avoid memory leak.
982 2006-11-13 Eric Blake <ebb9@byu.net>
984 * src/output.c (cleanup_tmpfile): Avoid double error message when
985 umask is prohibitive.
986 (m4_tmpname, m4_tmpopen, m4_tmpclose, m4_tmpremove): New
988 (m4_tmpfile): Add parameter, move cloexec action here.
989 (make_room_for): Adjust caller. Don't keep too many files open.
990 (insert_diversion_helper): Unlink emptied temp files.
991 (make_diversion): Don't keep too many files open.
992 * doc/m4.texinfo (Diversions): Tweak wording, now that open file
993 descriptors are no longer a limiting factor.
994 * NEWS: Document this change.
996 Backport sparse diversion handling from head.
997 * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
999 * src/output.c (struct m4_diversion): Rename from struct
1000 diversion, and update members. All users changed.
1001 (diversion_table): Change to an ordered set, instead of an array.
1002 (div0): New storage for diversion 0.
1003 (diversions): No longer needed.
1004 (free_list): New list to allow recycling diversion storage.
1005 (diversion_storage): New storage to reduce malloc overhead.
1006 (cmp_diversion_CB, threshold_diversion_CB): New callbacks.
1007 (output_init, output_exit, cleanup_tmpfile, make_room_for)
1008 (make_diversion): Handle new diversion storage scheme.
1009 (insert_diversion_helper): New function.
1010 (insert_diversion, undivert_all, freeze_diversions): Use it.
1011 * doc/m4.texinfo (Divert, Diversions): Move hidden test of memory
1012 exhaustion to visible test of large diversion numbers.
1013 * NEWS: Document this fix.
1015 2006-11-11 Eric Blake <ebb9@byu.net>
1017 * src/builtin.c (m4_translit): Slight optimization.
1019 * src/m4.h (to_uchar): Depend on HAVE_INLINE.
1021 * src/builtin.c: Remove unnecessary casts.
1022 (expand_ranges): Make 8-bit clean.
1023 * doc/m4.texinfo (Translit): Add tests and wording.
1024 * NEWS: Document this fix.
1026 2006-11-07 Eric Blake <ebb9@byu.net>
1028 * src/m4.h (output_exit): New prototype.
1029 * src/m4.c (main): Use it.
1030 * src/output.c (cleanup_tmpfile): Close files before removing
1032 (insert_diversion): Check for failure.
1033 (output_exit): Avoid memory leak.
1034 * doc/m4.texinfo (Diversions): Test this bug.
1036 * doc/m4.texinfo (Esyscmd, Errprint): Minor touchups.
1038 2006-11-01 Eric Blake <ebb9@byu.net>
1040 Allow C++ compilation on Linux, as a safety measure in type
1042 * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
1044 * src/m4.h (hack_symbol, hack_all_symbols): Use full prototype.
1045 (boolean): Kill this, and use stdbool.h instead.
1046 * src/debug.c, src/eval.c, src/input.c, src/macro.c, src/m4.c:
1047 * src/output.c, src/symtab.c: All users changed.
1048 * src/symtab.c (hack_all_symbols): Update prototype.
1049 * src/builtin.c (dump_symbol, set_trace): Update signature.
1050 (m4_dumpdef, m4_traceon, m4_traceoff): Update callers.
1051 (mkstemp_helper, m4_m4wrap, expand_ranges, m4_translit): Allow
1053 * src/debug.c (trace_flush): Likewise.
1054 * src/freeze.c (reload_frozen_state): Likewise.
1055 * src/input.c (push_file, push_string_finish, push_wrapup):
1056 (token_bottom, next_token): Likewise.
1057 * src/m4.c (main): Likewise.
1059 * doc/m4.texinfo (Invoking m4): Update according to POSIX 200x
1061 * src/m4.h (m4_path_search): Tweak signature.
1062 * src/path.c (m4_path_search): Likewise.
1063 * src/builtin.c (include): Update caller.
1064 * src/m4.c (main): Allow -D, -U, -t, and -s to be interspersed
1065 with file names. Don't write to **argv.
1066 (process_file): New helper method.
1067 * NEWS: Document this fix.
1069 2006-10-31 Eric Blake <ebb9@byu.net>
1071 * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import strstr'.
1072 * doc/m4.texinfo (Translit): Improve the documentation.
1073 * src/builtin.c (m4_translit): Optimize to O(n) instead of O(n^2)
1075 (m4_index): Simplify, and speed up slightly.
1076 * NEWS: Document this fix.
1078 2006-10-28 Eric Blake <ebb9@byu.net>
1080 * src/input.c (set_quotes): Don't allow empty end-quote with
1081 non-empty start-quote.
1082 (set_comment): Likewise for end-comment.
1083 * src/builtin.c (m4_changecom): Adjust caller.
1084 * doc/m4.texinfo (Changequote, Changecom): Update documentation to
1086 (Incompatibilities): Document another POSIX bug.
1087 * NEWS: Mention this change.
1089 2006-10-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1091 * examples/Makefile.am (EXTRA_DIST): Distribute recently-added
1094 2006-10-26 Eric Blake <ebb9@byu.net>
1096 Silence -Wwrite-strings -Wpointer-arith warnings.
1097 * src/builtin.c (define_user_macro): Allow NULL argument.
1098 (m4_builtin, m4_indir): Cast away const of "".
1099 * src/format.c (format): Likewise.
1100 * src/macro.c (collect_arguments): Likewise.
1101 (expand_macro): Avoid math on void*.
1102 * src/m4.c (main): Adjust caller.
1103 * src/output.c (freeze_diversions): Detect off_t overflow.
1105 * src/input.c (pop_input): Remove unnecessary code.
1107 2006-10-25 Eric Blake <ebb9@byu.net>
1109 * src/symtab.c (symtab_init): Avoid size_t overflow.
1110 * src/output.c (make_diversion): Avoid size_t overflow.
1111 * doc/m4.texinfo (Diversions): Test this fix.
1112 * src/input.c (input_block): Remove unused member. Reduce size
1114 (push_file, pop_input): Avoid useless assignment.
1115 * NEWS: Document the bug fix.
1117 Redo location tracking. Instead of having just files track the
1118 line to return to when popping input, now all input blocks track
1120 * src/input.c (INPUT_STRING_WRAP, INPUT_FILE_INIT): No longer
1122 (input_block): Have line and file storage for all input types, and
1123 rename some members.
1124 (input_change): New global flag.
1125 (push_file, push_macro, push_string_init, push_wrapup): Store
1127 (push_string_finish, pop_input, pop_wrapup): Notice changes in
1129 (peek_input): Adjust to new member names.
1130 (next_char, next_char1): Adjust location if needed.
1131 (skip_line): Simplify restoring location.
1132 * doc/m4.texinfo (Location): Augment the test to catch line
1133 location of expansion of multi-line arguments.
1134 Reported by Stepan Kasal.
1136 2006-10-23 Eric Blake <ebb9@byu.net>
1138 * doc/m4.texinfo (Macro Arguments): Document that leading space
1139 in argument collection stops at macro expansion.
1140 (Incompatibilities): Document POSIX whitespace wording issue.
1142 2006-10-20 Eric Blake <ebb9@byu.net>
1144 * doc/m4.texinfo: Trailing '@comment' doesn't format nicely in
1145 TeX, so recognize '@w{ }' instead. Likewise, @code{_name} at the
1146 end of a TeX line splits incorrectly.
1147 (Foreach, Improved foreach): Write these sections, borrowing ideas
1148 from CVS head and from m4sugar.
1149 * checks/get-them: Accomodate new way to show trailing space in
1151 * examples/foreach.m4: Make usable in documentation.
1152 * examples/foreachq.m4: New file.
1153 * examples/foreachq2.m4: New file.
1154 * examples/foreach2.m4: New file.
1155 * NEWS: Document the documentation updates.
1157 2006-10-19 Eric Blake <ebb9@byu.net>
1159 * src/builtin.c (mkstemp_helper, m4_mkstemp): New functions.
1160 (m4_maketemp): Provide traditional behavior.
1161 * doc/m4.texinfo (Mkstemp): Rename from Maketemp. Document the
1162 new `mkstemp' macro and the flaws of the old `maketemp'.
1163 (Incompatibilities): Move maketemp discussion to...
1164 (Extensions): ...here, since -G now supresses the GNU extension.
1165 * NEWS: Document this.
1167 * examples/forloop.m4: Simplify.
1168 * examples/forloop2.m4: New file.
1169 * examples/quote.m4: New file.
1170 * doc/m4.texinfo (Loops): Rename to...
1171 (Shift): ...this node.
1172 (Forloop, Foreach, Improved forloop, Improved foreach): New
1175 2006-10-17 Eric Blake <ebb9@byu.net>
1177 * m4/gnulib-cache.m4: Update with 'gnulib-tool --import
1179 * configure.ac (AC_CONFIG_HEADERS): Create config.h alongside
1180 gnulib headers, rather than in top directory.
1181 * src/Makefile.am (AUTOMAKE_OPTIONS): Add nostdinc, to reduce make
1184 2006-10-16 Eric Blake <ebb9@byu.net>
1186 * doc/m4.texinfo: Backport some minor cleanups from head.
1187 (Cleardivert): Rename from cleardiv.
1189 * doc/m4.texinfo (Invoking m4): Promote to a chapter, instead of
1190 a section of Preliminaries.
1191 (Operation modes, Preprocessor features, Limits control)
1192 (Frozen state, Debugging options, Command line files): Subdivide
1194 (Input processing, Quoting Arguments, Define, Arguments)
1195 (Cleardiv, Format, M4exit): Fix grammar of references.
1196 (Inhibiting Invocation, Macro Arguments, Builtin, Trace)
1197 (Debug Levels, Debug Output, Include, Search Path, Divert)
1198 (Platform macros, Syscmd, Location, Extensions): Point to new
1200 (Top, Loops, Include, Undivert, Location, Incompatibilities):
1201 Improve file references.
1203 2006-10-14 Eric Blake <ebb9@byu.net>
1205 * m4/input.c (file_clean): Don't close stdin twice, POSIX says it
1207 Reported by Ralf Wildenhues.
1209 * src/builtin.c (m4_undivert): Check for read error.
1211 2006-10-13 Eric Blake <ebb9@byu.net>
1213 * src/m4.h (UNIX, W32_NATIVE, OS2): Move platform checks after
1214 header files are included, since <unistd.h> can affect the tests.
1216 Reported by Martin Koeppe.
1218 Backport head's usage of clean-temp module, as it is cleaner than
1219 using tmpfile-safer.
1220 * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
1221 clean-temp closeout', and remove tmpfile-safer.
1222 * src/m4.h (includes): Adjust.
1223 (m4_path_search): Rename from path_search, to avoid collision
1225 * src/m4.c (main): Install closeout handler. Adjust caller.
1226 (usage): Now done by closeout module.
1227 * src/builtin.c (m4_m4exit): Likewise.
1228 (m4_undivert, include): Adjust callers.
1229 * src/freeze.c (reload_frozen_state): Likewise.
1230 * src/path.c (m4_path_search): Rename from path_search.
1231 * src/output.c (output_temp_dir): New variable.
1232 (cleanup_tmpfile, m4_tmpfile): New functions, from head.
1233 (insert_diversion, make_room_for): Use them.
1234 * doc/m4.texinfo (Diversions): Document this, and add a test.
1235 (Improved fatal_error): Fix typo.
1236 (Maketemp): Port test to mingw, and no longer hide from
1238 * NEWS: Document the change in TMPDIR behavior.
1240 * configure.ac (m4_pattern_forbid): Narrow the range of forbidden
1241 macros, to work with recent gnulib-tool update.
1243 * src/builtin.c (m4_builtin, m4_indir): Allow transparent
1244 handling of defn results.
1245 * doc/m4.texinfo (Builtin, Indir): Add test cases.
1246 * NEWS: Document this.
1248 2006-10-12 Eric Blake <ebb9@byu.net>
1250 * doc/m4.texinfo (Location): Fix typo in previous commit.
1251 (Changeword): Catch one more case.
1252 * src/input.c (skip_line): Fix case when outer file used macro to
1255 2006-10-11 Eric Blake <ebb9@byu.net>
1257 * src/input.c (enum input_type): Add additional types, to shave
1258 time off the common case.
1259 (push_wrapup): Wrapped strings remember location.
1260 (push_string_finish): Normal strings carry no location.
1261 (push_file): Start new files uninitialized.
1262 (peek_input, next_char_1): Optimize common cases by updating
1263 location only on new input types.
1264 (pop_input): Update to honor new input types.
1265 (skip_line, push_string_finish): Fix regression in previous patch
1266 when dnl is not followed by newline in included file.
1267 (push_string_init): Initialize all fields of INPUT_STRING sooner.
1268 (peek_token): Simplify.
1269 (peek_input): Don't pop input files on peek, so that __file__ and
1270 __line__ as last token of include file work correctly.
1271 * doc/m4.texinfo (History): Mention 1.4.8.
1272 (Answers): Split into sections, one per answer.
1273 (Improved exch, Improved cleardivert, Improved fatal_error): New
1275 (Dnl, M4wrap, Location, M4exit, Improved fatal_error): Update to
1276 new m4wrap location semantics.
1277 (Changeword): Add test that caught the regression.
1278 * NEWS: Document this.
1280 * src/macro.c (expand_macro): In macro expansion errors, report
1281 line number at open parenthesis.
1282 * src/input.c (next_token): Fix off-by-one bug in reporting end
1283 of file in unterminated comment and string.
1284 (file_names): New obstack, necessary since expand_macro now hangs
1285 on to file names longer than the files remain open.
1286 (input_init): Initialize new obstack.
1287 (push_file): Use new obstack. Delay updates to current_file
1288 until after expand_macro has restored state.
1289 (peek_input, next_char_1): Update current_file if necessary.
1290 (pop_wrapup): Release memory.
1291 * doc/m4.texinfo (Macro Arguments, Changequote, Changecom): Catch
1293 (Dnl): Update to the new location reporting rules.
1294 * NEWS: Document these changes.
1296 2006-10-10 Eric Blake <ebb9@byu.net>
1298 * src/macro.c (argc_stack, argv_stack): New variables for sharing
1299 obstacks across multiple macro calls.
1300 (expand_input): Initialize and tear down stack once per input
1301 file, instead of once per macro.
1302 (expand_macro): Reuse existing stacks when possible.
1303 (collect_arguments): Simplify slightly.
1305 * src/path.c (include_env_init): Fix botched patch application.
1306 Reported by Ralf Wildenhues.
1308 2006-10-09 Eric Blake <ebb9@byu.net>
1310 * src/m4.c (usage, main): Detect write failures to stderr.
1311 * src/builtin.c (m4_m4exit): Likewise.
1312 * NEWS: Document this.
1314 * src/macro.c (expand_macro): Allow --nesting-limit=0 to remove
1316 * NEWS: Document this.
1317 * doc/m4.texinfo (Invoking m4): Likewise.
1319 2006-10-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1321 * src/path.c (include_env_init): Copy the string returned
1322 by getenv before overwriting it; POSIX disallows this.
1324 2006-10-09 Eric Blake <ebb9@byu.net>
1326 * src/m4.c (main): Defer debugfile until after --help.
1327 * configure.ac (AC_INIT): Bump version number.
1328 * NEWS: Start changes of 1.4.7a.
1330 2006-09-25 Eric Blake <ebb9@byu.net>
1333 * configure.ac (AC_INIT): Bump version number.
1334 * NEWS: Describe changes since 1.4.6.
1336 2006-09-21 Eric Blake <ebb9@byu.net>
1338 * doc/m4.texinfo (Invoking m4): Add clarification on option
1339 processing behavior.
1341 Reported by Mikhail Teterin.
1343 * bootstrap: Add --force option, based on idea from coreutils.
1344 * README: Document that ./bootstrap and autoreconf are for
1345 developers, and not lightly done in tarballs.
1347 2006-09-20 Eric Blake <ebb9@byu.net>
1349 * src/m4.c (usage, OPTSTRING, main): Rename -e to -i, and give
1350 deprecation warning on -e.
1351 * doc/m4.texinfo (Invoking m4, Extensions): Document this.
1352 * NEWS: Document this.
1354 2006-09-19 Eric Blake <ebb9@byu.net>
1356 * src/m4.c (usage, long_options, main, DEBUGFILE_OPTION): Rename
1357 -o/--error-output to --debugfile, and deprecate the former. This
1358 will allow a future release to be more consistent with other GNU
1359 tools, with -o/--output affecting stdout, not debug.
1360 * doc/m4.texinfo (Invoking m4, Debug Output): Document this.
1361 * NEWS: Document this.
1363 2006-09-14 Eric Blake <ebb9@byu.net>
1365 * src/m4.c (main): Warn on deprecated options -B, -S, -T, -N,
1366 --diversions. `m4 --help --version' now displays help, not
1368 (interactive, frozen_file_to_read, frozen_file_to_write): Move to
1370 (show_help, show_version): No longer needed.
1371 (long_options, DIVERSIONS_OPTION): Backport patch from head to
1372 distinguish between -N and --diversions in warning.
1373 * doc/m4.texinfo (Invoking m4): Document this.
1376 2006-09-11 Eric Blake <ebb9@byu.net>
1378 * src/Makefile.am (m4_LDADD): Add any gnulib dependent libraries.
1379 * src/debug.c (debug_flush_files) [UNIX]: Flush stdin if it is
1381 (debug_set_file): Use STDOUT_FILENO.
1382 * src/builtin.c (m4_m4exit): Flush stdin before exiting, to comply
1383 with POSIX in regards to unread input.
1384 * NEWS: Document this fix.
1385 * doc/m4.texinfo (Syscmd, Esyscmd, M4exit): Likewise.
1387 2006-09-07 Eric Blake <ebb9@byu.net>
1389 * m4/gnulib-cache.m4: Update to newer gnulib-tool.
1390 * src/m4.h (push_file): Change prototype.
1391 * src/input.c (push_file, peek_input, next_char_1): Only call getc
1392 once at EOF, to avoid double ^D on terminal stdin; regression from
1394 (push_file, pop_file): Allow reading stdin twice.
1395 * src/m4.c (main): Likewise.
1396 * src/builtin.c (include): Update caller.
1397 * NEWS: Document this change.
1398 * doc/m4.texinfo (Invoking m4, Incompatibilities): Likewise.
1399 (Syscmd): Add a test that failed before this patch.
1401 2006-09-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1403 * checks/check-them: Quote $pwd.
1405 2006-09-05 Eric Blake <ebb9@byu.net>
1407 * src/builtin.c (define_macro): Warn on invalid macro name.
1408 * NEWS: Document this change.
1409 * doc/m4.texinfo: Fix typos.
1410 (Invoking m4, Macro Arguments, Pseudo Arguments, Defn, Indir)
1411 (Ifelse): Backport some improvements from head.
1413 2006-09-04 Eric Blake <ebb9@byu.net>
1415 * doc/m4.texinfo (Changeword): Skip test on mingw, where the
1416 native echo is braindead.
1417 * checks/check-them (strip_needed): Ignore \r in output. Now the
1418 testsuite will pass when cross-compiling from cygwin to mingw.
1420 * src/input.c (peek_input): Fix regression in handling macro
1421 without arguments as last token in file; debian bug 385720.
1422 (next_token): Always consume an input character.
1423 Reported by Andreas Schultz.
1424 * configure.ac (AC_INIT): Bump version number.
1425 * NEWS: Document this fix.
1426 * doc/m4.texinfo (History): Mention next version.
1427 (Changeword): Add example that exposes this bug.
1430 2006-08-25 Eric Blake <ebb9@byu.net>
1433 * configure.ac (AC_INIT): Bump version number.
1434 * NEWS: Describe changes since 1.4.5.
1436 * Makefile.maint (web-manual): Give up on VPATH build during
1437 distribution. But distributions are made so infrequently that
1438 this is not too much of a hardship.
1439 * Makefile.am (MAINTAINERCLEANFILES): Avoid error if lib/CVS/
1442 2006-08-24 Eric Blake <ebb9@byu.net>
1444 * src/builtin.c (m4_index, m4_substr, m4_translit): Similar to
1445 Solaris, produce output on just one argument.
1446 (m4_regexp, m4_patsubst): For consistency, do likewise.
1447 (m4_patsubst): Allow zero-length match at end of string.
1448 * doc/m4.texinfo (Sysval): Fix overfull hbox.
1449 (Bugs, Macro Arguments): Minor fixes.
1450 (Other tokens): Rearrange node order.
1451 (Index macro, Substr, Translit, Regexp, Patsubst): Add tests.
1452 * NEWS: Document these fixes.
1454 2006-08-22 Eric Blake <ebb9@byu.net>
1456 * src/input.c (pop_input): Avoid empty filename with -di option.
1457 * src/debug.c (debug_message_prefix): Put space before message.
1459 * m4/gnulib-cache.m4: We don't explicitly use alloca module.
1461 * m4/gnulib-cache.m4: Augment with gnulib-tool --import gnupload.
1462 * Makefile.maint (fetch): Simplify, now that we can use gnupload.
1464 * checks/check-them: State why a test is skipped.
1465 * doc/m4.texinfo (Changeword, Sysval, Maketemp): Likewise.
1467 * ChangeLog: Add copyright.
1468 * AUTHORS: Likewise.
1469 * BACKLOG: Likewise.
1473 * examples/COPYING: New file, add copyright for all the examples.
1474 * checks/get-them: Put copyright on testsuite files.
1476 2006-08-18 Eric Blake <ebb9@byu.net>
1478 Don't let unrelated child processes see too many files.
1479 * m4/gnulib-cache.m4: Augment with gnulib-tool --import cloexec.
1480 * src/builtin.c (m4_esyscmd, m4_regexp, m4_patsubst): Fix
1481 spelling in error message.
1482 * src/debug.c [!__STDC__]: Assume C89, and nuke old varargs.h.
1483 (debug_set_output): Close debug file on exec.
1484 * src/m4.h (includes): Add cloexec.h.
1485 * src/output.c (make_room_for): Close diversions on exec.
1486 * src/path.c (path_search): Close include files on exec.
1487 * NEWS: Document this.
1489 Regular expressions were leaking memory.
1490 * src/builtin.c (init_pattern_buffer, free_pattern_buffer): New
1492 (m4_regexp, m4_patsubst): Avoid memory leak.
1493 * src/input.c (init_pattern_buffer) [ENABLE_CHANGEWORD]: Make
1495 (set_word_regexp) [ENABLE_CHANGEWORD]: Avoid memory leak. Change
1496 from O(n^2) to O(n) for calculating word_start.
1497 (next_token, peek_token) [ENABLE_CHANGEWORD]: Treat word_start as
1498 O(1) bitmap, not O(n) search string.
1499 * NEWS: Document this fix.
1501 2006-08-17 Eric Blake <ebb9@byu.net>
1503 * NEWS: Document previous checkin.
1505 * src/builtin.c (substitute): Avoid core dump when accessing
1506 beyond bound of regular expression.
1507 Reported by Karl Nelson.
1508 * doc/m4.texinfo (Regexp): Add example that causes core dump on
1509 some architectures prior to this patch.
1512 2006-08-16 Eric Blake <ebb9@byu.net>
1514 * doc/m4.texinfo (Invoking m4, Debug Output): Fix wording to be
1515 clear that dumpdef does not always go to stderr.
1517 * src/builtin.c (m4_errprint): Flush buffers before printing to
1521 2006-08-15 Eric Blake <ebb9@byu.net>
1523 * src/builtin.c (m4_m4wrap, m4_errprint, m4_shift): Make blind,
1524 per debian bug 96075.
1525 * doc/m4.texinfo (Loops, M4wrap, Errprint): Document this change.
1526 (Changeword): Don't use shift as an example of a swallowed word.
1527 (Divert): Discuss fact that divert is an English word.
1528 Reported by Richard A Nelson.
1530 2006-08-14 Eric Blake <ebb9@byu.net>
1532 * doc/m4.texinfo (Invoking m4): Minor fixes.
1534 2006-08-12 Eric Blake <ebb9@byu.net>
1536 * doc/m4.texinfo (Arguments): Hint at better exch macro.
1537 (Answers): Provide a better definition.
1539 2006-08-09 Eric Blake <ebb9@byu.net>
1541 * doc/m4.texinfo (Incompatibilities): Document that m4 does not
1542 yet understand locales.
1543 * NEWS: Fix wording of a few items.
1545 2006-08-08 Eric Blake <ebb9@byu.net>
1547 Avoid printing `NONE:0:' in error messages.
1548 * src/m4.h (m4_error_at_line): New function.
1549 * src/m4.c (m4_error_at_line): Implement.
1550 * src/input.c (skip_line, input_init, next_token): Use "", not
1551 "NONE", for no file, since NONE can be a real file name.
1552 * src/macro.c (expand_argument): Likewise.
1553 * src/debug.c (debug_message_prefix, trace_header): Check for
1555 * doc/m4.texinfo (Dnl, M4wrap): Adjust accordingly.
1556 (Location): Document that synclines and internal message format
1557 are not impacted by redefining these macros.
1558 (M4exit): Hint at bug in fatal_error.
1559 (Answers): Provide workaround to match m4 output.
1561 * m4/gnulib-cache.m4: Augment with gnulib-tool --import verror.
1562 * src/m4.h (m4_error): New function.
1563 (M4ERROR, M4ERROR_AT_LINE): Reimplement without hacking around
1564 error module deficiencies.
1565 (reference_error, suppress_line): No longer needed.
1566 * src/m4.c (m4_error): Implement.
1567 (main): No longer need to install error callback.
1569 2006-08-04 Eric Blake <ebb9@byu.net>
1571 * src/m4.h (program_name): Declare.
1572 (suppress_line): New variable.
1573 (M4ERROR_AT_LINE): New macro.
1574 * src/m4.c (reference_error, main): Follow GNU Coding Standards
1575 for error message format.
1576 * src/input.c (skip_line, next_token): Use M4ERROR_AT_LINE.
1577 * src/macro.c (expand_argument): Likewise.
1578 * checks/check-them (examples): Adjust to new message format.
1579 * src/builtin.c (m4___program__): New builtin.
1580 * doc/m4.texinfo (Location): Split from Errprint into new node,
1581 and document __program__.
1582 (Builtin, Ifdef, Ifelse, Dumpdef, Trace, Debug Output, Dnl)
1583 (Include, Regexp, Patsubst, Incr, Eval): Adjust error message
1585 (Extensions): Document __program__.
1586 * NEWS: Document this change.
1588 2006-08-03 Eric Blake <ebb9@byu.net>
1590 Don't confuse leading `(' in comment or quote with start of
1591 argument collection.
1592 * src/m4.h (enum token_type): Add TOKEN_OPEN, TOKEN_COMMA,
1594 (peek_input): Make private to input.c.
1595 (peek_token): New prototype.
1596 * src/input.c (default_word_regexp): Reduce ifdefs.
1597 (peek_input): Make static.
1598 (next_token): Return new token types.
1599 (match_input, MATCH): Add argument consume, which controls
1600 whether match should be pushed back.
1601 (peek_token): New function.
1602 (token_type_string) [DEBUG_INPUT]: New function.
1603 * src/macro.c (expand_token, expand_argument, collect_arguments):
1604 Handle new token types.
1605 * doc/m4.texinfo (Changequote, Changecom): Document this.
1606 * NEWS: Document this.
1608 * src/stackovf.c (setup_stackovf_trap): Free memory on failure.
1610 * src/stackovf.c (setup_stackovf_trap): Gracefully avoid stack
1611 overflow detection when sigstack exists but is not implemented.
1612 Fixes debian bug 154053.
1614 Reported by David Perlin.
1616 2006-08-02 Eric Blake <ebb9@byu.net>
1618 * src/input.c (MATCH): Fix EOF detection on multi-byte comment
1621 2006-08-01 Eric Blake <ebb9@byu.net>
1623 * src/input.c (skip_line, next_token): Remember current file in
1624 case input file ends abruptly. Addresses debian bug 175365.
1625 (pop_input): Defer freeing storage that holds previous file
1627 (pop_wrapup): to here, after error message is issued.
1628 * src/macro.c (expand_argument): Remember current file in case
1629 input file ends abruptly.
1630 * doc/m4.texinfo (Macro Arguments, Dnl, Changequote, Changecom)
1631 (M4wrap): Adjust testsuite accordingly.
1632 (Errprint): Document line number limitation of m4wrap.
1633 * NEWS: Document this fix.
1636 2006-07-31 Eric Blake <ebb9@byu.net>
1638 * src/input.c (peek_input, next_char, match_input): Be eight-bit
1639 clean; fixes debian bug 311378.
1640 * doc/m4.texinfo (Syntax): Describe eight-bit handling.
1641 (Changequote, Changecom): Add examples to test this.
1642 * NEWS: Document this fix.
1644 Reported by Steven Augart.
1646 * doc/m4.texinfo: Whitespace fix.
1647 * checks/get-them: Avoid exceeding 14-char file name limit.
1650 2006-07-30 Eric Blake <ebb9@byu.net>
1652 * src/path.c (path_search): Detect allocation failure.
1654 Use native free when it is good enough.
1655 * m4/gnulib-cache.m4: Augment with gnulib-tool --import free.
1656 * src/builtin.c (define_user_macro, m4_regexp, m4_patsubst):
1658 * src/symtab.c (free_symbol): Likewise.
1659 * src/m4.c (xfree, main): Likewise.
1660 * src/m4.h (obstack_chunk_free): Likewise.
1661 * src/path.c (path_search): Likewise.
1662 * src/input.c (pop_wrapup, set_quotes, set_comment): Likewise.
1664 * doc/m4.texinfo (Errprint): Add example for last patch.
1665 * checks/check-them: Account for VPATH in latest example.
1667 2006-07-29 Eric Blake <ebb9@byu.net>
1669 * src/path.c (path_search): Add result parameter, so that
1670 -I can be accounted for. Debian bug 53685.
1671 * src/m4.h (path_search): Update prototype.
1672 * src/m4.c (main): Adjust callers.
1673 * src/freeze.c (reload_frozen_state): Likewise.
1674 * src/builtin.c (include, m4_undivert): Likewise.
1675 * NEWS: Document this change.
1676 Reported by Nicolas Lichtmaier.
1678 2006-07-28 Eric Blake <ebb9@byu.net>
1680 * Makefile.am (MAINTAINERCLEANFILES): Fix typo that tripped up
1681 several non-GNU makes.
1682 * src/stackovf.c (setup_stackovf_trap): Missed _ from yesterday.
1683 * src/m4.h: Likewise.
1684 * src/input.c (push_wrapup): Avoid compiler warning with Solaris
1687 2006-07-27 Eric Blake <ebb9@byu.net>
1689 * doc/m4.texinfo: Use @acronym{GNU} throughout.
1690 (History): Update for 1.4.6.
1692 * src/m4.h (_): Remove K&R cruft.
1693 * src/builtin.c: Likewise.
1694 * src/debug.c: Likewise.
1695 * src/eval.c: Likewise.
1696 * src/macro.c: Likewise.
1697 * src/stackovf.c: Likewise.
1699 * doc/Makefile.am (m4.1): Improve man page.
1700 * src/m4.c (usage): Improve --help output, including adding the
1701 bug reporting address.
1702 (main): Follow GNU Coding Standards for --version output.
1704 2006-07-26 Eric Blake <ebb9@byu.net>
1706 * doc/m4.texinfo: Use begin-quote, end-quote, begin-comment, and
1707 end-comment consistently, to match POSIX.
1709 * doc/m4.texinfo (Macro Arguments, Changequote, Changecom)
1710 (Dnl, M4wrap, Include): Document EOF issues, and add examples.
1711 (Incompatibilities): Document incompatibility of changecom
1712 vs. macro names, and of EOF in include.
1713 * src/input.c (next_token): Reject unterminated comments at EOF.
1714 (skip_line): Warn on unterminated dnl at EOF.
1715 * NEWS: Document these changes.
1717 2006-07-25 Eric Blake <ebb9@byu.net>
1719 * m4/gnulib-cache.m4: Update to reflect gnulib's split of
1720 stdio-safer into fopen-safer and tmpfile-safer.
1721 * src/m4.c: Remove redundant include.
1723 2006-07-24 Eric Blake <ebb9@byu.net>
1725 Fix bugs related to stream handling.
1726 * m4/gnulib-cache.m4: Augment with gnulib-tool --import
1727 unlocked-io stdio-safer stdlib-safer close-stream.
1728 * configure.ac (AC_CHECK_FUNCS_ONCE): Assume tmpfile; it can be
1729 provided by gnulib if needed.
1730 * src/output.c [! HAVE_TMPFILE]: Likewise.
1731 * src/m4.h (includes): Replace unistd, stdio, and stdlib with
1732 their safer counterparts.
1733 (retcode): New global variable.
1734 * src/input.c (pop_input): Check for read failure.
1735 * src/freeze.c (reload_frozen_state): Likewise.
1736 (produce_frozen_state): Check for write failure.
1737 * src/debug.c (debug_set_file): Likewise.
1738 * src/m4.c (usage, main): Likewise.
1739 (retcode): Make global.
1740 * src/builtin.c (m4_m4exit): Likewise. Ensure that the exit
1741 status is non-zero except when everything succeeds.
1742 * doc/m4.texinfo (M4exit): Document these changes.
1743 (Incompatibilities): Remove documentation of bug now fixed.
1744 * NEWS: Document these fixes.
1746 2006-07-22 Eric Blake <ebb9@byu.net>
1748 * src/format.c (format): Avoid compiler warning that str may be
1751 2006-07-21 Eric Blake <ebb9@byu.net>
1753 * src/m4.h [UNIX]: Add more platforms that are close enough to
1754 categorize as UNIX, but which don't predefine __unix__.
1755 Reported by Nelson H. F. Beebe.
1757 2006-07-20 Eric Blake <ebb9@byu.net>
1759 * m4/gnulib-cache.m4: gnulib-tool has changed again. Regenerate
1760 to explicitly ask for --assume-autoconf=2.60.
1762 2006-07-19 Eric Blake <ebb9@byu.net>
1764 * doc/m4.texinfo (Sysval): Avoid kill -1, since ksh traps SIGHUP
1765 and exits normally with 129.
1766 Reported by Nelson H. F. Beebe.
1769 * src/m4.h (EXIT_MISMATCH): Define.
1770 * src/freeze.c (reload_frozen_state): Detect version mismatch, by
1771 exiting with status 63.
1772 * src/m4.c (usage): Document this.
1773 * doc/m4.texinfo (Invoking m4, Using frozen files): Likewise.
1776 * doc/m4.texinfo (copying): Relax restriction on front-cover and
1779 2006-07-17 Eric Blake <ebb9@byu.net>
1781 * src/format.c (format): Support F, g, and G specifiers.
1782 * doc/m4.texinfo (Format): Document this.
1783 * NEWS: Document this addition.
1785 * doc/m4.texinfo (Builtin): Delete redundant text.
1787 * configure.ac (AC_INIT): Bump version number.
1788 * src/builtin.c (substitute): Bah. Fix buffer overrun.
1789 * NEWS: Document this fix.
1791 2006-07-15 Eric Blake <ebb9@byu.net>
1794 * configure.ac (AC_INIT): Bump version number.
1795 * NEWS: Describe changes since 1.4.4.
1797 * src/m4.c (usage): Document exit status.
1798 * doc/m4.texinfo: Use `exit status', not `exit code'.
1799 (Invoking m4): Document exit status.
1801 * bootstrap: Backport --help, --version from head.
1802 (func_update): New function, for easily grabbing up-to-date files
1804 * Makefile.maint (web-manual): Fix for VPATH builds.
1806 2006-07-14 Eric Blake <ebb9@byu.net>
1808 * doc/m4.texinfo: Global cleanup. Avoid @code{...}'d, as it
1809 looks bad in info. Use @deffn rather than @example for
1810 describing prototypes. Fix awkward wording and grammar.
1812 * src/builtin.c (substitute): Warn on bad escape sequences.
1813 Ignore trailing backslash.
1814 * doc/m4.texinfo (Regexp): Add documentation for this.
1815 * NEWS: Document this change.
1817 * src/builtin.c (m4_format, m4_indir): Warn on too few arguments.
1818 * doc/m4.texinfo (Defn, Builtin, Debug Levels, Debug Output): Add
1820 (Dnl): Update example to show side effects.
1821 * checks/get-them: Generate three digit test names.
1822 * checks/Makefile.in (CHECKS): Accomodate 100+ tests.
1824 2006-07-13 Eric Blake <ebb9@byu.net>
1826 * src/input.c (input_init): Simplify.
1827 (set_word_regexp): Treat empty string as default, since empty
1828 regexp would disable word parsing.
1829 * src/m4.c (user_word_regexp): Default to empty string.
1830 * src/builtin.c (builtin_tab): Make changeword blind.
1831 * doc/m4.texinfo (Changeword): Document this.
1832 * NEWS: Document this.
1833 * TODO: Knock off completed items.
1835 * src/builtin.c (m4_undefine, m4_popdef): Visit all arguments, not
1837 * doc/m4.texinfo (Undefine, Pushdef): Test this.
1838 * NEWS: Document this change.
1840 * src/builtin.c (numeric_arg): Treat empty string as 0, with a
1841 warning. Detect quoted leading space and overflow as warnings.
1842 (m4_eval): Treat empty radix as 10, and allow output in radix 1.
1843 Treat width as minimum number of digits, as required by POSIX.
1844 (m4_ifdef, m4_divert, m4_m4exit, m4_translit): Ignore extra
1846 (m4_substr): Likewise. Silently treat empty start as 0.
1847 (m4_undivert): Treat ` 1a' as file, not diversion 1.
1848 * src/eval.c (eval_lex): Parse radix 1 numbers.
1849 * doc/m4.texinfo (Invoking m4): Fix wording; there is more than
1850 one type of warning.
1851 (Manual): Document behavior of numeric parsing of empty string.
1852 (Divert, Incr): Document error handling.
1853 (Eval): Document radices better.
1854 (Incompatibilities): Document translit incompatibility.
1855 * NEWS: Document these changes.
1857 * Makefile.maint (fetch): Get gendocs from gnulib, not texinfo.
1858 (web-manual): Simplify.
1859 * m4/gnulib-cache.m4: Augment with gnulib-tool --import gendocs.
1860 * Makefile.am (EXTRA_DIST): Distribute gendocs.sh.
1861 (MAINTAINERCLEANFILES): Clean it as well.
1862 * doc/Makefile.am (EXTRA_DIST): Distribute gendocs_template.
1863 (MAINTAINERCLEANFILES): Clean it as well.
1865 2006-07-12 Eric Blake <ebb9@byu.net>
1867 * doc/m4.texinfo (Extensions): Document how to overcome
1868 implementation difference in > 9 positional parameters.
1870 * src/m4.c (usage): Sort within sections.
1871 (nesting_limit): Raise default from 250 to 1024.
1872 * doc/m4.texinfo: Use file name, not filename, per GNU coding
1873 standard. Use @option where appropriate.
1874 (Invoking m4): Sort to match --help output.
1875 (Debug Levels): Sort.
1876 (Frozen files): Sort and break into two nodes.
1878 * src/m4.c (nesting_limit): Raise default from 250 to 1024.
1879 * NEWS: Document raised -L limit.
1881 2006-07-11 Eric Blake <ebb9@byu.net>
1883 * Makefile.am (DISTCHECK_CONFIGURE_FLAGS): New macro, to
1884 stress-test changeword before a release.
1885 * doc/m4.texinfo: More doc cleanups.
1886 (Copying This Manual): New node; actually include the FDL in the
1888 * doc/Makefile.am (m4_TEXINFOS): Mention dependence on fdl.texi.
1889 * m4/gnulib-cache.m4: Augment with gnulib-tool --import fdl.
1890 * NEWS: Mention documentation improvements.
1892 * src/m4.h (OS2): New platform macro.
1893 * src/builtin.c (predefined_tab) [OS2]: Use it to give OS/2 a
1895 * doc/m4.texinfo (Platform macros): Document it.
1896 (Sysval): Remove non-portable test of system("").
1897 * NEWS: Document this change.
1898 Reported by Andreas Buening.
1900 2006-07-09 Eric Blake <ebb9@byu.net>
1902 * doc/m4.texinfo (Undivert): Fix typo in last commit.
1903 * src/m4.c (usage): Document M4PATH.
1904 * src/path.c (path_search): Reject empty string.
1905 * src/output.c (insert_diversion): Ignore diversion 0.
1906 * src/builtin.c (m4_undivert): Ignore empty string.
1907 * NEWS: Document this fix.
1909 2006-07-08 Eric Blake <ebb9@byu.net>
1911 * checks/get-them: Make filtering easier.
1912 * checks/check-them: Filter non-input lines, so line counts are
1913 more realistic in the documentation, and so changeword tests work
1914 even when dnl is disabled.
1915 * doc/m4.texinfo: Adjust example line numbers. Clean up
1916 front-matter, following autoconf's example.
1917 (Changeword): Enable tests, skipping if changeword not supported.
1918 (Define, Defn, Ifelse): Backport more examples from head.
1919 (Input processing, Answers): New nodes, backported from head.
1920 (Include): Expand test to cover empty filename.
1921 (Undivert): Add test of undivert(0).
1923 2006-07-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1925 * doc/m4.texinfo: Fix spelling errors.
1927 2006-07-07 Eric Blake <ebb9@byu.net>
1931 * doc/Makefile.am (m4.1): No need to go through a temporary file;
1932 this also ensures timestamps are updated.
1933 * src/m4.h (includes): Require config.h. Assume string.h,
1934 stdlib.h, errno. Include error.h, exit.h, and xalloc.h rather
1935 than prototyping ourselves.
1936 (builtin_func): Add parameter type-checking.
1937 (voidstar): Delete, now that we assume C89.
1938 * src/builtin.c, src/m4.c, src/macro.c, src/symtab.c: All users of
1940 * src/m4.c (xfree) [WITH_DMALLOC]: Avoid clash with dmalloc's
1943 2006-07-06 Eric Blake <ebb9@byu.net>
1945 * m4/gnulib-cache.m4: Augment with gnulib-tool --import
1947 * src/m4.h (includes): Add binary-io.h for O_BINARY.
1948 * src/freeze.c (produce_frozen_state): Use O_BINARY to remove
1949 #ifdef. Fixes patch from 2005-02-03 for cygwin.
1950 * NEWS: Mention this fix.
1952 * configure.ac (FUNC_SYSTEM_BROKEN): New check for OS/2 bug.
1953 * src/builtin.c (m4_syscmd): Work around OS/2 bug.
1955 * Makefile.am (SUBDIRS): Build . before src, so that autoheader
1956 runs first when needed.
1957 * doc/Makefile.am (m4.1): Backport rule from CVS head: build m4.1
1958 once in srcdir rather than multiple times in VPATH builds.
1960 2006-07-03 Eric Blake <ebb9@byu.net>
1962 * checks/check-them: Use portable = in test.
1963 * src/Makefile.am (AM_CPPFLAGS): Omit space between -I and
1964 directory, as required by Solaris cc. Include built headers, as
1965 required by Solaris make in VPATH build.
1966 * checks/Makefile.in: Use $(srcdir) where needed.
1967 (CHECKS): Factor $(srcdir) into macro.
1968 (DISTFILES): Likewise. Automake takes care of distributing
1971 (Makefile): Use modern syntax of config.status.
1972 * doc/m4.texinfo (Loops, Include, Undivert, Incompatibilities):
1973 Avoid overfull and underfull hboxes in dvi.
1975 Fix 'make check' in VPATH build. All files included by testsuite
1976 now live in a single directory. Use forloop.m4 in testsuite.
1977 * checks/incl.m4, checks/foo, checks/wrapfifo.m4: Move from
1979 * examples/incl.m4, examples/foo, examples/wrapfifo.m4: ...to
1981 * checks/Makefile.in (DISTFILES): Don't distribute moved files.
1982 * examples/Makefile.am (EXTRA_DIST): Distribute new files.
1983 * checks/check-them: Avoid s/// when filename is in pattern.
1984 * examples/forloop.m4: Fix to match documentation.
1985 * doc/m4.texinfo (Include, Undivert, Incompatibilities): Reflect
1987 (Loops, Format): Actually use forloop.m4 in tests.
1989 2006-07-02 Eric Blake <ebb9@byu.net>
1991 * checks/Makefile.in (exec_prefix, prefix): New macros, so that
1992 $(bindir) works in installcheck.
1993 (check, installcheck): No longer change directory, so that
1994 distcheck works with a read-only builddir.
1995 * checks/check-them: Work when pwd is no longer builddir.
1997 2006-07-01 Eric Blake <ebb9@byu.net>
1999 * GNUmakefile: New file, borrowed from coreutils.
2000 * Makefile.am (EXTRA_DIST): Distribute GNUmakefile.
2001 * Makefile.maint (Makefile): Delete this rule, now that
2002 GNUmakefile includes Makefile.
2004 2006-06-30 Eric Blake <ebb9@byu.net>
2006 For compatibility with other m4 implementations, sysval returns
2007 signal<<8 rather than 0 if syscmd is terminated by a signal.
2008 * configure.ac (AC_CHECK_HEADERS_ONCE): Check for sys/wait.h.
2009 * src/builtin.c (include): Include sys/wait.h when stdlib.h does
2010 not provide wait macros.
2011 (WTERMSIG, WIFSIGNALED, WIFEXITED): More fallback macros.
2012 (M4SYSVAL_EXITBITS, M4SYSVAL_TERMSIGBITS): New helper macros.
2013 (m4_esyscmd): Set sysval to -1 on failure.
2014 (m4_sysval): Print 127 on failure, and accomodate signals if they
2016 * NEWS: Document this change.
2017 * doc/m4.texinfo (Platform macros, Esyscmd, Sysval): Fix typos in
2019 * checks/check-them: Likewise.
2020 * src/debug.c (debug_set_file): Work around mingw fstat bug.
2022 * src/m4.h (UNIX, W32_NATIVE): Improve platform detection macros.
2023 * src/freeze.c (produce_frozen_state): Use new spelling of
2025 * src/builtin.c (predefined_tab): Add __windows__ on non-unix
2027 (m4_syscmd, m4_esyscmd): The empty command is successful.
2028 * doc/m4.texinfo (Shell commands): Rename from UNIX commands.
2029 Document platform-dependence of system().
2030 (Syscmd): Add example.
2031 (Esyscmd): Make example more robust, and actually demonstrate
2033 (Sysval): Expand test to cover esyscmd code path, and to check
2034 that empty command is successful. Add conditional check for
2036 (Other Incompatibilities): Move platform macros from here...
2037 (Platform macros): ...to this new node. Add windows macro.
2038 Check that exactly one platform macro is provided.
2039 * checks/check-them: Improve trap cleanup. Tolerate dirname and
2040 .exe in error messages. Allow for skipping checks.
2041 * configure.ac (HAVE_EFGCVT): Kill dead configure check.
2042 * NEWS: Document platform macros.
2044 2006-06-29 Eric Blake <ebb9@byu.net>
2046 Fix buffer overrun bug.
2047 * m4/gnulib-cache.m4: Augment with gnulib-tool --import
2049 * src/format.c [HAVE_EFGCVT]: Delete this code, and use *printf
2050 variant instead, since [efg]cvt are obsolete and our use of them
2051 was buggy (savannah sr #104303).
2052 (format): Fix buffer overflow by using xasprintf.
2053 * doc/m4.texinfo (Format): Expand format test to catch both bugs.
2054 * NEWS: Document this fix.
2056 * configure.ac (AC_CANONICAL_HOST, AC_CANONICAL_BUILD): Allow
2058 (AC_CACHE_CHECK): Cache search for ecvt.
2060 2006-06-27 Eric Blake <ebb9@byu.net>
2062 * doc/m4.texinfo (Eval): Document 32-bit signed limitations
2063 required by POSIX, and add example that exposed core dump on x86
2065 (Incompatibilities): Document incompatibility in eval precedence.
2066 * src/eval.c (shift_term): Explicitly mask, to avoid undefined
2068 (mult_term): Explicitly check for -1, to avoid SIGFPE on x86.
2069 * NEWS: Document this change.
2071 * doc/m4.texinfo: Use @noindent consistently.
2072 (Quoting Arguments): Document that unquoted parentheses group
2074 (Pseudo Arguments): Expand tests to show this.
2075 (Incompatibilities): Contrast traditional behavior of
2078 2006-06-24 Eric Blake <ebb9@byu.net>
2080 * configure.ac (AC_PREREQ): Autoconf 2.60 is now released.
2081 (AC_CHECK_HEADERS_ONCE): Use this new feature.
2082 (AC_CHECK_FUNCS_ONCE): Likewise.
2084 2006-06-23 Eric Blake <ebb9@byu.net>
2086 * doc/m4.texinfo: Quoting cleanup throughout - follow
2087 autoconf-recommended style of one level of quote per parenthesis
2088 in the normal case. Adjust error messages to match GNU coding
2089 standards (and to allow 'make check' to pass again).
2090 (Quoted strings, Inhibiting Invocation): Turn more examples into
2092 (Comments): Resolve FIXME by adding example.
2093 (Define): Add example about underquoting.
2094 (Defn): Add example about use of $0.
2095 (Indir, Format): Resolve FIXME done in last commit.
2096 (Ifelse): Add example about creating blind macro.
2097 (Debugging): Fix grammar.
2098 (Dnl): Add example about dnl with arguments.
2099 (M4wrap): Be explicit that LIFO order is non compliant, and will
2101 (Undivert): Resolve FIXME by adding example.
2102 (Frozen files): Document that m4wrap and sysval will not work
2103 consistently until m4 2.0.
2104 (Incompatibilities): Document another POSIX compliance bug, this
2105 time with changequote. Document a traditional incompatibility
2106 with partial input spanning file boundaries.
2108 Make error messages more consistent with GNU coding standards -
2109 start with lower case, and don't end sentence with punctuation.
2110 * src/debug.c (trace_pre): Update message wording.
2111 * src/eval.c (evaluate, cmp_term, shift_term, mult_term):
2113 * src/freeze.c (produce_frozen_state, issue_expect_message),
2114 (reload_frozen_state): Likewise.
2115 * src/input.c (push_string_init, pop_init, init_macro_token),
2116 (peek_input, next_char_1, set_word_regexp, next_token): Likewise.
2117 * src/m4.c (stackovf_handler, main): Likewise.
2118 * src/macro.c (expand_token, expand_argument, call_macro),
2119 (expand_macro): Likewise.
2120 * src/output.c (make_room_for, output_text, insert_file),
2121 (freeze_diversions): Likewise.
2122 * src/symtab.c (symtab_init, lookup_symbol): Likewise.
2124 * src/builtin.c (builtin_tab): Make format and indir blind.
2125 (substitute): Prefer "Warning:" vs. "ERROR:" in messages.
2126 * NEWS: Mention the change to builtins.
2128 2006-06-22 Eric Blake <ebb9@byu.net>
2130 Robustify frozen file format.
2131 * src/freeze.c (reload_frozen_state): Add GET_DIRECTIVE helper
2132 macro. Require V first, and only accept it once. For F, use
2133 placeholder if builtin is not found, rather than warning.
2134 * src/m4.h (m4_placeholder): New prototype.
2135 * src/builtin.c: Unify error message style.
2136 (m4_placeholder): New function, warn if invoked.
2137 (builtin_tab): Add m4_placeholder.
2138 (m4_defn): Warn if placeholder is encountered.
2139 (find_builtin_by_addr): Handle placeholder.
2140 (find_builtin_by_name): Return placeholder on failure.
2141 (m4_builtin): Treat placeholder as undefined.
2142 * doc/m4.texinfo (Frozen files): Document changes in V and F.
2143 * NEWS: Document this change.
2144 Reported by Bruno Haible.
2146 * doc/m4.texinfo: Whitespace cleanup. TABs are evil in texinfo.
2147 (tabchar): New macro, so that 'make check' still works.
2148 (Invoking m4): Document that ignored compatibility options -B, -S,
2149 and -T each consume an argument.
2150 * checks/get-them: Honor @tabchar{}.
2152 Avoid compiler warnings during -DDEBUG.
2153 * src/m4.h (M4_GNUC_ATTRIBUTE, M4_GNUC_UNUSED): New macros.
2154 [DEBUG]: Also imply DEBUG_OUTPUT and DEBUG_STKOVF.
2155 * src/input.c (print_token) [DEBUG_INPUT]: Use correct format.
2156 (lex_debug) [DEBUG_INPUT]: Fix to compile. Mark unused.
2157 (next_token) [DEBUG_INPUT]: Print before returning.
2158 * src/path.c (include_dump) [DEBUG_INCL]: Mark unused.
2159 * src/symtab.c (symtab_debug) [DEBUG_SYM]: Mark unused.
2161 Avoid mkstemp bugs on various platforms.
2162 * m4/gnulib-cache.c: Augment with gnulib-tool --import mkstemp.
2163 * src/output.c [! HAVE_MKSTEMP]: Delete.
2164 * configure.ac (AC_CHECK_FUNCS): Don't check for mkstemp.
2165 * src/m4.h (mkstemp) [! HAVE_MKSTEMP]: Prototype, if needed.
2166 * NEWS: Document this.
2168 * Makefile.am (EXTRA_DIST): Distribute gnulib-cache.m4.
2169 Reported by Bruno Haible.
2171 2006-06-21 Eric Blake <ebb9@byu.net>
2173 Avoid obsolete sigstack when POSIX sigaltstack is available.
2174 * src/m4.c: Blindly assume signal.h, since stackovf.c and gnulib
2176 * configure.ac (AC_CHECK_HEADERS): Likewise.
2177 (AC_CHECK_TYPES): New check for siginfo_t, since siginfo.h is
2178 obsolete and most hosts now have it in signal.h.
2179 (AC_CHECK_MEMBERS): New check for sigaction.sa_sigaction.
2180 (AC_CACHE_CHECK): Cache decision to use stackovf.
2181 (AC_EGREP_HEADER): Switch to AC_CHECK_TYPES.
2182 * src/stackovf.c (DEBUG_STACKOVF): Remove unused define.
2183 (SA_RESETHAND, SA_SIGINFO): Provide fallback definitions, to
2184 simplify later code.
2185 (PARAM_STACKOVF, PARAM_NOSTACKOVF): Move further away from NULL,
2186 in case of dereferencing a member of a NULL pointer.
2187 (sigsegv_handler) [HAVE_STRUCT_SIGACTION_SA_SIGACTION]: Define a
2189 (setup_stackovf_trap): Use NULL instead of 0 for pointers, use
2190 EXIT_FAILURE in error, indent preprocessor directives.
2191 [HAVE_SIGALTSTACK && HAVE_SIGINFO_T]: Depend on siginfo_t, not
2193 [HAVE_SIGACTION && defined SA_ONSTACK]: Prefer POSIX handler.
2194 Reported by Santiago Vila.
2196 2006-06-19 Eric Blake <ebb9@byu.net>
2200 2006-06-18 Andreas Buening <andreas.buening@nexgo.de> (tiny change)
2202 * checks/Makefile.in (PATH_SEPARATOR): New macro.
2203 (check, installcheck): Use it, for OS/2.
2205 2006-06-18 Eric Blake <ebb9@byu.net>
2207 Consistently use "GNU M4" as package name, "m4" as executable
2209 * NEWS: Document previous fix.
2211 * README: Fix grammar. Document that --enable-changeword is on
2213 * doc/m4.texinfo (Top, Changeword): Likewise.
2214 (Sysval): Enhance this test.
2215 (History): Backport this section from CVS head, and update.
2217 2006-06-18 Bruno Haible <bruno@clisp.org> (tiny change)
2218 Eric Blake <ebb9@byu.net>
2220 * src/builtin.c (WEXITSTATUS): Provide fallback definition.
2221 (m4_esyscmd): Set sysval to 0xffff, to accomodate both
2222 big-endian and little-endian wait status definitions.
2223 (m4_sysval): Use WEXITSTATUS.
2224 Reported by Andreas Buening.
2226 2006-06-18 Eric Blake <ebb9@byu.net>
2228 * configure.ac (AC_INIT): Bump version number.
2229 * NEWS: Describe changes in 1.4.4c.
2231 2006-06-17 Eric Blake <ebb9@byu.net>
2233 Beta Release 1.4.4b:
2234 * configure.ac (AC_INIT): Bump version number.
2235 * NEWS: Describe changes since 1.4.4.
2236 * Makefile.maint (cvs-news): Accomodate copyright line wrapping.
2238 * Makefile.am (MAINTAINERCLEANFILES): Clean files added by
2240 * checks/Makefile.in (maintainer-clean): Add missing target.
2241 * COPYING: Remove generated file from CVS.
2243 2006-06-16 Eric Blake <ebb9@byu.net>
2245 * checks/Makefile.in (DISTFILES): Distribute wrapfifo.m4.
2247 2006-06-15 Eric Blake <ebb9@byu.net>
2249 * checks/wrapfifo.m4: New file. Use it...
2250 * doc/m4.texinfo (Incompatibilities): here, in a new test case to
2251 demonstrate how to get POSIX behavior of m4wrap prior to m4 2.0.
2253 * src/m4.h (to_uchar): New function.
2254 * src/eval.c (eval_lex): Use it to avoid passing signed char to
2255 isdigit, isalpha, isupper, islower, isspace, isalnum.
2256 * src/builtin.c (expand_user_macro): Likewise.
2257 * src/format.c (format): Likewise.
2258 * src/macro.c (expand_argument): Likewise.
2259 * NEWS: Document this security fix.
2262 * src/symtab.c (lookup_symbol): Use invalid, not illegal.
2263 * src/freeze.c (reload_frozen_state): Fix typo in message.
2264 (produce_frozen_state): Standardize on builtin, not built-in.
2265 * src/builtin.c (numeric_arg, bad_argc): Likewise.
2267 * configure.ac (M4_EARLY, M4_INIT): Use gnulib.
2268 (AC_PROG_RANLIB, AC_AIX, AC_MINIX, AC_CHECK_HEADERS),
2269 (AC_FUNC_ALLOCA, AC_REPLACE_FUNCS): Avoid checks now done by
2271 * Makefile.am (ACLOCAL_AMFLAGS): New entry, for gnulib.
2272 * m4/gnulib-cache.m4: New file, from gnulib.
2273 * bootstrap: Invoke gnulib-tool --update.
2274 * src/m4.c (main): Cast away const.
2275 * NEWS: Document that regex is updated.
2278 2006-06-08 Eric Blake <ebb9@byu.net>
2280 * configure.ac (changeword): Work even when changeword is not a
2282 (AC_PROG_AWK, AC_PROG_INSTALL, AC_PROG_MAKE_SET, AC_HEADER_STDC):
2283 Delete; now done by automake.
2284 (AC_ISC_POSIX, AC_C_CONST): Delete; now obsolete.
2286 2006-06-07 Eric Blake <ebb9@byu.net>
2288 * lib/regex.c (bcmp_translate): Canonicalize type name.
2289 * doc/Makefile.am (MAINTAINERCLEANFILES): Fix typo.
2290 * configure.ac (changeword): Disable changeword for the creation
2291 of configure, in case of bootstrapping with an m4 configured with
2292 --enable-changeword.
2294 Distribute a rudimentary man page.
2295 * Makefile.am (SUBDIRS): Move doc after src so that 'm4 --help'
2297 * doc/Makefile.am (man_MANS, EXTRA_DIST, MAINTAINERDISTCLEAN),
2298 (SUFFIXES, m4.1): New macros and rules to build m4.1.
2300 2006-06-06 Eric Blake <ebb9@byu.net>
2302 * lib/regex.c (re_match_2_internal, bcmp_translate): Avoid
2303 compiler warnings at -O2.
2304 * lib/getopt.c (_getopt_internal): Likewise.
2306 Cleanup of previous patches.
2307 * src/input.c (struct input_block): Remove traced member.
2308 (push_macro, init_macro_token): Don't pass trace status around.
2309 * src/m4.h (struct token_data): Remove traced member.
2310 (struct symbol, struct builtin): Reduce unused space.
2311 (TOKEN_DATA_FUNC): Simplify.
2312 (TOKEN_DATA_FUNC_TRACED): Remove unused macro.
2313 (push_macro, define_builtin): Remove unused parameter.
2314 * src/builtin.c (define_builtin, builtin_init, define_macro),
2315 (m4_defn): Don't pass trace status around.
2316 * src/macro.c (expand_argument): Likewise.
2317 * src/freeze.c (reload_frozen_state): Likewise.
2318 * src/symtab.c: Whitespace cleanup.
2319 * NEWS: Clean up wording.
2320 * doc/m4.texinfo (Undefine, Dumpdef, Trace): Cleanup wording;
2321 ensure tests actually expose bugs prior to today's patches.
2323 Trace status of builtins is no longer inherited across
2324 define(...,defn(...)). Fixes bug that autom4te had been working
2326 * src/builtin.c (define_builtin): Don't override trace status.
2327 * doc/m4.texinfo (Trace): Add test for this.
2328 * NEWS: Document this.
2330 When changing macro definitions inside the arguments to the macro,
2331 consistently preserve the old definition that was in effect before
2332 argument collection, similar to the C pre-processor.
2333 Reported by John Brzustowski.
2334 * NEWS: Document this change.
2335 * doc/m4.texinfo (Macro Arguments, Undefine, Dumpdef): Document
2336 this policy, and add tests that expose core dumps prior to this
2338 * src/m4.h (struct symbol): New members to track when a symbol is
2339 still in use after removal from the symbol table.
2340 (SYMBOL_PENDING_EXPANSIONS, SYMBOL_DELETED): Define.
2341 (free_symbol): Prototype.
2342 * src/macro.c (expand_macro): Track pending expansions of a
2343 symbol. On completion, if a symbol is deleted and no longer
2344 pending, free its memory.
2345 * src/symtab.c (free_symbol): Export. Don't free memory if symbol
2347 (lookup_symbol) <SYMBOL_INSERT>: Create new entry when old entry
2349 (lookup_symbol) <SYMBOL_DELETE, SYMBOL_POPDEF>: Mark entries still
2350 in use as deleted and remove from the table without freeing
2352 (symtab_print_list) [DEBUG_SYM]: More debug output.
2354 * src/symtab.c (hack_all_symbols): Allow certain modifications of
2355 the symbol table during traversal.
2356 * src/builtin.c (set_trace): Replace SYMBOL_DELETE with
2357 SYMBOL_POPDEF, since only the latter is safe with
2360 Solve crash when passing "indir(`foo')" to "m4 -tfoo".
2361 * src/symtab.c (lookup_symbol) <SYMBOL_DELETE, SYMBOL_POPDEF>:
2362 Preserve placeholder when macro is being traced.
2363 * src/builtin.c (m4_ifdef, m4_indir): A traced but undefined
2364 symbol is not defined.
2365 (set_trace): Remove placeholder when no longer traced.
2366 (m4_traceon): On named traces, always reserve a slot in the
2368 (m4_traceoff): Don't warn about untracing a nonexistent symbol.
2369 * NEWS: Document new trace behavior.
2370 * doc/m4.texinfo (Trace): Tracing by name now consistently works
2371 no matter whether that macro is currently defined.
2372 (Incompatibilities): Document differences between traditional and
2375 2006-06-04 Paul Eggert <eggert@cs.ucla.edu> (tiny change)
2376 Eric Blake <ebb9@byu.net>
2378 * src/m4.h (hash_table_size): Now size_t instead of int.
2379 * src/m4.c (hash_table_size): Likewise.
2380 (main): Adjust to this; use atol rather than atoi.
2381 * src/symtab.c: Include <limits.h>, for CHAR_BIT.
2382 (symtab_init, lookup_symbol, hack_all_symbols):
2383 Use size_t for sizes and indexes, not int.
2384 (symtab_print_list) [DEBUG_SYM]: Likewise.
2385 (hash): Likewise. Don't case-fold in the hash function.
2386 Shift by 7, not 3, for consistency with gnulib/lib/hash.c.
2387 Don't assume hash word is 32 bits.
2388 * NEWS: Document this change.
2390 2006-06-04 Eric Blake <ebb9@byu.net>
2392 * src/symtab.c (symtab_debug, symtab_print_list) [DEBUG_SYM]: Fix
2393 to allow compilation, for use in debugger.
2394 (profiles, current_mode) [DEBUG_SYM]: New variables.
2395 (show_profile, profile_strcmp) [DEBUG_SYM]: New methods for
2396 determining hash table performance.
2398 2006-05-31 Eric Blake <ebb9@byu.net>
2399 John Brzustowski <jbrzusto@fastmail.fm>
2401 * src/input.c (input_stack): Delete; use current_input instead.
2402 (wrapup_stack): Dynamically allocate, so that recursion is handled
2404 (push_wrapup): Use current wrapup stack.
2405 (pop_wrapup): Rotate wrapup stack to current, and create new
2407 (input_init): Dynamically allocate stacks.
2408 * NEWS: Update, now that recursive m4wrap can no longer cause
2411 2006-05-31 Eric Blake <ebb9@byu.net>
2413 * lib/getopt.c: Fix copyright year.
2414 * lib/obstack.c: Ditto.
2415 * src/builtin.c: Ditto.
2417 2006-05-30 Eric Blake <ebb9@byu.net>
2419 * doc/m4.texinfo (M4wrap): Add test to expose m4wrap bug.
2420 Reported by John Brzustowski.
2421 (Incompatibilities): Document known POSIX incompatibilities.
2424 2006-05-29 Eric Blake <ebb9@byu.net>
2426 * doc/m4.texinfo (Maketemp): Work even when running 'make check'
2430 * Makefile.am: New file.
2431 * doc/Makefile.am: Ditto.
2432 * examples/Makefile.am: Ditto.
2433 * lib/Makefile.am: Ditto.
2434 * src/Makefile.am: Ditto.
2435 * acinclude.m4: New file, renamed from aclocal.m4.
2436 * configure.ac (AM_INIT_AUTOMAKE): Invoke new macro.
2437 (AC_ARG_PROGRAM): Now redundant.
2438 (STACKOVF): Turn into automake conditional.
2439 (AC_CONFIG_COMMANDS): stamp-h is a command, not a file.
2440 * checks/Makefile.in: Converting this dir to automake was not
2441 trivial; for now, just add missing targets demanded by top-level.
2442 * INSTALL: Remove files that are now generated from CVS.
2443 * Makefile.in: Ditto.
2444 * aclocal.m4: Ditto.
2445 * install-sh: Ditto.
2446 * mkinstalldirs: Ditto.
2447 * doc/Makefile.in: Ditto.
2448 * doc/texinfo.tex: Ditto.
2449 * examples/Makefile.in: Ditto.
2450 * lib/Makefile.in: Ditto.
2451 * src/Makefile.in: Ditto.
2453 * AUTHORS: Backport from CVS head, and update.
2454 * doc/m4.texinfo (Changeword): Fix examples to match behavior.
2456 2006-05-27 Eric Blake <ebb9@byu.net>
2458 * lib/regex.c (regex_compile): Kill compiler warnings.
2459 * lib/getopt.c: Likewise.
2460 * lib/obstack.c: Likewise.
2461 * src/builtin.c (builtin_init): Likewise.
2462 * src/path.c (path_search): Likewise.
2464 * doc/m4.texinfo: Fix usage of a vs. an.
2465 (Loops, Include, Cleardiv, Patsubst, Format, M4exit): Kill
2466 overfull hbox warnings.
2467 (Inhibiting Invocation, Divert, Maketemp, M4exit): Add new tests.
2469 * configure.ac: Update to autoconf 2.59. Forbid ^M4_. Fix
2471 * aclocal.m4 (fp_PROG_CC_STDC): Delete; now covered by autoconf.
2472 (fp_C_PROTOTYPES): Delete, GNU Coding Standards state we can now
2474 (M4_WITH_DMALLOC): Rename from fp_WITH_DMALLOC. Fix quoting.
2475 * src/m4.h (_): PROTOTYPES is no longer provided, assume C89.
2476 * src/Makefile.in: Delete remains of ansi2knr.
2477 * src/ansi2knr.1: Delete.
2478 * src/ansi2knr.c: Delete.
2480 2006-05-25 Eric Blake <ebb9@byu.net>
2482 * doc/m4.texinfo: Fix spelling errors. Use `invalid' instead of
2485 * doc/m4.texinfo (Francois): No longer needed as a tex variable.
2486 Reported by Karl Berry.
2488 2006-05-24 Eric Blake <ebb9@byu.net>
2490 * Makefile.in (html): New target.
2491 * doc/Makefile.in (html, m4.html): Likewise.
2492 (MAKEINFOHTML): New macro.
2493 * doc/m4.texinfo (Francois) [ifnottex]: Use newer texinfo
2495 (Regexp) [ifhtml]: Make cross-reference to emacs manual an
2497 Reported by Bob Badour.
2499 * THANKS: Update. Move reporter's email addresses here, instead
2502 2006-05-11 Eric Blake <ebb9@byu.net>
2505 * doc/m4.texinfo (Changequote): Give testsuite exposure to bug
2506 patched on 2005-12-04.
2507 Reported by Ilya N. Golubev.
2509 * bootstrap: New file, so that generated files need not be stored
2511 * Makefile.in (DISTFILES): Add bootstrap.
2513 Make testsuite less sensitive to doc changes.
2514 * doc/m4.texinfo: Use m4.input instead of filename.
2515 * checks/check-them (xerr): Turn m4.input into filename.
2516 * checks/Makefile.in (dist): Depend on stamp-checks.
2518 Portability updates for OS/2.
2519 * src/Makefile.in (EXEEXT, OBJEXT): Define.
2522 * lib/Makefile.in (OBJEXT): Define.
2524 * doc/Makefile.in (install, uninstall): Install info files into
2526 Reported by Andreas Buening.
2528 2006-05-09 Eric Blake <ebb9@byu.net>
2530 * install-sh: Update to newer upstream version.
2531 * mkinstalldirs: Likewise.
2532 Reported by Andreas Buening.
2534 * src/m4.c (main): Bump copyright year.
2535 * Makefile.in (datarootdir): Define, for autoconf 2.59c.
2536 * doc/Makefile.in (datarootdir): Likewise.
2538 2006-05-08 Eric Blake <ebb9@byu.net>
2541 * doc/m4.texinfo (Bugs): Backport bug email address from head.
2542 Reported by Stepan Kasal.
2544 2005-12-04 Ilya N. Golubev <gin@mo.msk.ru> (tiny change)
2546 * input.c (match_input): Do not pass expression with side effect
2547 to `obstack_grow'. Fix <INTERNAL ERROR: Recursive push_string!>.
2550 2005-12-04 Gary V. Vaughan <gary@gnu.org> (tiny change)
2552 * doc/m4.texinfo (How to debug macros and input): s/woould/would/
2553 Reported by Damian Menscher.
2555 2005-10-19 Gary V. Vaughan <gary@gnu.org> (tiny change)
2557 * configure.ac (AC_INIT): Bump to 1.4.4a.
2559 2005-10-19 Gary V. Vaughan <gary@gnu.org> (tiny change)
2562 * configure.ac (AC_INIT): Bump to 1.4.4.
2563 * NEWS: Describe 1.4.4's changes.
2564 * INSTALL, install-sh, doc/texinfo.tex: Updated from upstream.
2566 2005-10-17 John Gatewood Ham <zappaman@buraphalinux.org> (tiny change)
2568 * src/m4.c: fix return code when non-existent files are processed
2570 2005-10-17 John Gatewood Ham <zappaman@buraphalinux.org> (tiny change)
2572 * README: update email address for bug reports.
2574 2005-10-17 Gary V. Vaughan <gary@gnu.org>
2576 * doc/m4.info: Generated files are not kept in the repository.
2578 2005-05-01 Gary V. Vaughan <gary@gnu.org>
2580 The FSF are moving offices today. Changed their contact address
2581 in all files from `59 Temple Place, Suite 330, MA 02111-1307' to
2582 `51 Franklin Street, Fifth Floor, MA 02110-1301'.
2584 Also, some of the files here were never updated from the previous
2585 '675 Mass Ave, Cambridge, MA 02139', so changed those to the
2586 '51 Franklin Street, Fifth Floor, MA 02110-1301' address too.
2588 2005-03-31 Mike Frysinger <vapier@gentoo.org>
2590 * Makefile.in (bindir, infodir): Substitute from configure rather
2592 * doc/Makefile.in (infodir): Ditto.
2593 * src/Makefile.in (bindir): Ditto.
2596 2005-03-31 Gary V. Vaughan <gary@gnu.org>
2598 Changes needed to automate the release process for 1.4.3:
2600 * Makefile.in (dist): Make .tar.bz2 tarball too.
2601 * Makefile.maint (TSDEPS_DIST): Remove m4/libtool.m4.
2602 (cvs-news): Look 1 line further down for NEWS release number.
2603 (cvs-dist): We don't use automake, so make dist is fine.
2604 Remove double . before suffixes.
2605 (cvs-release): Don't mention manual.html.
2606 (fetch): Get latest gendocs files.
2607 (web-manual): Rewritten to use gendoc for multiformat manuals.
2608 * doc/gendocs.sh: Don't save an old version in m4 CVS!
2609 * doc/m4.texinfo (Index): HFS+ (the file system on my Mac) is case
2610 preserving, but case insensitive, so generating html docs per node
2611 clashes between Index.html, the node file, and index.html, the
2612 top-level of the document tree...
2613 (Index macro): ...so renamed to this. Changed all references.
2615 2005-03-31 Gary V. Vaughan <gary@gnu.org> (tiny change)
2617 * configure.ac (AC_INIT): Bump to 1.4.3a.
2619 2005-03-31 Gary V. Vaughan <gary@gnu.org> (tiny change)
2622 * configure.in (AC_INIT): Bump to 1.4.3.
2623 * NEWS: Describe 1.4.3's changes.
2625 2005-03-31 Gary V. Vaughan <gary@gnu.org>
2627 * Makefile.maint: New file with release rules, from CVS libtool.
2628 * Makefile.in (DISTFILES): Add Makefile.maint.
2629 * INSTALL, install-sh, doc/texinfo.tex: Updated to latest
2632 2005-03-31 Eric Blake <ebb9@byu.net> (tiny change)
2634 * doc/m4.texinfo (Patsubst): Re-add trailing space required by
2635 checks/47.patsubst, with a redundant @comment to prevent emacs
2636 from removing it accidentally again.
2637 * checks/get-them: Allow for trailing spaces tucked behind
2640 2005-03-31 Eric Blake <ebb9@byu.net> (tiny change)
2642 * doc/Makefile.in (install, uninstall): Accomodate DESTDIR.
2643 * src/Makefile.in (install, uninstall): Likewise.
2645 2005-02-07 Gary V. Vaughan <gary@gnu.org>
2647 * lib/regex.c, lib/regex.h: Reverted gnulib update, which broke
2649 Reported by Eric Blake.
2651 2005-02-04 Gary V. Vaughan <gary@gnu.org>
2653 * lib/regex.c, lib/regex.h: Updated from gnulib.
2654 * src/input.c (set_word_regexp): Don't change the word_regexp
2655 unless it compiles correctly.
2657 Reported by Frank Schwidom.
2659 * Makefile.in (stamp-h): Regenerate config.h properly.
2661 2005-02-03 Gary V. Vaughan <gary@gnu.org>
2663 * configure.ac (AC_DEFINE): Fix overquoting of description
2666 * src/m4.h (__CYGWIN__, WIN32): Canonicalise Windows and Cygwin
2668 * src/freeze.c (produce_frozen_state): Use \n line-endings even
2669 on Windows, so that the frozen file reader will work.
2670 Reported by Josef T. Burger.
2672 * src/m4.c (main): Modernise the --version output.
2674 2005-02-03 Gary V. Vaughan <gary@gnu.org>
2676 Modernise the configury a little to prevent spurious errors from
2677 Autoconf-2.59's autoreconf:
2679 * config.h.in: Renamed to...
2680 * config-h.in: ...this to better support DOS 8.3 file systems.
2681 * acconfig.h: Removed.
2682 * configure.in: Renamed to...
2683 * configure.ac: ...this, and AC_DEFINE used to declare config.h
2684 entry comments. Slight reorganisation and reformatting.
2685 * aclocal.m4: Use third argument to AC_DEFINE to declare config.h
2687 (AC_INIT): Use a modern 3 argument call.
2688 * Makefile.in, checks/Makefile.in, doc/Makefile.in,
2689 examples/Makefile.in, lib/Makefile.in, src/Makefile.in:
2690 s/PRODUCT/PACKAGE/g.
2691 * Makefile.in (DISTFILES): Removed acconfig.h, configure.in,
2692 config.h.in. Added configure.ac, config-h.in.
2693 (stamp-h.in): Removed acconfig.h from dependencies.
2694 (configure): Depends on configure.ac, not configure.in.
2695 * doc/Makefile.in (stamp-vti): Ditto.
2696 * src/freeze.c (produce_frozen_state), src/m4.c (main): Adjust for
2697 difference between PRODUCT="m4" and PACKAGE="GNU M4".
2698 * configure: Regenerated.
2700 2005-02-03 Noah Misch <noah@cs.caltech.edu>
2702 * src/output.c (mkstemp): Make non-static, and build regardless of
2703 HAVE_TMPFILE; src/builtin.c also needs this replacement.
2706 2004-09-09 Vincent Lonngren <Vincent.lonngren.759@student.lu.se>
2708 * configure.in (AC_CHECK_HEADERS): Commit works best when you save
2709 changes from your editor buffer first.
2711 * configure.in (AC_CHECK_HEADERS): Add signal.h, sys/signal.h.
2712 * src/m4.c: And include them as appropriate.
2715 2004-09-09 Andreas Schwab <schwab@suse.de>
2717 Refactoring of the string read case in next_char provides about a
2718 20% speedup of M4 as typically used by autoconf:
2720 * src/input.c (next_char_1): Renamed from next_char.
2721 (next_char): New macro.
2724 2004-08-21 Gary V. Vaughan <gary@gnu.org>
2726 * configure.in (VERSION): Bump to 1.4.2a.
2728 2004-08-19 Paul Eggert <eggert@twinsun.com>
2731 * configure.in (VERSION): Bump to 1.4.2.
2732 * News: Describe 1.4.2's changes.
2734 * src/m4.c (reference_error): Preserve errno, since M4ERROR
2736 * src/builtin.c (m4_esyscmd): Clear errno before calling popen.
2737 (m4_maketemp): Clear errno before calling mkstemp.
2738 * src/path.c (path_search): Don't let "free" trash errno when
2740 * src/output.c (insert_file): Don't assume errno has a valid
2741 value simply because fread returns zero. This fixes a
2742 portability bug reported by Marion Hakanson in
2743 <http://lists.gnu.org/archive/html/bug-m4/2004-07/msg00029.html>.
2745 2004-06-09 Gary V. Vaughan <gary@gnu.org>
2747 * configure.in (VERSION): Bump to 1.4.1a.
2748 * NEWS: Place holder for next stable release.
2750 2004-06-03 Paul Eggert <eggert@cs.ucla.edu>
2753 * configure.in (VERSION): Bump to 1.4.1.
2754 * NEWS: Describe 1.4.1's changes.
2756 * aclocal.m4 (fp_PROG_CC_STDC): Use AC_DEFUN, not define, to
2757 pacify Autoconf 2.59.
2759 * doc/m4.texinfo: Insert commas after @xref's that lack them,
2760 to pacify Texinfo 4.7.
2761 * doc/Makefile.in (info): Remove info-1, info-2, info-3.
2763 * src/m4.h, src/debug.c: Use #ifdef __STDC__, not #if __STDC__, to
2764 pacify Sun C compilers.
2766 2003-09-28 Akim Demaille <akim@epita.fr>
2768 * src/symtab.c (lookup_symbol): Fix an uninitialized-variable
2771 2003-09-03 Santiago Vila <sanvila@debian.org>
2773 * examples/stackovf.sh: Use tempfile if available.
2775 2001-04-02 Robert Bihlmeyer <robbe@orcus.priv.at>
2777 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=92629
2778 * src/output.c (m4_insert_file): Do not mix buffered and
2779 unbuffered I/O, as this breaks on the Hurd. (trivial change)
2781 2001-02-01 Santiago Vila <sanvila@debian.org>
2783 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=84451
2784 * src/m4.c (main): Fix format vulnerabilities. (trivial change)
2786 2001-02-01 Matt Kraai <kraai@debian.org>
2788 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=84416
2789 * doc/m4.texinfo (Maketemp): Change maketemp to refer to a new,
2790 empty file rather than to a nonexistent file. This closes a common
2792 * src/builtin.c (m4_maketemp): Implement the above, by using
2793 mkstemp rather than mktemp. (trivial change)
2795 2000-01-09 Akim Demaille <demaille@inf.enst.fr>
2797 * src/builtin.c (expand_ranges): Added break after trailing dash.
2798 This caused misbehaviors on some systems.
2800 Sat Nov 5 15:52:47 1994 Francois Pinard (pinard@icule)
2803 * doc/Makefile.in (realclean): Also remove stamp-vti.
2804 Reported by Eric Backus.
2806 Wed Nov 2 00:47:53 1994 Francois Pinard (pinard@icule)
2808 * src/freeze.c (produce_frozen_state): If the frozen file cannot
2809 be opened, return immediately after producing the error message.
2810 Reported by Andreas Schwab.
2812 * configure.in: Check for const only after having found possible
2813 ANSIfying compiler flags, this is of no use to check it before.
2814 Reported by Alexander Lehmann.
2816 Tue Nov 1 22:02:37 1994 Francois Pinard (pinard@icule)
2818 * src/macro.c (collect_arguments): Cast obstack arguments to
2819 (voidstar), so avoiding compiler warnings.
2820 Reported by Joseph E. Sacco.
2822 * src/freeze.c (produce_frozen_state): Cast printed lengths to
2823 (int) so they correspond to %d format items.
2824 Reported by Joseph E. Sacco.
2826 * src/m4.c (main): Cast the argument to xfree to (voidstar).
2827 * src/symtab.c (free_symbol): Idem.
2828 Reported by Karl Vogel.
2830 Mon Oct 31 02:11:19 1994 Francois Pinard (pinard@icule)
2832 * Makefile.in (DISTFILES): Distribute BACKLOG.
2834 * configure.in: Define PRODUCT and VERSION.
2835 * acconfig.h: Document PRODUCT and VERSION.
2836 * src/m4.c, src/freeze.c: Use PRODUCT and VERSION instead of the
2837 constant string m4 and variable or parameter named version.
2839 Sun Oct 30 08:13:03 1994 Francois Pinard (pinard@icule)
2841 * src/m4.h, src/debug.c: Replace all #ifdef __STDC__ by #if
2842 __STDC__. Alliant FX/2800 Concentrix 2.2 (i860-BSD4.3) compiler
2843 defines __STDC__ to 0, for indicating it is *not* ANSI!
2844 Reported by Kaveh R. Ghazi.
2846 * configure.in: Added obsolescent tests for AIX and Minix.
2848 * doc/Makefile.in (mostlyclean): Remove texclean in dependencies,
2849 which texclean does not exist anymore.
2850 Reported by Eric Backus, Jim Meyering, John David Anglin and
2853 Sat Oct 29 05:10:03 1994 Francois Pinard (pinard@icule)
2855 * aclocal.m4 (fp_C_PROTOTYPES): Force -D_HPUX_SOURCE with -Aa.
2856 Reported by John David Anglin.
2858 * src/ansi2knr.c: New version, sent by Peter Deutsch.
2859 * aclocal.m4 (fp_C_PROTOTYPES): Substitute empty or ansi2knr for
2860 ANSI2KNR, depending on the fact the compiler is ANSI or not.
2861 * src/Makefile.in: Use -Ovarargs=convert on ansi2knr calls.
2862 Remove the sed filter after ansi2knr for debug.c. Use $O instead
2863 of $U, put underline in extensions rather than in basenames. Use
2864 implicit rules, now that regularity makes this possible.
2865 Have $(OBJECTS) depend on $(ANSI2KNR), so to trigger compilation
2866 of ansi2knr whenever it is needed.
2867 * configure.in: Adjusted for correct STACKOVF substitution.
2868 * src/debug.c (trace_format): When not __STDC__, use (...) as a
2869 parameter list, so ansi2knr will convert it to (va_alist) va_dcl.
2870 Reported by David MacKenzie.
2872 * Makefile.in: Remove binprefix. Use transform_name instead.
2873 Reported by David MacKenzie.
2875 * doc/Makefile.in: Create version.texi, use it, clean it.
2876 Reported by Jim Meyering.
2878 Fri Oct 28 20:33:55 1994 Francois Pinard (pinard@icule)
2880 * Makefile.in (all, install, uninstall): Depend on Makefile.
2882 * Makefile.in: For actions invoking $(MAKE) from within compound
2883 sh statements, exit non-zero if the sub-make fails. Otherwise,
2884 the top-level make may exit successfully when it should fail.
2885 Reported by Jim Kingdon.
2887 * {,/*}Makefile.in: Use && after all cd, in case they fail.
2889 * {,*/}Makefile.in: Declare PRODUCT and VERSION macros.
2890 (dist): Use PRODUCT and VERSION instead of tricks on .fname.
2891 * configure.in: Substitute PRODUCT and VERSION.
2893 * {,*/}Makefile.in (dist): Always try a hard link before a copy.
2895 Thu Oct 27 22:32:58 1994 Francois Pinard (pinard@icule)
2897 * Makefile.in (mostlyclean-local): Do not remove *~.
2898 * */Makefile.in (mostlyclean): Idem.
2899 Reported by Robert E. Brown and Richard Stallman.
2901 Sun Oct 9 08:30:13 1994 Francois Pinard (pinard@icule)
2903 * src/m4.h: Get rid of CONFIG_BROKETS.
2905 Sun Oct 2 16:48:10 1994 Francois Pinard (pinard@icule)
2907 * configure.in: Use AC_ARG_PROGRAM.
2908 * aclocal.m4 (fp_C_PROTOTYPES): Substitute @kr@ by kr or empty.
2909 Reported by David MacKenzie.
2911 Sat Oct 1 11:22:42 1994 Francois Pinard (pinard@icule)
2913 * configure.in: Do not add -O to CFLAGS for GNU C, now that
2914 configure does it automatically.
2915 Reported by Jim Meyering.
2917 Fri Sep 23 08:16:58 1994 Francois Pinard (pinard@icule)
2919 * src/stackovf.c: Declare the handler_t typedef earlier in the
2920 code, use it for stackovf_handler.
2921 (setup_stackovf_trap): Use RETSIGTYPE instead of void while
2922 casting sigsegv_handler.
2923 Reported by Robert Bernstein.
2925 * src/m4.c (main): Initialize program_name to argv[0] without
2927 Reported by Karl Berry.
2929 Sun Sep 18 11:42:50 1994 Francois Pinard (pinard@icule)
2931 * src/Makefile.in (TAGS): Include a ../lib/TAGS reference.
2932 Reported by Karl Berry.
2934 Wed Sep 14 10:00:22 1994 Francois Pinard (pinard@icule)
2936 * lib/Makefile.in (mostlyclean): Added.
2937 (TAGS): Make in $(srcdir).
2939 * configure.in: Use `choke me' in test, like everywhere!
2941 * {doc,examples,lib,src}/Makefile.in (check): Deleted, as
2942 unreacheable and useless.
2944 * doc/Makefile.in (texclean): Deleted, merged in mostlyclean.
2946 * lib/Makefile.in (DISTFILES): Distribute TAGS.
2947 (distclean): Do not remove TAGS.
2948 (realclean): Remove it.
2949 * Makefile.in: Make TAGS in lib also, not just in src.
2950 Reported by Karl Berry.
2952 * Makefile.in (distclean, realclean): Instead of recursively
2953 calling $(MAKE) for the -local part, allow parallel execution of
2954 -recursive and -local, only delay the removal of config.status,
2955 which is repeated in both goals.
2957 Tue Sep 13 19:21:05 1994 Francois Pinard (pinard@icule)
2960 * Makefile.in: Group all *clean-recursive goals in one, using sed
2961 to remove `-recursive' while calling make recursively. Also, use
2962 a subshell for each recursive $(MAKE).
2963 Reported by Jim Meyering.
2965 * src/m4.h (memcpy): Define with bcopy for BSD systems.
2966 Reported by Kaveh R. Ghazi.
2968 * src/Makefile.in (ansi2knr): Use $(LIBS) while linking, for SunOS
2969 4.1.3 requires -ldl to link even ansik2nr, and we need a way to
2972 * configure.in: Use date instead of touch for stamp-h.
2973 * Makefile.in (stamp-h.in): Idem.
2975 * Makefile.in (distclean, realclean): Force serial execution of
2976 both goals, in case parallel makes are being used.
2977 Reported by Jim Meyering.
2979 * src/Makefile.in (DISTFILES): Distribute TAGS.
2980 (distclean): Do not remove TAGS.
2981 (realclean): Remove it.
2982 Reported by Karl Berry.
2984 Sat Sep 10 12:34:04 1994 Francois Pinard (pinard@icule)
2986 * configure.in: Use fp_ to match aclocal.m4. Revert _OS_ macros
2987 to old names, for following Autoconf.
2989 Thu Sep 8 15:07:27 1994 Francois Pinard (pinard@icule)
2991 * Makefile.in (MDEFINES): Remove INSTALL substitutions, for
2992 ./install.sh will not be correctly referred to in sub-Makefiles.
2993 Reported by John David Anglin.
2995 * doc/Makefile.in (texclean): Remove *.cps and *.fns too.
2996 Reported by Eric Backus.
2998 * Makefile.in, checks/Makefile.in, doc/Makefile.in,
2999 examples/Makefile.in, lib/Makefile.in, src/Makefile.in: Limit
3000 config.status into remaking this directory's Makefile only.
3001 * Makefile.in (stamp-h): Do not check nor touch stamp-h.
3002 * configure.in (AC_OUTPUT): Touch stamp-h if CONFIG_HEADERS.
3003 Reported by Jim Meyering.
3005 Tue Sep 6 12:07:33 1994 Francois Pinard (pinard@icule)
3007 * configure.in: Correct stack overflow detection logic, taking
3008 care of systems having only incomplete implementations (like for
3009 Pyramid 9820 OSx 5.0d).
3010 Reported by Kaveh R. Ghazi.
3012 * src/Makefile.in (TAGS): Remote -t from etags call.
3014 Fri Sep 2 10:37:10 1994 Francois Pinard (pinard@icule)
3016 * lib/Makefile.in (install): Depend on all.
3018 Wed Aug 31 11:17:21 1994 Francois Pinard (pinard@icule)
3020 * examples/Makefile.in (mostlyclean): Do not depend on texclean.
3021 Reported by Jim Meyering and John David Anglin.
3023 * Makefile.in (distclean-local): Delete config.log.
3024 Reported by Jim Meyering.
3026 Solidify frozen files with respect to -P:
3027 * src/m4.c: Have -P set prefix_all_buitins variable instead of
3028 calling a function by that name. Declare the variable.
3029 * src/m4.h: Adjust declaration for prefix_all_buitins.
3030 * src/builtin.c (builtin_init): Merge in functionality from
3031 previous prefix_all_buitins function, while making entries in the
3032 symbol table, but not modifying the builtin description itself.
3034 * src/freeze.c (reload_frozen_state): Add a useless `break;',
3035 because *many* compilers do not accept an empty `default:'.
3036 Reported by Akiko Matsushita, Eric Backus, John David Anglin,
3037 Joseph E. Sacco, Kaveh R. Ghazi, Tom McConnell and Ulrich Drepper.
3039 * configure.in: Use AC_TYPE_SIGNAL.
3040 * src/stackovf.c (setup_stackovf_trap): Use RETSIGTYPE.
3041 Reported by Robert Bernstein.
3043 * checks/Makefile.in (check): Modify PATH so check-them will find
3044 m4 in the src directory.
3045 * Makefile.in (check): Don't.
3046 Reported by Akiko Matsushita and Jim Meyering.
3048 * src/output.c (make_room_for, output_character_helper): New
3049 functions, for implementing a global MAXIMUM_TOTAL_SIZE instead of
3050 a per buffer MAXIMUM_BUFFER_SIZE.
3052 * src/output.c (output_text): New function, for optimizing the
3053 output of strings of characters. Use it.
3055 Tue Aug 30 01:44:29 1994 Francois Pinard (pinard@icule)
3057 * doc, src: New directories reorganizing the distribution.
3058 * doc/Makefile.in, src/Makefile.in, examples/Makefile.in: New
3060 * Makefile.in: Adjusted.
3061 * configure.in: Configure new Makefiles.
3063 * m4.h: Declare STRING typedef. Use it for comment and quote
3064 strings, adjusting all references. (This is the rudiments of a
3065 beginning for the eventual withdrawal of NUL terminated strings.)
3066 * output.c (shipout_text): Accept a length parameter, and use it.
3067 All callers adjusted.
3069 Mon Aug 29 12:27:19 1994 Francois Pinard (pinard@icule)
3071 * m4.h: Include <unistd.h> if it exists.
3072 * stackovf.c: Don't.
3074 Clean up for current_diversion variable:
3075 * output.c: Move current_diversion from builtin.c.
3076 * m4.h: Declare current_diversion so builtin.c can access it.
3077 * output.c (output_init, make_diversion): Initialize or update
3079 * builtin.c (builtin_init, m4_divert): Leave current_diversion
3082 Remove limit on number of diversions:
3083 * output.c: Replace ndiversion by diversions, declare it.
3084 (output_init): Allocate only diversion 0.
3085 (make_diversion): Allocate new diversions as needed.
3086 * m4.h, m4.c: Remove NDIVERSIONS and ndiversion related stuff.
3087 * m4.c: Still accept -N, but do nothing with it.
3088 Reported by David MacKenzie.
3091 * output.c (freeze_diversions): New function.
3092 * m4.h: Declare freeze_diversions.
3093 * freeze.c: Document frozen file format, revise it, call
3094 freeze_diversions to add diversions to frozen format, and code to
3095 reload them properly.
3096 * m4.c: Do not undivert automatically at end when status being
3097 frozen. Do not call builtin_init when reloading frozen state.
3099 Speed up diversion processing:
3100 * output.c: Add INITIAL_BUFFER_SIZE, MAXIMUM_BUFFER_SIZE,
3101 COPY_BUFFER_SIZE, in-memory diversion buffers, struct diversion
3102 structure and variables, cached variables out of output_diversion,
3103 reallocate_diversion_for and OUTPUT_CHARACTER.
3104 (shipout_text, make_diversion, insert_diversion): Adapted to new
3106 (insert_file): Use better buffering.
3107 Reported by David MacKenzie.
3109 Sun Aug 28 05:20:02 1994 Francois Pinard (pinard@icule)
3111 * Makefile.in, lib/Makefile.in, checks/Makefile.in: Arrange so
3112 dist works from another build directory.
3114 Sat Aug 27 14:32:45 1994 Francois Pinard (pinard@icule)
3116 * symtab.c (hack_all_symbols): Use hash_table_size instead of
3117 constant HASHMAX, for -H option to work better.
3119 * builtin.c (DECLARE): Simplify by using _ ().
3121 * freeze.c: New file.
3122 * Makefile.in: Compile it, distribute it.
3123 * m4.c: Recognize, document and process --freeze-state (-F) and
3124 --reload-state (-R) options. Pass a true flag to builtin_init
3125 only if no reloading some state.
3126 * builtin.c (define_builtin): Remove static specifier.
3127 (find_builtin_by_name): Remove static specifier.
3128 (builtin_init): Accept and obey a flag argument.
3129 * m4.h: Add declarations for freeze.c, changes for builtin.c.
3131 Wed Aug 24 16:14:19 1994 Francois Pinard (pinard@icule)
3133 * builtin.c (dumpdef_cmp): Rewrite so the cast protect the const
3136 * configure.in: Implement --with-dmalloc.
3137 * acconfig.h: Document WITH_DMALLOC.
3138 * m4.h: Add code for when WITH_DMALLOC.
3140 Mon Aug 15 12:38:05 1994 Francois Pinard (pinard@icule)
3142 * m4.c (long_options): Use "error-output", the dash was missing.
3143 Reported by Akiko Matsushita.
3145 Fri Aug 12 16:38:01 1994 Francois Pinard (pinard@icule)
3147 * m4.h: Include <sys/types.h>.
3148 * builtin.c, debug.c, m4.c, output.c, stackovf.c: Don't.
3149 * m4.h: Declare len_lquote and len_rquote as size_t, not int.
3151 * input.c: Declare len_lquote, len_rquote, len_bcomm and len_ecomm
3153 * builtin.c (dump_args): Declare len as size_t, not int.
3155 * debug.c: Prototype the forward declaration of debug_set_file.
3157 * builtin.c (m4_undivert): Replace div by file, for avoiding the
3158 shadowing of this variable.
3159 * output.c (insert_diversion): Idem.
3161 * input.c: Delete def_rquote, def_lquote, def_bcomm and def_ecomm.
3162 (input_init): Duplicate default quote and comment strings.
3163 (set_quotes): Free previous quote strings in all cases. Duplicate
3164 even default quote strings.
3165 (set_comment): Free previous comment strings in all cases.
3166 Duplicate even default comment strings.
3168 * configure.in: Updated for Autoconf 2.0.
3169 * Makefile.in (distclean-local): Also delete config.cache.
3171 * m4.c (usage): Reorganize the --help output by topic. Include a
3172 description for debugging flags.
3174 Fri Jul 29 10:15:52 1994 Francois Pinard (pinard@icule)
3176 * configure.in: If sigaction is available and SA_ONSTACK defined,
3177 use sigaction. Otherwise, if sigvec is available and SV_ONSTACK
3178 defined, use sigvec. Else don't compile stackovf.c.
3179 * stackovf.c (setup_stackovf_trap): Idem.
3180 Reported by Jim Avera, Karl Berry, Kaveh R. Ghazi, Matthias Rabe
3183 Thu Jul 21 22:43:17 1994 Francois Pinard (pinard@icule)
3185 * m4.c (usage): Replace printf par fputs.
3187 Mon Jul 18 23:48:23 1994 Francois Pinard (pinard@icule)
3191 Sun Jul 17 08:08:25 1994 Francois Pinard (pinard@icule)
3193 * configure.in: Check for sigaction and sigvec. Add a new delayed
3194 check for RLIMIT_STACK, combine in the checking for getrlimit.
3195 All those things are not universally available.
3196 * stackovf.c: Split setting up the trap handler and catching
3197 signals, for better taking care of various configure outcomes.
3198 * examples/stackovf.sh: Correct a typo.
3199 Reported by Eric Backus, Jim Avera and Jim Meyering.
3201 Sat Jul 16 20:36:19 1994 Francois Pinard (pinard@icule)
3203 * ansi2knr.c: New version sent by its author, Peter Deutsch.
3205 Fri Jul 15 14:36:21 1994 Francois Pinard (pinard@icule)
3207 * Makefile.in: Modify so parallel make will not try making
3208 lib/libm4.a twice simultaneously.
3209 Reported by Jim Meyering.
3211 Thu Jul 14 17:23:17 1994 Francois Pinard (pinard@icule)
3213 * stackovf.c (setup_stackovf_trap): Replace "Don't" by "Do not" in
3214 error message, for when no code possibility exists. Even if this
3215 line is completely #ifdef'ed out, it brings a syntax error.
3216 Reported by Andreas Schwab, Jim Meyering and Joseph E. Sacco.
3218 * Makefile.in (install): Have install depend on all too, for lib
3219 to be remade as needed.
3221 * examples/stackovf.sh: Try ksh, bsh and bash for shells
3222 providing ulimit, instead of using only ksh.
3223 Reported by Jim Avera and Joseph E. Sacco.
3225 Tue Jul 12 06:54:31 1994 Francois Pinard (pinard@icule)
3227 * Makefile.in (check): Have it depend on all instead of m4. In
3228 this way, a change in lib will be detected and processed.
3230 * builtin.c (numeric_arg): Use strtol and verify the conversion,
3231 instead of using sscanf which stops as soon as there is a
3232 non-digit in the input. Previously, incr(1xyzzy), eval(1,2xyzzy)
3233 and divert(1xyzzy) were all accepted without any warning or error
3235 * m4.h: Declare strtol as long if not including stdlib.h.
3236 * configure.in: Check for limits.h, and replace strtol if missing.
3237 * lib/Makefile.in: Substitute LIBOBJS. Distribute strtol.c.
3238 * lib/strtol.c: New file, from elsewhere.
3239 Reported by Andreas Schwab.
3241 Thu Jul 7 22:38:10 1994 Francois Pinard (pinard@icule)
3243 * macro.c (expand_macro): Cast value to (boolean) prior to
3244 assigning it to traced.
3245 Reported by Tom McConnell.
3247 * Makefile.in (m4): Always make all in lib first.
3248 Reported by Jim Meyering.
3250 Wed Jul 6 13:16:31 1994 Jim Avera (jima@netcom.com)
3252 * stackovf.c: Isolated OS-dependent sections; Improved portability,
3253 adding support for SunOS/BSD (sigvec, sigstack, and 4-parameter signal
3254 handlers), and a default error message if the fault address is not
3255 available (when neither siginfo.h nor BSD sigcontext are supported).
3256 * configure.in: Changes for stackovf.h: Check for sigcontext,
3257 sigaction, sigstack, and define rlim_t as int if necessary.
3258 * acconfig.h: Added HAVE_SIGCONTEXT and rlim_t.
3259 * examples/stackovf.sh: Run m4 -L99999999 to allow stack overflow.
3260 * ansi2knr.c: Fix for func-ptr args; convert "..." to varargs syntax.
3262 Tue Jul 5 19:13:54 1994 Francois Pinard (pinard@icule)
3264 * configure.in: Use AC_SET_MAKE.
3265 * Makefile.in: Use @SET_MAKE@.
3266 Reported by Jim Meyering.
3268 * checks/check-them: Do not trap on SIGQUIT or SIGALRM.
3269 Reported by Ian Taylor.
3271 Sat Jul 2 00:58:47 1994 Francois Pinard (pinard@icule)
3273 * configure.in: Remove dependency of USE_STACKOVF on STDC_HEADERS,
3274 because siginfo.h is unrelated to standard headers, and siginfo.h
3275 is already checked for.
3276 Reported by Joseph E. Sacco.
3278 * acconfig.h, aclocal.m4, m4.h: Replace HAVE_PROTOTYPES by
3280 * aclocal.m4, configure.in: Replace AC_HAVE_PROTOTYPES by
3283 Wed Jun 29 22:41:53 1994 Francois Pinard (pinard@icule)
3285 * builtin.c (substitute): Use \& to represent this part of the
3286 string which was matched by the whole regexp, instead of
3287 representing the whole string. Any usage of \0 issues a warning
3288 and acts like \&, it will disappear in some subsequent release.
3290 Mon Jun 27 14:24:23 1994 Francois Pinard (pinard@icule)
3292 * m4.c: Complete prototype for forwarded declaration of usage.
3294 * input.c (init_macro_token): Correct own reference in error
3295 message. Previous name get_macro_func was referred to instead.
3296 (next_char): Correct own reference in error message. Previous
3297 name advance_input was referred to instead.
3299 * m4.h: Declare eval_t and unsigned_eval_t typedefs to 32 bits.
3300 * eval.c (logical_or_term, logical_and_term, or_term, xor_term,
3301 and_term, not_term, logical_not_term, cmp_term, shift_term,
3302 add_term, mult_term, exp_term, unary_term, simple_term): Add
3303 prototype to forwarded declarations. Declare parameter v1 as
3304 eval_t * instead of int *. Same for local variable v2 in dyadic
3305 functions. Same for result in exp_term.
3306 * builtin.c (m4_eval): Declare value as eval_t instead of int.
3307 (ntoa): Declare value as eval_t instead of int. Declare uvalue as
3308 unsigned_eval_t instead of unsigned int. Change casts accordingly.
3309 (shipout_int): Cast first argument of ntoa to eval_t.
3310 Reported by Thorsten Ohl.
3312 * macro.c: Complete the prototypes of forwarded expand_macro and
3314 Reported by Thorsten Ohl.
3316 * m4.h: Define voidstar as void * or char * depending on __STDC__.
3317 The Ultrix 3.1 compiler cannot do much with void pointers.
3319 * builtin.c (dumpdef_cmp): Replace void * by voidstar.
3320 * m4.c (xfree): Replace void * by voidstar.
3321 Reported by Tom McConnell.
3323 * ansi2knr.1: New, from elsewhere.
3324 * Makefile.in (DISTFILES): Distribute ansi2knr.1
3326 * Makefile.in (stamp-h.in): Avoid running ./config.status if
3327 stamp-h does not exist yet. This avoids running it a second time
3328 just after the initial ./configure.
3329 Reported by David MacKenzie and Tom McConnell.
3331 * m4.h: Replace the enum debug_info declaration with a series of
3332 #define's. The Ultrix 3.1 compiler would otherwise need casting
3333 (int) to most references, when used in expressions.
3334 Reported by Tom McConnell.
3336 Sat Jun 25 00:10:05 1994 Francois Pinard (pinard@icule)
3338 * aclocal.m4: Replace FP_PROTOTYPES by AC_HAVE_PROTOTYPES,
3339 following an idea from Brook G. Milligan. AC_HAVE_PROTOTYPES
3340 calls the compiler. Previously, FP_PROTOTYPES was only calling
3341 the preprocessor; by not being subject to CFLAGS, this was
3342 discouraging those flags asking for ANSI compilation.
3343 * acconfig.h: Document HAVE_PROTOTYPES.
3344 * configure.in: Use AC_HAVE_PROTOTYPES instead of FP_PROTOTYPES.
3345 * m4.h: Define _() according to HAVE_PROTOTYPES, not __STDC__.
3346 Reported by Eric Backus.
3348 * configure.in: Substitute CFLAGS and LDFLAGS, taking their value
3349 from the environment. Default CFLAGS to -g if not set.
3350 * Makefile.in: Have CFLAGS and LDFLAGS substituted from configure.
3351 * lib/Makefile.in: Have CFLAGS substituted from configure.
3352 Reported by Eric Backus and Tom McConnell.
3354 * configure.in: m4_undefine changeword before using AC_ENABLE.
3356 * m4.h: Declare prototypes for error (for ANSI compilers only),
3357 prefix_all_builtins and reference_error.
3358 Reported by Tom McConnell.
3360 * input.c (set_word_regexp): Do not try to initialize the array
3361 test from a string, this does not work with non-ANSI compilers.
3362 Reported by Eric Backus.
3364 * Makefile.in (dist): Clean examples/ before saving it.
3365 (distclean-local): Also remove stamp-h.
3366 Reported by Eric Backus.
3368 * Makefile.in (_stackovf.c): Goal for compiling stacokovf.c with
3370 Reported by Tom McConnell.
3372 * checks/Makefile.in (clean): Depends on mostlyclean.
3373 (mostlyclean): New goal.
3375 Fri Jun 24 23:30:31 1994 Francois Pinard (pinard@icule)
3377 * Makefile.in (DISTFILES): Distribute install.sh.
3378 * install.sh: New file, copied from elsewhere.
3379 Reported by Assar Westerlund and Kaveh R. Ghazi.
3381 Thu Jun 23 00:00:30 1994 Francois Pinard (pinard@icule)
3383 * configure.in: Define ENABLE_CHANGEWORD if --enable-changeword.
3384 * acconfig.h: Explain ENABLE_CHANGEWORD.
3386 [These modifs all depend upon ENABLE_CHANGEWORD and are adapted
3387 from code provided by Pete Chown]
3388 * m4.h: Add original_text field to u_t variant of union u.
3389 Declare TOKEN_DATA_FUNC macro.
3390 * builtin.c: Declare changeword.
3391 (m4_changeword): New function.
3392 * input.c: Include "regex.h", define variables with word regexps.
3393 (input_init): Initialize the word regexp.
3394 (set_word_regexp): New.
3395 (next_token): Declare local variables, use the previous code if
3396 default_word_regexp is true. Else, match using a new code. Save
3398 * macro.c (expand_token): Ship out original text if not a macro
3400 Reported by Krste Asanovic and Pete Chown.
3402 [These modifs all depend upon ENABLE_CHANGEWORD]
3403 * m4.h: Declare external user_word_regexp.
3404 * m4.c: Declare user_word_regexp, and initialize it from
3405 --word-regexp or -W, or NULL if not specified.
3406 * input.c: Use user_word_regexp if specified, instead of
3407 DEFAULT_WORD_REGEXP.
3409 * Makefile.in (m4): Revert Jan 3 1994 change. I'm unable to
3412 * Makefile.in, lib/Makefile.in: Limit suffixes to .c and .o.
3413 * checks/Makefile.in: Empty the suffix list.
3414 Reported by Geoff Russell, Joel Sherrill and Roland McGrath.
3416 * m4.c: Declare nesting_limit and initialize it to 250.
3417 Implement -LNUMBER or --nesting-limit=NUMBER to change its
3419 * m4.h: Declare nesting_limit as external.
3420 * macro.c (expand_macro): Stop execution whenever nesting limit
3422 Reported by Bengt Mertensson.
3424 * eval.c (evaluate): Diagnose excess characters in eval input.
3425 Things like `eval(08)' used to return 0 with no diagnostic.
3427 * m4.h: Capitalize first letter of all macro arguments in
3430 * m4.c: Declare warning_status, initialize it to 0. Add new
3431 option -E, or --fatal-warnings, which sets warning_status to
3432 EXIT_FAILURE instead.
3433 * m4.h: Declare external warning_status. Define EXIT_SUCCESS and
3434 EXIT_FAILURE if not otherwise done by header files.
3435 * m4.c: Delete declarations for EXIT_SUCCESS and EXIT_FAILURE.
3436 * m4.c, input.c, output.c, symtab.c, builtin.c, macro.c, debug.c,
3437 eval.c: Replace 0 by warning_status and 1 by EXIT_FAILURE in first
3438 argument of all M4ERROR calls.
3439 Reported by Noah Friedman.
3441 * examples/incl-test.m4: Renamed from incl_test.m4.
3442 * examples/include.m4: Include incl-test.m4 instead of
3444 * examples/multiquotes.m4: Renamed from multi-quotes.m.
3446 Wed Jun 22 21:58:54 1994 Francois Pinard (pinard@icule)
3448 * configure.in: Avoid USE_STACKOVF if <siginfo.h> not found. Note
3449 that Jim developped stackovf.c on a 486 running SVR4.0 (ESIX), and
3450 also tested it on a Sun Sparc workstation running SunOS 4.x.
3452 * format.c (format): When not HAVE_EFGCVT, m4 was failing the
3453 49.format check, abusing a `union values' argument with sprintf
3454 without selecting the proper field. Now, save the formatting type
3455 first, delaying the fetch of the corresponding argument.
3456 Reported by Joseph E. Sacco and Tom Quinn.
3458 * format.c (format): Remove const from char *fmt declaration when
3459 not HAVE_EFGCVT, because a NUL may be forced into it.
3461 * m4.h: Declare atof() when not STDC_HEADERS.
3462 Reported by Joseph E. Sacco.
3464 * Regenerate configure using Autoconf 1.11, this corrects a
3465 problem about an incorrect cpp seting on NeXT 3.1.
3466 Reported by Alexander Lehmann.
3468 Sun Jun 5 16:25:19 1994 Francois Pinard (pinard@icule)
3470 * m4.h (_): Change argument from `x' to `Args'.
3472 Wed May 4 23:59:39 1994 Francois Pinard (pinard@icule)
3474 * Makefile.in: Remove all occurrences of $(MFLAGS), which were
3475 bringing more evil than good on a few systems.
3476 Reported by Greg A. Woods.
3478 Fri Apr 22 15:59:35 1994 Francois Pinard (pinard@icule)
3480 * m4.h: Rename Args() to _().
3481 * m4.h: Remove extern specifier from all function declarations.
3483 Fri Apr 22 15:51:21 1994 Jim Avera (jima@netcom.com)
3485 * stackovf.c: New file implementing stack-overflow detection.
3486 * configure.in: Check for getrlimit, sigaction. If all of
3487 standard headers, getrlimit and sigaction, define USE_STACKOVF and
3488 substitute ${U}stackovf.o for STACKOVF.
3489 * acconfig.h: Declare USE_STACKOVF.
3490 * Makefile.in: Distribute stackovf.c, link with $(STACKOVF).
3491 * m4.h: Declare setup_stackovf_trap().
3492 * m4.c: Call setup_stackovf_trap().
3493 * tests/stackovf_test.sh: New file.
3495 Wed Apr 13 14:10:30 1994 Francois Pinard (pinard@icule)
3497 * checks/Makefile.in: Rename .all-stamp to stamp-checks.
3499 * Makefile.in (Makefile, etc.): Adapt for Autoconf 1.8.
3501 Sun Jan 30 14:24:19 1994 (pinard at icule)
3503 * m4.h: Remove definition of volatile, not used anymore.
3504 Reported by Jim Meyering and Joseph E. Sacco.
3506 * m4.h: Consistently use `do { ... } while (0)' in macros, instead
3507 of `if ... else /* nothing */' for if macros.
3508 Reported by Jim Meyering.
3510 * builtin.c (m4_regexp): Reorganize the code for avoiding a
3511 warning from gcc about `repl' possibly used before defined.
3512 Reported by Jim Meyering.
3514 * m4.h: Avoid a pre-ANSI <memory.h> together with <string.h>.
3515 Reported by Jim Meyering.
3517 Tue Jan 25 18:39:37 1994 Francois Pinard (pinard at icule)
3519 * m4.h: Move the conditional definition of volatile after the
3520 inclusion of system files, because they may define it first.
3522 Tue Jan 4 19:46:50 1994 Francois Pinard (pinard@icule)
3524 * checks/Makefile.in (CHECKS): Add a useless `*' before `[', to
3525 get around a problem with Alpha make seeing a syntax error, there.
3526 Reported by Vern Paxson.
3528 Mon Jan 3 00:21:45 1994 Francois Pinard (pinard@icule)
3530 * Makefile.in: Do not define LDFLAGS, use CFLAGS on link calls.
3531 Reported by Richard Stallman.
3533 Sat Dec 25 08:06:05 1993 Francois Pinard (pinard@icule)
3535 * configure.in: Correct test for strerror, AC_FUNC_CHECK was used
3536 instead of AC_HAVE_FUNCS.
3537 Reported by Noah Friedman.
3539 Wed Dec 1 09:37:53 1993 Francois Pinard (pinard@icule)
3541 * m4.c: Initialize show_help and show_version to zero.
3543 * m4.c: Ensure EXIT_SUCCESS and EXIT_FAILURE are defined.
3544 Use them in exit() and usage() calls.
3546 Sat Nov 27 10:43:24 1993 Francois Pinard (pinard@icule)
3548 * m4.h: Delete extern sys_nerr, sys_errlist declarations, and
3549 syserr() macro. Delete errref, add reference_error and M4ERROR.
3550 * m4.c: Replace errref, which was returning an input reference
3551 string, with reference_error, which prints it on standard error.
3552 * builtin.c, output.c: Use errno as second parameter to error,
3553 instead of using syserr() with %s.
3554 * *.c: Use M4ERROR instead of error: no more errref() with %s.
3555 Doing so, the program name appears after the input reference
3556 instead of before, which eases M-x next-error processing.
3558 Wed Nov 24 22:16:15 1993 Francois Pinard (pinard@icule)
3560 * checks/get-them: Escape braces with backslashes in patterns,
3561 because HPUX-9.01 awk needs this.
3562 Reported by Jim Meyering.
3564 Mon Nov 22 10:55:52 1993 Francois Pinard (pinard@icule)
3566 * builtin.c: Declare "FILE *popen ();".
3568 * m4.h: Remove MESSAGE{,1,2}, WARNING1, FATAL{,1}, INTERNAL_ERROR
3569 macros, replace error_message_prefix() declaration by errref()'s.
3570 Declare xrealloc, for use in errref().
3571 * m4.c: Delete error_message_prefix() function, add errref().
3572 * *.c: Use error() systematically in place of all error macros,
3573 now that error() flushes stdout first. Make needed adjustments.
3575 * m4.h: Remove const in sys_errlist[] declaration, it creates
3576 conflicts on SGI and Alpha.
3577 Reported by Kaveh R. Ghazi.
3579 Sat Nov 20 08:26:15 1993 Francois Pinard (pinard@icule)
3581 * m4.c: Include <getopt.h> instead of "getopt.h".
3583 * configure.in: Output to config.h. Use HAVE_FUNCS preferably.
3584 * acconfig.h: New, for documenting HAVE_EFGCVT.
3585 * Makefile.in: Distribute acconfig.h, .stamp-h.in and config.h.in,
3586 use them wherever appropriate. Also use -I. for compilations.
3587 * lib/Makefile.in: Use -I.. for compilations.
3588 * *.c: Include <config.h> or "config.h".
3590 * m4.h: Test for HAVE_MEMORY_H instead of NEED_MEMORY_H.
3591 * configure.in: Use AC_HAVE_HEADERS(memory.h), delete AC_MEMORY_H.
3593 Wed Nov 17 09:34:55 1993 Francois Pinard (pinard@icule)
3595 * builtin.c (m4_eval): Cast strlen to (int) before comparing.
3597 * input.c (input_init): Initialize quote and comment strings
3598 explicitely instead of calling set_quotes and set_comment: by
3599 doing so, we ensure we do not free uninitialized variables.
3601 * checks/check-them: Reverse arguments to both diff, so the
3602 expected is on the left and the obtained on the right.
3604 * m4.h: Add MESSAGE{,1,2}, WARNING1, FATAL{,1} and INTERNAL_ERROR
3605 macros. Delete declarations for m4error, warning, fatal and
3606 internal_error, add declaration for error_message_prefix.
3607 * m4.c: Delete m4error, warning, fatal and internal_error
3608 routines, add error_message_prefix routine.
3609 * *.c: Replace m4error routine calls with MESSAGE* macro calls,
3610 warning with WARNING*, fatal with FATAL* and internal_error with
3612 * Makefile.in (_m4.c): Do not adjust ansi2knr output for va_alist,
3613 this is not needed anymore.
3615 * m4.h: Declare extern FILE *debug. Add DEBUG_PRINT{1,3} and
3616 DEBUG_MESSAGE{,1,2} macros. Delete declarations for debug_print
3617 and debug_message, add declaration for debug_message_prefix.
3618 * debug.c: Remove static specifier for FILE *debug declaration.
3619 Delete debug_print and debug_message routines, add
3620 debug_message_prefix routine.
3621 * builtin.c, debug.c: Replace debug_print routine calls with
3622 DEBUG_PRINT* macro calls.
3623 * input.c, path.c: Replace debug_message routine calls with
3624 DEBUG_MESSAGE* macro calls.
3626 * m4.h: Remove inclusion of <varargs.h>.
3627 * debug.c: Include <stdarg.h> or <varargs.h>.
3628 (trace_format): Use stdarg instead of varargs if __STDC__.
3630 * configure.in: Remove checks for vfprintf and _doprnt. These
3631 implementations use varargs tricks which are not portable enough.
3632 * lib/vfprintf.c: Deleted.
3633 * lib/_doprnt.c: Deleted.
3634 * lib/Makefile.in: Adjusted accordingly. Remove LIBOBJS.
3635 Reported by Joel Sherrill.
3637 * path.c (add_include_directory): Use xstrdup.
3639 * builtin.c (find_builtin_by_name): Declare static.
3641 * *.[ch]: Add const to a few "char *" declarations.
3643 * configure.in: Remove commented tests for fileno() and fstat().
3644 * debug.c: Remove comments about HAVE_FILENO and HAVE_FSTAT.
3646 * debug.c (debug_flush_files): New.
3647 * m4.h: Declares it.
3648 * builtin.c (m4_syscmd, m4_esyscmd): Use it.
3649 Reported by Nicolas Pioch.
3651 Fri Nov 12 10:02:26 1993 Francois Pinard (pinard@icule)
3653 * Makefile.in (m4.dvi): Use m4.texinfo instead of m4.texi.
3654 Reported by Joel Sherrill.
3656 * builtin.c (prefix_all_builtins): Instead of the table size, use
3657 the null entry at end for stopping the loop. It was overwritten.
3658 Reported by Andreas Schwab and Jim Meyering.
3660 * builtin.c (prefix_all_builtins): Cast xmalloc to (char *).
3661 Reported by Kaveh R. Ghazi.
3663 * macro.c (call_macro): Add * in (*SYMBOL_FUNC (sym)) (...).
3664 Reported by Karl Vogel.
3666 Tue Nov 9 09:31:47 1993 Francois Pinard (pinard@icule)
3668 * m4.h: Do not define volatile if already defined.
3669 Reported by Rene' Seindal.
3671 * lib/Makefile.in: Add a forgotten ALLOCA=@ALLOCA@. Grrr!
3673 Reported by Bernhard Daeubler, Eric Backus, Hal Peterson, Hoang
3674 Uong, Ian Taylor, Kaveh R. Ghazi, Tom McConnell and Walter Wong.
3676 Mon Nov 8 21:11:44 1993 Francois Pinard (pinard@icule)
3678 * m4.h: Define strchr and strrchr in terms of index and rindex,
3679 instead of the other way around.
3680 * builtin.c, m4.c, path.c: Use strchr instead of index.
3682 * input.c (next_char): Remove a "break;" after a "return ...;".
3683 Reported by Tom McConnell.
3685 Mon Nov 8 12:45:34 1993 Francois Pinard (pinard@icule)
3689 * configure.in: Do not copy check files in the build hierarchy.
3690 * checks/check-them: Identify the m4 version being checked. For
3691 finding m4, look in $PATH instead of in the parent directory.
3692 * Makefile.in (check): Prepend `pwd` to $PATH before checking.
3693 * checks/Makefile.in (.all-stamp): Always create check files in
3694 the source hierarchy, not anymore in the build hierarchy.
3695 (check): cd to the source hierarchy before performing checks.
3696 Do not copy nor clean COPYING anymore, take it from `..'.
3697 Reported by Tom McConnell.
3699 * Makefile.in (Makefile): Use $(SHELL).
3700 (config.status): Use $(SHELL). Use "config.status --recheck"
3701 instead of "configure --no-create", which is obsolete.
3702 Reported by Tom McConnell.
3704 Fri Nov 5 09:49:30 1993 Francois Pinard (pinard@compy.IRO.UMontreal.CA)
3706 * m4.c (usage): Use "%s" instead of "m4" in format string.
3707 Reported by Jim Meyering.
3709 * Makefile.in: Distribute mkinstalldirs.
3710 Reported by Pierre Gaumond.
3711 Reported by Jim Meyering.
3712 Reported by Tom McConnell.
3713 Reported by Andreas Gustafsson.
3715 * checks/check-them: Renamed from checks/check_them.
3716 * checks/get-them: Renamed from checks/get_them.
3717 * checks/.all-stamp: Renamed from checks/.all_stamp.
3718 * checks/Makefile.in: Changed accordingly.
3719 Reported by Jim Meyering.
3721 Thu Nov 4 13:50:52 1993 Francois Pinard (pinard@lagrande.IRO.UMontreal.CA)
3723 * lib/Makefile.in (dist): Correct permissions on files.
3725 * output.c: Declare tmpfile, some systems don't.
3727 Wed Nov 3 09:09:16 1993 Francois Pinard (pinard@icule)
3729 * checks/Makefile.in (dist): Correct permissions on files.
3731 * Makefile.in (dist): Ensure recursive linking for subdirectory
3732 `examples', also set read/write permissions on all its files.
3734 * mkinstalldirs: New, from elsewhere.
3735 * Makefile.in: Use it.
3737 * debug.c: Synchronize debug messages and regular output when
3738 the debug file and stdout are redirected to the same file.
3739 * configure.in: Add (commented) checks for fileno and fstat.
3740 Reported by Jim Avera.
3742 * builtin.c (m4_ifelse): Diagnose excess arguments if 5, 8, 11,
3743 etc., arguments, then ignore the superfluous one. m4 used to
3744 diagnose missing arguments and return the empty string.
3745 Reported by Nick S. Kanakakorn.
3747 Tue Nov 2 00:55:41 1993 Francois Pinard (pinard@icule)
3749 * m4.c (main): At end of all input, ensure all undiverted text
3750 goes to the main output stream.
3751 Reported by Andreas Gustafsson.
3753 * m4.c (main): exit (0), instead of return 0.
3755 * m4.c: Implement -P and --prefix-builtins.
3756 * builtin.c: Delete const specifier on builtin_tab.
3757 (prefix_all_builtins): New.
3758 Reported by Noah Friedman.
3759 Reported by Scott Bartram.
3761 * c-boxes.el: New, from elsewhere.
3762 * Makefile.in: Distribute it.
3764 * m4.h: Do not define bcopy if <string.h> defines it.
3765 Reported by Stephen Perkins.
3767 * builtin.c (define_macro): Allow a missing second argument, in
3768 which case it is implied empty. Affects define and pushdef.
3769 Reported by Eric Allman.
3771 Mon Nov 1 07:45:24 1993 Francois Pinard (pinard@icule)
3773 * m4.h: Add blind_if_no_args in struct builtin, blind_no_args in
3774 struct symbol adn SYMBOL_BLIND_NO_ARGS macro.
3775 * builtin.c: Initialize all the blindness fields in builtin_tab.
3776 (define_builtin): Copy the blindness of a builtin into its symbol.
3777 * macro.c (expand_token): Avoid processing a blind builtin if the
3778 next character is not an opening parenthesis.
3779 Reported by David MacKenzie.
3780 Reported by Noah Friedman.
3782 * configure.in: Ensure an exit status of 0 on completion.
3783 Reported by Vivek P. Singhal.
3785 * eval.c (eval_lex): Admit both lower and upper case letters for
3786 bases greater than 10. Only lower case letters were accepted.
3788 * eval.c (eval_lex): Recognize 0bDIGITS and 0rRADIX:DIGITS syntax.
3789 Reported by Krste Asanovic.
3791 * eval.c: Rename NOT to LNOT. Add XOR, NOT, LSHIFT and RSHIFT.
3792 * eval.c (logical_not_term): New name for not_term.
3793 * eval.c (xor_term): New, between or_term and and_term.
3794 * eval.c (not_term): New, between and_term and logical_not_term.
3795 * eval.c (shift_term): New, between cmp_term and add_term.
3796 Reported by Krste Asanovic: ~, ^, <<, >>.
3797 Reported by Ben A. Mesander: ** vs ^.
3799 * m4.c: Delete xmalloc.c, xrealloc.c, xstrdup.c.
3800 * m4.h: Delete xrealloc.c.
3801 * lib/xmalloc.c: New, from elsewhere.
3802 * lib/xstrdup.c: New, from elsewhere.
3803 * lib/Makefile.in: Distribute and compile them.
3805 * m4.c: Change progname to program_name.
3806 * builtin.c, eval.c, m4.c, m4.h: Rename error to m4error.
3807 * lib/error.c: New, from elsewhere.
3808 * lib/Makefile.in: Distribute and compile error.c.
3809 * configure.in: Check AC_VPRINTF and for strerror.
3810 * m4.c: Delete cmd_error. Use error instead.
3811 * m4.c: Change label capitalisation to "ERROR", "Warning", etc.
3813 * m4.h: Delete #define const, let Autoconf takes care of this.
3815 * m4.c: Remove all code conditionalized by IMPLEMENT_M4OPTS.
3816 Merge parse_args into main. Declare argv to be `char *const *',
3817 then remove superfluous casts.
3819 * m4.c: Rename --no-gnu-extensions to --traditional.
3820 Reported by Ben A. Mesander.
3822 * m4.c (usage): Add a status parameter. Supply one in various
3823 calls. Add --help processing. Remove -V for --version.
3825 * lib/Makefile.in: Put $(CFLAGS) last in .c.o rule.
3827 * lib/Makefile.in: Have an AR=ar declaration.
3828 Reported by Eric Backus.
3829 Reported by Bjorn R. Bjornsson.
3830 Reported by Tom Tromey.
3831 Reported by Kristine Lund.
3832 Reported by Marion Hakanson.
3834 Sat Oct 30 12:51:47 1993 Francois Pinard (pinard@icule)
3836 * Makefile.in (m4.info): Use -I$(srcdir) on $(MAKEINFO).
3837 Reported by Noah Friedman.
3839 Mon Oct 25 14:58:48 1993 Francois Pinard (pinard@icule)
3841 * Makefile.in: Remove MDEFINES and cleanup.
3843 Wed Jun 9 14:59:46 1993 Francois Pinard (pinard@icule)
3845 * Makefile.in (dist): Replace "echo `pwd`" by a mere "pwd".
3848 Sat Feb 6 14:59:22 1993 Francois Pinard (pinard@icule)
3850 * Makefile.in, lib/Makefile.in, check/Makefile.in: In dist goals,
3851 ensure 777 mode for directories, so older tar's will restore file
3854 Sun Jan 17 15:38:05 1993 Francois Pinard (pinard@icule)
3856 * Makefile.in, lib/Makefile.in: Put $(CFLAGS) after $(CPPFLAGS),
3857 so the installer can override automatically configured choices.
3858 Reported by Karl Berry.
3860 Fri Jan 15 16:07:00 1993 Francois Pinard (pinard@icule)
3862 * lib/vfprintf.c: Stolen from Oleo distribution and adapted. The
3863 previous version was not working properly on m68k-hp-bsd4.3.
3864 Reported by Roland McGrath.
3866 * lib/_doprnt.c: Stolen from Oleo distribution.
3867 * configure.in: Check for _doprnt.c if vfprintf.c selected.
3868 * lib/Makefile.in: Distribute _doprnt.c.
3869 Do not distribute regex.[ch].old anymore.
3871 Fri Jan 1 19:42:23 1993 Francois Pinard (pinard at icule)
3873 * Makefile.in, lib/Makefile.in: Reinstate $(CPPFLAGS), use it.
3874 Richard wants it there.
3876 Sun Dec 27 07:01:54 1992 Francois Pinard (pinard at icule)
3878 * Makefile.in: Add DEFS to MDEFINES.
3879 * lib/Makefile.in (.c.o): Remove $(CPPFLAGS).
3880 (libm4.a): Remove the library before creating it.
3881 (distclean): Remove tags and TAGS too.
3883 Wed Dec 23 12:46:55 1992 Francois Pinard (pinard at icule)
3885 * Makefile.in (dvi, m4.dvi): New goals.
3887 * builtin.c, eval.c, format.c, input.c, m4.[ch], m4.texinfo,
3888 macro.c, output.c, path.c, symtab.c: Change Copyright from
3889 1989-1992 to the explicit enumeration 1989, 1990, 1991, 1992.
3891 * examples/divert.m4: Deleted, this bug has been corrected.
3893 * Makefile.in (texclean, mostlyclean): New goals.
3895 * Makefile.in (clean): Remove clutter from ansi2knr.
3896 Reported by Pierre Gaumond.
3897 Reported by Greg A. Woods.
3899 Sun Dec 20 10:40:20 1992 Francois Pinard (pinard at icule)
3901 * Makefile.in: Remove $(CPPFLAGS) from the .c.o rule. The user
3902 might well use CFLAGS is s/he needs it.
3904 * Makefile.in: Allow installation of info files from a separate
3906 Reported by Jason Merrill.
3907 Reported by David MacKenzie.
3908 Reported by Skip Montanaro.
3909 Reported by Erez Zadok.
3910 Reported by Assar Westerlund.
3912 Sat Dec 19 08:21:34 1992 Francois Pinard (pinard at icule)
3915 This is still a beta release for the future GNU m4 version 1.1.
3917 * lib/alloca.c: New, from elsewhere.
3918 * lib/Makefile.in: Distribute it. Define and use $(ALLOCA).
3920 * m4.h: Do not define index/rindex if already defined. If
3921 FALSE/TRUE are already defined, do not redefine them, but merely
3922 define boolean typedef to int.
3924 * Makefile.in: Use $(DEFS) while compiling ansi2knr.
3925 * ansi2knr.c: Rewrite #ifdef HAVE_STRING_H || STDC_HEADERS,
3926 because some C compilers do not like connectives with #ifdef.
3927 * m4.h: Define `volatile' only if __GNUC__, instead of once for
3928 __GNUC__ and once for __STDC__.
3929 * lib/regex.h: Leave const alone, AC_CONST will take care of it.
3931 * checks/Makefile.in: Use .all_stamp instead of $(CHECKS) for
3932 Makefile dependencies. Without it, make keeps destroying and
3933 remaking $(CHECKS) in a loop (why?). Distribute .all_stamp.
3935 * m4.h, m4.c, builtin.c, output.c: Change all divertion/DIVERTION
3936 to diversion/DIVERSION, this was a spelling error.
3938 * m4.c: Declare version[], remove #include "version.h".
3939 * version.h: Deleted.
3940 * Makefile.in: Remove references to version.h.
3942 * output.c (shipout_text): Centralize all `#line NUM ["FILE"]'
3943 production, by using a simpler and more robust algorithm. This
3944 solves the problem of synclines sometimes written in the middle of
3945 an output line. Delete sync_line() and output_lines variable.
3946 * m4.h: Remove sync_line prototype and output_lines declaration.
3947 * input.c (next_char), output.c (shipout_text): Remove references
3949 * input.c (push_file, pop_file): Merely put the value -1 in
3950 output_current_line instead of calling sync_line, for delaying a
3951 single `#line NUM FILE' before next output line. Do not test
3952 for sync_output, because this is unnecessary clutter.
3953 * output.c (make_divertion, insert_divertion): Idem.
3954 * input.c: Rename must_advance_line to start_of_input_line, for
3957 * debug.c (trace_header): Select a new debug line format, which
3958 better complies with GNU standards for formatting error messages.
3959 With option `-dfl', M-x next-error might be used on the output.
3960 * m4.c (vmesg): Adjust format of error output to GNU standards.
3961 * m4.texinfo: Adjust examples for `make check' to work.
3963 * m4.h, builtin.c, debug.c, input.c, macro.c, path.c: Use upper
3964 case for enum debug_info constants, which were all lower case.
3966 * builtin.c (m4_regexp, m4_patsubst): Use re_search instead of
3968 * lib/regex.[ch]: Use new version from textutils 1.3.6, with some
3969 collected patches. I tried a few times using newer regex.[ch], it
3970 mysteriously stopped aborting with this one. Insecure feeling...
3971 * lib/Makefile.in: Distribute regex.[ch].old, just in case!
3973 Fri Dec 18 11:08:03 1992 Francois Pinard (pinard at icule)
3975 * m4.c: Change `--no-warnings' to `--silent'.
3976 Reported by David MacKenzie.
3978 * m4.c: Put all M4OPTS code upon IMPLEMENT_M4OPTS control, and
3979 leave it off for now. See comment in m4.c for justification.
3980 Reported by David MacKenzie.
3982 * configure.in: Replace AC_USG by AC_HAVE_HEADERS(string.h).
3983 * m4.h, ansi2knr.c, lib/regex.h: Replace USG by HAVE_STRING_H.
3985 * Makefile.in: Add a new `info' goal. Use macro MAKEINFO.
3987 * Makefile.in: Ensure recursive cleaning is done before local
3988 cleaning for all clean goals.
3990 * builtin.c (ntoa): Ensure the value is always interpreted as a
3991 signed quantity, whatever the radix is.
3993 Wed Nov 18 07:57:19 1992 Jim Meyering (meyering@idefix)
3995 * builtin.c, format.c, input.c: Split long lines.
3996 * m4.c: Use typedef macro_definition instead of struct
3998 * symtab.c: Use typedef symbol instead of struct symbol.
4000 Tue Nov 17 01:58:40 1992 Francois Pinard (pinard at icule)
4002 * *.[ch]: Remove all trailing whitespace, in code and comments.
4004 * configure.in: Find some awk.
4005 * Makefile.in: Add $(AWK) to MDEFINES.
4006 * checks/Makefile.in: Transmit $(AWK) to get_them.
4007 * checks/get_them: Use $AWK instead of gawk. Add a close in the
4008 awk script when switching files, because without this, mawk runs
4009 out of file descriptors.
4011 Mon Nov 16 20:42:56 1992 Francois Pinard (pinard at icule)
4013 * Makefile.in (realclean): Delete m4.info*.
4014 Reported by Jim Meyering.
4016 * Makefile.in: Adjust and link with checks/Makefile.
4017 * checks/Makefile.in: New.
4018 * configure.in: Output checks/Makefile.
4020 * checks/get_them: Have the dnl header of each test more
4021 recognizable by next-error, also use a better message.
4023 Mon Nov 16 07:48:52 1992 Jim Meyering (meyering@idefix)
4025 * m4.h [__GNUC__]: Use __volatile__ instead of `volatile.'
4026 And use that only if __GNUC__ since we're using it's GCC-specific
4027 semantics that tell the compiler the associated function doesn't
4030 * builtin.c (substitute): Don't use character as an array index.
4031 (dumpdef_cmp): Make formal arguments `const void *' to avoid
4032 warnings with gcc -W -Wall on systems with qsort prototype.
4033 (m4_errprint): Cast obstack_finish to `char *' to avoid warnings
4036 * eval.c (most functions): Add parentheses to assignments used
4037 as truth values go avoid warnings from gcc -Wall.
4039 * input.c, m4.c, output.c, path.c, symtab.c: Declare static
4040 any functions that don't need external scope.
4042 * builtin.c, debug.c, format.c, m4.c, m4.h, macro.c, symtab.c
4043 (many functions and arrays): Declare `const'.
4045 Sun Nov 15 09:42:09 1992 Francois Pinard (pinard at icule)
4047 * *.[ch]: Rename nil to NULL, using the declaration from <stdio.h>,
4048 removing the declaration from m4.h. Also rename false to FALSE
4051 * lib/Makefile.in (Makefile): New goal.
4053 * Makefile.in, lib/Makefile.in: Add a .c.o rule, so CFLAGS is not
4054 so heavily loaded. It gets more easily overridable, calling make.
4055 Reported by Jim Meyering.
4057 * Makefile.in (dist): Get .fname from the current directory name,
4058 instead of from version.h. I need updating many files manually,
4059 when the version changes, version.h is just one of them.
4061 Sat Nov 14 11:01:20 1992 Francois Pinard (pinard at icule)
4063 * m4.h: Remove the tag `boolean' on the enum introducing typedef
4064 `boolean'. This tag conflicts with <sys/types.h> on SVR4.
4065 Reported by Tom McConnell.
4067 Fri Nov 13 00:12:50 1992 Francois Pinard (pinard at icule)
4069 * m4.texinfo: Correct the examples for 33.divert, 38.divnum,
4070 39.cleardiv, which were describing missing or spurious newlines.
4071 Modify examples 52.eval, 53.esyscmd and 54.sysval so the results
4072 do not depend on machine word size, `/bin/false' implementation,
4073 or `wc' output format. `make check' is more dependable, now.
4075 * checks/check_them: Summarize the failed tests by listing their
4076 name, at end. If none, issue `All checks successful'. Output
4077 `Checking' instead of `Input file:'.
4079 * checks/get_them, checks/check_them: Reindented.
4081 * Makefile.in (dist): chmod a+r before making the tar file.
4083 Thu Nov 12 14:42:57 1992 Francois Pinard (pinard at icule)
4085 * builtin.c (m4_dnl): Diagnose any parameter to `dnl'.
4087 * input.c (next_token): Reinitialize token_buttom just after using
4088 it as a watermark with obstack_free. Or else, a future token, big
4089 enough for triggering reallocation of the obstack chunk, could
4090 void the initialized value of token_buttom, later causing panic in
4091 obstack_free. Rename token_buttom to token_bottom everywhere.
4093 * m4.h: Before declaring errno, first include <errno.h> and
4094 ensure that it does not define errno.
4095 Reported by Richard Stallman.
4097 Wed Nov 11 17:40:35 1992 Francois Pinard (pinard at icule)
4099 * builtin.c: Define and use DECLARE macro for builtins.
4101 * builtin.c (m4_ifelse): Avoid any diagnostic when exactly one
4102 argument, this is a common idiom for introducing long comments.
4104 * builtin.c (m4_ifelse): If 3n + 2 arguments, diagnose missing
4105 arguments. The last argument was silently ignored.
4107 * m4.c (cmd_error): Add a missing semicolon before va_end().
4109 Tue Nov 10 08:57:05 1992 Francois Pinard (pinard at icule)
4111 * Makefile.in: Now handle protoized sources. Define and use U.
4112 Compile and use ansi2knr with old compilers. Update DISTFILES.
4113 Add `aclocal.m4' to `configure' dependencies.
4114 * ansi2knr.c: New, from Ghostscript distribution.
4115 * configure.in: Define U through FP_PROTOTYPES for old compilers.
4116 Add AC_ISC_POSIX, AC_CONST, AC_SIZE_T.
4117 * aclocal.m4: New, provide FP_PROTOTYPES.
4118 * m4.h: Conditionnaly protoized through Args, save for varags.
4119 * builtin.c: Protoized. Then:
4120 Include <sys/types.h> if size_t is not defined, before "regex.h".
4121 (m4_ifelse): Fetch built-in name properly for diagnostic.
4122 (m4_dumpdef): Remove wrong (char *) cast calling dump_symbol.
4123 (m4_regexp): Add const to `msg' declaration.
4124 (m4_patsubst): Add const to `msg' declaration.
4125 * debug.c: Protoized, save for varargs.
4126 * eval.c: Protoized.
4127 * format.c: Protoized.
4128 * input.c: Protoized.
4129 * m4.c: Protoized, save for varargs. Then:
4130 (xfree): Accept void * instead of char *.
4131 (xmalloc): Return void * instead of char *.
4132 (xrealloc): Accept and return void * instead of char *.
4133 * macro.c: Protoized.
4134 * output.c: Protoized.
4135 * path.c: Protoized. Then cast some (char *) over xmalloc's.
4136 * symtab.c: Protoized.
4138 Fri Nov 6 02:05:21 1992 Francois Pinard (pinard at icule)
4140 * m4.texinfo: Remove directory from diagnostics in 30.include,
4141 51.eval, 56.errprint and 57.m4exit tests.
4143 * m4.h: Remove declarations for int or void system functions, they
4144 cause more conflicting trouble than they make good.
4146 * configure.in: Avoid configuration header file. Add some tests.
4147 * m4.h: Remove #include "config.h".
4148 * Makefile.in, lib/Makefile.in: Implement Autoconf interface.
4149 Then, rewritten for better compliance with GNU standards.
4151 Thu Nov 5 12:37:13 1992 Francois Pinard (pinard at icule)
4153 * format.c (format): Avoid syntax error if not HAVE_EFGCVT,
4154 because of a misplaced #endif.
4156 * Many *.[hc] files: Correct intra-line spacing here and there,
4157 according to GNU indent 1.6 advice.
4159 * configure.in: New, using Autoconf 1.2.
4160 * m4.h: Reverse NO_MEMORY_H to NEED_MEMORY_H.
4161 * Delete old configure.in, configure, etc/configure.in,
4162 etc/configure, lib/configure.in, lib/configure and config/*.
4163 Reported by Jason Merrill.
4165 * symtab.c (hash): Change (char) NULL to '\0'.
4166 Reported by Jason Merrill.
4168 * Delete .vers, etc/newdist.sh, etc/newvers.sh and
4169 etc/nextvers.sh. Release numbers will be edited `by hand'.
4170 * version.h: De-automatize, force value in.
4172 * m4.c: Changes in order to use a newer getopt.h.
4173 Reported by David MacKenzie.
4175 * checks/: New name for examples/.
4176 * checks/get_them: New location for etc/get_examples.
4177 * checks/check_them: New location for etc/check_examples.
4178 * Makefile.in, checks/get_them, checks/check_them: Adjust.
4179 * lib/vfprintf.c: New location for etc/vfprintf.c.
4180 * Delete empty etc/.
4181 * examples/: New name for test/.
4183 Tue Mar 10 00:29:46 1992 Francois Pinard (pinard at icule)
4185 * Makefile.in (check): Add m4 as dependency.
4187 * m4.c: Accept --no-warnings instead of --no_warnings, and
4188 --no-gnu-extensions instead of --no_gnu_extensions. Make the
4189 usage message more informative.
4190 Reported by David MacKenzie.
4192 Mon Mar 9 14:53:40 1992 Francois Pinard (pinard at icule)
4194 * etc/check_examples: New name for check_examples.sh.
4195 * etc/get_examples: New name for get_examples.sh.
4196 * Makefile.in, etc/Makefile.in: Use new names.
4198 * Makefile.in: Transmit $(CC) while making in lib.
4200 * Many *.[hc] files: GNU indent'ed, with further fine tuning of
4201 code disposition by hand.
4203 Sun Mar 8 11:01:55 1992 Francois Pinard (pinard at icule)
4205 * m4.h: Delete definitions for abort() and exit().
4206 Reported by Richard Stallman.
4208 * config/hmake-unicos, config/s-unicos.h: New files.
4209 Reported by Hal Peterson.
4211 * eval.c (exp_term): Have N^0 return 1.
4212 Reported by Michael Fetterman.
4214 * eval.c, input.c, m4.h: Remove last comma in enums.
4215 Reported by Mike Lijewski.
4217 * Transfer of maintenance duties from Rene' to Franc,ois.
4219 Thu Oct 24 15:18:46 1991 Rene' Seindal (seindal at diku.dk)
4221 * Release 1.0. Many thanks to those, who provided me with bug
4222 reports and feedback.
4224 * Uses GNU configure, taken from the gdb distribution.
4226 * Uses GNU getopt(), with long option names.
4228 * The -Q/+quiet option is added, which suppresses warnings about
4229 missing or superflous arguments to built-in macros.
4231 * Added default options via the M4OPTS environment variable.
4233 * The built-in format can now be configured to use sprintf as
4234 the formatting engine, for systems without [efg]cvt(3).
4236 * GNU library code is moved to the ./lib subdirectory; other
4237 utility files are now in ./etc.
4239 * Several minor bugs have been fixed.
4241 Fri Jul 26 15:28:42 1991 Rene' Seindal (seindal at diku.dk)
4243 * Fixed various bugs. Release 0.99, manual 0.09. Many thanks to
4244 Francois Pinard and Roland H. Pesch for providing me with reports.
4246 * The builtins incr and decr are now implemented without use of
4249 * The builtin indir is added, to allow for indirect macro calls
4250 (allows use of "illegal" macro names).
4252 * The debugging and tracing facilities has been enhanced
4253 considerably. See the manual for details.
4255 * The -tMACRO option is added, marks MACRO for tracing as soon
4258 * Builtins are traced after renaming iff they were before.
4260 * Named files can now be undiverted.
4262 * The -Nnum option can be used to increase the number of
4263 divertions available.
4265 * Calling changecom without arguments now disables all comment
4268 * The function m4_patsubst() is now consistently declared
4271 * A bug in dnl is fixed.
4273 * A bug in the multi-character quoting code is fixed.
4275 * Several typos in the manual has been corrected. More probably
4278 * The m4.info file is now installed along with the program.
4280 Thu Nov 15 21:51:06 1990 Rene' Seindal (seindal at diku.dk)
4282 * Updated and enhanced version. Release 0.75, manual 0.07.
4284 * Implemented search path for include files (-I option and
4285 M4PATH envronment variable).
4287 * Implemented builtin "format" for printf-like formatting.
4289 * Implemented builtin "regexp" for searching for regular
4292 * Implemented builtin "patsubst" for substitution with regular
4295 * Implemented builtin "esyscmd", which expands to a shell
4298 * Implemented "__file__" and "__line__" for use in error
4301 * Implemented character ranges in "translit".
4303 * Implemented control over debugging output.
4305 * Implemented multi-character quotes.
4307 * Implemented multi-character comment delimiters.
4309 * Changed predefined macro "gnu" to "__gnu__".
4311 * Changed predefined macro "unix" to "__unix__", when the -G
4312 option is not used. With -G, "unix" is still defined.
4314 * Changed "shift", "$@" and "$*" to not insert spaces afters
4317 * Added program name to error messages.
4319 * Fixed two missing null bytes bugs.
4321 Mon Jan 22 21:08:52 1990 Rene' Seindal (seindal at diku.dk)
4323 * Initial beta release. Release 0.50, manual 0.05.
4333 Copyright (C) 1990, 1991, 1992, 1993, 1994, 2000, 2001, 2003,
4334 2005, 2006, 2007 Free Software Foundation, Inc.
4336 Copying and distribution of this file, with or without
4337 modification, are permitted provided the copyright notice
4338 and this notice are preserved.