1 2006-10-31 Eric Blake <ebb9@byu.net>
3 * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import strstr'.
4 * doc/m4.texinfo (Translit): Improve the documentation.
5 * src/builtin.c (m4_translit): Optimize to O(n) instead of O(n^2)
7 (m4_index): Simplify, and speed up slightly.
8 * NEWS: Document this fix.
10 2006-10-28 Eric Blake <ebb9@byu.net>
12 * src/input.c (set_quotes): Don't allow empty end-quote with
13 non-empty start-quote.
14 (set_comment): Likewise for end-comment.
15 * src/builtin.c (m4_changecom): Adjust caller.
16 * doc/m4.texinfo (Changequote, Changecom): Update documentation to
18 (Incompatibilities): Document another POSIX bug.
19 * NEWS: Mention this change.
21 2006-10-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
23 * examples/Makefile.am (EXTRA_DIST): Distribute recently-added
26 2006-10-26 Eric Blake <ebb9@byu.net>
28 Silence -Wwrite-strings -Wpointer-arith warnings.
29 * src/builtin.c (define_user_macro): Allow NULL argument.
30 (m4_builtin, m4_indir): Cast away const of "".
31 * src/format.c (format): Likewise.
32 * src/macro.c (collect_arguments): Likewise.
33 (expand_macro): Avoid math on void*.
34 * src/m4.c (main): Adjust caller.
35 * src/output.c (freeze_diversions): Detect off_t overflow.
37 * src/input.c (pop_input): Remove unnecessary code.
39 2006-10-25 Eric Blake <ebb9@byu.net>
41 * src/symtab.c (symtab_init): Avoid size_t overflow.
42 * src/output.c (make_diversion): Avoid size_t overflow.
43 * doc/m4.texinfo (Diversions): Test this fix.
44 * src/input.c (input_block): Remove unused member. Reduce size
46 (push_file, pop_input): Avoid useless assignment.
47 * NEWS: Document the bug fix.
49 Redo location tracking. Instead of having just files track the
50 line to return to when popping input, now all input blocks track
52 * src/input.c (INPUT_STRING_WRAP, INPUT_FILE_INIT): No longer
54 (input_block): Have line and file storage for all input types, and
56 (input_change): New global flag.
57 (push_file, push_macro, push_string_init, push_wrapup): Store
59 (push_string_finish, pop_input, pop_wrapup): Notice changes in
61 (peek_input): Adjust to new member names.
62 (next_char, next_char1): Adjust location if needed.
63 (skip_line): Simplify restoring location.
64 * doc/m4.texinfo (Location): Augment the test to catch line
65 location of expansion of multi-line arguments.
66 Reported by Stepan Kasal.
68 2006-10-23 Eric Blake <ebb9@byu.net>
70 * doc/m4.texinfo (Macro Arguments): Document that leading space
71 in argument collection stops at macro expansion.
72 (Incompatibilities): Document POSIX whitespace wording issue.
74 2006-10-20 Eric Blake <ebb9@byu.net>
76 * doc/m4.texinfo: Trailing '@comment' doesn't format nicely in
77 TeX, so recognize '@w{ }' instead. Likewise, @code{_name} at the
78 end of a TeX line splits incorrectly.
79 (Foreach, Improved foreach): Write these sections, borrowing ideas
80 from CVS head and from m4sugar.
81 * checks/get-them: Accomodate new way to show trailing space in
83 * examples/foreach.m4: Make usable in documentation.
84 * examples/foreachq.m4: New file.
85 * examples/foreachq2.m4: New file.
86 * examples/foreach2.m4: New file.
87 * NEWS: Document the documentation updates.
89 2006-10-19 Eric Blake <ebb9@byu.net>
91 * src/builtin.c (mkstemp_helper, m4_mkstemp): New functions.
92 (m4_maketemp): Provide traditional behavior.
93 * doc/m4.texinfo (Mkstemp): Rename from Maketemp. Document the
94 new `mkstemp' macro and the flaws of the old `maketemp'.
95 (Incompatibilities): Move maketemp discussion to...
96 (Extensions): ...here, since -G now supresses the GNU extension.
97 * NEWS: Document this.
99 * examples/forloop.m4: Simplify.
100 * examples/forloop2.m4: New file.
101 * examples/quote.m4: New file.
102 * doc/m4.texinfo (Loops): Rename to...
103 (Shift): ...this node.
104 (Forloop, Foreach, Improved forloop, Improved foreach): New
107 2006-10-17 Eric Blake <ebb9@byu.net>
109 * m4/gnulib-cache.m4: Update with 'gnulib-tool --import
111 * configure.ac (AC_CONFIG_HEADERS): Create config.h alongside
112 gnulib headers, rather than in top directory.
113 * src/Makefile.am (AUTOMAKE_OPTIONS): Add nostdinc, to reduce make
116 2006-10-16 Eric Blake <ebb9@byu.net>
118 * doc/m4.texinfo: Backport some minor cleanups from head.
119 (Cleardivert): Rename from cleardiv.
121 * doc/m4.texinfo (Invoking m4): Promote to a chapter, instead of
122 a section of Preliminaries.
123 (Operation modes, Preprocessor features, Limits control)
124 (Frozen state, Debugging options, Command line files): Subdivide
126 (Input processing, Quoting Arguments, Define, Arguments)
127 (Cleardiv, Format, M4exit): Fix grammar of references.
128 (Inhibiting Invocation, Macro Arguments, Builtin, Trace)
129 (Debug Levels, Debug Output, Include, Search Path, Divert)
130 (Platform macros, Syscmd, Location, Extensions): Point to new
132 (Top, Loops, Include, Undivert, Location, Incompatibilities):
133 Improve file references.
135 2006-10-14 Eric Blake <ebb9@byu.net>
137 * m4/input.c (file_clean): Don't close stdin twice, POSIX says it
139 Reported by Ralf Wildenhues.
141 * src/builtin.c (m4_undivert): Check for read error.
143 2006-10-13 Eric Blake <ebb9@byu.net>
145 * src/m4.h (UNIX, W32_NATIVE, OS2): Move platform checks after
146 header files are included, since <unistd.h> can affect the tests.
148 Reported by Martin Koeppe.
150 Backport head's usage of clean-temp module, as it is cleaner than
152 * m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
153 clean-temp closeout', and remove tmpfile-safer.
154 * src/m4.h (includes): Adjust.
155 (m4_path_search): Rename from path_search, to avoid collision
157 * src/m4.c (main): Install closeout handler. Adjust caller.
158 (usage): Now done by closeout module.
159 * src/builtin.c (m4_m4exit): Likewise.
160 (m4_undivert, include): Adjust callers.
161 * src/freeze.c (reload_frozen_state): Likewise.
162 * src/path.c (m4_path_search): Rename from path_search.
163 * src/output.c (output_temp_dir): New variable.
164 (cleanup_tmpfile, m4_tmpfile): New functions, from head.
165 (insert_diversion, make_room_for): Use them.
166 * doc/m4.texinfo (Diversions): Document this, and add a test.
167 (Improved fatal_error): Fix typo.
168 (Maketemp): Port test to mingw, and no longer hide from
170 * NEWS: Document the change in TMPDIR behavior.
172 * configure.ac (m4_pattern_forbid): Narrow the range of forbidden
173 macros, to work with recent gnulib-tool update.
175 * src/builtin.c (m4_builtin, m4_indir): Allow transparent
176 handling of defn results.
177 * doc/m4.texinfo (Builtin, Indir): Add test cases.
178 * NEWS: Document this.
180 2006-10-12 Eric Blake <ebb9@byu.net>
182 * doc/m4.texinfo (Location): Fix typo in previous commit.
183 (Changeword): Catch one more case.
184 * src/input.c (skip_line): Fix case when outer file used macro to
187 2006-10-11 Eric Blake <ebb9@byu.net>
189 * src/input.c (enum input_type): Add additional types, to shave
190 time off the common case.
191 (push_wrapup): Wrapped strings remember location.
192 (push_string_finish): Normal strings carry no location.
193 (push_file): Start new files uninitialized.
194 (peek_input, next_char_1): Optimize common cases by updating
195 location only on new input types.
196 (pop_input): Update to honor new input types.
197 (skip_line, push_string_finish): Fix regression in previous patch
198 when dnl is not followed by newline in included file.
199 (push_string_init): Initialize all fields of INPUT_STRING sooner.
200 (peek_token): Simplify.
201 (peek_input): Don't pop input files on peek, so that __file__ and
202 __line__ as last token of include file work correctly.
203 * doc/m4.texinfo (History): Mention 1.4.8.
204 (Answers): Split into sections, one per answer.
205 (Improved exch, Improved cleardivert, Improved fatal_error): New
207 (Dnl, M4wrap, Location, M4exit, Improved fatal_error): Update to
208 new m4wrap location semantics.
209 (Changeword): Add test that caught the regression.
210 * NEWS: Document this.
212 * src/macro.c (expand_macro): In macro expansion errors, report
213 line number at open parenthesis.
214 * src/input.c (next_token): Fix off-by-one bug in reporting end
215 of file in unterminated comment and string.
216 (file_names): New obstack, necessary since expand_macro now hangs
217 on to file names longer than the files remain open.
218 (input_init): Initialize new obstack.
219 (push_file): Use new obstack. Delay updates to current_file
220 until after expand_macro has restored state.
221 (peek_input, next_char_1): Update current_file if necessary.
222 (pop_wrapup): Release memory.
223 * doc/m4.texinfo (Macro Arguments, Changequote, Changecom): Catch
225 (Dnl): Update to the new location reporting rules.
226 * NEWS: Document these changes.
228 2006-10-10 Eric Blake <ebb9@byu.net>
230 * src/macro.c (argc_stack, argv_stack): New variables for sharing
231 obstacks across multiple macro calls.
232 (expand_input): Initialize and tear down stack once per input
233 file, instead of once per macro.
234 (expand_macro): Reuse existing stacks when possible.
235 (collect_arguments): Simplify slightly.
237 * src/path.c (include_env_init): Fix botched patch application.
238 Reported by Ralf Wildenhues.
240 2006-10-09 Eric Blake <ebb9@byu.net>
242 * src/m4.c (usage, main): Detect write failures to stderr.
243 * src/builtin.c (m4_m4exit): Likewise.
244 * NEWS: Document this.
246 * src/macro.c (expand_macro): Allow --nesting-limit=0 to remove
248 * NEWS: Document this.
249 * doc/m4.texinfo (Invoking m4): Likewise.
251 2006-10-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
253 * src/path.c (include_env_init): Copy the string returned
254 by getenv before overwriting it; POSIX disallows this.
256 2006-10-09 Eric Blake <ebb9@byu.net>
258 * src/m4.c (main): Defer debugfile until after --help.
259 * configure.ac (AC_INIT): Bump version number.
260 * NEWS: Start changes of 1.4.7a.
262 2006-09-25 Eric Blake <ebb9@byu.net>
266 * configure.ac (AC_INIT): Bump version number.
267 * NEWS: Describe changes since 1.4.6.
269 2006-09-21 Eric Blake <ebb9@byu.net>
271 * doc/m4.texinfo (Invoking m4): Add clarification on option
274 Reported by Mikhail Teterin.
276 * bootstrap: Add --force option, based on idea from coreutils.
277 * README: Document that ./bootstrap and autoreconf are for
278 developers, and not lightly done in tarballs.
280 2006-09-20 Eric Blake <ebb9@byu.net>
282 * src/m4.c (usage, OPTSTRING, main): Rename -e to -i, and give
283 deprecation warning on -e.
284 * doc/m4.texinfo (Invoking m4, Extensions): Document this.
285 * NEWS: Document this.
287 2006-09-19 Eric Blake <ebb9@byu.net>
289 * src/m4.c (usage, long_options, main, DEBUGFILE_OPTION): Rename
290 -o/--error-output to --debugfile, and deprecate the former. This
291 will allow a future release to be more consistent with other GNU
292 tools, with -o/--output affecting stdout, not debug.
293 * doc/m4.texinfo (Invoking m4, Debug Output): Document this.
294 * NEWS: Document this.
296 2006-09-14 Eric Blake <ebb9@byu.net>
298 * src/m4.c (main): Warn on deprecated options -B, -S, -T, -N,
299 --diversions. `m4 --help --version' now displays help, not
301 (interactive, frozen_file_to_read, frozen_file_to_write): Move to
303 (show_help, show_version): No longer needed.
304 (long_options, DIVERSIONS_OPTION): Backport patch from head to
305 distinguish between -N and --diversions in warning.
306 * doc/m4.texinfo (Invoking m4): Document this.
309 2006-09-11 Eric Blake <ebb9@byu.net>
311 * src/Makefile.am (m4_LDADD): Add any gnulib dependent libraries.
312 * src/debug.c (debug_flush_files) [UNIX]: Flush stdin if it is
314 (debug_set_file): Use STDOUT_FILENO.
315 * src/builtin.c (m4_m4exit): Flush stdin before exiting, to comply
316 with POSIX in regards to unread input.
317 * NEWS: Document this fix.
318 * doc/m4.texinfo (Syscmd, Esyscmd, M4exit): Likewise.
320 2006-09-07 Eric Blake <ebb9@byu.net>
322 * m4/gnulib-cache.m4: Update to newer gnulib-tool.
323 * src/m4.h (push_file): Change prototype.
324 * src/input.c (push_file, peek_input, next_char_1): Only call getc
325 once at EOF, to avoid double ^D on terminal stdin; regression from
327 (push_file, pop_file): Allow reading stdin twice.
328 * src/m4.c (main): Likewise.
329 * src/builtin.c (include): Update caller.
330 * NEWS: Document this change.
331 * doc/m4.texinfo (Invoking m4, Incompatibilities): Likewise.
332 (Syscmd): Add a test that failed before this patch.
334 2006-09-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
336 * checks/check-them: Quote $pwd.
338 2006-09-05 Eric Blake <ebb9@byu.net>
340 * src/builtin.c (define_macro): Warn on invalid macro name.
341 * NEWS: Document this change.
342 * doc/m4.texinfo: Fix typos.
343 (Invoking m4, Macro Arguments, Pseudo Arguments, Defn, Indir)
344 (Ifelse): Backport some improvements from head.
346 2006-09-04 Eric Blake <ebb9@byu.net>
348 * doc/m4.texinfo (Changeword): Skip test on mingw, where the
349 native echo is braindead.
350 * checks/check-them (strip_needed): Ignore \r in output. Now the
351 testsuite will pass when cross-compiling from cygwin to mingw.
353 * src/input.c (peek_input): Fix regression in handling macro
354 without arguments as last token in file; debian bug 385720.
355 (next_token): Always consume an input character.
356 Reported by Andreas Schultz.
357 * configure.ac (AC_INIT): Bump version number.
358 * NEWS: Document this fix.
359 * doc/m4.texinfo (History): Mention next version.
360 (Changeword): Add example that exposes this bug.
363 2006-08-25 Eric Blake <ebb9@byu.net>
367 * configure.ac (AC_INIT): Bump version number.
368 * NEWS: Describe changes since 1.4.5.
370 * Makefile.maint (web-manual): Give up on VPATH build during
371 distribution. But distributions are made so infrequently that
372 this is not too much of a hardship.
373 * Makefile.am (MAINTAINERCLEANFILES): Avoid error if lib/CVS/
376 2006-08-24 Eric Blake <ebb9@byu.net>
378 * src/builtin.c (m4_index, m4_substr, m4_translit): Similar to
379 Solaris, produce output on just one argument.
380 (m4_regexp, m4_patsubst): For consistency, do likewise.
381 (m4_patsubst): Allow zero-length match at end of string.
382 * doc/m4.texinfo (Sysval): Fix overfull hbox.
383 (Bugs, Macro Arguments): Minor fixes.
384 (Other tokens): Rearrange node order.
385 (Index macro, Substr, Translit, Regexp, Patsubst): Add tests.
386 * NEWS: Document these fixes.
388 2006-08-22 Eric Blake <ebb9@byu.net>
390 * src/input.c (pop_input): Avoid empty filename with -di option.
391 * src/debug.c (debug_message_prefix): Put space before message.
393 * m4/gnulib-cache.m4: We don't explicitly use alloca module.
395 * m4/gnulib-cache.m4: Augment with gnulib-tool --import gnupload.
396 * Makefile.maint (fetch): Simplify, now that we can use gnupload.
398 * checks/check-them: State why a test is skipped.
399 * doc/m4.texinfo (Changeword, Sysval, Maketemp): Likewise.
401 * ChangeLog: Add copyright.
407 * examples/COPYING: New file, add copyright for all the examples.
408 * checks/get-them: Put copyright on testsuite files.
410 2006-08-18 Eric Blake <ebb9@byu.net>
412 Don't let unrelated child processes see too many files.
413 * m4/gnulib-cache.m4: Augment with gnulib-tool --import cloexec.
414 * src/builtin.c (m4_esyscmd, m4_regexp, m4_patsubst): Fix
415 spelling in error message.
416 * src/debug.c [!__STDC__]: Assume C89, and nuke old varargs.h.
417 (debug_set_output): Close debug file on exec.
418 * src/m4.h (includes): Add cloexec.h.
419 * src/output.c (make_room_for): Close diversions on exec.
420 * src/path.c (path_search): Close include files on exec.
421 * NEWS: Document this.
423 Regular expressions were leaking memory.
424 * src/builtin.c (init_pattern_buffer, free_pattern_buffer): New
426 (m4_regexp, m4_patsubst): Avoid memory leak.
427 * src/input.c (init_pattern_buffer) [ENABLE_CHANGEWORD]: Make
429 (set_word_regexp) [ENABLE_CHANGEWORD]: Avoid memory leak. Change
430 from O(n^2) to O(n) for calculating word_start.
431 (next_token, peek_token) [ENABLE_CHANGEWORD]: Treat word_start as
432 O(1) bitmap, not O(n) search string.
433 * NEWS: Document this fix.
435 2006-08-17 Eric Blake <ebb9@byu.net>
437 * NEWS: Document previous checkin.
439 * src/builtin.c (substitute): Avoid core dump when accessing
440 beyond bound of regular expression.
441 Reported by Karl Nelson.
442 * doc/m4.texinfo (Regexp): Add example that causes core dump on
443 some architectures prior to this patch.
446 2006-08-16 Eric Blake <ebb9@byu.net>
448 * doc/m4.texinfo (Invoking m4, Debug Output): Fix wording to be
449 clear that dumpdef does not always go to stderr.
451 * src/builtin.c (m4_errprint): Flush buffers before printing to
455 2006-08-15 Eric Blake <ebb9@byu.net>
457 * src/builtin.c (m4_m4wrap, m4_errprint, m4_shift): Make blind,
458 per debian bug 96075.
459 * doc/m4.texinfo (Loops, M4wrap, Errprint): Document this change.
460 (Changeword): Don't use shift as an example of a swallowed word.
461 (Divert): Discuss fact that divert is an English word.
462 Reported by Richard A Nelson.
464 2006-08-14 Eric Blake <ebb9@byu.net>
466 * doc/m4.texinfo (Invoking m4): Minor fixes.
468 2006-08-12 Eric Blake <ebb9@byu.net>
470 * doc/m4.texinfo (Arguments): Hint at better exch macro.
471 (Answers): Provide a better definition.
473 2006-08-09 Eric Blake <ebb9@byu.net>
475 * doc/m4.texinfo (Incompatibilities): Document that m4 does not
476 yet understand locales.
477 * NEWS: Fix wording of a few items.
479 2006-08-08 Eric Blake <ebb9@byu.net>
481 Avoid printing `NONE:0:' in error messages.
482 * src/m4.h (m4_error_at_line): New function.
483 * src/m4.c (m4_error_at_line): Implement.
484 * src/input.c (skip_line, input_init, next_token): Use "", not
485 "NONE", for no file, since NONE can be a real file name.
486 * src/macro.c (expand_argument): Likewise.
487 * src/debug.c (debug_message_prefix, trace_header): Check for
489 * doc/m4.texinfo (Dnl, M4wrap): Adjust accordingly.
490 (Location): Document that synclines and internal message format
491 are not impacted by redefining these macros.
492 (M4exit): Hint at bug in fatal_error.
493 (Answers): Provide workaround to match m4 output.
495 * m4/gnulib-cache.m4: Augment with gnulib-tool --import verror.
496 * src/m4.h (m4_error): New function.
497 (M4ERROR, M4ERROR_AT_LINE): Reimplement without hacking around
498 error module deficiencies.
499 (reference_error, suppress_line): No longer needed.
500 * src/m4.c (m4_error): Implement.
501 (main): No longer need to install error callback.
503 2006-08-04 Eric Blake <ebb9@byu.net>
505 * src/m4.h (program_name): Declare.
506 (suppress_line): New variable.
507 (M4ERROR_AT_LINE): New macro.
508 * src/m4.c (reference_error, main): Follow GNU Coding Standards
509 for error message format.
510 * src/input.c (skip_line, next_token): Use M4ERROR_AT_LINE.
511 * src/macro.c (expand_argument): Likewise.
512 * checks/check-them (examples): Adjust to new message format.
513 * src/builtin.c (m4___program__): New builtin.
514 * doc/m4.texinfo (Location): Split from Errprint into new node,
515 and document __program__.
516 (Builtin, Ifdef, Ifelse, Dumpdef, Trace, Debug Output, Dnl)
517 (Include, Regexp, Patsubst, Incr, Eval): Adjust error message
519 (Extensions): Document __program__.
520 * NEWS: Document this change.
522 2006-08-03 Eric Blake <ebb9@byu.net>
524 Don't confuse leading `(' in comment or quote with start of
526 * src/m4.h (enum token_type): Add TOKEN_OPEN, TOKEN_COMMA,
528 (peek_input): Make private to input.c.
529 (peek_token): New prototype.
530 * src/input.c (default_word_regexp): Reduce ifdefs.
531 (peek_input): Make static.
532 (next_token): Return new token types.
533 (match_input, MATCH): Add argument consume, which controls
534 whether match should be pushed back.
535 (peek_token): New function.
536 (token_type_string) [DEBUG_INPUT]: New function.
537 * src/macro.c (expand_token, expand_argument, collect_arguments):
538 Handle new token types.
539 * doc/m4.texinfo (Changequote, Changecom): Document this.
540 * NEWS: Document this.
542 * src/stackovf.c (setup_stackovf_trap): Free memory on failure.
544 * src/stackovf.c (setup_stackovf_trap): Gracefully avoid stack
545 overflow detection when sigstack exists but is not implemented.
546 Fixes debian bug 154053.
548 Reported by David Perlin.
550 2006-08-02 Eric Blake <ebb9@byu.net>
552 * src/input.c (MATCH): Fix EOF detection on multi-byte comment
555 2006-08-01 Eric Blake <ebb9@byu.net>
557 * src/input.c (skip_line, next_token): Remember current file in
558 case input file ends abruptly. Addresses debian bug 175365.
559 (pop_input): Defer freeing storage that holds previous file
561 (pop_wrapup): to here, after error message is issued.
562 * src/macro.c (expand_argument): Remember current file in case
563 input file ends abruptly.
564 * doc/m4.texinfo (Macro Arguments, Dnl, Changequote, Changecom)
565 (M4wrap): Adjust testsuite accordingly.
566 (Errprint): Document line number limitation of m4wrap.
567 * NEWS: Document this fix.
570 2006-07-31 Eric Blake <ebb9@byu.net>
572 * src/input.c (peek_input, next_char, match_input): Be eight-bit
573 clean; fixes debian bug 311378.
574 * doc/m4.texinfo (Syntax): Describe eight-bit handling.
575 (Changequote, Changecom): Add examples to test this.
576 * NEWS: Document this fix.
578 Reported by Steven Augart.
580 * doc/m4.texinfo: Whitespace fix.
581 * checks/get-them: Avoid exceeding 14-char file name limit.
584 2006-07-30 Eric Blake <ebb9@byu.net>
586 * src/path.c (path_search): Detect allocation failure.
588 Use native free when it is good enough.
589 * m4/gnulib-cache.m4: Augment with gnulib-tool --import free.
590 * src/builtin.c (define_user_macro, m4_regexp, m4_patsubst):
592 * src/symtab.c (free_symbol): Likewise.
593 * src/m4.c (xfree, main): Likewise.
594 * src/m4.h (obstack_chunk_free): Likewise.
595 * src/path.c (path_search): Likewise.
596 * src/input.c (pop_wrapup, set_quotes, set_comment): Likewise.
598 * doc/m4.texinfo (Errprint): Add example for last patch.
599 * checks/check-them: Account for VPATH in latest example.
601 2006-07-29 Eric Blake <ebb9@byu.net>
603 * src/path.c (path_search): Add result parameter, so that
604 -I can be accounted for. Debian bug 53685.
605 * src/m4.h (path_search): Update prototype.
606 * src/m4.c (main): Adjust callers.
607 * src/freeze.c (reload_frozen_state): Likewise.
608 * src/builtin.c (include, m4_undivert): Likewise.
609 * NEWS: Document this change.
610 Reported by Nicolas Lichtmaier.
612 2006-07-28 Eric Blake <ebb9@byu.net>
614 * Makefile.am (MAINTAINERCLEANFILES): Fix typo that tripped up
615 several non-GNU makes.
616 * src/stackovf.c (setup_stackovf_trap): Missed _ from yesterday.
617 * src/m4.h: Likewise.
618 * src/input.c (push_wrapup): Avoid compiler warning with Solaris
621 2006-07-27 Eric Blake <ebb9@byu.net>
623 * doc/m4.texinfo: Use @acronym{GNU} throughout.
624 (History): Update for 1.4.6.
626 * src/m4.h (_): Remove K&R cruft.
627 * src/builtin.c: Likewise.
628 * src/debug.c: Likewise.
629 * src/eval.c: Likewise.
630 * src/macro.c: Likewise.
631 * src/stackovf.c: Likewise.
633 * doc/Makefile.am (m4.1): Improve man page.
634 * src/m4.c (usage): Improve --help output, including adding the
635 bug reporting address.
636 (main): Follow GNU Coding Standards for --version output.
638 2006-07-26 Eric Blake <ebb9@byu.net>
640 * doc/m4.texinfo: Use begin-quote, end-quote, begin-comment, and
641 end-comment consistently, to match POSIX.
643 * doc/m4.texinfo (Macro Arguments, Changequote, Changecom)
644 (Dnl, M4wrap, Include): Document EOF issues, and add examples.
645 (Incompatibilities): Document incompatibility of changecom
646 vs. macro names, and of EOF in include.
647 * src/input.c (next_token): Reject unterminated comments at EOF.
648 (skip_line): Warn on unterminated dnl at EOF.
649 * NEWS: Document these changes.
651 2006-07-25 Eric Blake <ebb9@byu.net>
653 * m4/gnulib-cache.m4: Update to reflect gnulib's split of
654 stdio-safer into fopen-safer and tmpfile-safer.
655 * src/m4.c: Remove redundant include.
657 2006-07-24 Eric Blake <ebb9@byu.net>
659 Fix bugs related to stream handling.
660 * m4/gnulib-cache.m4: Augment with gnulib-tool --import
661 unlocked-io stdio-safer stdlib-safer close-stream.
662 * configure.ac (AC_CHECK_FUNCS_ONCE): Assume tmpfile; it can be
663 provided by gnulib if needed.
664 * src/output.c [! HAVE_TMPFILE]: Likewise.
665 * src/m4.h (includes): Replace unistd, stdio, and stdlib with
666 their safer counterparts.
667 (retcode): New global variable.
668 * src/input.c (pop_input): Check for read failure.
669 * src/freeze.c (reload_frozen_state): Likewise.
670 (produce_frozen_state): Check for write failure.
671 * src/debug.c (debug_set_file): Likewise.
672 * src/m4.c (usage, main): Likewise.
673 (retcode): Make global.
674 * src/builtin.c (m4_m4exit): Likewise. Ensure that the exit
675 status is non-zero except when everything succeeds.
676 * doc/m4.texinfo (M4exit): Document these changes.
677 (Incompatibilities): Remove documentation of bug now fixed.
678 * NEWS: Document these fixes.
680 2006-07-22 Eric Blake <ebb9@byu.net>
682 * src/format.c (format): Avoid compiler warning that str may be
685 2006-07-21 Eric Blake <ebb9@byu.net>
687 * src/m4.h [UNIX]: Add more platforms that are close enough to
688 categorize as UNIX, but which don't predefine __unix__.
689 Reported by Nelson H. F. Beebe.
691 2006-07-20 Eric Blake <ebb9@byu.net>
693 * m4/gnulib-cache.m4: gnulib-tool has changed again. Regenerate
694 to explicitly ask for --assume-autoconf=2.60.
696 2006-07-19 Eric Blake <ebb9@byu.net>
698 * doc/m4.texinfo (Sysval): Avoid kill -1, since ksh traps SIGHUP
699 and exits normally with 129.
700 Reported by Nelson H. F. Beebe.
703 * src/m4.h (EXIT_MISMATCH): Define.
704 * src/freeze.c (reload_frozen_state): Detect version mismatch, by
705 exiting with status 63.
706 * src/m4.c (usage): Document this.
707 * doc/m4.texinfo (Invoking m4, Using frozen files): Likewise.
710 * doc/m4.texinfo (copying): Relax restriction on front-cover and
713 2006-07-17 Eric Blake <ebb9@byu.net>
715 * src/format.c (format): Support F, g, and G specifiers.
716 * doc/m4.texinfo (Format): Document this.
717 * NEWS: Document this addition.
719 * doc/m4.texinfo (Builtin): Delete redundant text.
721 * configure.ac (AC_INIT): Bump version number.
722 * src/builtin.c (substitute): Bah. Fix buffer overrun.
723 * NEWS: Document this fix.
725 2006-07-15 Eric Blake <ebb9@byu.net>
729 * configure.ac (AC_INIT): Bump version number.
730 * NEWS: Describe changes since 1.4.4.
732 * src/m4.c (usage): Document exit status.
733 * doc/m4.texinfo: Use `exit status', not `exit code'.
734 (Invoking m4): Document exit status.
736 * bootstrap: Backport --help, --version from head.
737 (func_update): New function, for easily grabbing up-to-date files
739 * Makefile.maint (web-manual): Fix for VPATH builds.
741 2006-07-14 Eric Blake <ebb9@byu.net>
743 * doc/m4.texinfo: Global cleanup. Avoid @code{...}'d, as it
744 looks bad in info. Use @deffn rather than @example for
745 describing prototypes. Fix awkward wording and grammar.
747 * src/builtin.c (substitute): Warn on bad escape sequences.
748 Ignore trailing backslash.
749 * doc/m4.texinfo (Regexp): Add documentation for this.
750 * NEWS: Document this change.
752 * src/builtin.c (m4_format, m4_indir): Warn on too few arguments.
753 * doc/m4.texinfo (Defn, Builtin, Debug Levels, Debug Output): Add
755 (Dnl): Update example to show side effects.
756 * checks/get-them: Generate three digit test names.
757 * checks/Makefile.in (CHECKS): Accomodate 100+ tests.
759 2006-07-13 Eric Blake <ebb9@byu.net>
761 * src/input.c (input_init): Simplify.
762 (set_word_regexp): Treat empty string as default, since empty
763 regexp would disable word parsing.
764 * src/m4.c (user_word_regexp): Default to empty string.
765 * src/builtin.c (builtin_tab): Make changeword blind.
766 * doc/m4.texinfo (Changeword): Document this.
767 * NEWS: Document this.
768 * TODO: Knock off completed items.
770 * src/builtin.c (m4_undefine, m4_popdef): Visit all arguments, not
772 * doc/m4.texinfo (Undefine, Pushdef): Test this.
773 * NEWS: Document this change.
775 * src/builtin.c (numeric_arg): Treat empty string as 0, with a
776 warning. Detect quoted leading space and overflow as warnings.
777 (m4_eval): Treat empty radix as 10, and allow output in radix 1.
778 Treat width as minimum number of digits, as required by POSIX.
779 (m4_ifdef, m4_divert, m4_m4exit, m4_translit): Ignore extra
781 (m4_substr): Likewise. Silently treat empty start as 0.
782 (m4_undivert): Treat ` 1a' as file, not diversion 1.
783 * src/eval.c (eval_lex): Parse radix 1 numbers.
784 * doc/m4.texinfo (Invoking m4): Fix wording; there is more than
786 (Manual): Document behavior of numeric parsing of empty string.
787 (Divert, Incr): Document error handling.
788 (Eval): Document radices better.
789 (Incompatibilities): Document translit incompatibility.
790 * NEWS: Document these changes.
792 * Makefile.maint (fetch): Get gendocs from gnulib, not texinfo.
793 (web-manual): Simplify.
794 * m4/gnulib-cache.m4: Augment with gnulib-tool --import gendocs.
795 * Makefile.am (EXTRA_DIST): Distribute gendocs.sh.
796 (MAINTAINERCLEANFILES): Clean it as well.
797 * doc/Makefile.am (EXTRA_DIST): Distribute gendocs_template.
798 (MAINTAINERCLEANFILES): Clean it as well.
800 2006-07-12 Eric Blake <ebb9@byu.net>
802 * doc/m4.texinfo (Extensions): Document how to overcome
803 implementation difference in > 9 positional parameters.
805 * src/m4.c (usage): Sort within sections.
806 (nesting_limit): Raise default from 250 to 1024.
807 * doc/m4.texinfo: Use file name, not filename, per GNU coding
808 standard. Use @option where appropriate.
809 (Invoking m4): Sort to match --help output.
810 (Debug Levels): Sort.
811 (Frozen files): Sort and break into two nodes.
813 * src/m4.c (nesting_limit): Raise default from 250 to 1024.
814 * NEWS: Document raised -L limit.
816 2006-07-11 Eric Blake <ebb9@byu.net>
818 * Makefile.am (DISTCHECK_CONFIGURE_FLAGS): New macro, to
819 stress-test changeword before a release.
820 * doc/m4.texinfo: More doc cleanups.
821 (Copying This Manual): New node; actually include the FDL in the
823 * doc/Makefile.am (m4_TEXINFOS): Mention dependence on fdl.texi.
824 * m4/gnulib-cache.m4: Augment with gnulib-tool --import fdl.
825 * NEWS: Mention documentation improvements.
827 * src/m4.h (OS2): New platform macro.
828 * src/builtin.c (predefined_tab) [OS2]: Use it to give OS/2 a
830 * doc/m4.texinfo (Platform macros): Document it.
831 (Sysval): Remove non-portable test of system("").
832 * NEWS: Document this change.
833 Reported by Andreas Buening.
835 2006-07-09 Eric Blake <ebb9@byu.net>
837 * doc/m4.texinfo (Undivert): Fix typo in last commit.
838 * src/m4.c (usage): Document M4PATH.
839 * src/path.c (path_search): Reject empty string.
840 * src/output.c (insert_diversion): Ignore diversion 0.
841 * src/builtin.c (m4_undivert): Ignore empty string.
842 * NEWS: Document this fix.
844 2006-07-08 Eric Blake <ebb9@byu.net>
846 * checks/get-them: Make filtering easier.
847 * checks/check-them: Filter non-input lines, so line counts are
848 more realistic in the documentation, and so changeword tests work
849 even when dnl is disabled.
850 * doc/m4.texinfo: Adjust example line numbers. Clean up
851 front-matter, following autoconf's example.
852 (Changeword): Enable tests, skipping if changeword not supported.
853 (Define, Defn, Ifelse): Backport more examples from head.
854 (Input processing, Answers): New nodes, backported from head.
855 (Include): Expand test to cover empty filename.
856 (Undivert): Add test of undivert(0).
858 2006-07-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
860 * doc/m4.texinfo: Fix spelling errors.
862 2006-07-07 Eric Blake <ebb9@byu.net>
866 * doc/Makefile.am (m4.1): No need to go through a temporary file;
867 this also ensures timestamps are updated.
868 * src/m4.h (includes): Require config.h. Assume string.h,
869 stdlib.h, errno. Include error.h, exit.h, and xalloc.h rather
870 than prototyping ourselves.
871 (builtin_func): Add parameter type-checking.
872 (voidstar): Delete, now that we assume C89.
873 * src/builtin.c, src/m4.c, src/macro.c, src/symtab.c: All users of
875 * src/m4.c (xfree) [WITH_DMALLOC]: Avoid clash with dmalloc's
878 2006-07-06 Eric Blake <ebb9@byu.net>
880 * m4/gnulib-cache.m4: Augment with gnulib-tool --import
882 * src/m4.h (includes): Add binary-io.h for O_BINARY.
883 * src/freeze.c (produce_frozen_state): Use O_BINARY to remove
884 #ifdef. Fixes patch from 2005-02-03 for cygwin.
885 * NEWS: Mention this fix.
887 * configure.ac (FUNC_SYSTEM_BROKEN): New check for OS/2 bug.
888 * src/builtin.c (m4_syscmd): Work around OS/2 bug.
890 * Makefile.am (SUBDIRS): Build . before src, so that autoheader
891 runs first when needed.
892 * doc/Makefile.am (m4.1): Backport rule from CVS head: build m4.1
893 once in srcdir rather than multiple times in VPATH builds.
895 2006-07-03 Eric Blake <ebb9@byu.net>
897 * checks/check-them: Use portable = in test.
898 * src/Makefile.am (AM_CPPFLAGS): Omit space between -I and
899 directory, as required by Solaris cc. Include built headers, as
900 required by Solaris make in VPATH build.
901 * checks/Makefile.in: Use $(srcdir) where needed.
902 (CHECKS): Factor $(srcdir) into macro.
903 (DISTFILES): Likewise. Automake takes care of distributing
906 (Makefile): Use modern syntax of config.status.
907 * doc/m4.texinfo (Loops, Include, Undivert, Incompatibilities):
908 Avoid overfull and underfull hboxes in dvi.
910 Fix 'make check' in VPATH build. All files included by testsuite
911 now live in a single directory. Use forloop.m4 in testsuite.
912 * checks/incl.m4, checks/foo, checks/wrapfifo.m4: Move from
914 * examples/incl.m4, examples/foo, examples/wrapfifo.m4: ...to
916 * checks/Makefile.in (DISTFILES): Don't distribute moved files.
917 * examples/Makefile.am (EXTRA_DIST): Distribute new files.
918 * checks/check-them: Avoid s/// when filename is in pattern.
919 * examples/forloop.m4: Fix to match documentation.
920 * doc/m4.texinfo (Include, Undivert, Incompatibilities): Reflect
922 (Loops, Format): Actually use forloop.m4 in tests.
924 2006-07-02 Eric Blake <ebb9@byu.net>
926 * checks/Makefile.in (exec_prefix, prefix): New macros, so that
927 $(bindir) works in installcheck.
928 (check, installcheck): No longer change directory, so that
929 distcheck works with a read-only builddir.
930 * checks/check-them: Work when pwd is no longer builddir.
932 2006-07-01 Eric Blake <ebb9@byu.net>
934 * GNUmakefile: New file, borrowed from coreutils.
935 * Makefile.am (EXTRA_DIST): Distribute GNUmakefile.
936 * Makefile.maint (Makefile): Delete this rule, now that
937 GNUmakefile includes Makefile.
939 2006-06-30 Eric Blake <ebb9@byu.net>
941 For compatibility with other m4 implementations, sysval returns
942 signal<<8 rather than 0 if syscmd is terminated by a signal.
943 * configure.ac (AC_CHECK_HEADERS_ONCE): Check for sys/wait.h.
944 * src/builtin.c (include): Include sys/wait.h when stdlib.h does
945 not provide wait macros.
946 (WTERMSIG, WIFSIGNALED, WIFEXITED): More fallback macros.
947 (M4SYSVAL_EXITBITS, M4SYSVAL_TERMSIGBITS): New helper macros.
948 (m4_esyscmd): Set sysval to -1 on failure.
949 (m4_sysval): Print 127 on failure, and accomodate signals if they
951 * NEWS: Document this change.
952 * doc/m4.texinfo (Platform macros, Esyscmd, Sysval): Fix typos in
954 * checks/check-them: Likewise.
955 * src/debug.c (debug_set_file): Work around mingw fstat bug.
957 * src/m4.h (UNIX, W32_NATIVE): Improve platform detection macros.
958 * src/freeze.c (produce_frozen_state): Use new spelling of
960 * src/builtin.c (predefined_tab): Add __windows__ on non-unix
962 (m4_syscmd, m4_esyscmd): The empty command is successful.
963 * doc/m4.texinfo (Shell commands): Rename from UNIX commands.
964 Document platform-dependence of system().
965 (Syscmd): Add example.
966 (Esyscmd): Make example more robust, and actually demonstrate
968 (Sysval): Expand test to cover esyscmd code path, and to check
969 that empty command is successful. Add conditional check for
971 (Other Incompatibilities): Move platform macros from here...
972 (Platform macros): ...to this new node. Add windows macro.
973 Check that exactly one platform macro is provided.
974 * checks/check-them: Improve trap cleanup. Tolerate dirname and
975 .exe in error messages. Allow for skipping checks.
976 * configure.ac (HAVE_EFGCVT): Kill dead configure check.
977 * NEWS: Document platform macros.
979 2006-06-29 Eric Blake <ebb9@byu.net>
981 Fix buffer overrun bug.
982 * m4/gnulib-cache.m4: Augment with gnulib-tool --import
984 * src/format.c [HAVE_EFGCVT]: Delete this code, and use *printf
985 variant instead, since [efg]cvt are obsolete and our use of them
986 was buggy (savannah sr #104303).
987 (format): Fix buffer overflow by using xasprintf.
988 * doc/m4.texinfo (Format): Expand format test to catch both bugs.
989 * NEWS: Document this fix.
991 * configure.ac (AC_CANONICAL_HOST, AC_CANONICAL_BUILD): Allow
993 (AC_CACHE_CHECK): Cache search for ecvt.
995 2006-06-27 Eric Blake <ebb9@byu.net>
997 * doc/m4.texinfo (Eval): Document 32-bit signed limitations
998 required by POSIX, and add example that exposed core dump on x86
1000 (Incompatibilities): Document incompatibility in eval precedence.
1001 * src/eval.c (shift_term): Explicitly mask, to avoid undefined
1003 (mult_term): Explicitly check for -1, to avoid SIGFPE on x86.
1004 * NEWS: Document this change.
1006 * doc/m4.texinfo: Use @noindent consistently.
1007 (Quoting Arguments): Document that unquoted parentheses group
1009 (Pseudo Arguments): Expand tests to show this.
1010 (Incompatibilities): Contrast traditional behavior of
1013 2006-06-24 Eric Blake <ebb9@byu.net>
1015 * configure.ac (AC_PREREQ): Autoconf 2.60 is now released.
1016 (AC_CHECK_HEADERS_ONCE): Use this new feature.
1017 (AC_CHECK_FUNCS_ONCE): Likewise.
1019 2006-06-23 Eric Blake <ebb9@byu.net>
1021 * doc/m4.texinfo: Quoting cleanup throughout - follow
1022 autoconf-recommended style of one level of quote per parenthesis
1023 in the normal case. Adjust error messages to match GNU coding
1024 standards (and to allow 'make check' to pass again).
1025 (Quoted strings, Inhibiting Invocation): Turn more examples into
1027 (Comments): Resolve FIXME by adding example.
1028 (Define): Add example about underquoting.
1029 (Defn): Add example about use of $0.
1030 (Indir, Format): Resolve FIXME done in last commit.
1031 (Ifelse): Add example about creating blind macro.
1032 (Debugging): Fix grammar.
1033 (Dnl): Add example about dnl with arguments.
1034 (M4wrap): Be explicit that LIFO order is non compliant, and will
1036 (Undivert): Resolve FIXME by adding example.
1037 (Frozen files): Document that m4wrap and sysval will not work
1038 consistently until m4 2.0.
1039 (Incompatibilities): Document another POSIX compliance bug, this
1040 time with changequote. Document a traditional incompatibility
1041 with partial input spanning file boundaries.
1043 Make error messages more consistent with GNU coding standards -
1044 start with lower case, and don't end sentence with punctuation.
1045 * src/debug.c (trace_pre): Update message wording.
1046 * src/eval.c (evaluate, cmp_term, shift_term, mult_term):
1048 * src/freeze.c (produce_frozen_state, issue_expect_message),
1049 (reload_frozen_state): Likewise.
1050 * src/input.c (push_string_init, pop_init, init_macro_token),
1051 (peek_input, next_char_1, set_word_regexp, next_token): Likewise.
1052 * src/m4.c (stackovf_handler, main): Likewise.
1053 * src/macro.c (expand_token, expand_argument, call_macro),
1054 (expand_macro): Likewise.
1055 * src/output.c (make_room_for, output_text, insert_file),
1056 (freeze_diversions): Likewise.
1057 * src/symtab.c (symtab_init, lookup_symbol): Likewise.
1059 * src/builtin.c (builtin_tab): Make format and indir blind.
1060 (substitute): Prefer "Warning:" vs. "ERROR:" in messages.
1061 * NEWS: Mention the change to builtins.
1063 2006-06-22 Eric Blake <ebb9@byu.net>
1065 Robustify frozen file format.
1066 * src/freeze.c (reload_frozen_state): Add GET_DIRECTIVE helper
1067 macro. Require V first, and only accept it once. For F, use
1068 placeholder if builtin is not found, rather than warning.
1069 * src/m4.h (m4_placeholder): New prototype.
1070 * src/builtin.c: Unify error message style.
1071 (m4_placeholder): New function, warn if invoked.
1072 (builtin_tab): Add m4_placeholder.
1073 (m4_defn): Warn if placeholder is encountered.
1074 (find_builtin_by_addr): Handle placeholder.
1075 (find_builtin_by_name): Return placeholder on failure.
1076 (m4_builtin): Treat placeholder as undefined.
1077 * doc/m4.texinfo (Frozen files): Document changes in V and F.
1078 * NEWS: Document this change.
1079 Reported by Bruno Haible.
1081 * doc/m4.texinfo: Whitespace cleanup. TABs are evil in texinfo.
1082 (tabchar): New macro, so that 'make check' still works.
1083 (Invoking m4): Document that ignored compatibility options -B, -S,
1084 and -T each consume an argument.
1085 * checks/get-them: Honor @tabchar{}.
1087 Avoid compiler warnings during -DDEBUG.
1088 * src/m4.h (M4_GNUC_ATTRIBUTE, M4_GNUC_UNUSED): New macros.
1089 [DEBUG]: Also imply DEBUG_OUTPUT and DEBUG_STKOVF.
1090 * src/input.c (print_token) [DEBUG_INPUT]: Use correct format.
1091 (lex_debug) [DEBUG_INPUT]: Fix to compile. Mark unused.
1092 (next_token) [DEBUG_INPUT]: Print before returning.
1093 * src/path.c (include_dump) [DEBUG_INCL]: Mark unused.
1094 * src/symtab.c (symtab_debug) [DEBUG_SYM]: Mark unused.
1096 Avoid mkstemp bugs on various platforms.
1097 * m4/gnulib-cache.c: Augment with gnulib-tool --import mkstemp.
1098 * src/output.c [! HAVE_MKSTEMP]: Delete.
1099 * configure.ac (AC_CHECK_FUNCS): Don't check for mkstemp.
1100 * src/m4.h (mkstemp) [! HAVE_MKSTEMP]: Prototype, if needed.
1101 * NEWS: Document this.
1103 * Makefile.am (EXTRA_DIST): Distribute gnulib-cache.m4.
1104 Reported by Bruno Haible.
1106 2006-06-21 Eric Blake <ebb9@byu.net>
1108 Avoid obsolete sigstack when POSIX sigaltstack is available.
1109 * src/m4.c: Blindly assume signal.h, since stackovf.c and gnulib
1111 * configure.ac (AC_CHECK_HEADERS): Likewise.
1112 (AC_CHECK_TYPES): New check for siginfo_t, since siginfo.h is
1113 obsolete and most hosts now have it in signal.h.
1114 (AC_CHECK_MEMBERS): New check for sigaction.sa_sigaction.
1115 (AC_CACHE_CHECK): Cache decision to use stackovf.
1116 (AC_EGREP_HEADER): Switch to AC_CHECK_TYPES.
1117 * src/stackovf.c (DEBUG_STACKOVF): Remove unused define.
1118 (SA_RESETHAND, SA_SIGINFO): Provide fallback definitions, to
1119 simplify later code.
1120 (PARAM_STACKOVF, PARAM_NOSTACKOVF): Move further away from NULL,
1121 in case of dereferencing a member of a NULL pointer.
1122 (sigsegv_handler) [HAVE_STRUCT_SIGACTION_SA_SIGACTION]: Define a
1124 (setup_stackovf_trap): Use NULL instead of 0 for pointers, use
1125 EXIT_FAILURE in error, indent preprocessor directives.
1126 [HAVE_SIGALTSTACK && HAVE_SIGINFO_T]: Depend on siginfo_t, not
1128 [HAVE_SIGACTION && defined SA_ONSTACK]: Prefer POSIX handler.
1129 Reported by Santiago Vila.
1131 2006-06-19 Eric Blake <ebb9@byu.net>
1135 2006-06-18 Andreas Buening <andreas.buening@nexgo.de> (tiny change)
1137 * checks/Makefile.in (PATH_SEPARATOR): New macro.
1138 (check, installcheck): Use it, for OS/2.
1140 2006-06-18 Eric Blake <ebb9@byu.net>
1142 Consistently use "GNU M4" as package name, "m4" as executable
1144 * NEWS: Document previous fix.
1146 * README: Fix grammar. Document that --enable-changeword is on
1148 * doc/m4.texinfo (Top, Changeword): Likewise.
1149 (Sysval): Enhance this test.
1150 (History): Backport this section from CVS head, and update.
1152 2006-06-18 Bruno Haible <bruno@clisp.org> (tiny change)
1153 Eric Blake <ebb9@byu.net>
1155 * src/builtin.c (WEXITSTATUS): Provide fallback definition.
1156 (m4_esyscmd): Set sysval to 0xffff, to accomodate both
1157 big-endian and little-endian wait status definitions.
1158 (m4_sysval): Use WEXITSTATUS.
1159 Reported by Andreas Buening.
1161 2006-06-18 Eric Blake <ebb9@byu.net>
1163 * configure.ac (AC_INIT): Bump version number.
1164 * NEWS: Describe changes in 1.4.4c.
1166 2006-06-17 Eric Blake <ebb9@byu.net>
1170 * configure.ac (AC_INIT): Bump version number.
1171 * NEWS: Describe changes since 1.4.4.
1172 * Makefile.maint (cvs-news): Accomodate copyright line wrapping.
1174 * Makefile.am (MAINTAINERCLEANFILES): Clean files added by
1176 * checks/Makefile.in (maintainer-clean): Add missing target.
1177 * COPYING: Remove generated file from CVS.
1179 2006-06-16 Eric Blake <ebb9@byu.net>
1181 * checks/Makefile.in (DISTFILES): Distribute wrapfifo.m4.
1183 2006-06-15 Eric Blake <ebb9@byu.net>
1185 * checks/wrapfifo.m4: New file. Use it...
1186 * doc/m4.texinfo (Incompatibilities): here, in a new test case to
1187 demonstrate how to get POSIX behavior of m4wrap prior to m4 2.0.
1189 * src/m4.h (to_uchar): New function.
1190 * src/eval.c (eval_lex): Use it to avoid passing signed char to
1191 isdigit, isalpha, isupper, islower, isspace, isalnum.
1192 * src/builtin.c (expand_user_macro): Likewise.
1193 * src/format.c (format): Likewise.
1194 * src/macro.c (expand_argument): Likewise.
1195 * NEWS: Document this security fix.
1198 * src/symtab.c (lookup_symbol): Use invalid, not illegal.
1199 * src/freeze.c (reload_frozen_state): Fix typo in message.
1200 (produce_frozen_state): Standardize on builtin, not built-in.
1201 * src/builtin.c (numeric_arg, bad_argc): Likewise.
1203 * configure.ac (M4_EARLY, M4_INIT): Use gnulib.
1204 (AC_PROG_RANLIB, AC_AIX, AC_MINIX, AC_CHECK_HEADERS),
1205 (AC_FUNC_ALLOCA, AC_REPLACE_FUNCS): Avoid checks now done by
1207 * Makefile.am (ACLOCAL_AMFLAGS): New entry, for gnulib.
1208 * m4/gnulib-cache.m4: New file, from gnulib.
1209 * bootstrap: Invoke gnulib-tool --update.
1210 * src/m4.c (main): Cast away const.
1211 * NEWS: Document that regex is updated.
1214 2006-06-08 Eric Blake <ebb9@byu.net>
1216 * configure.ac (changeword): Work even when changeword is not a
1218 (AC_PROG_AWK, AC_PROG_INSTALL, AC_PROG_MAKE_SET, AC_HEADER_STDC):
1219 Delete; now done by automake.
1220 (AC_ISC_POSIX, AC_C_CONST): Delete; now obsolete.
1222 2006-06-07 Eric Blake <ebb9@byu.net>
1224 * lib/regex.c (bcmp_translate): Canonicalize type name.
1225 * doc/Makefile.am (MAINTAINERCLEANFILES): Fix typo.
1226 * configure.ac (changeword): Disable changeword for the creation
1227 of configure, in case of bootstrapping with an m4 configured with
1228 --enable-changeword.
1230 Distribute a rudimentary man page.
1231 * Makefile.am (SUBDIRS): Move doc after src so that 'm4 --help'
1233 * doc/Makefile.am (man_MANS, EXTRA_DIST, MAINTAINERDISTCLEAN),
1234 (SUFFIXES, m4.1): New macros and rules to build m4.1.
1236 2006-06-06 Eric Blake <ebb9@byu.net>
1238 * lib/regex.c (re_match_2_internal, bcmp_translate): Avoid
1239 compiler warnings at -O2.
1240 * lib/getopt.c (_getopt_internal): Likewise.
1242 Cleanup of previous patches.
1243 * src/input.c (struct input_block): Remove traced member.
1244 (push_macro, init_macro_token): Don't pass trace status around.
1245 * src/m4.h (struct token_data): Remove traced member.
1246 (struct symbol, struct builtin): Reduce unused space.
1247 (TOKEN_DATA_FUNC): Simplify.
1248 (TOKEN_DATA_FUNC_TRACED): Remove unused macro.
1249 (push_macro, define_builtin): Remove unused parameter.
1250 * src/builtin.c (define_builtin, builtin_init, define_macro),
1251 (m4_defn): Don't pass trace status around.
1252 * src/macro.c (expand_argument): Likewise.
1253 * src/freeze.c (reload_frozen_state): Likewise.
1254 * src/symtab.c: Whitespace cleanup.
1255 * NEWS: Clean up wording.
1256 * doc/m4.texinfo (Undefine, Dumpdef, Trace): Cleanup wording;
1257 ensure tests actually expose bugs prior to today's patches.
1259 Trace status of builtins is no longer inherited across
1260 define(...,defn(...)). Fixes bug that autom4te had been working
1262 * src/builtin.c (define_builtin): Don't override trace status.
1263 * doc/m4.texinfo (Trace): Add test for this.
1264 * NEWS: Document this.
1266 When changing macro definitions inside the arguments to the macro,
1267 consistently preserve the old definition that was in effect before
1268 argument collection, similar to the C pre-processor.
1269 Reported by John Brzustowski.
1270 * NEWS: Document this change.
1271 * doc/m4.texinfo (Macro Arguments, Undefine, Dumpdef): Document
1272 this policy, and add tests that expose core dumps prior to this
1274 * src/m4.h (struct symbol): New members to track when a symbol is
1275 still in use after removal from the symbol table.
1276 (SYMBOL_PENDING_EXPANSIONS, SYMBOL_DELETED): Define.
1277 (free_symbol): Prototype.
1278 * src/macro.c (expand_macro): Track pending expansions of a
1279 symbol. On completion, if a symbol is deleted and no longer
1280 pending, free its memory.
1281 * src/symtab.c (free_symbol): Export. Don't free memory if symbol
1283 (lookup_symbol) <SYMBOL_INSERT>: Create new entry when old entry
1285 (lookup_symbol) <SYMBOL_DELETE, SYMBOL_POPDEF>: Mark entries still
1286 in use as deleted and remove from the table without freeing
1288 (symtab_print_list) [DEBUG_SYM]: More debug output.
1290 * src/symtab.c (hack_all_symbols): Allow certain modifications of
1291 the symbol table during traversal.
1292 * src/builtin.c (set_trace): Replace SYMBOL_DELETE with
1293 SYMBOL_POPDEF, since only the latter is safe with
1296 Solve crash when passing "indir(`foo')" to "m4 -tfoo".
1297 * src/symtab.c (lookup_symbol) <SYMBOL_DELETE, SYMBOL_POPDEF>:
1298 Preserve placeholder when macro is being traced.
1299 * src/builtin.c (m4_ifdef, m4_indir): A traced but undefined
1300 symbol is not defined.
1301 (set_trace): Remove placeholder when no longer traced.
1302 (m4_traceon): On named traces, always reserve a slot in the
1304 (m4_traceoff): Don't warn about untracing a nonexistent symbol.
1305 * NEWS: Document new trace behavior.
1306 * doc/m4.texinfo (Trace): Tracing by name now consistently works
1307 no matter whether that macro is currently defined.
1308 (Incompatibilities): Document differences between traditional and
1311 2006-06-04 Paul Eggert <eggert@cs.ucla.edu> (tiny change)
1312 Eric Blake <ebb9@byu.net>
1314 * src/m4.h (hash_table_size): Now size_t instead of int.
1315 * src/m4.c (hash_table_size): Likewise.
1316 (main): Adjust to this; use atol rather than atoi.
1317 * src/symtab.c: Include <limits.h>, for CHAR_BIT.
1318 (symtab_init, lookup_symbol, hack_all_symbols):
1319 Use size_t for sizes and indexes, not int.
1320 (symtab_print_list) [DEBUG_SYM]: Likewise.
1321 (hash): Likewise. Don't case-fold in the hash function.
1322 Shift by 7, not 3, for consistency with gnulib/lib/hash.c.
1323 Don't assume hash word is 32 bits.
1324 * NEWS: Document this change.
1326 2006-06-04 Eric Blake <ebb9@byu.net>
1328 * src/symtab.c (symtab_debug, symtab_print_list) [DEBUG_SYM]: Fix
1329 to allow compilation, for use in debugger.
1330 (profiles, current_mode) [DEBUG_SYM]: New variables.
1331 (show_profile, profile_strcmp) [DEBUG_SYM]: New methods for
1332 determining hash table performance.
1334 2006-05-31 Eric Blake <ebb9@byu.net>
1335 John Brzustowski <jbrzusto@fastmail.fm>
1337 * src/input.c (input_stack): Delete; use current_input instead.
1338 (wrapup_stack): Dynamically allocate, so that recursion is handled
1340 (push_wrapup): Use current wrapup stack.
1341 (pop_wrapup): Rotate wrapup stack to current, and create new
1343 (input_init): Dynamically allocate stacks.
1344 * NEWS: Update, now that recursive m4wrap can no longer cause
1347 2006-05-31 Eric Blake <ebb9@byu.net>
1349 * lib/getopt.c: Fix copyright year.
1350 * lib/obstack.c: Ditto.
1351 * src/builtin.c: Ditto.
1353 2006-05-30 Eric Blake <ebb9@byu.net>
1355 * doc/m4.texinfo (M4wrap): Add test to expose m4wrap bug.
1356 Reported by John Brzustowski.
1357 (Incompatibilities): Document known POSIX incompatibilities.
1360 2006-05-29 Eric Blake <ebb9@byu.net>
1362 * doc/m4.texinfo (Maketemp): Work even when running 'make check'
1366 * Makefile.am: New file.
1367 * doc/Makefile.am: Ditto.
1368 * examples/Makefile.am: Ditto.
1369 * lib/Makefile.am: Ditto.
1370 * src/Makefile.am: Ditto.
1371 * acinclude.m4: New file, renamed from aclocal.m4.
1372 * configure.ac (AM_INIT_AUTOMAKE): Invoke new macro.
1373 (AC_ARG_PROGRAM): Now redundant.
1374 (STACKOVF): Turn into automake conditional.
1375 (AC_CONFIG_COMMANDS): stamp-h is a command, not a file.
1376 * checks/Makefile.in: Converting this dir to automake was not
1377 trivial; for now, just add missing targets demanded by top-level.
1378 * INSTALL: Remove files that are now generated from CVS.
1379 * Makefile.in: Ditto.
1380 * aclocal.m4: Ditto.
1381 * install-sh: Ditto.
1382 * mkinstalldirs: Ditto.
1383 * doc/Makefile.in: Ditto.
1384 * doc/texinfo.tex: Ditto.
1385 * examples/Makefile.in: Ditto.
1386 * lib/Makefile.in: Ditto.
1387 * src/Makefile.in: Ditto.
1389 * AUTHORS: Backport from CVS head, and update.
1390 * doc/m4.texinfo (Changeword): Fix examples to match behavior.
1392 2006-05-27 Eric Blake <ebb9@byu.net>
1394 * lib/regex.c (regex_compile): Kill compiler warnings.
1395 * lib/getopt.c: Likewise.
1396 * lib/obstack.c: Likewise.
1397 * src/builtin.c (builtin_init): Likewise.
1398 * src/path.c (path_search): Likewise.
1400 * doc/m4.texinfo: Fix usage of a vs. an.
1401 (Loops, Include, Cleardiv, Patsubst, Format, M4exit): Kill
1402 overfull hbox warnings.
1403 (Inhibiting Invocation, Divert, Maketemp, M4exit): Add new tests.
1405 * configure.ac: Update to autoconf 2.59. Forbid ^M4_. Fix
1407 * aclocal.m4 (fp_PROG_CC_STDC): Delete; now covered by autoconf.
1408 (fp_C_PROTOTYPES): Delete, GNU Coding Standards state we can now
1410 (M4_WITH_DMALLOC): Rename from fp_WITH_DMALLOC. Fix quoting.
1411 * src/m4.h (_): PROTOTYPES is no longer provided, assume C89.
1412 * src/Makefile.in: Delete remains of ansi2knr.
1413 * src/ansi2knr.1: Delete.
1414 * src/ansi2knr.c: Delete.
1416 2006-05-25 Eric Blake <ebb9@byu.net>
1418 * doc/m4.texinfo: Fix spelling errors. Use `invalid' instead of
1421 * doc/m4.texinfo (Francois): No longer needed as a tex variable.
1422 Reported by Karl Berry.
1424 2006-05-24 Eric Blake <ebb9@byu.net>
1426 * Makefile.in (html): New target.
1427 * doc/Makefile.in (html, m4.html): Likewise.
1428 (MAKEINFOHTML): New macro.
1429 * doc/m4.texinfo (Francois) [ifnottex]: Use newer texinfo
1431 (Regexp) [ifhtml]: Make cross-reference to emacs manual an
1433 Reported by Bob Badour.
1435 * THANKS: Update. Move reporter's email addresses here, instead
1438 2006-05-11 Eric Blake <ebb9@byu.net>
1441 * doc/m4.texinfo (Changequote): Give testsuite exposure to bug
1442 patched on 2005-12-04.
1443 Reported by Ilya N. Golubev.
1445 * bootstrap: New file, so that generated files need not be stored
1447 * Makefile.in (DISTFILES): Add bootstrap.
1449 Make testsuite less sensitive to doc changes.
1450 * doc/m4.texinfo: Use m4.input instead of filename.
1451 * checks/check-them (xerr): Turn m4.input into filename.
1452 * checks/Makefile.in (dist): Depend on stamp-checks.
1454 Portability updates for OS/2.
1455 * src/Makefile.in (EXEEXT, OBJEXT): Define.
1458 * lib/Makefile.in (OBJEXT): Define.
1460 * doc/Makefile.in (install, uninstall): Install info files into
1462 Reported by Andreas Buening.
1464 2006-05-09 Eric Blake <ebb9@byu.net>
1466 * install-sh: Update to newer upstream version.
1467 * mkinstalldirs: Likewise.
1468 Reported by Andreas Buening.
1470 * src/m4.c (main): Bump copyright year.
1471 * Makefile.in (datarootdir): Define, for autoconf 2.59c.
1472 * doc/Makefile.in (datarootdir): Likewise.
1474 2006-05-08 Eric Blake <ebb9@byu.net>
1477 * doc/m4.texinfo (Bugs): Backport bug email address from head.
1478 Reported by Stepan Kasal.
1480 2005-12-04 Ilya N. Golubev <gin@mo.msk.ru> (tiny change)
1482 * input.c (match_input): Do not pass expression with side effect
1483 to `obstack_grow'. Fix <INTERNAL ERROR: Recursive push_string!>.
1486 2005-12-04 Gary V. Vaughan <gary@gnu.org> (tiny change)
1488 * doc/m4.texinfo (How to debug macros and input): s/woould/would/
1489 Reported by Damian Menscher.
1491 2005-10-19 Gary V. Vaughan <gary@gnu.org> (tiny change)
1493 * configure.ac (AC_INIT): Bump to 1.4.4a.
1495 2005-10-19 Gary V. Vaughan <gary@gnu.org> (tiny change)
1499 * configure.ac (AC_INIT): Bump to 1.4.4.
1500 * NEWS: Describe 1.4.4's changes.
1501 * INSTALL, install-sh, doc/texinfo.tex: Updated from upstream.
1503 2005-10-17 John Gatewood Ham <zappaman@buraphalinux.org> (tiny change)
1505 * src/m4.c: fix return code when non-existent files are processed
1507 2005-10-17 John Gatewood Ham <zappaman@buraphalinux.org> (tiny change)
1509 * README: update email address for bug reports.
1511 2005-10-17 Gary V. Vaughan <gary@gnu.org>
1513 * doc/m4.info: Generated files are not kept in the repository.
1515 2005-05-01 Gary V. Vaughan <gary@gnu.org>
1517 The FSF are moving offices today. Changed their contact address
1518 in all files from `59 Temple Place, Suite 330, MA 02111-1307' to
1519 `51 Franklin Street, Fifth Floor, MA 02110-1301'.
1521 Also, some of the files here were never updated from the previous
1522 '675 Mass Ave, Cambridge, MA 02139', so changed those to the
1523 '51 Franklin Street, Fifth Floor, MA 02110-1301' address too.
1525 2005-03-31 Mike Frysinger <vapier@gentoo.org>
1527 * Makefile.in (bindir, infodir): Substitute from configure rather
1529 * doc/Makefile.in (infodir): Ditto.
1530 * src/Makefile.in (bindir): Ditto.
1533 2005-03-31 Gary V. Vaughan <gary@gnu.org>
1535 Changes needed to automate the release process for 1.4.3:
1537 * Makefile.in (dist): Make .tar.bz2 tarball too.
1538 * Makefile.maint (TSDEPS_DIST): Remove m4/libtool.m4.
1539 (cvs-news): Look 1 line further down for NEWS release number.
1540 (cvs-dist): We don't use automake, so make dist is fine.
1541 Remove double . before suffixes.
1542 (cvs-release): Don't mention manual.html.
1543 (fetch): Get latest gendocs files.
1544 (web-manual): Rewritten to use gendoc for multiformat manuals.
1545 * doc/gendocs.sh: Don't save an old version in m4 CVS!
1546 * doc/m4.texinfo (Index): HFS+ (the file system on my Mac) is case
1547 preserving, but case insensitive, so generating html docs per node
1548 clashes between Index.html, the node file, and index.html, the
1549 top-level of the document tree...
1550 (Index macro): ...so renamed to this. Changed all references.
1552 2005-03-31 Gary V. Vaughan <gary@gnu.org> (tiny change)
1554 * configure.ac (AC_INIT): Bump to 1.4.3a.
1556 2005-03-31 Gary V. Vaughan <gary@gnu.org> (tiny change)
1560 * configure.in (AC_INIT): Bump to 1.4.3.
1561 * NEWS: Describe 1.4.3's changes.
1563 2005-03-31 Gary V. Vaughan <gary@gnu.org>
1565 * Makefile.maint: New file with release rules, from CVS libtool.
1566 * Makefile.in (DISTFILES): Add Makefile.maint.
1567 * INSTALL, install-sh, doc/texinfo.tex: Updated to latest
1570 2005-03-31 Eric Blake <ebb9@byu.net> (tiny change)
1572 * doc/m4.texinfo (Patsubst): Re-add trailing space required by
1573 checks/47.patsubst, with a redundant @comment to prevent emacs
1574 from removing it accidentally again.
1575 * checks/get-them: Allow for trailing spaces tucked behind
1578 2005-03-31 Eric Blake <ebb9@byu.net> (tiny change)
1580 * doc/Makefile.in (install, uninstall): Accomodate DESTDIR.
1581 * src/Makefile.in (install, uninstall): Likewise.
1583 2005-02-07 Gary V. Vaughan <gary@gnu.org>
1585 * lib/regex.c, lib/regex.h: Reverted gnulib update, which broke
1587 Reported by Eric Blake.
1589 2005-02-04 Gary V. Vaughan <gary@gnu.org>
1591 * lib/regex.c, lib/regex.h: Updated from gnulib.
1592 * src/input.c (set_word_regexp): Don't change the word_regexp
1593 unless it compiles correctly.
1595 Reported by Frank Schwidom.
1597 * Makefile.in (stamp-h): Regenerate config.h properly.
1599 2005-02-03 Gary V. Vaughan <gary@gnu.org>
1601 * configure.ac (AC_DEFINE): Fix overquoting of description
1604 * src/m4.h (__CYGWIN__, WIN32): Canonicalise Windows and Cygwin
1606 * src/freeze.c (produce_frozen_state): Use \n line-endings even
1607 on Windows, so that the frozen file reader will work.
1608 Reported by Josef T. Burger.
1610 * src/m4.c (main): Modernise the --version output.
1612 2005-02-03 Gary V. Vaughan <gary@gnu.org>
1614 Modernise the configury a little to prevent spurious errors from
1615 Autoconf-2.59's autoreconf:
1617 * config.h.in: Renamed to...
1618 * config-h.in: ...this to better support DOS 8.3 file systems.
1619 * acconfig.h: Removed.
1620 * configure.in: Renamed to...
1621 * configure.ac: ...this, and AC_DEFINE used to declare config.h
1622 entry comments. Slight reorganisation and reformatting.
1623 * aclocal.m4: Use third argument to AC_DEFINE to declare config.h
1625 (AC_INIT): Use a modern 3 argument call.
1626 * Makefile.in, checks/Makefile.in, doc/Makefile.in,
1627 examples/Makefile.in, lib/Makefile.in, src/Makefile.in:
1628 s/PRODUCT/PACKAGE/g.
1629 * Makefile.in (DISTFILES): Removed acconfig.h, configure.in,
1630 config.h.in. Added configure.ac, config-h.in.
1631 (stamp-h.in): Removed acconfig.h from dependencies.
1632 (configure): Depends on configure.ac, not configure.in.
1633 * doc/Makefile.in (stamp-vti): Ditto.
1634 * src/freeze.c (produce_frozen_state), src/m4.c (main): Adjust for
1635 difference between PRODUCT="m4" and PACKAGE="GNU M4".
1636 * configure: Regenerated.
1638 2005-02-03 Noah Misch <noah@cs.caltech.edu>
1640 * src/output.c (mkstemp): Make non-static, and build regardless of
1641 HAVE_TMPFILE; src/builtin.c also needs this replacement.
1644 2004-09-09 Vincent Lonngren <Vincent.lonngren.759@student.lu.se>
1646 * configure.in (AC_CHECK_HEADERS): Commit works best when you save
1647 changes from your editor buffer first.
1649 * configure.in (AC_CHECK_HEADERS): Add signal.h, sys/signal.h.
1650 * src/m4.c: And include them as appropriate.
1653 2004-09-09 Andreas Schwab <schwab@suse.de>
1655 Refactoring of the string read case in next_char provides about a
1656 20% speedup of M4 as typically used by autoconf:
1658 * src/input.c (next_char_1): Renamed from next_char.
1659 (next_char): New macro.
1662 2004-08-21 Gary V. Vaughan <gary@gnu.org>
1664 * configure.in (VERSION): Bump to 1.4.2a.
1666 2004-08-19 Paul Eggert <eggert@twinsun.com>
1670 * configure.in (VERSION): Bump to 1.4.2.
1671 * News: Describe 1.4.2's changes.
1673 * src/m4.c (reference_error): Preserve errno, since M4ERROR
1675 * src/builtin.c (m4_esyscmd): Clear errno before calling popen.
1676 (m4_maketemp): Clear errno before calling mkstemp.
1677 * src/path.c (path_search): Don't let "free" trash errno when
1679 * src/output.c (insert_file): Don't assume errno has a valid
1680 value simply because fread returns zero. This fixes a
1681 portability bug reported by Marion Hakanson in
1682 <http://lists.gnu.org/archive/html/bug-m4/2004-07/msg00029.html>.
1684 2004-06-09 Gary V. Vaughan <gary@gnu.org>
1686 * configure.in (VERSION): Bump to 1.4.1a.
1687 * NEWS: Place holder for next stable release.
1689 2004-06-03 Paul Eggert <eggert@cs.ucla.edu>
1693 * configure.in (VERSION): Bump to 1.4.1.
1694 * NEWS: Describe 1.4.1's changes.
1696 * aclocal.m4 (fp_PROG_CC_STDC): Use AC_DEFUN, not define, to
1697 pacify Autoconf 2.59.
1699 * doc/m4.texinfo: Insert commas after @xref's that lack them,
1700 to pacify Texinfo 4.7.
1701 * doc/Makefile.in (info): Remove info-1, info-2, info-3.
1703 * src/m4.h, src/debug.c: Use #ifdef __STDC__, not #if __STDC__, to
1704 pacify Sun C compilers.
1706 2003-09-28 Akim Demaille <akim@epita.fr>
1708 * src/symtab.c (lookup_symbol): Fix an uninitialized-variable
1711 2003-09-03 Santiago Vila <sanvila@debian.org>
1713 * examples/stackovf.sh: Use tempfile if available.
1715 2001-04-02 Robert Bihlmeyer <robbe@orcus.priv.at>
1717 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=92629
1718 * src/output.c (m4_insert_file): Do not mix buffered and
1719 unbuffered I/O, as this breaks on the Hurd. (trivial change)
1721 2001-02-01 Santiago Vila <sanvila@debian.org>
1723 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=84451
1724 * src/m4.c (main): Fix format vulnerabilities. (trivial change)
1726 2001-02-01 Matt Kraai <kraai@debian.org>
1728 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=84416
1729 * doc/m4.texinfo (Maketemp): Change maketemp to refer to a new,
1730 empty file rather than to a nonexistent file. This closes a common
1732 * src/builtin.c (m4_maketemp): Implement the above, by using
1733 mkstemp rather than mktemp. (trivial change)
1735 2000-01-09 Akim Demaille <demaille@inf.enst.fr>
1737 * src/builtin.c (expand_ranges): Added break after trailing dash.
1738 This caused misbehaviors on some systems.
1740 Sat Nov 5 15:52:47 1994 Francois Pinard (pinard@icule)
1744 * doc/Makefile.in (realclean): Also remove stamp-vti.
1745 Reported by Eric Backus.
1747 Wed Nov 2 00:47:53 1994 Francois Pinard (pinard@icule)
1749 * src/freeze.c (produce_frozen_state): If the frozen file cannot
1750 be opened, return immediately after producing the error message.
1751 Reported by Andreas Schwab.
1753 * configure.in: Check for const only after having found possible
1754 ANSIfying compiler flags, this is of no use to check it before.
1755 Reported by Alexander Lehmann.
1757 Tue Nov 1 22:02:37 1994 Francois Pinard (pinard@icule)
1759 * src/macro.c (collect_arguments): Cast obstack arguments to
1760 (voidstar), so avoiding compiler warnings.
1761 Reported by Joseph E. Sacco.
1763 * src/freeze.c (produce_frozen_state): Cast printed lengths to
1764 (int) so they correspond to %d format items.
1765 Reported by Joseph E. Sacco.
1767 * src/m4.c (main): Cast the argument to xfree to (voidstar).
1768 * src/symtab.c (free_symbol): Idem.
1769 Reported by Karl Vogel.
1771 Mon Oct 31 02:11:19 1994 Francois Pinard (pinard@icule)
1773 * Makefile.in (DISTFILES): Distribute BACKLOG.
1775 * configure.in: Define PRODUCT and VERSION.
1776 * acconfig.h: Document PRODUCT and VERSION.
1777 * src/m4.c, src/freeze.c: Use PRODUCT and VERSION instead of the
1778 constant string m4 and variable or parameter named version.
1780 Sun Oct 30 08:13:03 1994 Francois Pinard (pinard@icule)
1782 * src/m4.h, src/debug.c: Replace all #ifdef __STDC__ by #if
1783 __STDC__. Alliant FX/2800 Concentrix 2.2 (i860-BSD4.3) compiler
1784 defines __STDC__ to 0, for indicating it is *not* ANSI!
1785 Reported by Kaveh R. Ghazi.
1787 * configure.in: Added obsolescent tests for AIX and Minix.
1789 * doc/Makefile.in (mostlyclean): Remove texclean in dependencies,
1790 which texclean does not exist anymore.
1791 Reported by Eric Backus, Jim Meyering, John David Anglin and
1794 Sat Oct 29 05:10:03 1994 Francois Pinard (pinard@icule)
1796 * aclocal.m4 (fp_C_PROTOTYPES): Force -D_HPUX_SOURCE with -Aa.
1797 Reported by John David Anglin.
1799 * src/ansi2knr.c: New version, sent by Peter Deutsch.
1800 * aclocal.m4 (fp_C_PROTOTYPES): Substitute empty or ansi2knr for
1801 ANSI2KNR, depending on the fact the compiler is ANSI or not.
1802 * src/Makefile.in: Use -Ovarargs=convert on ansi2knr calls.
1803 Remove the sed filter after ansi2knr for debug.c. Use $O instead
1804 of $U, put underline in extensions rather than in basenames. Use
1805 implicit rules, now that regularity makes this possible.
1806 Have $(OBJECTS) depend on $(ANSI2KNR), so to trigger compilation
1807 of ansi2knr whenever it is needed.
1808 * configure.in: Adjusted for correct STACKOVF substitution.
1809 * src/debug.c (trace_format): When not __STDC__, use (...) as a
1810 parameter list, so ansi2knr will convert it to (va_alist) va_dcl.
1811 Reported by David MacKenzie.
1813 * Makefile.in: Remove binprefix. Use transform_name instead.
1814 Reported by David MacKenzie.
1816 * doc/Makefile.in: Create version.texi, use it, clean it.
1817 Reported by Jim Meyering.
1819 Fri Oct 28 20:33:55 1994 Francois Pinard (pinard@icule)
1821 * Makefile.in (all, install, uninstall): Depend on Makefile.
1823 * Makefile.in: For actions invoking $(MAKE) from within compound
1824 sh statements, exit non-zero if the sub-make fails. Otherwise,
1825 the top-level make may exit successfully when it should fail.
1826 Reported by Jim Kingdon.
1828 * {,/*}Makefile.in: Use && after all cd, in case they fail.
1830 * {,*/}Makefile.in: Declare PRODUCT and VERSION macros.
1831 (dist): Use PRODUCT and VERSION instead of tricks on .fname.
1832 * configure.in: Substitute PRODUCT and VERSION.
1834 * {,*/}Makefile.in (dist): Always try a hard link before a copy.
1836 Thu Oct 27 22:32:58 1994 Francois Pinard (pinard@icule)
1838 * Makefile.in (mostlyclean-local): Do not remove *~.
1839 * */Makefile.in (mostlyclean): Idem.
1840 Reported by Robert E. Brown and Richard Stallman.
1842 Sun Oct 9 08:30:13 1994 Francois Pinard (pinard@icule)
1844 * src/m4.h: Get rid of CONFIG_BROKETS.
1846 Sun Oct 2 16:48:10 1994 Francois Pinard (pinard@icule)
1848 * configure.in: Use AC_ARG_PROGRAM.
1849 * aclocal.m4 (fp_C_PROTOTYPES): Substitute @kr@ by kr or empty.
1850 Reported by David MacKenzie.
1852 Sat Oct 1 11:22:42 1994 Francois Pinard (pinard@icule)
1854 * configure.in: Do not add -O to CFLAGS for GNU C, now that
1855 configure does it automatically.
1856 Reported by Jim Meyering.
1858 Fri Sep 23 08:16:58 1994 Francois Pinard (pinard@icule)
1860 * src/stackovf.c: Declare the handler_t typedef earlier in the
1861 code, use it for stackovf_handler.
1862 (setup_stackovf_trap): Use RETSIGTYPE instead of void while
1863 casting sigsegv_handler.
1864 Reported by Robert Bernstein.
1866 * src/m4.c (main): Initialize program_name to argv[0] without
1868 Reported by Karl Berry.
1870 Sun Sep 18 11:42:50 1994 Francois Pinard (pinard@icule)
1872 * src/Makefile.in (TAGS): Include a ../lib/TAGS reference.
1873 Reported by Karl Berry.
1875 Wed Sep 14 10:00:22 1994 Francois Pinard (pinard@icule)
1877 * lib/Makefile.in (mostlyclean): Added.
1878 (TAGS): Make in $(srcdir).
1880 * configure.in: Use `choke me' in test, like everywhere!
1882 * {doc,examples,lib,src}/Makefile.in (check): Deleted, as
1883 unreacheable and useless.
1885 * doc/Makefile.in (texclean): Deleted, merged in mostlyclean.
1887 * lib/Makefile.in (DISTFILES): Distribute TAGS.
1888 (distclean): Do not remove TAGS.
1889 (realclean): Remove it.
1890 * Makefile.in: Make TAGS in lib also, not just in src.
1891 Reported by Karl Berry.
1893 * Makefile.in (distclean, realclean): Instead of recursively
1894 calling $(MAKE) for the -local part, allow parallel execution of
1895 -recursive and -local, only delay the removal of config.status,
1896 which is repeated in both goals.
1898 Tue Sep 13 19:21:05 1994 Francois Pinard (pinard@icule)
1902 * Makefile.in: Group all *clean-recursive goals in one, using sed
1903 to remove `-recursive' while calling make recursively. Also, use
1904 a subshell for each recursive $(MAKE).
1905 Reported by Jim Meyering.
1907 * src/m4.h (memcpy): Define with bcopy for BSD systems.
1908 Reported by Kaveh R. Ghazi.
1910 * src/Makefile.in (ansi2knr): Use $(LIBS) while linking, for SunOS
1911 4.1.3 requires -ldl to link even ansik2nr, and we need a way to
1914 * configure.in: Use date instead of touch for stamp-h.
1915 * Makefile.in (stamp-h.in): Idem.
1917 * Makefile.in (distclean, realclean): Force serial execution of
1918 both goals, in case parallel makes are being used.
1919 Reported by Jim Meyering.
1921 * src/Makefile.in (DISTFILES): Distribute TAGS.
1922 (distclean): Do not remove TAGS.
1923 (realclean): Remove it.
1924 Reported by Karl Berry.
1926 Sat Sep 10 12:34:04 1994 Francois Pinard (pinard@icule)
1928 * configure.in: Use fp_ to match aclocal.m4. Revert _OS_ macros
1929 to old names, for following Autoconf.
1931 Thu Sep 8 15:07:27 1994 Francois Pinard (pinard@icule)
1933 * Makefile.in (MDEFINES): Remove INSTALL substitutions, for
1934 ./install.sh will not be correctly referred to in sub-Makefiles.
1935 Reported by John David Anglin.
1937 * doc/Makefile.in (texclean): Remove *.cps and *.fns too.
1938 Reported by Eric Backus.
1940 * Makefile.in, checks/Makefile.in, doc/Makefile.in,
1941 examples/Makefile.in, lib/Makefile.in, src/Makefile.in: Limit
1942 config.status into remaking this directory's Makefile only.
1943 * Makefile.in (stamp-h): Do not check nor touch stamp-h.
1944 * configure.in (AC_OUTPUT): Touch stamp-h if CONFIG_HEADERS.
1945 Reported by Jim Meyering.
1947 Tue Sep 6 12:07:33 1994 Francois Pinard (pinard@icule)
1949 * configure.in: Correct stack overflow detection logic, taking
1950 care of systems having only incomplete implementations (like for
1951 Pyramid 9820 OSx 5.0d).
1952 Reported by Kaveh R. Ghazi.
1954 * src/Makefile.in (TAGS): Remote -t from etags call.
1956 Fri Sep 2 10:37:10 1994 Francois Pinard (pinard@icule)
1958 * lib/Makefile.in (install): Depend on all.
1960 Wed Aug 31 11:17:21 1994 Francois Pinard (pinard@icule)
1962 * examples/Makefile.in (mostlyclean): Do not depend on texclean.
1963 Reported by Jim Meyering and John David Anglin.
1965 * Makefile.in (distclean-local): Delete config.log.
1966 Reported by Jim Meyering.
1968 Solidify frozen files with respect to -P:
1969 * src/m4.c: Have -P set prefix_all_buitins variable instead of
1970 calling a function by that name. Declare the variable.
1971 * src/m4.h: Adjust declaration for prefix_all_buitins.
1972 * src/builtin.c (builtin_init): Merge in functionality from
1973 previous prefix_all_buitins function, while making entries in the
1974 symbol table, but not modifying the builtin description itself.
1976 * src/freeze.c (reload_frozen_state): Add a useless `break;',
1977 because *many* compilers do not accept an empty `default:'.
1978 Reported by Akiko Matsushita, Eric Backus, John David Anglin,
1979 Joseph E. Sacco, Kaveh R. Ghazi, Tom McConnell and Ulrich Drepper.
1981 * configure.in: Use AC_TYPE_SIGNAL.
1982 * src/stackovf.c (setup_stackovf_trap): Use RETSIGTYPE.
1983 Reported by Robert Bernstein.
1985 * checks/Makefile.in (check): Modify PATH so check-them will find
1986 m4 in the src directory.
1987 * Makefile.in (check): Don't.
1988 Reported by Akiko Matsushita and Jim Meyering.
1990 * src/output.c (make_room_for, output_character_helper): New
1991 functions, for implementing a global MAXIMUM_TOTAL_SIZE instead of
1992 a per buffer MAXIMUM_BUFFER_SIZE.
1994 * src/output.c (output_text): New function, for optimizing the
1995 output of strings of characters. Use it.
1997 Tue Aug 30 01:44:29 1994 Francois Pinard (pinard@icule)
1999 * doc, src: New directories reorganizing the distribution.
2000 * doc/Makefile.in, src/Makefile.in, examples/Makefile.in: New
2002 * Makefile.in: Adjusted.
2003 * configure.in: Configure new Makefiles.
2005 * m4.h: Declare STRING typedef. Use it for comment and quote
2006 strings, adjusting all references. (This is the rudiments of a
2007 beginning for the eventual withdrawal of NUL terminated strings.)
2008 * output.c (shipout_text): Accept a length parameter, and use it.
2009 All callers adjusted.
2011 Mon Aug 29 12:27:19 1994 Francois Pinard (pinard@icule)
2013 * m4.h: Include <unistd.h> if it exists.
2014 * stackovf.c: Don't.
2016 Clean up for current_diversion variable:
2017 * output.c: Move current_diversion from builtin.c.
2018 * m4.h: Declare current_diversion so builtin.c can access it.
2019 * output.c (output_init, make_diversion): Initialize or update
2021 * builtin.c (builtin_init, m4_divert): Leave current_diversion
2024 Remove limit on number of diversions:
2025 * output.c: Replace ndiversion by diversions, declare it.
2026 (output_init): Allocate only diversion 0.
2027 (make_diversion): Allocate new diversions as needed.
2028 * m4.h, m4.c: Remove NDIVERSIONS and ndiversion related stuff.
2029 * m4.c: Still accept -N, but do nothing with it.
2030 Reported by David MacKenzie.
2033 * output.c (freeze_diversions): New function.
2034 * m4.h: Declare freeze_diversions.
2035 * freeze.c: Document frozen file format, revise it, call
2036 freeze_diversions to add diversions to frozen format, and code to
2037 reload them properly.
2038 * m4.c: Do not undivert automatically at end when status being
2039 frozen. Do not call builtin_init when reloading frozen state.
2041 Speed up diversion processing:
2042 * output.c: Add INITIAL_BUFFER_SIZE, MAXIMUM_BUFFER_SIZE,
2043 COPY_BUFFER_SIZE, in-memory diversion buffers, struct diversion
2044 structure and variables, cached variables out of output_diversion,
2045 reallocate_diversion_for and OUTPUT_CHARACTER.
2046 (shipout_text, make_diversion, insert_diversion): Adapted to new
2048 (insert_file): Use better buffering.
2049 Reported by David MacKenzie.
2051 Sun Aug 28 05:20:02 1994 Francois Pinard (pinard@icule)
2053 * Makefile.in, lib/Makefile.in, checks/Makefile.in: Arrange so
2054 dist works from another build directory.
2056 Sat Aug 27 14:32:45 1994 Francois Pinard (pinard@icule)
2058 * symtab.c (hack_all_symbols): Use hash_table_size instead of
2059 constant HASHMAX, for -H option to work better.
2061 * builtin.c (DECLARE): Simplify by using _ ().
2063 * freeze.c: New file.
2064 * Makefile.in: Compile it, distribute it.
2065 * m4.c: Recognize, document and process --freeze-state (-F) and
2066 --reload-state (-R) options. Pass a true flag to builtin_init
2067 only if no reloading some state.
2068 * builtin.c (define_builtin): Remove static specifier.
2069 (find_builtin_by_name): Remove static specifier.
2070 (builtin_init): Accept and obey a flag argument.
2071 * m4.h: Add declarations for freeze.c, changes for builtin.c.
2073 Wed Aug 24 16:14:19 1994 Francois Pinard (pinard@icule)
2075 * builtin.c (dumpdef_cmp): Rewrite so the cast protect the const
2078 * configure.in: Implement --with-dmalloc.
2079 * acconfig.h: Document WITH_DMALLOC.
2080 * m4.h: Add code for when WITH_DMALLOC.
2082 Mon Aug 15 12:38:05 1994 Francois Pinard (pinard@icule)
2084 * m4.c (long_options): Use "error-output", the dash was missing.
2085 Reported by Akiko Matsushita.
2087 Fri Aug 12 16:38:01 1994 Francois Pinard (pinard@icule)
2089 * m4.h: Include <sys/types.h>.
2090 * builtin.c, debug.c, m4.c, output.c, stackovf.c: Don't.
2091 * m4.h: Declare len_lquote and len_rquote as size_t, not int.
2093 * input.c: Declare len_lquote, len_rquote, len_bcomm and len_ecomm
2095 * builtin.c (dump_args): Declare len as size_t, not int.
2097 * debug.c: Prototype the forward declaration of debug_set_file.
2099 * builtin.c (m4_undivert): Replace div by file, for avoiding the
2100 shadowing of this variable.
2101 * output.c (insert_diversion): Idem.
2103 * input.c: Delete def_rquote, def_lquote, def_bcomm and def_ecomm.
2104 (input_init): Duplicate default quote and comment strings.
2105 (set_quotes): Free previous quote strings in all cases. Duplicate
2106 even default quote strings.
2107 (set_comment): Free previous comment strings in all cases.
2108 Duplicate even default comment strings.
2110 * configure.in: Updated for Autoconf 2.0.
2111 * Makefile.in (distclean-local): Also delete config.cache.
2113 * m4.c (usage): Reorganize the --help output by topic. Include a
2114 description for debugging flags.
2116 Fri Jul 29 10:15:52 1994 Francois Pinard (pinard@icule)
2118 * configure.in: If sigaction is available and SA_ONSTACK defined,
2119 use sigaction. Otherwise, if sigvec is available and SV_ONSTACK
2120 defined, use sigvec. Else don't compile stackovf.c.
2121 * stackovf.c (setup_stackovf_trap): Idem.
2122 Reported by Jim Avera, Karl Berry, Kaveh R. Ghazi, Matthias Rabe
2125 Thu Jul 21 22:43:17 1994 Francois Pinard (pinard@icule)
2127 * m4.c (usage): Replace printf par fputs.
2129 Mon Jul 18 23:48:23 1994 Francois Pinard (pinard@icule)
2133 Sun Jul 17 08:08:25 1994 Francois Pinard (pinard@icule)
2135 * configure.in: Check for sigaction and sigvec. Add a new delayed
2136 check for RLIMIT_STACK, combine in the checking for getrlimit.
2137 All those things are not universally available.
2138 * stackovf.c: Split setting up the trap handler and catching
2139 signals, for better taking care of various configure outcomes.
2140 * examples/stackovf.sh: Correct a typo.
2141 Reported by Eric Backus, Jim Avera and Jim Meyering.
2143 Sat Jul 16 20:36:19 1994 Francois Pinard (pinard@icule)
2145 * ansi2knr.c: New version sent by its author, Peter Deutsch.
2147 Fri Jul 15 14:36:21 1994 Francois Pinard (pinard@icule)
2149 * Makefile.in: Modify so parallel make will not try making
2150 lib/libm4.a twice simultaneously.
2151 Reported by Jim Meyering.
2153 Thu Jul 14 17:23:17 1994 Francois Pinard (pinard@icule)
2155 * stackovf.c (setup_stackovf_trap): Replace "Don't" by "Do not" in
2156 error message, for when no code possibility exists. Even if this
2157 line is completely #ifdef'ed out, it brings a syntax error.
2158 Reported by Andreas Schwab, Jim Meyering and Joseph E. Sacco.
2160 * Makefile.in (install): Have install depend on all too, for lib
2161 to be remade as needed.
2163 * examples/stackovf.sh: Try ksh, bsh and bash for shells
2164 providing ulimit, instead of using only ksh.
2165 Reported by Jim Avera and Joseph E. Sacco.
2167 Tue Jul 12 06:54:31 1994 Francois Pinard (pinard@icule)
2169 * Makefile.in (check): Have it depend on all instead of m4. In
2170 this way, a change in lib will be detected and processed.
2172 * builtin.c (numeric_arg): Use strtol and verify the conversion,
2173 instead of using sscanf which stops as soon as there is a
2174 non-digit in the input. Previously, incr(1xyzzy), eval(1,2xyzzy)
2175 and divert(1xyzzy) were all accepted without any warning or error
2177 * m4.h: Declare strtol as long if not including stdlib.h.
2178 * configure.in: Check for limits.h, and replace strtol if missing.
2179 * lib/Makefile.in: Substitute LIBOBJS. Distribute strtol.c.
2180 * lib/strtol.c: New file, from elsewhere.
2181 Reported by Andreas Schwab.
2183 Thu Jul 7 22:38:10 1994 Francois Pinard (pinard@icule)
2185 * macro.c (expand_macro): Cast value to (boolean) prior to
2186 assigning it to traced.
2187 Reported by Tom McConnell.
2189 * Makefile.in (m4): Always make all in lib first.
2190 Reported by Jim Meyering.
2192 Wed Jul 6 13:16:31 1994 Jim Avera (jima@netcom.com)
2194 * stackovf.c: Isolated OS-dependent sections; Improved portability,
2195 adding support for SunOS/BSD (sigvec, sigstack, and 4-parameter signal
2196 handlers), and a default error message if the fault address is not
2197 available (when neither siginfo.h nor BSD sigcontext are supported).
2198 * configure.in: Changes for stackovf.h: Check for sigcontext,
2199 sigaction, sigstack, and define rlim_t as int if necessary.
2200 * acconfig.h: Added HAVE_SIGCONTEXT and rlim_t.
2201 * examples/stackovf.sh: Run m4 -L99999999 to allow stack overflow.
2202 * ansi2knr.c: Fix for func-ptr args; convert "..." to varargs syntax.
2204 Tue Jul 5 19:13:54 1994 Francois Pinard (pinard@icule)
2206 * configure.in: Use AC_SET_MAKE.
2207 * Makefile.in: Use @SET_MAKE@.
2208 Reported by Jim Meyering.
2210 * checks/check-them: Do not trap on SIGQUIT or SIGALRM.
2211 Reported by Ian Taylor.
2213 Sat Jul 2 00:58:47 1994 Francois Pinard (pinard@icule)
2215 * configure.in: Remove dependency of USE_STACKOVF on STDC_HEADERS,
2216 because siginfo.h is unrelated to standard headers, and siginfo.h
2217 is already checked for.
2218 Reported by Joseph E. Sacco.
2220 * acconfig.h, aclocal.m4, m4.h: Replace HAVE_PROTOTYPES by
2222 * aclocal.m4, configure.in: Replace AC_HAVE_PROTOTYPES by
2225 Wed Jun 29 22:41:53 1994 Francois Pinard (pinard@icule)
2227 * builtin.c (substitute): Use \& to represent this part of the
2228 string which was matched by the whole regexp, instead of
2229 representing the whole string. Any usage of \0 issues a warning
2230 and acts like \&, it will disappear in some subsequent release.
2232 Mon Jun 27 14:24:23 1994 Francois Pinard (pinard@icule)
2234 * m4.c: Complete prototype for forwarded declaration of usage.
2236 * input.c (init_macro_token): Correct own reference in error
2237 message. Previous name get_macro_func was referred to instead.
2238 (next_char): Correct own reference in error message. Previous
2239 name advance_input was referred to instead.
2241 * m4.h: Declare eval_t and unsigned_eval_t typedefs to 32 bits.
2242 * eval.c (logical_or_term, logical_and_term, or_term, xor_term,
2243 and_term, not_term, logical_not_term, cmp_term, shift_term,
2244 add_term, mult_term, exp_term, unary_term, simple_term): Add
2245 prototype to forwarded declarations. Declare parameter v1 as
2246 eval_t * instead of int *. Same for local variable v2 in dyadic
2247 functions. Same for result in exp_term.
2248 * builtin.c (m4_eval): Declare value as eval_t instead of int.
2249 (ntoa): Declare value as eval_t instead of int. Declare uvalue as
2250 unsigned_eval_t instead of unsigned int. Change casts accordingly.
2251 (shipout_int): Cast first argument of ntoa to eval_t.
2252 Reported by Thorsten Ohl.
2254 * macro.c: Complete the prototypes of forwarded expand_macro and
2256 Reported by Thorsten Ohl.
2258 * m4.h: Define voidstar as void * or char * depending on __STDC__.
2259 The Ultrix 3.1 compiler cannot do much with void pointers.
2261 * builtin.c (dumpdef_cmp): Replace void * by voidstar.
2262 * m4.c (xfree): Replace void * by voidstar.
2263 Reported by Tom McConnell.
2265 * ansi2knr.1: New, from elsewhere.
2266 * Makefile.in (DISTFILES): Distribute ansi2knr.1
2268 * Makefile.in (stamp-h.in): Avoid running ./config.status if
2269 stamp-h does not exist yet. This avoids running it a second time
2270 just after the initial ./configure.
2271 Reported by David MacKenzie and Tom McConnell.
2273 * m4.h: Replace the enum debug_info declaration with a series of
2274 #define's. The Ultrix 3.1 compiler would otherwise need casting
2275 (int) to most references, when used in expressions.
2276 Reported by Tom McConnell.
2278 Sat Jun 25 00:10:05 1994 Francois Pinard (pinard@icule)
2280 * aclocal.m4: Replace FP_PROTOTYPES by AC_HAVE_PROTOTYPES,
2281 following an idea from Brook G. Milligan. AC_HAVE_PROTOTYPES
2282 calls the compiler. Previously, FP_PROTOTYPES was only calling
2283 the preprocessor; by not being subject to CFLAGS, this was
2284 discouraging those flags asking for ANSI compilation.
2285 * acconfig.h: Document HAVE_PROTOTYPES.
2286 * configure.in: Use AC_HAVE_PROTOTYPES instead of FP_PROTOTYPES.
2287 * m4.h: Define _() according to HAVE_PROTOTYPES, not __STDC__.
2288 Reported by Eric Backus.
2290 * configure.in: Substitute CFLAGS and LDFLAGS, taking their value
2291 from the environment. Default CFLAGS to -g if not set.
2292 * Makefile.in: Have CFLAGS and LDFLAGS substituted from configure.
2293 * lib/Makefile.in: Have CFLAGS substituted from configure.
2294 Reported by Eric Backus and Tom McConnell.
2296 * configure.in: m4_undefine changeword before using AC_ENABLE.
2298 * m4.h: Declare prototypes for error (for ANSI compilers only),
2299 prefix_all_builtins and reference_error.
2300 Reported by Tom McConnell.
2302 * input.c (set_word_regexp): Do not try to initialize the array
2303 test from a string, this does not work with non-ANSI compilers.
2304 Reported by Eric Backus.
2306 * Makefile.in (dist): Clean examples/ before saving it.
2307 (distclean-local): Also remove stamp-h.
2308 Reported by Eric Backus.
2310 * Makefile.in (_stackovf.c): Goal for compiling stacokovf.c with
2312 Reported by Tom McConnell.
2314 * checks/Makefile.in (clean): Depends on mostlyclean.
2315 (mostlyclean): New goal.
2317 Fri Jun 24 23:30:31 1994 Francois Pinard (pinard@icule)
2319 * Makefile.in (DISTFILES): Distribute install.sh.
2320 * install.sh: New file, copied from elsewhere.
2321 Reported by Assar Westerlund and Kaveh R. Ghazi.
2323 Thu Jun 23 00:00:30 1994 Francois Pinard (pinard@icule)
2325 * configure.in: Define ENABLE_CHANGEWORD if --enable-changeword.
2326 * acconfig.h: Explain ENABLE_CHANGEWORD.
2328 [These modifs all depend upon ENABLE_CHANGEWORD and are adapted
2329 from code provided by Pete Chown]
2330 * m4.h: Add original_text field to u_t variant of union u.
2331 Declare TOKEN_DATA_FUNC macro.
2332 * builtin.c: Declare changeword.
2333 (m4_changeword): New function.
2334 * input.c: Include "regex.h", define variables with word regexps.
2335 (input_init): Initialize the word regexp.
2336 (set_word_regexp): New.
2337 (next_token): Declare local variables, use the previous code if
2338 default_word_regexp is true. Else, match using a new code. Save
2340 * macro.c (expand_token): Ship out original text if not a macro
2342 Reported by Krste Asanovic and Pete Chown.
2344 [These modifs all depend upon ENABLE_CHANGEWORD]
2345 * m4.h: Declare external user_word_regexp.
2346 * m4.c: Declare user_word_regexp, and initialize it from
2347 --word-regexp or -W, or NULL if not specified.
2348 * input.c: Use user_word_regexp if specified, instead of
2349 DEFAULT_WORD_REGEXP.
2351 * Makefile.in (m4): Revert Jan 3 1994 change. I'm unable to
2354 * Makefile.in, lib/Makefile.in: Limit suffixes to .c and .o.
2355 * checks/Makefile.in: Empty the suffix list.
2356 Reported by Geoff Russell, Joel Sherrill and Roland McGrath.
2358 * m4.c: Declare nesting_limit and initialize it to 250.
2359 Implement -LNUMBER or --nesting-limit=NUMBER to change its
2361 * m4.h: Declare nesting_limit as external.
2362 * macro.c (expand_macro): Stop execution whenever nesting limit
2364 Reported by Bengt Mertensson.
2366 * eval.c (evaluate): Diagnose excess characters in eval input.
2367 Things like `eval(08)' used to return 0 with no diagnostic.
2369 * m4.h: Capitalize first letter of all macro arguments in
2372 * m4.c: Declare warning_status, initialize it to 0. Add new
2373 option -E, or --fatal-warnings, which sets warning_status to
2374 EXIT_FAILURE instead.
2375 * m4.h: Declare external warning_status. Define EXIT_SUCCESS and
2376 EXIT_FAILURE if not otherwise done by header files.
2377 * m4.c: Delete declarations for EXIT_SUCCESS and EXIT_FAILURE.
2378 * m4.c, input.c, output.c, symtab.c, builtin.c, macro.c, debug.c,
2379 eval.c: Replace 0 by warning_status and 1 by EXIT_FAILURE in first
2380 argument of all M4ERROR calls.
2381 Reported by Noah Friedman.
2383 * examples/incl-test.m4: Renamed from incl_test.m4.
2384 * examples/include.m4: Include incl-test.m4 instead of
2386 * examples/multiquotes.m4: Renamed from multi-quotes.m.
2388 Wed Jun 22 21:58:54 1994 Francois Pinard (pinard@icule)
2390 * configure.in: Avoid USE_STACKOVF if <siginfo.h> not found. Note
2391 that Jim developped stackovf.c on a 486 running SVR4.0 (ESIX), and
2392 also tested it on a Sun Sparc workstation running SunOS 4.x.
2394 * format.c (format): When not HAVE_EFGCVT, m4 was failing the
2395 49.format check, abusing a `union values' argument with sprintf
2396 without selecting the proper field. Now, save the formatting type
2397 first, delaying the fetch of the corresponding argument.
2398 Reported by Joseph E. Sacco and Tom Quinn.
2400 * format.c (format): Remove const from char *fmt declaration when
2401 not HAVE_EFGCVT, because a NUL may be forced into it.
2403 * m4.h: Declare atof() when not STDC_HEADERS.
2404 Reported by Joseph E. Sacco.
2406 * Regenerate configure using Autoconf 1.11, this corrects a
2407 problem about an incorrect cpp seting on NeXT 3.1.
2408 Reported by Alexander Lehmann.
2410 Sun Jun 5 16:25:19 1994 Francois Pinard (pinard@icule)
2412 * m4.h (_): Change argument from `x' to `Args'.
2414 Wed May 4 23:59:39 1994 Francois Pinard (pinard@icule)
2416 * Makefile.in: Remove all occurrences of $(MFLAGS), which were
2417 bringing more evil than good on a few systems.
2418 Reported by Greg A. Woods.
2420 Fri Apr 22 15:59:35 1994 Francois Pinard (pinard@icule)
2422 * m4.h: Rename Args() to _().
2423 * m4.h: Remove extern specifier from all function declarations.
2425 Fri Apr 22 15:51:21 1994 Jim Avera (jima@netcom.com)
2427 * stackovf.c: New file implementing stack-overflow detection.
2428 * configure.in: Check for getrlimit, sigaction. If all of
2429 standard headers, getrlimit and sigaction, define USE_STACKOVF and
2430 substitute ${U}stackovf.o for STACKOVF.
2431 * acconfig.h: Declare USE_STACKOVF.
2432 * Makefile.in: Distribute stackovf.c, link with $(STACKOVF).
2433 * m4.h: Declare setup_stackovf_trap().
2434 * m4.c: Call setup_stackovf_trap().
2435 * tests/stackovf_test.sh: New file.
2437 Wed Apr 13 14:10:30 1994 Francois Pinard (pinard@icule)
2439 * checks/Makefile.in: Rename .all-stamp to stamp-checks.
2441 * Makefile.in (Makefile, etc.): Adapt for Autoconf 1.8.
2443 Sun Jan 30 14:24:19 1994 (pinard at icule)
2445 * m4.h: Remove definition of volatile, not used anymore.
2446 Reported by Jim Meyering and Joseph E. Sacco.
2448 * m4.h: Consistently use `do { ... } while (0)' in macros, instead
2449 of `if ... else /* nothing */' for if macros.
2450 Reported by Jim Meyering.
2452 * builtin.c (m4_regexp): Reorganize the code for avoiding a
2453 warning from gcc about `repl' possibly used before defined.
2454 Reported by Jim Meyering.
2456 * m4.h: Avoid a pre-ANSI <memory.h> together with <string.h>.
2457 Reported by Jim Meyering.
2459 Tue Jan 25 18:39:37 1994 Francois Pinard (pinard at icule)
2461 * m4.h: Move the conditional definition of volatile after the
2462 inclusion of system files, because they may define it first.
2464 Tue Jan 4 19:46:50 1994 Francois Pinard (pinard@icule)
2466 * checks/Makefile.in (CHECKS): Add a useless `*' before `[', to
2467 get around a problem with Alpha make seeing a syntax error, there.
2468 Reported by Vern Paxson.
2470 Mon Jan 3 00:21:45 1994 Francois Pinard (pinard@icule)
2472 * Makefile.in: Do not define LDFLAGS, use CFLAGS on link calls.
2473 Reported by Richard Stallman.
2475 Sat Dec 25 08:06:05 1993 Francois Pinard (pinard@icule)
2477 * configure.in: Correct test for strerror, AC_FUNC_CHECK was used
2478 instead of AC_HAVE_FUNCS.
2479 Reported by Noah Friedman.
2481 Wed Dec 1 09:37:53 1993 Francois Pinard (pinard@icule)
2483 * m4.c: Initialize show_help and show_version to zero.
2485 * m4.c: Ensure EXIT_SUCCESS and EXIT_FAILURE are defined.
2486 Use them in exit() and usage() calls.
2488 Sat Nov 27 10:43:24 1993 Francois Pinard (pinard@icule)
2490 * m4.h: Delete extern sys_nerr, sys_errlist declarations, and
2491 syserr() macro. Delete errref, add reference_error and M4ERROR.
2492 * m4.c: Replace errref, which was returning an input reference
2493 string, with reference_error, which prints it on standard error.
2494 * builtin.c, output.c: Use errno as second parameter to error,
2495 instead of using syserr() with %s.
2496 * *.c: Use M4ERROR instead of error: no more errref() with %s.
2497 Doing so, the program name appears after the input reference
2498 instead of before, which eases M-x next-error processing.
2500 Wed Nov 24 22:16:15 1993 Francois Pinard (pinard@icule)
2502 * checks/get-them: Escape braces with backslashes in patterns,
2503 because HPUX-9.01 awk needs this.
2504 Reported by Jim Meyering.
2506 Mon Nov 22 10:55:52 1993 Francois Pinard (pinard@icule)
2508 * builtin.c: Declare "FILE *popen ();".
2510 * m4.h: Remove MESSAGE{,1,2}, WARNING1, FATAL{,1}, INTERNAL_ERROR
2511 macros, replace error_message_prefix() declaration by errref()'s.
2512 Declare xrealloc, for use in errref().
2513 * m4.c: Delete error_message_prefix() function, add errref().
2514 * *.c: Use error() systematically in place of all error macros,
2515 now that error() flushes stdout first. Make needed adjustments.
2517 * m4.h: Remove const in sys_errlist[] declaration, it creates
2518 conflicts on SGI and Alpha.
2519 Reported by Kaveh R. Ghazi.
2521 Sat Nov 20 08:26:15 1993 Francois Pinard (pinard@icule)
2523 * m4.c: Include <getopt.h> instead of "getopt.h".
2525 * configure.in: Output to config.h. Use HAVE_FUNCS preferably.
2526 * acconfig.h: New, for documenting HAVE_EFGCVT.
2527 * Makefile.in: Distribute acconfig.h, .stamp-h.in and config.h.in,
2528 use them wherever appropriate. Also use -I. for compilations.
2529 * lib/Makefile.in: Use -I.. for compilations.
2530 * *.c: Include <config.h> or "config.h".
2532 * m4.h: Test for HAVE_MEMORY_H instead of NEED_MEMORY_H.
2533 * configure.in: Use AC_HAVE_HEADERS(memory.h), delete AC_MEMORY_H.
2535 Wed Nov 17 09:34:55 1993 Francois Pinard (pinard@icule)
2537 * builtin.c (m4_eval): Cast strlen to (int) before comparing.
2539 * input.c (input_init): Initialize quote and comment strings
2540 explicitely instead of calling set_quotes and set_comment: by
2541 doing so, we ensure we do not free uninitialized variables.
2543 * checks/check-them: Reverse arguments to both diff, so the
2544 expected is on the left and the obtained on the right.
2546 * m4.h: Add MESSAGE{,1,2}, WARNING1, FATAL{,1} and INTERNAL_ERROR
2547 macros. Delete declarations for m4error, warning, fatal and
2548 internal_error, add declaration for error_message_prefix.
2549 * m4.c: Delete m4error, warning, fatal and internal_error
2550 routines, add error_message_prefix routine.
2551 * *.c: Replace m4error routine calls with MESSAGE* macro calls,
2552 warning with WARNING*, fatal with FATAL* and internal_error with
2554 * Makefile.in (_m4.c): Do not adjust ansi2knr output for va_alist,
2555 this is not needed anymore.
2557 * m4.h: Declare extern FILE *debug. Add DEBUG_PRINT{1,3} and
2558 DEBUG_MESSAGE{,1,2} macros. Delete declarations for debug_print
2559 and debug_message, add declaration for debug_message_prefix.
2560 * debug.c: Remove static specifier for FILE *debug declaration.
2561 Delete debug_print and debug_message routines, add
2562 debug_message_prefix routine.
2563 * builtin.c, debug.c: Replace debug_print routine calls with
2564 DEBUG_PRINT* macro calls.
2565 * input.c, path.c: Replace debug_message routine calls with
2566 DEBUG_MESSAGE* macro calls.
2568 * m4.h: Remove inclusion of <varargs.h>.
2569 * debug.c: Include <stdarg.h> or <varargs.h>.
2570 (trace_format): Use stdarg instead of varargs if __STDC__.
2572 * configure.in: Remove checks for vfprintf and _doprnt. These
2573 implementations use varargs tricks which are not portable enough.
2574 * lib/vfprintf.c: Deleted.
2575 * lib/_doprnt.c: Deleted.
2576 * lib/Makefile.in: Adjusted accordingly. Remove LIBOBJS.
2577 Reported by Joel Sherrill.
2579 * path.c (add_include_directory): Use xstrdup.
2581 * builtin.c (find_builtin_by_name): Declare static.
2583 * *.[ch]: Add const to a few "char *" declarations.
2585 * configure.in: Remove commented tests for fileno() and fstat().
2586 * debug.c: Remove comments about HAVE_FILENO and HAVE_FSTAT.
2588 * debug.c (debug_flush_files): New.
2589 * m4.h: Declares it.
2590 * builtin.c (m4_syscmd, m4_esyscmd): Use it.
2591 Reported by Nicolas Pioch.
2593 Fri Nov 12 10:02:26 1993 Francois Pinard (pinard@icule)
2595 * Makefile.in (m4.dvi): Use m4.texinfo instead of m4.texi.
2596 Reported by Joel Sherrill.
2598 * builtin.c (prefix_all_builtins): Instead of the table size, use
2599 the null entry at end for stopping the loop. It was overwritten.
2600 Reported by Andreas Schwab and Jim Meyering.
2602 * builtin.c (prefix_all_builtins): Cast xmalloc to (char *).
2603 Reported by Kaveh R. Ghazi.
2605 * macro.c (call_macro): Add * in (*SYMBOL_FUNC (sym)) (...).
2606 Reported by Karl Vogel.
2608 Tue Nov 9 09:31:47 1993 Francois Pinard (pinard@icule)
2610 * m4.h: Do not define volatile if already defined.
2611 Reported by Rene' Seindal.
2613 * lib/Makefile.in: Add a forgotten ALLOCA=@ALLOCA@. Grrr!
2615 Reported by Bernhard Daeubler, Eric Backus, Hal Peterson, Hoang
2616 Uong, Ian Taylor, Kaveh R. Ghazi, Tom McConnell and Walter Wong.
2618 Mon Nov 8 21:11:44 1993 Francois Pinard (pinard@icule)
2620 * m4.h: Define strchr and strrchr in terms of index and rindex,
2621 instead of the other way around.
2622 * builtin.c, m4.c, path.c: Use strchr instead of index.
2624 * input.c (next_char): Remove a "break;" after a "return ...;".
2625 Reported by Tom McConnell.
2627 Mon Nov 8 12:45:34 1993 Francois Pinard (pinard@icule)
2631 * configure.in: Do not copy check files in the build hierarchy.
2632 * checks/check-them: Identify the m4 version being checked. For
2633 finding m4, look in $PATH instead of in the parent directory.
2634 * Makefile.in (check): Prepend `pwd` to $PATH before checking.
2635 * checks/Makefile.in (.all-stamp): Always create check files in
2636 the source hierarchy, not anymore in the build hierarchy.
2637 (check): cd to the source hierarchy before performing checks.
2638 Do not copy nor clean COPYING anymore, take it from `..'.
2639 Reported by Tom McConnell.
2641 * Makefile.in (Makefile): Use $(SHELL).
2642 (config.status): Use $(SHELL). Use "config.status --recheck"
2643 instead of "configure --no-create", which is obsolete.
2644 Reported by Tom McConnell.
2646 Fri Nov 5 09:49:30 1993 Francois Pinard (pinard@compy.IRO.UMontreal.CA)
2648 * m4.c (usage): Use "%s" instead of "m4" in format string.
2649 Reported by Jim Meyering.
2651 * Makefile.in: Distribute mkinstalldirs.
2652 Reported by Pierre Gaumond.
2653 Reported by Jim Meyering.
2654 Reported by Tom McConnell.
2655 Reported by Andreas Gustafsson.
2657 * checks/check-them: Renamed from checks/check_them.
2658 * checks/get-them: Renamed from checks/get_them.
2659 * checks/.all-stamp: Renamed from checks/.all_stamp.
2660 * checks/Makefile.in: Changed accordingly.
2661 Reported by Jim Meyering.
2663 Thu Nov 4 13:50:52 1993 Francois Pinard (pinard@lagrande.IRO.UMontreal.CA)
2665 * lib/Makefile.in (dist): Correct permissions on files.
2667 * output.c: Declare tmpfile, some systems don't.
2669 Wed Nov 3 09:09:16 1993 Francois Pinard (pinard@icule)
2671 * checks/Makefile.in (dist): Correct permissions on files.
2673 * Makefile.in (dist): Ensure recursive linking for subdirectory
2674 `examples', also set read/write permissions on all its files.
2676 * mkinstalldirs: New, from elsewhere.
2677 * Makefile.in: Use it.
2679 * debug.c: Synchronize debug messages and regular output when
2680 the debug file and stdout are redirected to the same file.
2681 * configure.in: Add (commented) checks for fileno and fstat.
2682 Reported by Jim Avera.
2684 * builtin.c (m4_ifelse): Diagnose excess arguments if 5, 8, 11,
2685 etc., arguments, then ignore the superfluous one. m4 used to
2686 diagnose missing arguments and return the empty string.
2687 Reported by Nick S. Kanakakorn.
2689 Tue Nov 2 00:55:41 1993 Francois Pinard (pinard@icule)
2691 * m4.c (main): At end of all input, ensure all undiverted text
2692 goes to the main output stream.
2693 Reported by Andreas Gustafsson.
2695 * m4.c (main): exit (0), instead of return 0.
2697 * m4.c: Implement -P and --prefix-builtins.
2698 * builtin.c: Delete const specifier on builtin_tab.
2699 (prefix_all_builtins): New.
2700 Reported by Noah Friedman.
2701 Reported by Scott Bartram.
2703 * c-boxes.el: New, from elsewhere.
2704 * Makefile.in: Distribute it.
2706 * m4.h: Do not define bcopy if <string.h> defines it.
2707 Reported by Stephen Perkins.
2709 * builtin.c (define_macro): Allow a missing second argument, in
2710 which case it is implied empty. Affects define and pushdef.
2711 Reported by Eric Allman.
2713 Mon Nov 1 07:45:24 1993 Francois Pinard (pinard@icule)
2715 * m4.h: Add blind_if_no_args in struct builtin, blind_no_args in
2716 struct symbol adn SYMBOL_BLIND_NO_ARGS macro.
2717 * builtin.c: Initialize all the blindness fields in builtin_tab.
2718 (define_builtin): Copy the blindness of a builtin into its symbol.
2719 * macro.c (expand_token): Avoid processing a blind builtin if the
2720 next character is not an opening parenthesis.
2721 Reported by David MacKenzie.
2722 Reported by Noah Friedman.
2724 * configure.in: Ensure an exit status of 0 on completion.
2725 Reported by Vivek P. Singhal.
2727 * eval.c (eval_lex): Admit both lower and upper case letters for
2728 bases greater than 10. Only lower case letters were accepted.
2730 * eval.c (eval_lex): Recognize 0bDIGITS and 0rRADIX:DIGITS syntax.
2731 Reported by Krste Asanovic.
2733 * eval.c: Rename NOT to LNOT. Add XOR, NOT, LSHIFT and RSHIFT.
2734 * eval.c (logical_not_term): New name for not_term.
2735 * eval.c (xor_term): New, between or_term and and_term.
2736 * eval.c (not_term): New, between and_term and logical_not_term.
2737 * eval.c (shift_term): New, between cmp_term and add_term.
2738 Reported by Krste Asanovic: ~, ^, <<, >>.
2739 Reported by Ben A. Mesander: ** vs ^.
2741 * m4.c: Delete xmalloc.c, xrealloc.c, xstrdup.c.
2742 * m4.h: Delete xrealloc.c.
2743 * lib/xmalloc.c: New, from elsewhere.
2744 * lib/xstrdup.c: New, from elsewhere.
2745 * lib/Makefile.in: Distribute and compile them.
2747 * m4.c: Change progname to program_name.
2748 * builtin.c, eval.c, m4.c, m4.h: Rename error to m4error.
2749 * lib/error.c: New, from elsewhere.
2750 * lib/Makefile.in: Distribute and compile error.c.
2751 * configure.in: Check AC_VPRINTF and for strerror.
2752 * m4.c: Delete cmd_error. Use error instead.
2753 * m4.c: Change label capitalisation to "ERROR", "Warning", etc.
2755 * m4.h: Delete #define const, let Autoconf takes care of this.
2757 * m4.c: Remove all code conditionalized by IMPLEMENT_M4OPTS.
2758 Merge parse_args into main. Declare argv to be `char *const *',
2759 then remove superfluous casts.
2761 * m4.c: Rename --no-gnu-extensions to --traditional.
2762 Reported by Ben A. Mesander.
2764 * m4.c (usage): Add a status parameter. Supply one in various
2765 calls. Add --help processing. Remove -V for --version.
2767 * lib/Makefile.in: Put $(CFLAGS) last in .c.o rule.
2769 * lib/Makefile.in: Have an AR=ar declaration.
2770 Reported by Eric Backus.
2771 Reported by Bjorn R. Bjornsson.
2772 Reported by Tom Tromey.
2773 Reported by Kristine Lund.
2774 Reported by Marion Hakanson.
2776 Sat Oct 30 12:51:47 1993 Francois Pinard (pinard@icule)
2778 * Makefile.in (m4.info): Use -I$(srcdir) on $(MAKEINFO).
2779 Reported by Noah Friedman.
2781 Mon Oct 25 14:58:48 1993 Francois Pinard (pinard@icule)
2783 * Makefile.in: Remove MDEFINES and cleanup.
2785 Wed Jun 9 14:59:46 1993 Francois Pinard (pinard@icule)
2787 * Makefile.in (dist): Replace "echo `pwd`" by a mere "pwd".
2790 Sat Feb 6 14:59:22 1993 Francois Pinard (pinard@icule)
2792 * Makefile.in, lib/Makefile.in, check/Makefile.in: In dist goals,
2793 ensure 777 mode for directories, so older tar's will restore file
2796 Sun Jan 17 15:38:05 1993 Francois Pinard (pinard@icule)
2798 * Makefile.in, lib/Makefile.in: Put $(CFLAGS) after $(CPPFLAGS),
2799 so the installer can override automatically configured choices.
2800 Reported by Karl Berry.
2802 Fri Jan 15 16:07:00 1993 Francois Pinard (pinard@icule)
2804 * lib/vfprintf.c: Stolen from Oleo distribution and adapted. The
2805 previous version was not working properly on m68k-hp-bsd4.3.
2806 Reported by Roland McGrath.
2808 * lib/_doprnt.c: Stolen from Oleo distribution.
2809 * configure.in: Check for _doprnt.c if vfprintf.c selected.
2810 * lib/Makefile.in: Distribute _doprnt.c.
2811 Do not distribute regex.[ch].old anymore.
2813 Fri Jan 1 19:42:23 1993 Francois Pinard (pinard at icule)
2815 * Makefile.in, lib/Makefile.in: Reinstate $(CPPFLAGS), use it.
2816 Richard wants it there.
2818 Sun Dec 27 07:01:54 1992 Francois Pinard (pinard at icule)
2820 * Makefile.in: Add DEFS to MDEFINES.
2821 * lib/Makefile.in (.c.o): Remove $(CPPFLAGS).
2822 (libm4.a): Remove the library before creating it.
2823 (distclean): Remove tags and TAGS too.
2825 Wed Dec 23 12:46:55 1992 Francois Pinard (pinard at icule)
2827 * Makefile.in (dvi, m4.dvi): New goals.
2829 * builtin.c, eval.c, format.c, input.c, m4.[ch], m4.texinfo,
2830 macro.c, output.c, path.c, symtab.c: Change Copyright from
2831 1989-1992 to the explicit enumeration 1989, 1990, 1991, 1992.
2833 * examples/divert.m4: Deleted, this bug has been corrected.
2835 * Makefile.in (texclean, mostlyclean): New goals.
2837 * Makefile.in (clean): Remove clutter from ansi2knr.
2838 Reported by Pierre Gaumond.
2839 Reported by Greg A. Woods.
2841 Sun Dec 20 10:40:20 1992 Francois Pinard (pinard at icule)
2843 * Makefile.in: Remove $(CPPFLAGS) from the .c.o rule. The user
2844 might well use CFLAGS is s/he needs it.
2846 * Makefile.in: Allow installation of info files from a separate
2848 Reported by Jason Merrill.
2849 Reported by David MacKenzie.
2850 Reported by Skip Montanaro.
2851 Reported by Erez Zadok.
2852 Reported by Assar Westerlund.
2854 Sat Dec 19 08:21:34 1992 Francois Pinard (pinard at icule)
2857 This is still a beta release for the future GNU m4 version 1.1.
2859 * lib/alloca.c: New, from elsewhere.
2860 * lib/Makefile.in: Distribute it. Define and use $(ALLOCA).
2862 * m4.h: Do not define index/rindex if already defined. If
2863 FALSE/TRUE are already defined, do not redefine them, but merely
2864 define boolean typedef to int.
2866 * Makefile.in: Use $(DEFS) while compiling ansi2knr.
2867 * ansi2knr.c: Rewrite #ifdef HAVE_STRING_H || STDC_HEADERS,
2868 because some C compilers do not like connectives with #ifdef.
2869 * m4.h: Define `volatile' only if __GNUC__, instead of once for
2870 __GNUC__ and once for __STDC__.
2871 * lib/regex.h: Leave const alone, AC_CONST will take care of it.
2873 * checks/Makefile.in: Use .all_stamp instead of $(CHECKS) for
2874 Makefile dependencies. Without it, make keeps destroying and
2875 remaking $(CHECKS) in a loop (why?). Distribute .all_stamp.
2877 * m4.h, m4.c, builtin.c, output.c: Change all divertion/DIVERTION
2878 to diversion/DIVERSION, this was a spelling error.
2880 * m4.c: Declare version[], remove #include "version.h".
2881 * version.h: Deleted.
2882 * Makefile.in: Remove references to version.h.
2884 * output.c (shipout_text): Centralize all `#line NUM ["FILE"]'
2885 production, by using a simpler and more robust algorithm. This
2886 solves the problem of synclines sometimes written in the middle of
2887 an output line. Delete sync_line() and output_lines variable.
2888 * m4.h: Remove sync_line prototype and output_lines declaration.
2889 * input.c (next_char), output.c (shipout_text): Remove references
2891 * input.c (push_file, pop_file): Merely put the value -1 in
2892 output_current_line instead of calling sync_line, for delaying a
2893 single `#line NUM FILE' before next output line. Do not test
2894 for sync_output, because this is unnecessary clutter.
2895 * output.c (make_divertion, insert_divertion): Idem.
2896 * input.c: Rename must_advance_line to start_of_input_line, for
2899 * debug.c (trace_header): Select a new debug line format, which
2900 better complies with GNU standards for formatting error messages.
2901 With option `-dfl', M-x next-error might be used on the output.
2902 * m4.c (vmesg): Adjust format of error output to GNU standards.
2903 * m4.texinfo: Adjust examples for `make check' to work.
2905 * m4.h, builtin.c, debug.c, input.c, macro.c, path.c: Use upper
2906 case for enum debug_info constants, which were all lower case.
2908 * builtin.c (m4_regexp, m4_patsubst): Use re_search instead of
2910 * lib/regex.[ch]: Use new version from textutils 1.3.6, with some
2911 collected patches. I tried a few times using newer regex.[ch], it
2912 mysteriously stopped aborting with this one. Insecure feeling...
2913 * lib/Makefile.in: Distribute regex.[ch].old, just in case!
2915 Fri Dec 18 11:08:03 1992 Francois Pinard (pinard at icule)
2917 * m4.c: Change `--no-warnings' to `--silent'.
2918 Reported by David MacKenzie.
2920 * m4.c: Put all M4OPTS code upon IMPLEMENT_M4OPTS control, and
2921 leave it off for now. See comment in m4.c for justification.
2922 Reported by David MacKenzie.
2924 * configure.in: Replace AC_USG by AC_HAVE_HEADERS(string.h).
2925 * m4.h, ansi2knr.c, lib/regex.h: Replace USG by HAVE_STRING_H.
2927 * Makefile.in: Add a new `info' goal. Use macro MAKEINFO.
2929 * Makefile.in: Ensure recursive cleaning is done before local
2930 cleaning for all clean goals.
2932 * builtin.c (ntoa): Ensure the value is always interpreted as a
2933 signed quantity, whatever the radix is.
2935 Wed Nov 18 07:57:19 1992 Jim Meyering (meyering@idefix)
2937 * builtin.c, format.c, input.c: Split long lines.
2938 * m4.c: Use typedef macro_definition instead of struct
2940 * symtab.c: Use typedef symbol instead of struct symbol.
2942 Tue Nov 17 01:58:40 1992 Francois Pinard (pinard at icule)
2944 * *.[ch]: Remove all trailing whitespace, in code and comments.
2946 * configure.in: Find some awk.
2947 * Makefile.in: Add $(AWK) to MDEFINES.
2948 * checks/Makefile.in: Transmit $(AWK) to get_them.
2949 * checks/get_them: Use $AWK instead of gawk. Add a close in the
2950 awk script when switching files, because without this, mawk runs
2951 out of file descriptors.
2953 Mon Nov 16 20:42:56 1992 Francois Pinard (pinard at icule)
2955 * Makefile.in (realclean): Delete m4.info*.
2956 Reported by Jim Meyering.
2958 * Makefile.in: Adjust and link with checks/Makefile.
2959 * checks/Makefile.in: New.
2960 * configure.in: Output checks/Makefile.
2962 * checks/get_them: Have the dnl header of each test more
2963 recognizable by next-error, also use a better message.
2965 Mon Nov 16 07:48:52 1992 Jim Meyering (meyering@idefix)
2967 * m4.h [__GNUC__]: Use __volatile__ instead of `volatile.'
2968 And use that only if __GNUC__ since we're using it's GCC-specific
2969 semantics that tell the compiler the associated function doesn't
2972 * builtin.c (substitute): Don't use character as an array index.
2973 (dumpdef_cmp): Make formal arguments `const void *' to avoid
2974 warnings with gcc -W -Wall on systems with qsort prototype.
2975 (m4_errprint): Cast obstack_finish to `char *' to avoid warnings
2978 * eval.c (most functions): Add parentheses to assignments used
2979 as truth values go avoid warnings from gcc -Wall.
2981 * input.c, m4.c, output.c, path.c, symtab.c: Declare static
2982 any functions that don't need external scope.
2984 * builtin.c, debug.c, format.c, m4.c, m4.h, macro.c, symtab.c
2985 (many functions and arrays): Declare `const'.
2987 Sun Nov 15 09:42:09 1992 Francois Pinard (pinard at icule)
2989 * *.[ch]: Rename nil to NULL, using the declaration from <stdio.h>,
2990 removing the declaration from m4.h. Also rename false to FALSE
2993 * lib/Makefile.in (Makefile): New goal.
2995 * Makefile.in, lib/Makefile.in: Add a .c.o rule, so CFLAGS is not
2996 so heavily loaded. It gets more easily overridable, calling make.
2997 Reported by Jim Meyering.
2999 * Makefile.in (dist): Get .fname from the current directory name,
3000 instead of from version.h. I need updating many files manually,
3001 when the version changes, version.h is just one of them.
3003 Sat Nov 14 11:01:20 1992 Francois Pinard (pinard at icule)
3005 * m4.h: Remove the tag `boolean' on the enum introducing typedef
3006 `boolean'. This tag conflicts with <sys/types.h> on SVR4.
3007 Reported by Tom McConnell.
3009 Fri Nov 13 00:12:50 1992 Francois Pinard (pinard at icule)
3011 * m4.texinfo: Correct the examples for 33.divert, 38.divnum,
3012 39.cleardiv, which were describing missing or spurious newlines.
3013 Modify examples 52.eval, 53.esyscmd and 54.sysval so the results
3014 do not depend on machine word size, `/bin/false' implementation,
3015 or `wc' output format. `make check' is more dependable, now.
3017 * checks/check_them: Summarize the failed tests by listing their
3018 name, at end. If none, issue `All checks successful'. Output
3019 `Checking' instead of `Input file:'.
3021 * checks/get_them, checks/check_them: Reindented.
3023 * Makefile.in (dist): chmod a+r before making the tar file.
3025 Thu Nov 12 14:42:57 1992 Francois Pinard (pinard at icule)
3027 * builtin.c (m4_dnl): Diagnose any parameter to `dnl'.
3029 * input.c (next_token): Reinitialize token_buttom just after using
3030 it as a watermark with obstack_free. Or else, a future token, big
3031 enough for triggering reallocation of the obstack chunk, could
3032 void the initialized value of token_buttom, later causing panic in
3033 obstack_free. Rename token_buttom to token_bottom everywhere.
3035 * m4.h: Before declaring errno, first include <errno.h> and
3036 ensure that it does not define errno.
3037 Reported by Richard Stallman.
3039 Wed Nov 11 17:40:35 1992 Francois Pinard (pinard at icule)
3041 * builtin.c: Define and use DECLARE macro for builtins.
3043 * builtin.c (m4_ifelse): Avoid any diagnostic when exactly one
3044 argument, this is a common idiom for introducing long comments.
3046 * builtin.c (m4_ifelse): If 3n + 2 arguments, diagnose missing
3047 arguments. The last argument was silently ignored.
3049 * m4.c (cmd_error): Add a missing semicolon before va_end().
3051 Tue Nov 10 08:57:05 1992 Francois Pinard (pinard at icule)
3053 * Makefile.in: Now handle protoized sources. Define and use U.
3054 Compile and use ansi2knr with old compilers. Update DISTFILES.
3055 Add `aclocal.m4' to `configure' dependencies.
3056 * ansi2knr.c: New, from Ghostscript distribution.
3057 * configure.in: Define U through FP_PROTOTYPES for old compilers.
3058 Add AC_ISC_POSIX, AC_CONST, AC_SIZE_T.
3059 * aclocal.m4: New, provide FP_PROTOTYPES.
3060 * m4.h: Conditionnaly protoized through Args, save for varags.
3061 * builtin.c: Protoized. Then:
3062 Include <sys/types.h> if size_t is not defined, before "regex.h".
3063 (m4_ifelse): Fetch built-in name properly for diagnostic.
3064 (m4_dumpdef): Remove wrong (char *) cast calling dump_symbol.
3065 (m4_regexp): Add const to `msg' declaration.
3066 (m4_patsubst): Add const to `msg' declaration.
3067 * debug.c: Protoized, save for varargs.
3068 * eval.c: Protoized.
3069 * format.c: Protoized.
3070 * input.c: Protoized.
3071 * m4.c: Protoized, save for varargs. Then:
3072 (xfree): Accept void * instead of char *.
3073 (xmalloc): Return void * instead of char *.
3074 (xrealloc): Accept and return void * instead of char *.
3075 * macro.c: Protoized.
3076 * output.c: Protoized.
3077 * path.c: Protoized. Then cast some (char *) over xmalloc's.
3078 * symtab.c: Protoized.
3080 Fri Nov 6 02:05:21 1992 Francois Pinard (pinard at icule)
3082 * m4.texinfo: Remove directory from diagnostics in 30.include,
3083 51.eval, 56.errprint and 57.m4exit tests.
3085 * m4.h: Remove declarations for int or void system functions, they
3086 cause more conflicting trouble than they make good.
3088 * configure.in: Avoid configuration header file. Add some tests.
3089 * m4.h: Remove #include "config.h".
3090 * Makefile.in, lib/Makefile.in: Implement Autoconf interface.
3091 Then, rewritten for better compliance with GNU standards.
3093 Thu Nov 5 12:37:13 1992 Francois Pinard (pinard at icule)
3095 * format.c (format): Avoid syntax error if not HAVE_EFGCVT,
3096 because of a misplaced #endif.
3098 * Many *.[hc] files: Correct intra-line spacing here and there,
3099 according to GNU indent 1.6 advice.
3101 * configure.in: New, using Autoconf 1.2.
3102 * m4.h: Reverse NO_MEMORY_H to NEED_MEMORY_H.
3103 * Delete old configure.in, configure, etc/configure.in,
3104 etc/configure, lib/configure.in, lib/configure and config/*.
3105 Reported by Jason Merrill.
3107 * symtab.c (hash): Change (char) NULL to '\0'.
3108 Reported by Jason Merrill.
3110 * Delete .vers, etc/newdist.sh, etc/newvers.sh and
3111 etc/nextvers.sh. Release numbers will be edited `by hand'.
3112 * version.h: De-automatize, force value in.
3114 * m4.c: Changes in order to use a newer getopt.h.
3115 Reported by David MacKenzie.
3117 * checks/: New name for examples/.
3118 * checks/get_them: New location for etc/get_examples.
3119 * checks/check_them: New location for etc/check_examples.
3120 * Makefile.in, checks/get_them, checks/check_them: Adjust.
3121 * lib/vfprintf.c: New location for etc/vfprintf.c.
3122 * Delete empty etc/.
3123 * examples/: New name for test/.
3125 Tue Mar 10 00:29:46 1992 Francois Pinard (pinard at icule)
3127 * Makefile.in (check): Add m4 as dependency.
3129 * m4.c: Accept --no-warnings instead of --no_warnings, and
3130 --no-gnu-extensions instead of --no_gnu_extensions. Make the
3131 usage message more informative.
3132 Reported by David MacKenzie.
3134 Mon Mar 9 14:53:40 1992 Francois Pinard (pinard at icule)
3136 * etc/check_examples: New name for check_examples.sh.
3137 * etc/get_examples: New name for get_examples.sh.
3138 * Makefile.in, etc/Makefile.in: Use new names.
3140 * Makefile.in: Transmit $(CC) while making in lib.
3142 * Many *.[hc] files: GNU indent'ed, with further fine tuning of
3143 code disposition by hand.
3145 Sun Mar 8 11:01:55 1992 Francois Pinard (pinard at icule)
3147 * m4.h: Delete definitions for abort() and exit().
3148 Reported by Richard Stallman.
3150 * config/hmake-unicos, config/s-unicos.h: New files.
3151 Reported by Hal Peterson.
3153 * eval.c (exp_term): Have N^0 return 1.
3154 Reported by Michael Fetterman.
3156 * eval.c, input.c, m4.h: Remove last comma in enums.
3157 Reported by Mike Lijewski.
3159 * Transfer of maintenance duties from Rene' to Franc,ois.
3161 Thu Oct 24 15:18:46 1991 Rene' Seindal (seindal at diku.dk)
3163 * Release 1.0. Many thanks to those, who provided me with bug
3164 reports and feedback.
3166 * Uses GNU configure, taken from the gdb distribution.
3168 * Uses GNU getopt(), with long option names.
3170 * The -Q/+quiet option is added, which suppresses warnings about
3171 missing or superflous arguments to built-in macros.
3173 * Added default options via the M4OPTS environment variable.
3175 * The built-in format can now be configured to use sprintf as
3176 the formatting engine, for systems without [efg]cvt(3).
3178 * GNU library code is moved to the ./lib subdirectory; other
3179 utility files are now in ./etc.
3181 * Several minor bugs have been fixed.
3183 Fri Jul 26 15:28:42 1991 Rene' Seindal (seindal at diku.dk)
3185 * Fixed various bugs. Release 0.99, manual 0.09. Many thanks to
3186 Francois Pinard and Roland H. Pesch for providing me with reports.
3188 * The builtins incr and decr are now implemented without use of
3191 * The builtin indir is added, to allow for indirect macro calls
3192 (allows use of "illegal" macro names).
3194 * The debugging and tracing facilities has been enhanced
3195 considerably. See the manual for details.
3197 * The -tMACRO option is added, marks MACRO for tracing as soon
3200 * Builtins are traced after renaming iff they were before.
3202 * Named files can now be undiverted.
3204 * The -Nnum option can be used to increase the number of
3205 divertions available.
3207 * Calling changecom without arguments now disables all comment
3210 * The function m4_patsubst() is now consistently declared
3213 * A bug in dnl is fixed.
3215 * A bug in the multi-character quoting code is fixed.
3217 * Several typos in the manual has been corrected. More probably
3220 * The m4.info file is now installed along with the program.
3222 Thu Nov 15 21:51:06 1990 Rene' Seindal (seindal at diku.dk)
3224 * Updated and enhanced version. Release 0.75, manual 0.07.
3226 * Implemented search path for include files (-I option and
3227 M4PATH envronment variable).
3229 * Implemented builtin "format" for printf-like formatting.
3231 * Implemented builtin "regexp" for searching for regular
3234 * Implemented builtin "patsubst" for substitution with regular
3237 * Implemented builtin "esyscmd", which expands to a shell
3240 * Implemented "__file__" and "__line__" for use in error
3243 * Implemented character ranges in "translit".
3245 * Implemented control over debugging output.
3247 * Implemented multi-character quotes.
3249 * Implemented multi-character comment delimiters.
3251 * Changed predefined macro "gnu" to "__gnu__".
3253 * Changed predefined macro "unix" to "__unix__", when the -G
3254 option is not used. With -G, "unix" is still defined.
3256 * Changed "shift", "$@" and "$*" to not insert spaces afters
3259 * Added program name to error messages.
3261 * Fixed two missing null bytes bugs.
3263 Mon Jan 22 21:08:52 1990 Rene' Seindal (seindal at diku.dk)
3265 * Initial beta release. Release 0.50, manual 0.05.
3275 Copyright (C) 1990, 1991, 1992, 1993, 1994, 2000, 2001, 2003,
3276 2005, 2006 Free Software Foundation, Inc.
3278 Copying and distribution of this file, with or without
3279 modification, are permitted provided the copyright notice
3280 and this notice are preserved.