Savannah Git Hosting - m4.git/log
Eric Blake [2008年1月21日 19:04:45 +0000 (12:04 -0700)]
Stage 11: full circle for single argument references.
Pass quoted strings through to argument collection in a single
action, so that an argument can be reused throughout macro
recursion if it remains unchanged.
Memory impact: noticeable improvement, due to more reuse in
argument collection stacks.
Speed impact: noticeable improvement, due to less copying.
* m4/m4module.h (m4_arg_text): Add parameter.
(M4ARG): Adjust.
* m4/m4private.h (CHAR_QUOTE): New input engine sentinel.
(m4__make_text_link): New prototype.
(struct m4_symbol_chain): Add quote_age member.
(struct m4_symbol_value): Add end member to chained symbol.
(struct m4_macro_args): Add wrapper member.
* m4/symtab.c (m4_symbol_value_print): Print composite tokens.
(m4_symbol_value_copy, m4_symbol_value_delete): Recognize
composite tokens.
* m4/input.c (make_text_link): Rename...
(m4__make_text_link): ...to this, and export.
(m4_push_string_finish): Adjust caller.
(make_text_link, m4__push_symbol): Update new field.
(file_read, builtin_read, string_read, composite_read, next_char):
Add parameter.
(m4_skip_line, match_input, consume_syntax): Adjust callers.
(append_quote_token): New function.
(m4__next_token): Pass quoted strings onto argument collection.
(m4_print_token) [DEBUG_INPUT]: Update.
* m4/macro.c (expand_argument): Collect composite arguments.
(collect_arguments): Update new field.
(expand_macro): Reduce ref-count of back-references after use.
(arg_mark, m4_arg_symbol, m4_make_argv_ref): Adjust to new member
names.
(m4_is_arg_text): Also recognize composite symbols as text.
(m4_arg_text, m4_arg_len): Merge composite symbols as needed.
(m4_arg_equal): Compare composite symbols.
(m4_push_arg, m4_push_args): Handle composite symbols.
(m4_arg_symbol): Relax assertion.
(process_macro): Use single-argument references.
* m4/output.c (m4_shipout_string_trunc): Update comment.
* tests/macros.at (Rescanning macros): Augment test.
Signed-off-by: Eric Blake <ebb9@byu.net>
Eric Blake [2008年1月16日 14:28:32 +0000 (07:28 -0700)]
Stage 10: avoid extra copying of strings and comments.
* ltdl/m4/gnulib-cache.m4: Import intprops and vasnprintf-posix
modules.
* m4/m4private.h (m4__token_type): Adjust prototype.
* m4/input.c (m4__next_token): Support new parameter.
* m4/macro.c (m4_macro_expand_input, expand_token)
(expand_argument, collect_arguments): Adjust callers.
* modules/m4.c (ntoa): Tighten buffer size.
* m4/output.c (m4_tmpname): Guarantee no buffer overflow.
* modules/format.c (arg_int, arg_long, arg_double): New helper
functions, to detect overflow or unparsed characters.
(ARG_INT, ARG_LONG, ARG_STR, ARG_DOUBLE): Adjust to check for
missing or excess arguments.
(format): Likewise, and also output directly into obstack if there
is room.
* doc/m4.texinfo (History): Update for new year.
(Format): Test for new warnings.
Signed-off-by: Eric Blake <ebb9@byu.net>
Eric Blake [2008年1月15日 04:55:45 +0000 (21:55 -0700)]
* TODO: Update with some newer URLs.
Signed-off-by: Eric Blake <ebb9@byu.net>
Eric Blake [2008年1月15日 04:43:02 +0000 (21:43 -0700)]
Verify linear `index'.
* tests/builtins.at (index): New test.
(translit): Make test take longer, to make quadratic algorithms
more apparent.
Signed-off-by: Eric Blake <ebb9@byu.net>
Eric Blake [Wed, 9 Jan 2008 16:37:50 +0000 (09:37 -0700)]
Give better summaries of StageN patches in ChangeLog.
Signed-off-by: Eric Blake <ebb9@byu.net>
Eric Blake [2007年12月20日 17:56:29 +0000 (10:56 -0700)]
Stage 9: share rather than copy single-arg refs.
* ltdl/m4/gnulib-cache.m4: Import memmem and quote modules.
* m4/m4module.h (m4_arg_scratch): New prototype.
* m4/m4private.h (m4__push_symbol): Add parameter.
(m4_arg_scratch): Add fast accessor.
(struct m4): Add expansion_level member, taken...
* m4/macro.c (expansion_level): ...from here. Adjust all users.
(expand_argument): Minor cleanup.
(expand_macro): Track scratch space per macro call.
(m4_arg_scratch): New function.
(m4_make_argv_ref): Call new function.
(m4_push_arg): Push reference to 0ドル.
(m4_push_args): Rework separator usage, since separators will
usually be inlined.
(process_macro): Allow embedded NUL.
* m4/input.c (INPUT_INLINE_THRESHOLD): New define.
(m4__push_symbol): Add parameter. Inline short strings, and save
references through rescanning.
* m4/symtab.c (m4_set_symbol_value_text): Weaken assertion.
* modules/m4.c (errprint, index): Handle NUL transparently.
(dumpdef, translit): Use scratch space, rather than expansion
stack.
* modules/gnu.c (renamesyms, m4symbols): Likewise.
* tests/others.at (nul character): New test.
(iso8859): Quote absolute file name, remove XFAIL.
* tests/iso8859.m4: Avoid raw NUL in output.
* tests/null.m4: New file.
* tests/null.out: Likewise.
* tests/null.err: Likewise.
* Makefile.am (OTHER_FILES): Distribute new files.
* .gitattributes: Treat new files as text.
Signed-off-by: Eric Blake <ebb9@byu.net>
Eric Blake [2007年12月17日 16:28:39 +0000 (09:28 -0700)]
Stage 8: extend life of references into argv.
* m4/system_.h (obstack_regrow): Delete.
* m4/m4private.h (struct m4_symbol_chain): Add level field.
(m4__push_symbol): Adjust prototype.
(m4__adjust_refcount): New prototype.
(DEBUG_MACRO) [DEBUG]: New debug control.
(struct m4__macro_arg_stacks): New structure.
(struct m4): Add arg_stacks, stacks_count fields.
* m4/m4module.h (m4_make_argv_ref): Add parameter.
* m4/macro.c (argc_stack, argv_stack): Delete, replaced by
context->arg_stacks.
(m4_macro_expand_input) [DEBUG_MACRO]: Add debug hooks,
conditional on M4_DEBUG_MACRO envvar.
(collect_arguments): Adjust signature.
(expand_macro): Rework obstack handling.
(m4__adjust_refcount, arg_mark): New functions.
(m4_make_argv_ref): Populate new field.
(m4_push_arg, m4_push_args): Track inuse.
(process_macro): One less cast.
* m4/m4.c (m4_delete): Clean up arg_stacks.
* m4/input.c (make_text_link): Use new field.
(m4__push_symbol, file_clean): Update signature.
(composite_read): Bump refcount when done with reference.
(composite_clean): New function.
(pop_input): Adjust caller.
* m4/debug.c (m4_debug_message): Make assertion match comment.
* modules/gnu.c (builtin, indir): Adjust callers.
* tests/builtins.at (ifelse): New test.
(exp): Move and rename...
* tests/others.at (countdown): ...to this.
* doc/m4.texinfo (Improved foreach): Fix tracing usage in
example.
Signed-off-by: Eric Blake <ebb9@byu.net>
Eric Blake [2007年12月13日 18:47:55 +0000 (11:47 -0700)]
Yet more rewording.
* doc/m4.texinfo (Inhibiting Invocation): Missed one instance in
the previous patch.
Signed-off-by: Eric Blake <ebb9@byu.net>
(cherry picked from commit
da38cc2a2e8272f41366ed87aee5abe64e81c3f9)
Eric Blake [2007年12月13日 17:53:26 +0000 (10:53 -0700)]
Eric Blake [2007年12月11日 16:36:08 +0000 (09:36 -0700)]
Stage 7: use chained input support in input parser.
* m4/m4private.h (m4__push_symbol): New prototype.
(struct m4_symbol_chain): Add const-safety.
* m4/symtab.c (m4_symbol_value_print): Simplify.
(dump_symbol_CB): Update caller.
* m4/input.c (struct m4_input_block): Alter u_c member, first
introduced 2006年10月25日, but unused until now.
(composite_peek, composite_read, composite_unget)
(composite_print, init_builtin_token): Rewrite accordingly.
(m4_push_wrapup): No longer need trailing NUL.
(m4__push_symbol, make_text_link): New functions.
(m4_push_string_finish): Use them.
* m4/macro.c (m4_push_arg, m4_push_args): Likewise.
(expand_macro): Simplify logic of nesting_limit.
* src/main.c (main): Likewise.
* doc/m4.texinfo (Dumpdef): Augment test.
Signed-off-by: Eric Blake <ebb9@byu.net>
Eric Blake [Sun, 9 Dec 2007 04:05:11 +0000 (21:05 -0700)]
Stage 6: convert builtins to push arg at a time.
* m4/m4module.h (m4_shipout_text): Rename...
(m4_divert_text): ...to this, to avoid confusion with m4_shipout_*
that does not worry about sync lines.
(m4_shipout_string_trunc): New prototype.
* m4/output.c (m4_shipout_text): Rename...
(m4_divert_text): ...to this.
(m4_shipout_string): Move guts...
(m4_shipout_string_trunc): ...to this new function.
* m4/macro.c (m4_push_arg, m4_push_args): New functions.
(expand_token, process_macro): Update callers.
* m4/input.c (string_print): Likewise.
* modules/m4.c (ifdef, ifelse, shift, substr, translit, divert):
Likewise.
* modules/gnu.c (patsubst): Likewise.
(debuglen): Use SIZE_MAX for unlimited debug length.
* src/main.c (main): Likewise.
* m4/m4.c (m4_create): Default max_debug_length to SIZE_MAX, not
zero.
Signed-off-by: Eric Blake <ebb9@byu.net>
Eric Blake [Fri, 7 Dec 2007 21:11:21 +0000 (14:11 -0700)]
Minor security fix: Quote output of mkstemp.
* modules/m4.c (m4_make_temp): Produce quoted output.
* doc/m4.texinfo (Mkstemp, Mkdtemp): Update the documentation and
tests.
Signed-off-by: Eric Blake <ebb9@byu.net>
Eric Blake [Fri, 7 Dec 2007 05:14:22 +0000 (22:14 -0700)]
Stage 5: add notion of quote age.
* m4/m4module.h (m4_get_symbol_value_quote_age): New prototype.
(m4_set_symbol_value_text): Adjust prototype.
(m4_has_syntax): Factor out the unsigned char cast.
* m4/m4private.h (struct m4_syntax_table): Add syntax_age and
quote_age members.
(m4__quote_age, m4__safe_quotes): New accessor macros, no need for
functions at this point.
(struct m4_symbol_value, struct m4_macro_args): Add quote_age
member.
(m4_set_symbol_value_text): Adjust fast accessor.
(m4_get_symbol_value_quote_age): New fast accessor.
* m4/symtab.c (m4_set_symbol_value_text): Add parameter.
(m4_get_symbol_value_quote_age): New function.
(m4_symbol_value_copy): Adjust callers.
* m4/macro.c (expand_token): Add parameter, and track quote age.
(expand_argument, collect_arguments): Track quote age.
(m4_macro_expand_input, process_macro, m4_make_argv_ref)
(m4_macro_expand_input): Update callers.
(m4_arg_text, m4_arg_len, m4_arg_func): Abort on type mismatch.
* m4/input.c: Comment cleanups.
(struct m4_input_block): Reduce size.
(m4__next_token): Report quote age.
(m4_push_builtin, init_builtin_token): Update callers.
* m4/utility.c (skip_space): Adjust callers.
* m4/module.c (install_macro_table): Likewise.
* m4/syntax.c (m4_set_syntax): Initialize and update quote age.
(m4_set_quotes, m4_set_comment): Detect no-op changes, and update
quote age.
(set_quote_age): New helper function.
(check_is_single_quotes, check_is_single_comments): Adjust
callers.
* src/freeze.c (reload_frozen_state): Likewise.
* src/main.c (main): Likewise.
* modules/m4.c (define, pushdef): No need to set macro text.
* tests/builtins.at (changequote, defn): New tests.
* examples/wrapfifo.m4: New file.
* examples/wraplifo.m4: New file.
* Makefile.am (dist_pkgdata_DATA): Distribute new examples.
Signed-off-by: Eric Blake <ebb9@byu.net>
Eric Blake [Tue, 4 Dec 2007 16:00:30 +0000 (09:00 -0700)]
gnulib-tool doesn't recognize config.*.
* build-aux/.cvsignore: Explicitly ignore config.rpath, for gnulib-tool.
* build-aux/.gitignore: Likewise.
Signed-off-by: Eric Blake <ebb9@byu.net>
Eric Blake [Tue, 4 Dec 2007 13:43:29 +0000 (06:43 -0700)]
Fix builds with OpenBSD make.
* Makefile.am (HELP2MAN): New macro.
(dist_man_MANS, doc/m4.1): Fix rules for building m4.1 into
srcdir.
* README: Update copyright.
* HACKING: Mention help2man and makeinfo dependencies.
Signed-off-by: Eric Blake <ebb9@byu.net>
Eric Blake [2007年11月30日 04:26:22 +0000 (21:26 -0700)]
Stage 4: route indir, builtin through ref; make argv opaque.
* m4/system_.h (obstack_regrow): Fix precedence.
* m4/m4module.h (m4_arg_equal, m4_arg_empty, m4_make_argv_ref):
New prototypes.
(struct m4_macro_args): Move...
* m4/m4private.h (struct m4_macro_args): ...here, making it opaque
to modules. Add has_ref member.
(bool_bitfield): New helper typedef.
(struct m4_symbol_chain): Add flatten and len members.
* m4/macro.c (empty_symbol): New placeholder, for optimizing
comparison with empty string.
(m4_macro_expand_input): Initialize it.
(collect_arguments): Alter signature, and populate new fields.
(trace_pre, trace_post): Remove redundant parameter.
(expand_macro): Alter handling of obstacks.
(m4_arg_symbol): Account for wrapped argv.
(m4_arg_equal, m4_arg_empty, m4_make_argv_ref): New methods.
(m4_arg_text, m4_arg_len, m4_arg_func): Use new methods.
* modules/m4.c (ifelse, syscmd): Likewise.
* modules/evalparse.c (m4_evaluate): Likewise.
(undefine, popdef, m4_dump_symbols): Optimize.
* modules/gnu.c (builtin, indir, esyscmd, debugfile): Use new
methods.
(changesyntax, regexp): Optimize.
* m4/output.c (diversion_storage): Use typedef.
Signed-off-by: Eric Blake <ebb9@byu.net>
Eric Blake [2007年11月28日 21:03:48 +0000 (14:03 -0700)]
Stage 3b: cache length, rather than computing it, in modules.
* m4/hash.c (m4_hash_remove): Avoid double free on remove
failure.
* m4/output.c (m4_shipout_string): Change semantics of len param.
(m4_shipout_int): Use cached length.
* m4/input.c (m4_push_string_finish): Likewise.
* modules/m4.h (m4_make_temp_func): Add parameter.
* m4/macro.c (expand_token, m4_arg_len): Use cached length.
(collect_arguments, expand_macro): Alter signature.
(trace_format): Don't use out-of-scope buffer.
(process_macro): All callers changed.
* m4/utility.c (m4_dump_args): Likewise.
* m4/symtab.c (m4_symbol_value_print): Likewise.
* modules/gnu.c (__file__, __program__, builtin, indir)
(m4symbols, mkdtemp, regexp_compile, regexp_substitute,
renamesyms, patsubst, regexp, regexp_compile): Likewise.
* modules/load.c (m4modules): Likewise.
* modules/m4.c (defn, m4wrap, maketemp, m4_make_temp)
(numb_obstack, ifdef, ifelse, divert, len, substr): Likewise.
* modules/perl.c (perleval): Likewise.
* modules/stdlib.c (getcwd, getenv, getlogin, getpwnam, getpwuid)
(hostname, uname, setenv): Likewise.
* modules/mpeval.c (numb_obstack): Likewise.
* src/freeze.c (dump_symbol_CB): Likewise.
* doc/m4.texinfo (Renamesyms, Dumpdef, Changesyntax): Adjust test.
* tests/builtins.at (mkstemp): Likewise.
* tests/others.at (iso8859): XFAIL this test, now that
length-based handling allows NUL through part but not all of M4.
Signed-off-by: Eric Blake <ebb9@byu.net>
Eric Blake [2007年11月28日 13:45:20 +0000 (06:45 -0700)]
Stage 3a: cache length, rather than computing it, in libm4.
* m4/m4module.h (struct m4_macro_args): Cache length.
(m4_get_symbol_len, m4_get_symbol_value_len): New accessors.
(m4_set_symbol_value_text): Change signature.
* m4/m4private.h (struct m4_symbol_value): Store string length.
(m4_get_symbol_value_text, m4_get_symbol_value_placeholder)
(m4_set_symbol_value_placeholder): Update accordingly.
(m4_set_symbol_value_text): Change signature.
(m4_get_symbol_value_len): New accessor.
* m4/input.c (struct m4_input_block, string_peek, string_read)
(string_unget, string_print, m4_push_string_finish)
(m4_push_wrapup): Track length of string input.
(m4__next_token): Adjust all users of symbol text to track length,
too.
* m4/macro.c (expand_argument, collect_arguments): Likewise.
* m4/module.c (install_macro_table): Likewise.
* modules/gnu.c (builtin, indir): Likewise.
* modules/m4.c (define, pushdef): Likewise.
* src/main.c (main): Likewise.
* src/freeze.c (reload_frozen_state): Likewise.
* m4/symtab.c (m4_symbol_value_copy): Likewise.
(m4_get_symbol_value_len): New function.
(m4_get_symbol_value_text, m4_get_symbol_value_placeholder)
(m4_set_symbol_value_text, m4_set_symbol_value_placeholder):
Adjust implementation.
Signed-off-by: Eric Blake <ebb9@byu.net>
Eric Blake [2007年11月27日 17:15:48 +0000 (10:15 -0700)]
Stage 2: use accessors, not direct reference, into argv.
* m4/m4private.h (m4_arg_argc): New fast accessor.
* m4/m4module.h (m4_arg_argc, m4_arg_symbol, m4_is_arg_text)
(m4_is_arg_func, m4_arg_text, m4_arg_len, m4_arg_func): New
prototypes.
(m4_builtin_func, M4BUILTIN, M4BUILTIN_HANDLER, m4_dump_args)
(m4_macro_call): Make argc unsigned.
(M4ARG): Use new accessors.
* modules/m4.c (define, pushdef): Likewise.
(undefine, popdef, ifelse, m4_dump_symbols, defn, undivert)
(traceon, traceoff): Make argc unsigned.
* modules/m4.h (m4_dump_symbols_func): Likewise.
* modules/evalparse.c (m4_evaluate): Likewise.
* modules/gnu.c (builtin, indir): Use new accessors.
(changesyntax): Make argc unsigned.
* modules/perl.c (perleval): Likewise.
* m4/utility.c (m4_dump_args): Use new accessors.
* m4/macro.c (trace_pre): Likewise.
(m4_arg_symbol, m4_arg_argc, m4_is_arg_text, m4_is_arg_func)
(m4_arg_text, m4_arg_len, m4_arg_func): New functions.
(expand_macro, trace_pre, trace_post, m4_macro_call): Update argc
usage.
Signed-off-by: Eric Blake <ebb9@byu.net>
Eric Blake [2007年11月24日 23:23:47 +0000 (16:23 -0700)]
Stage 1: convert m4_symbol_value** into new object.
* ltdl/m4/gnulib-cache.m4: Import flexmember module.
* m4/m4module.h (m4_macro_args): New type, will be opaque to
modules later.
(m4_builtin_func, M4BUILTIN, M4BUILTIN_HANDLER, m4_dump_args)
(m4_macro_call): Alter signature to use m4_macro_args object.
(M4ARG): Redefine to access new struct.
* m4/m4private.h (M4_SYMBOL_COMP): New enumerator.
(struct m4_symbol_chain): New type.
(struct m4_symbol_value): Add chain alternative.
* m4/macro.c (collect_arguments): Build new struct.
(expand_macro, m4_macro_call, process_macro, trace_pre)
(trace_post): Adjust implementation to use it.
* m4/utility.c (m4_dump_args): Likewise.
* modules/gnu.c (builtin, indir): Likewise.
* modules/format.c (format): Likewise.
* modules/m4.h (m4_dump_symbols_func): Likewise.
* modules/m4.c (m4_dump_symbols, define, pushdef, defn, ifelse)
(shift, include, errprint, m4wrap): Likewise.
* modules/evalparse.c (m4_evaluate): Likewise.
Signed-off-by: Eric Blake <ebb9@byu.net>
Eric Blake [2007年11月24日 14:04:18 +0000 (07:04 -0700)]
Pass only macro name to utility functions.
* m4/m4module.h (m4_bad_argc, m4_numeric_arg): Adjust signature.
* m4/utility.c (m4_bad_argc, m4_numeric_arg): Adjust
implementation.
* m4/macro.c (m4_macro_call): Adjust callers.
* modules/gnu.c (builtin, debuglen): Likewise.
* modules/m4.c (ifelse, incr, decr, divert, undivert, m4exit)
(substr): Likewise.
* modules/evalparse.c (m4_evaluate): Likewise.
* modules/stdlib.c (setenv, getpwuid, srand): Likewise.
* modules/time.c (ctime, gmtime, localtime, mktime, strftime):
Likewise.
Signed-off-by: Eric Blake <ebb9@byu.net>
Eric Blake [2007年11月23日 23:14:17 +0000 (16:14 -0700)]
Add macro name to debugfile messages.
* m4/m4module.h (m4_debug_set_output): Add parameter.
* m4/debug.c (m4_debug_set_output, set_debug_file): Pass macro
name through.
* modules/gnu.c (debugfile): Adjust caller.
* modules/m4.c (m4exit): Likewise.
* src/main.c (main): Likewise.
Signed-off-by: Eric Blake <ebb9@byu.net>
Eric Blake [2007年11月23日 22:18:40 +0000 (15:18 -0700)]
Factor out handling of macro name in error messages.
* m4/m4module.h (m4_error, m4_error_at_line, m4_warn)
(m4_warn_at_line): Add new parameter.
* m4/utility.c (m4_verror_at_line): New helper method.
(m4_error, m4_error_at_line, m4_warn, m4_warn_at_line): Add new
parameter.
(m4_bad_argc, m4_numeric_arg, m4_parse_truth_arg): All callers
changed.
* m4/debug.c: Likewise.
* m4/input.c: Likewise.
* m4/macro.c: Likewise.
* m4/module.c: Likewise.
* m4/output.c: Likewise.
* m4/path.c: Likewise.
* modules/evalparse.c: Likewise.
* modules/format.c: Likewise.
* modules/gnu.c: Likewise.
* modules/load.c: Likewise.
* modules/m4.c: Likewise.
* modules/mpeval.c: Likewise.
* src/freeze.c: Likewise.
* src/main.c: Likewise.
Signed-off-by: Eric Blake <ebb9@byu.net>
Eric Blake [2007年11月14日 23:39:43 +0000 (16:39 -0700)]
Handle some defn corner cases differently.
* doc/m4.texinfo (Defn): Update documentation; although this still
doesn't match the branch, since it may be changed before 2.0.
* m4/macro.c (expand_argument): Consistently ignore builtins in
concatenation contexts.
* m4/m4private.h (m4__symbol_type): Fix C89 compliance bug.
Signed-off-by: Eric Blake <ebb9@byu.net>
Eric Blake [2007年11月13日 21:08:16 +0000 (14:08 -0700)]
Fix memory leak in tail recursion.
* m4/input.c (pop_input): Add flag parameter and return type.
(next_char): Adjust caller.
(m4_push_string_init): Let go of memory earlier.
Signed-off-by: Eric Blake <ebb9@byu.net>
(cherry picked from commit
6bfe1ba306cacd8d9316647f3b9f276cf56b31a8)
Eric Blake [Wed, 7 Nov 2007 15:13:43 +0000 (08:13 -0700)]
More corner case testing.
* tests/macros.at (Rescanning macros): Test more corner cases.
Signed-off-by: Eric Blake <ebb9@byu.net>
Eric Blake [Tue, 6 Nov 2007 13:29:27 +0000 (06:29 -0700)]
* build-aux/mkstamp: Rename from ltdl/config/mkstamp.
Signed-off-by: Eric Blake <ebb9@byu.net>
Eric Blake [Tue, 6 Nov 2007 13:14:37 +0000 (06:14 -0700)]
* Makefile.am (tests/package.m4): Work around bash bug.
Reported by Ralf Wildenhues.
Signed-off-by: Eric Blake <ebb9@byu.net>
Eric Blake [Mon, 5 Nov 2007 20:14:03 +0000 (13:14 -0700)]
Ignore bootstrap leftovers.
Signed-off-by: Eric Blake <ebb9@byu.net>
Eric Blake [Mon, 5 Nov 2007 20:11:17 +0000 (13:11 -0700)]
For consistency with other GNU projects, use build-aux directory.
* configure.ac (AC_CONFIG_AUX_DIR): Change ltdl/config to
build-aux.
* bootstrap (config_aux_dir): Likewise.
* Makefile.am (config_aux_dir): Likewise.
* ltdl/m4/gnulib-cache.m4: Use --aux-dir option.
Signed-off-by: Eric Blake <ebb9@byu.net>
Eric Blake [Sat, 3 Nov 2007 00:42:16 +0000 (18:42 -0600)]
Update some documentation about version control.
* NEWS: M4 is now stored in git.
* HACKING: Likewise.
* README: Likewise.
* bootstrap: Likewise.
* commit: Delete, now that CVS commits are no longer necessary.
* ltdl/config/mailnotify: No longer necessary; git's patch
generation and mail capability is more powerful.
Signed-off-by: Eric Blake <ebb9@byu.net>
(cherry picked from commit
0f7701a19187152180a0b9907fab29d152fc534a)
Eric Blake [Fri, 2 Nov 2007 23:03:01 +0000 (17:03 -0600)]
Update to recent gnulib changes.
* ltdl/m4/gnulib-cache.m4: Replace fprintf-posix, vasprintf-posix,
xprintf, and xvasprintf with xprintf-posix and xvasprintf-posix.
Signed-off-by: Eric Blake <ebb9@byu.net>
Eric Blake [Thu, 1 Nov 2007 13:08:35 +0000 (07:08 -0600)]
Improve error message when early end of file occurs.
* doc/m4.texinfo (Macro Arguments, Changequote, Changecom)
(M4wrap): Adjust to new messages.
(Improved capitalize): Enhance test.
* m4/m4private.h (m4__next_token): Adjust prototype.
* m4/input.c (m4__next_token): Add new parameter, and improve
error message.
* m4/macro.c (m4_macro_expand_input, collect_arguments): Adjust
callers.
(expand_argument): Likewise, and add parameter.
Signed-off-by: Eric Blake <ebb9@byu.net>
Eric Blake [2007年10月31日 14:50:30 +0000 (08:50 -0600)]
Test more corner cases.
* tests/macros.at (Rescanning macros): Beef up test.
* doc/m4.texinfo (Changecom): Beef up test.
(Improved foreach): Document alternate foreachq style.
* examples/foreachq3.m4: New file.
* examples/loop.m4: New file.
* Makefile.am (dist_pkgdata_DATA): Distribute them.
Signed-off-by: Eric Blake <ebb9@byu.net>
Eric Blake [2007年10月29日 03:26:41 +0000 (21:26 -0600)]
More test coverage for autoconf usage patterns.
* doc/m4.texinfo (Shift): Document cond macro, and add new test.
* tests/macros.at (Rescanning macros): New test.
* tests/builtins.at (include): Augment test.
Signed-off-by: Eric Blake <ebb9@byu.net>
ChangeLog for previous commit.
* Makefile.am: Adjust getopt handling to latest gnulib layout.
Eric Blake [2007年10月27日 12:15:51 +0000 (06:15 -0600)]
Document one use of changequote(`(',`)').
* doc/m4.texinfo (Changequote): Add new test, based on recent
autoconf addition of m4_expand.
Signed-off-by: Eric Blake <ebb9@byu.net>
(cherry picked from commit
37e491acd84f447920057b1619ebab148adea8b1)
Fix 'make distcheck'.
* Makefile.am (dist_pkgdata_DATA): Add examples/capitalize2.m4.
Eric Blake [2007年10月22日 20:57:28 +0000 (14:57 -0600)]
Never let printf failures go undetected.
* ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
xprintf'.
* m4/system_.h: Include xprintf.h.
* m4/debug.c (m4_debug_message_prefix, m4_debug_message): Wrap all
use of printf, xprintf.
* m4/input.c [DEBUG_INPUT]: Likewise.
* m4/module.c [DEBUG_MODULES]: Likewise.
* m4/output.c (m4_shipout_text, m4_shipout_int)
(m4_freeze_diversions): Likewise.
* m4/path.c [DEBUG_INCL]: Likewise.
* m4/symtab.c [DEBUG_SYM]: Likewise.
* m4/syntax.c [DEBUG_SYNTAX]: Likewise.
* modules/modtest.c (export_test): Likewise.
* src/freeze.c (produce_resyntax_dump, produce_syntax_dump)
(produce_module_dump, dump_symbol_CB, produce_frozen_state):
Likewise.
* src/main.c (usage): Likewise.
* po/POTFILES.in: Adjust to new file.
* po/Makevars (XGETTEXT_OPTIONS): Likewise.
Signed-off-by: Eric Blake <ebb9@byu.net>
Eric Blake [2007年10月18日 16:45:16 +0000 (10:45 -0600)]
Fix 'm4 -F file -t undefined'.
* src/freeze.c (produce_symbol_dump): Skip trace placeholders.
* src/freeze.c (dump_symbol_CB): Also skip void symbols.
* tests/freeze.at (reloading unknown builtin): Test for this bug.
* m4/m4module.h (m4_symtab_apply): Add parameter.
* m4/symtab.c (m4_symtab_apply): Ignore trace placeholders when
requested.
(m4_symtab_delete, symtab_dump): Adjust callers.
* modules/m4.c (m4_dump_symbols): Likewise.
Signed-off-by: Eric Blake <ebb9@byu.net>
Eric Blake [Tue, 9 Oct 2007 19:55:37 +0000 (13:55 -0600)]
Fix regexp regression of 2007年09月29日.
* modules/gnu.c (substitute): Allow NULL buf when no
subexpressions were present.
(regexp): Handle \ escapes even with empty regex.
* doc/m4.texinfo (Regexp, Patsubst): Catch this bug.
Signed-off-by: Eric Blake <ebb9@byu.net>
Eric Blake [Tue, 9 Oct 2007 18:16:29 +0000 (12:16 -0600)]
Cache regex compilation for another autoconf speedup.
* modules/gnu.c (gnu_buf): Replace...
(REGEX_CACHE_SIZE, regex_cache): ...with new declarations.
(m4_pattern_buffer): Add fields.
(m4_regexp_compile): Rename...
(regexp_compile): ...to this, and drop no_sub parameter.
Implement caching.
(M4FINISH_HANDLER): Clean up entire cache.
(m4_regexp_search): Rename...
(regex_search): ...to this, adjust to new struct contents, and add
no_sub parameter.
(m4_regexp_substitute): Rename...
(regexp_substitute): ...to this.
(substitute, patsubst, regexp, renamesyms): Adjust callers.
Signed-off-by: Eric Blake <ebb9@byu.net>
Eric Blake [Sat, 6 Oct 2007 21:58:57 +0000 (15:58 -0600)]
Ignore some more files.
Signed-off-by: Eric Blake <ebb9@byu.net>
Eric Blake [Tue, 2 Oct 2007 20:01:51 +0000 (14:01 -0600)]
Document quoting pitfalls in capitalize.
* doc/m4.texinfo (Patsubst): Use the examples directory. Also
document shortfall.
(Improved capitalize): New node.
* examples/capitalize.m4: Update to match manual.
* examples/capitalize2.m4: New file.
Signed-off-by: Eric Blake <ebb9@byu.net>
Eric Blake [Mon, 1 Oct 2007 22:40:12 +0000 (16:40 -0600)]
Another Autoconf usage pattern optimization.
* modules/m4.c (m4_index): Optimize search for one byte.
* doc/m4.texinfo (Index macro, Regexp, Patsubst): Test the new
code paths.
Signed-off-by: Eric Blake <ebb9@byu.net>
Eric Blake [2007年9月30日 01:31:06 +0000 (19:31 -0600)]
Optimize for Autoconf usage pattern.
* modules/gnu.c (regexp, patsubst): Handle empty regex faster.
Signed-off-by: Eric Blake <ebb9@byu.net>
Eric Blake [2007年9月29日 19:06:26 +0000 (13:06 -0600)]
Borrow idea from autoconf testsuite.
* tests/testsuite.at (AT_CHECK_M4): Slight optimization.
Signed-off-by: Eric Blake <ebb9@byu.net>
Eric Blake [2007年9月24日 22:36:47 +0000 (16:36 -0600)]
Create .gitignore alongside .cvsignore.
* bootstrap (version control): Update to reflect git usage.
Signed-off-by: Eric Blake <ebb9@byu.net>
Eric Blake [2007年9月13日 14:03:42 +0000 (14:03 +0000)]
* AUTHORS: Fix typo.
Be consistent about using 'module' for m4_module types and
'handle' for lt_dlhandle types:
* m4/m4private.h (m4_symbol_value): Rename handle element to
method. Changed all references.
(VALUE_MODULE, SYMBOL_MODULE): Renamed from VALUE_HANDLE and
SYMBOL_HANDLE respectively. Changed all references.
* m4/m4module.h (M4INIT_HANDLER, M4FINISH_HANDLER): Ditto.
* m4/builtin.c (m4_builtin_find_by_name)
(m4_builtin_find_by_func): Use module as the parameter name for
pointers of type 'm4_module'.
* m4/module.c (module_remove, m4_get_module_name)
(install_builtin_table, install_macro_table)
(m4_module_make_resident, m4__module_next, m4_module_refcount):
Ditto.
* src/freeze.c (produce_module_dump): Ditto.
* m4/input.c (m4_input_block): Rename handle element to method.
Changed all references.
* m4/symtab.c (m4__symtab_remove_module_references): Ditto.
* modules/load.c: Use module as the variable name for pointers
of type 'm4_module'.
* modules/m4.c: Ditto.
* modules/perl.c: Ditto.
* modules/shadow.c: Ditto.
Eric Blake [Fri, 7 Sep 2007 22:37:46 +0000 (22:37 +0000)]
Add refcount builtin.
* modules/load.c (refcount): New builtin.
(m4modules): Use correct type.
* doc/m4.texinfo (Refcount): New section.
* m4/m4private.h (struct m4_module): Add refcount member.
(m4_module_refcount) [NDEBUG]: Add faster accessor macro.
* m4/module.c (m4_module_load): Add symbols to table on first
load by m4, regardless of other libltdl loads of same module.
(m4_module_refcount): Use new struct member, rather than relying
on libltdl count which might be inflated by unrelated loads.
(m4__module_interface): Optimize.
(m4__module_next, m4__module_find): Avoid assertions that could
trigger with unrelated libltdl loads.
(m4__module_open): Track m4 load count.
(m4__module_exit): Only unload what m4 loaded.
(module_remove): Track m4 unloads.
* NEWS: Document new builtin.
Eric Blake [Fri, 7 Sep 2007 20:59:36 +0000 (20:59 +0000)]
More conversion to m4_module*.
* src/freeze.c (produce_module_dump, dump_symbol_CB)
(reload_frozen_state): Use correct type.
* m4/input.c (struct m4_input_block): Likewise.
* m4/symtab.c (dump_symbol_CB): Likewise.
Eric Blake [Fri, 7 Sep 2007 13:07:59 +0000 (13:07 +0000)]
* AUTHORS: Simplify, to match libtool and autoconf layout.
* THANKS: Sync with branch.
Eric Blake [Thu, 6 Sep 2007 22:58:25 +0000 (22:58 +0000)]
Wrap lt_dlhandle in struct m4_module.
* m4/m4module.h (includes): No longer require clients to know
about lt_dlhandle.
(m4_module): New opaque declaration.
(m4_export): Delete unused type.
(M4INIT_HANDLER, M4FINISH_HANDLER, m4_module_init_func)
(m4_module_finish_func, m4_module_load, m4_get_module_name)
(m4_builtin_find_by_name, m4_builtin_find_by_func): Use new
wrapper.
(m4_module_makeresident, m4_module_refcount): New declarations.
* m4/m4private.h (includes): Move <ltdl.h> here.
(m4_module): New declaration. Simple for now, but intended for
growth.
(m4__module_open, m4__module_next, m4__module_find)
(m4__symtab_remove_module_references): Use new wrapper.
* m4/builtin.c (m4_builtin_find_by_name, m4_builtin_find_by_func):
Likewise.
* m4/module.c (m4_get_module_name, m4_module_import)
(m4_module_load): Likewise.
(install_builtin_table, install_macro_table): Likewise. Also,
change return type since these always returned NULL and no one
used the result.
(m4_module_makereside
* bootstrap (ltdl/m4/.cvsignore): Add xstrtol module macros.
* src/m4/.cvsignore: Add xstrtol module sources.
Work around a bug in darwin's awk:
* bootstrap (func_get_translations): Use $AWK instead of raw
`awk' so that the user can use an alternative implementation
if the first awk in PATH doesn't behave as expected.
(func_get_translations): The first awk script mangles the last
entry passed to it for at least the awk implementation shipped
with Darwin 8.10.1. Capture 3ドル into a variable too to work-
around that problem.
As gnulib xstrtol is only used by main, and unconditionally pulls
in a copy of getopt, undo bootstrap change from 2007年08月11日 below,
and copy the xstrtol code into src/ so that main() can use it
without pushing the extra code into libm4:
* bootstrap (src_modules): Add getopt and xstrtol modules.
* Makefile.am (src_m4_SOURCES): Add xstrtol sources.
* po/POTFILES.in: Move gnu/xstrtol-error.c to src/xstrtol-error.c.
Eric Blake [2007年8月11日 15:50:58 +0000 (15:50 +0000)]
Another upstream xstrtol change.
* po/POTFILES.in: Track changes in files containing messages.
* bootstrap (src_modules): getopt is now pulled into libgnu.a, no
need to grab it separately.
* src/main.c (OPT_STR, LONG_OPT_STR, short_opt_str, OPT_STR_INIT):
No longer needed.
(size_opt): Adjust to latest xstrtol interface.
Eric Blake [2007年8月10日 15:09:45 +0000 (15:09 +0000)]
Documentation improvements.
* doc/m4.texinfo (Defn): Resync with branch.
(Compatibility, Extensions): Sync with branch.
Eric Blake [Tue, 7 Aug 2007 20:59:23 +0000 (20:59 +0000)]
Adjust to gnulib xstrtol changes.
* src/main.c (size_opt): Adjust signature, so that error strings
are easier to translate.
(OPT_STR, LONG_OPT_STR, short_opt_str, OPT_STR_INIT): New macros
for tracking long options.
(main): Track which long option was used.
* tests/options.at (--debuglen, --nesting-limit): Adjust to change
in error message.
(deprecated options): Test that --arglength spelling shows up in
error message.
Eric Blake [Tue, 7 Aug 2007 03:15:24 +0000 (03:15 +0000)]
Normalize all GPL license notices.
* m4/COPYING.LIB: Delete - libm4 is not distributed under LGPLv2
at this time.
* Makefile.am: Update license wording.
* bootstrap: Likewise.
* commit: Likewise.
* configure.ac: Likewise.
* ltdl/config/mailnotify: Likewise.
* ltdl/config/mkstamp: Likewise.
* ltdl/m4/debug.m4: Likewise.
* ltdl/m4/gmp.m4: Likewise.
* ltdl/m4/m4-error.m4: Likewise.
* ltdl/m4/m4-getopt.m4: Likewise.
* ltdl/m4/m4-gettext.m4: Likewise.
* ltdl/m4/m4-obstack.m4: Likewise.
* ltdl/m4/m4-regex.m4: Likewise.
* ltdl/m4/stackovf.m4: Likewise.
* m4/builtin.c: Likewise.
* m4/debug.c: Likewise.
* m4/hash.c: Likewise.
* m4/hash.h: Likewise.
* m4/input.c: Likewise.
* m4/m4.c: Likewise.
* m4/m4module.h: Likewise.
* m4/m4private.h: Likewise.
* m4/macro.c: Likewise.
* m4/module.c: Likewise.
* m4/output.c: Likewise.
* m4/path.c: Likewise.
* m4/resyntax.c: Likewise.
* m4/symtab.c: Likewise.
* m4/syntax.c: Likewise.
* m4/system_.h: Likewise.
* m4/utility.c: Likewise.
* modules/evalp
Eric Blake [2007年7月22日 22:53:35 +0000 (22:53 +0000)]
Fix diversions on NetBSD, when fopen(name,"a+") seeks to end.
* m4/output.c (m4_tmpopen): Explicitly seek to beginning.
* tests/builtins.at (divert): Enhance test to cover this.
* THANKS: Update.
Reported by Thomas Klausner.
Eric Blake [2007年7月21日 03:41:12 +0000 (03:41 +0000)]
Fix 'make distcheck' issues.
* bootstrap: Add more files that might be more up-to-date in
gnulib.
* Makefile.am (EXTRA_DIST): No longer distribute removed diff.
* config/m4/gnulib-cache.m4: Update to latest gnulib.
Eric Blake [2007年7月16日 13:09:20 +0000 (13:09 +0000)]
* po/POTFILES.in: Track recent translation additions from gnulib
updates.
Eric Blake [2007年7月15日 04:26:45 +0000 (04:26 +0000)]
Reflect upstream license .texi changes.
* doc/m4.texinfo (Copying): Rename node...
(GNU General Public License): ...to this.
(GNU Free Documentation License): Adjust node location.
* local/doc/gpl-3.0.texi.diff: Remove file.
Eric Blake [2007年7月10日 20:48:06 +0000 (20:48 +0000)]
Upgrade to GPLv3, and document 1.4.10.
* bootstrap: Adjust to GPLv3.
(func_update): Port from branch.
* ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool
--local-dir=local --import gpl-3.0'.
* doc/m4.texinfo (History): Mention 1.4.11.
(Copying This Package): New appendix.
* NEWS: Document 1.4.10.
* local/doc/gpl-3.0.texi.diff: New file.
* Makefile.am: Update license.
(doc_m4_TEXINFOS, EXTRA_DIST): Distribute additions.
* commit: Update license.
* configure.ac: Likewise.
* ltdl/config/mailnotify: Likewise.
* ltdl/config/mkstamp: Likewise.
* ltdl/m4/debug.m4: Likewise.
* ltdl/m4/gmp.m4: Likewise.
* ltdl/m4/m4-error.m4: Likewise.
* ltdl/m4/m4-getopt.m4: Likewise.
* ltdl/m4/m4-gettext.m4: Likewise.
* ltdl/m4/m4-obstack.m4: Likewise.
* ltdl/m4/m4-regex.m4: Likewise.
* ltdl/m4/stackovf.m4: Likewise.
* m4/builtin.c: Likewise.
* m4/debug.c: Likewise.
* m4/hash.c: Likewise.
* m4/hash.h: Likewise.
* m4/input.c: Likewise.
* m4/m4.c: Likewise.
* m4/m4module.h: Likewise.
* m4/m4private.
Eric Blake [Mon, 9 Jul 2007 13:21:56 +0000 (13:21 +0000)]
* modules/format.c (format): Avoid undefined behavior with %c.
The translation project has moved.
* bootstrap (func_get_translations): Use the new translation
project url.
(TP_URL): Removed.
Eric Blake [2007年6月26日 11:31:54 +0000 (11:31 +0000)]
Match Free Software Directory categories.
* doc/m4.texinfo (dircategory): Update.
Eric Blake [2007年5月31日 13:26:38 +0000 (13:26 +0000)]
Add extension to divert builtin.
* modules/m4.c (builtin_divert): Immediately divert second
argument.
* m4/output.c (m4_output_text): Allow 0 length. Fixes regression
from two days ago.
(m4_shipout_text): Short-circuit on zero length.
* tests/freeze.at (loading format 2): Expand test to catch
regression. Also check out-of-range version.
* tests/builtins.at (divert): Expand test to check corner cases
of extension.
* NEWS: Document the extension.
Reported by Daniel Richard G.
Eric Blake [2007年5月30日 13:36:58 +0000 (13:36 +0000)]
Port format improvements from branch.
* doc/m4.texinfo (History): Mention upcoming 1.4.10 release.
(Format): Enhance section.
* modules/format.c (format): Accept %'hhd, and issue warnings on
unrecognized specifiers.
* modules/gnu.c (builtin_format): Adjust how format is called.
Eric Blake [2007年5月28日 22:08:44 +0000 (22:08 +0000)]
* tests/options.at (--syncoutput): Add xfailed test.
Eric Blake [2007年5月28日 21:48:40 +0000 (21:48 +0000)]
Fix sync line interaction with multiline comments.
* doc/m4.texinfo (Preprocessor features): Improve documentation.
(Syncoutput): Improve testsuite.
(Incompatibilities): Add testcase, and document bug.
* src/freeze.c (reload_frozen_state): Don't interfere with
synclines when reloading state.
* m4/input.c (m4__next_token): Report line where multiline tokens
start.
* m4/m4private.h (m4__token_type): Add parameter.
* m4/m4module.h (m4_output_text): Export.
(m4_shipout_text): Add parameter.
* src/macro.c (m4_macro_expand_input, expand_token)
(expand_argument): Adjust callers so that line is passed from
input to output.
* m4/output.c (output_text): Rename...
(m4_output_text): ...to this, and export.
(m4_insert_file, insert_diversion_helper): Update callers.
(m4_shipout_text): Take new parameter for start line of token.
Output at most one syncline per token.
Reported by Sergey Poznyakoff.
Eric Blake [2007年5月28日 20:10:01 +0000 (20:10 +0000)]
Fix large diversion corner cases.
* tests/freeze.at (large diversion): New test.
* m4/output.c (m4_tmpfile, m4_tmpopen): Simplify use of errno.
(make_room_for): Use NULL, not 0, for pointers.
(m4_freeze_diversions): Allow freezing large diversions.
(insert_diversion_helper): Avoid using rewind.
Eric Blake [2007年5月28日 18:52:41 +0000 (18:52 +0000)]
Also run gnulib unit tests during make check.
* ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool
--tests-base=tests/gnu --with-tests'.
* configure.ac (AC_CONFIG_FILES): Build tests/gnu testdir.
* Makefile.am (SUBDIRS): Run gnulib tests before ours.
Eric Blake [2007年5月26日 02:47:06 +0000 (02:47 +0000)]
* m4/system_.h: Include <stdint.h>, for intmax_t.
* THANKS: Update.
Reported by Daniel Richard G.
Eric Blake [2007年5月24日 20:13:44 +0000 (20:13 +0000)]
Provide consistent shift semantics regardless of hardware.
* modules/m4.c (numb_lshift, numb_rshift, numb_urshift): Mask
before shifting.
(number, unumber): Always use [u]intmax_t.
Reported by Gary V. Vaughan.
Eric Blake [2007年5月24日 18:02:54 +0000 (18:02 +0000)]
Support POSIX flush semantics on all platforms.
* modules/m4.c (m4_sysval_flush): Rely on gnulib.
* ltdl/m4/gnulib-cache.m4: Fix typo in previous commit.
Eric Blake [2007年5月24日 12:54:12 +0000 (12:54 +0000)]
Work around cygwin and mingw fseeko bugs.
* ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
fseeko'.
* modules/m4.c (m4_sysval_flush): Prefer fseeko over fseek.
Eric Blake [2007年4月25日 14:16:21 +0000 (14:16 +0000)]
Test that regression in 1.4.9's eval doesn't recur.
* doc/m4.texinfo (Eval): Check negative division.
* THANKS: Update.
Eric Blake [2007年4月12日 17:41:34 +0000 (17:41 +0000)]
Allow for running test in sticky or setgid directory.
* tests/builtins.at (mkdtemp): Adjust test.
Eric Blake [2007年4月12日 17:38:28 +0000 (17:38 +0000)]
Don't test for broken sed too soon.
* tests/others.at (stdin seekable): Rearrange subtests.
Eric Blake [2007年4月12日 16:27:20 +0000 (16:27 +0000)]
Work around 'stdin seekable' shortcoming on glibc.
* ltdl/m4/gnulib-cache.m4: Use closein instead of closeout.
* tests/others.at (stdin closed): Adjust to new output.
* src/main.c (process_file): No need to return anything.
(main): Use close_stdin instead of close_stdout.
Reported by Ralf Wildenhues.
Eric Blake [2007年4月12日 12:30:20 +0000 (12:30 +0000)]
Enable autobuild usage.
* ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
autobuild'.
* configure.ac (AB_INIT): Output autobuild information.
Eric Blake [2007年4月11日 15:48:09 +0000 (15:48 +0000)]
Address testsuite shortcoming in 'stdout full' on glibc.
* tests/others.at (stdout full): Adjust expected output when more
than 1k text is printed to /dev/full.
Reported by Ralf Wildenhues.
Eric Blake [2007年4月10日 14:39:40 +0000 (14:39 +0000)]
* HACKING: Document policy behind 2007年04月07日 patch.
Eric Blake [2007年4月10日 13:56:20 +0000 (13:56 +0000)]
* tests/macros.at (Arity and defn): Fix quoting.
Eric Blake [2007年4月10日 03:45:23 +0000 (03:45 +0000)]
Address failure of 'seekable stdin' on Mac OS X.
* ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
fflush.
Eric Blake [Sun, 8 Apr 2007 05:06:42 +0000 (05:06 +0000)]
Include <config.h> first in all C files, and not in headers.
Fixes regression for --disable-assert builds from 2007年04月02日.
* src/m4.h (includes): Don't include config.h here.
* m4/m4private.h (includes): Likewise.
* m4/builtin.c: Include config.h before anything else.
* m4/debug.c: Likewise.
* m4/hash.c: Likewise.
* m4/input.c: Likewise.
* m4/m4.c: Likewise.
* m4/macro.c: Likewise.
* m4/module.c: Likewise.
* m4/symtab.c: Likewise.
* m4/syntax.c: Likewise.
* m4/utility.c: Likewise.
* src/freeze.c: Likewise.
* src/stackovf.c: Likewise.
Eric Blake [Tue, 3 Apr 2007 21:06:16 +0000 (21:06 +0000)]
* modules/m4.c (numb_ratio, numb_divide, numb_modulo): Avoid
SIGFPE on x86 architectures.
Reported by Ralf Wildenhues.
Eric Blake [Tue, 3 Apr 2007 11:38:01 +0000 (11:38 +0000)]
Fix warnings from last commit.
* ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
fprintf-posix sprintf-posix'.
* m4/macro.c (expand_macro, trace_format): Use correct specifier
for size_t.
(process_macro): Avoid negative array index.
* src/freeze.c (produce_resyntax_dump, produce_module_dump)
(dump_symbol_CB, produce_frozen_state): Use correct specifier for
size_t.
Get rid of the last 'differs in signedness' compiler warnings:
* m4/macro.c (process_macro): m4_get_symbol_value_text() returns
a regular 'char *', so variables to store the return address,
and iterate through it should be regular 'char *' too.
* m4/input.c (m4_input_block): The start and current members of
the string part of this union store regular 'char *' types, so
they should be regular 'char *' types too.
M4 was designed to have a small number of header files defining
the interfaces to several source files each. Keeping this in
mind allows us to tidy things up considerably. Having done this,
it becomes clear that some of the installed headers reference
other headers which are not installed (but that's another patch):
* m4/m4private.h (stdio--.h, stdlib--.h, unistd--.h): Moved from
here...
* m4/system_.h (gnu/stdio--.h, gnu/stdlib--.h, gnu/unistd--.h):
...to here, so client modules can benefit too.
(assert.h, errno.h, limits.h, sys/stat.h): Include one here at the
lowest level to save doing it multiple times elsewhere.
* m4/debug.c (stdio.h): Removed. The portable <gnu/stdio--.h>
is already included via m4private.h.
* modules/time.c (stdio.h): Ditto.
* modules/gnu.c (stdlib.h): Ditto resp <gnu/stdlib--.h>.
* modules/stdlib.c (stdlib.h, unistd.h): Ditto resp <gnu/stdlib--.h>
and <gnu/unistd--.h>,
* m4/m4private.h (m4module.h): Use angle brackets for an installed
file.
* m4/hash.h (system.h): Ditto.
* modules/gnu.c (progname.h): Removed.
* src/freeze.c (m4/system.h, m4private.h): Already included vi m4.h.
* m4/m4private.h (assert.h, errno.h): Already included via
m4/m4module.h.
* m4/input.c (ctype.h): Ditto.
* m4/module.c (ltdl.h): Ditto.
* m4/output.c (errno.h, limits.h, stdio.h, sys/types.h, sys/stat.h)
(unistd.h): Ditto.
* m4/path.c (config.h, stdlib.h): Ditto.
* m4/utility.c (config.h): Ditto.
* modules/evalparse.c (assert.h, ctype.h): Ditto.
* modules/gnu.c (assert.h, ctype.h, errno.h): Ditto.
* modules/import.c (assert.h): Ditto.
* modules/m4.c (assert.h, errno.h): Ditto.
* modules/modtest.c (assert.h): Ditto.
* modules/stdlib.c (sys/types.h): DittAo.
* src/m4.h (ctype.h, errno.h, string.h, sys/types.h, ltdl.h):
Ditto.
* src/stackovf.c (assert.h): Ditto.
* modules/gnu.c (m4/m4module.h, m4private.h): Build using the faster
private interfaces when NDEBUG is defined.
* modules/import.c (m4/m4module.h, m4private.h): Ditto.
* modules/load.c (m4/m4module.h, m4private.h): Ditto.
* modules/m4.c (m4/m4module.h, m4private.h): Ditto.
* modules/modtest.c (m4/m4module.h, m4private.h): Ditto.
* modules/mpeval.c (m4/m4module.h, m4private.h): Ditto.
* modules/perl.c (m4/m4module.h, m4private.h): Ditto.
* modules/shadow.c (m4/m4module.h, m4private.h): Ditto.
* modules/time.c (m4/m4module.h, m4private.h): Ditto.
* modules/traditional.c (m4/m4module.h, m4private.h): Ditto.
* src/m4.h (locale.h): Moved from here...
* src/main.h: ...to here.
(m4private.h): Already included via m4.h.
* src/stackovf.c (m4private.h): Ditto.
* Makefile.am (stamp-vcl): Removed.
(CONFIG_STATUS_DEPENDENCIES): Depend directly on ChangeLog.
Eric Blake [2007年3月28日 12:19:35 +0000 (12:19 +0000)]
* src/main.c (usage): Improve note to TRANSLATORS.
* m4/system_.h (EXIT_FAILURE): Reflect gnulib changes.
Eric Blake [2007年3月28日 11:42:04 +0000 (11:42 +0000)]
* tests/builtins.at (__m4_version__): Fix bug when TIMESTAMP is
empty.
Eric Blake [2007年3月24日 21:29:41 +0000 (21:29 +0000)]
* m4/output.c (m4_output_init): Update to latest gnulib.
* bootstrap (ltdl/m4/.cvsignore): No longer track generated
.cvsignore in CVS.
* NEWS: Reflect release of 1.4.9.
* THANKS: Update.
Eric Blake [Wed, 7 Mar 2007 15:46:52 +0000 (15:46 +0000)]
* AUTHORS: Update