m4-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SCM] GNU M4 source repository branch, branch-1.6, updated. v1.5.89a-143


From: Eric Blake
Subject: [SCM] GNU M4 source repository branch, branch-1.6, updated. v1.5.89a-143-g52b195a
Date: Thu, 26 Nov 2009 20:35:55 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU M4 source repository".

http://git.sv.gnu.org/gitweb/?p=m4.git;a=commitdiff;h=52b195a5edbd9b534c40493d58a3f203d6271fbc

The branch, branch-1.6 has been updated
       via  52b195a5edbd9b534c40493d58a3f203d6271fbc (commit)
       via  a953e7dcfb3e6634a3a32c4f30e8b74580aec64e (commit)
       via  a7ac163e302571774b1afcc66ba0fb497a5c1c15 (commit)
      from  cf0d4cd466af02bdb76f16fab4a0bebedbeaab70 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 52b195a5edbd9b534c40493d58a3f203d6271fbc
Author: Eric Blake <address@hidden>
Date:   Thu Nov 26 07:11:11 2009 -0700

    Ignore write failures before stack overflow exit.
    
    * m4/gnulib-cache.m4: Import ignore-value module.
    * src/m4.h (includes): Use it.
    (xfwrite): New wrapper.
    * src/builtin.c (compile_pattern, m4_dumpdef, m4_errprint)
    (m4_regexp, m4_patsubst, m4_errprint): Use it.
    * src/debug.c (trace_flush): Likewise.
    * src/freeze.c (dump_symbol_CB, produce_frozen_state): Likewise.
    * src/stackovf.c (process_sigsegv): Ignore write failures prior to
    a non-zero exit.
    
    Signed-off-by: Eric Blake <address@hidden>
    (cherry picked from commit 30cd2068dcb8b51f9fe29741732027bb00b522a5)

commit a953e7dcfb3e6634a3a32c4f30e8b74580aec64e
Author: Eric Blake <address@hidden>
Date:   Wed Nov 25 12:41:05 2009 -0700

    Allow use of compiler warnings.
    
    * m4/gnulib-cache.m4: Import manywarnings module.
    * configure.ac (WERROR_CFLAGS, WARN_CFLAGS): New variables.
    * src/Makefile.am (AM_CFLAGS): Use them.
    * Makefile.am (DISTCHECK_CONFIGURE_FLAGS): Turn on warnings during
    distcheck.
    * src/m4.h (M4_GNUC_NORETURN): New macro.
    * src/m4.c (usage): Use it.
    (m4_verror_at_line): Add gcc printf attribute.
    (main): Use consistent type in ?:.  Mark potentially unused
    parameter.
    * src/format.c (arg_int, arg_long, arg_double): Avoid signed
    vs. unsigned comparison.
    * src/freeze.c (reload_frozen_state): Likewise.
    * src/output.c (freeze_diversions): Likewise.
    * src/builtin.c (bad_argc, numeric_arg, m4_eval, m4_index)
    (substitute): Likewise.
    (define_user_macro): Likewise.  Allow C++ compilation.
    (m4_define, m4_undefine, m4_pushdef, m4_popdef, m4_syscmd)
    (m4_sysval, m4_divert, m4_undivert, m4_dnl, m4_changequote)
    (m4_changecom, m4_changeword, m4_include, m4_sinclude)
    (m4_m4wrap, m4_traceoff, m4_debugmode, m4_debugfile)
    (m4_placeholder): Mark unused parameters.
    (m4_m4exit): Likewise.  Add gcc noreturn attribute.
    (m4_esyscmd): Avoid shadowing a variable.
    * src/input.c (input_eof): Add missing initializer.
    (next_token): Avoid signed vs. unsigned comparison.
    * src/macro.c (expand_macro, adjust_refcount, wrap_args):
    Likewise.
    (expand_input): Discard const.
    * src/path.c (m4_fopen): Remove unused parameter.
    (m4_path_search): Adjust caller.
    * src/stackovf.c (process_sigsegv): Avoid cast warning.
    (sigsegv_handler): Mark unused parameter.
    
    Signed-off-by: Eric Blake <address@hidden>
    (cherry picked from commit 324f56e49ed43de04cf6e648fea9d89739788f24)

commit a7ac163e302571774b1afcc66ba0fb497a5c1c15
Author: Eric Blake <address@hidden>
Date:   Wed Nov 25 10:23:52 2009 -0700

    Update from gnulib.
    
    * gnulib: Update.
    * m4/gnulib-cache.m4: Use --makefile-name.
    * lib/Makefile.am: Wrap the gnulib-generated file.
    * tests/Makefile.am: Likewise.
    * .gitignore: Track our wrappers.
    * doc/m4.texinfo (Improved capitalize): Fix typo.
    
    Signed-off-by: Eric Blake <address@hidden>
    (cherry picked from commit 48873014007f6a22b77ed3b3fd8b01705e231715)

-----------------------------------------------------------------------

Summary of changes:
 .gitignore                 |    6 ++-
 ChangeLog                  |   56 +++++++++++++++++++++++
 Makefile.am                |    3 +-
 configure.ac               |   49 ++++++++++++++++++++
 doc/m4.texinfo             |    2 +-
 gnulib                     |    2 +-
 {src => lib}/Makefile.am   |   23 +++++-----
 m4/gnulib-cache.m4         |    6 ++-
 src/Makefile.am            |    1 +
 src/builtin.c              |  108 +++++++++++++++++++++++++-------------------
 src/debug.c                |    2 +-
 src/format.c               |    6 +-
 src/freeze.c               |   20 ++++----
 src/input.c                |    4 +-
 src/m4.c                   |   10 ++---
 src/m4.h                   |   14 ++++++
 src/macro.c                |    9 ++--
 src/output.c               |    3 +-
 src/path.c                 |    6 +-
 src/stackovf.c             |   12 +++---
 {src => tests}/Makefile.am |   14 +-----
 21 files changed, 242 insertions(+), 114 deletions(-)
 copy {src => lib}/Makefile.am (63%)
 copy {src => tests}/Makefile.am (63%)

diff --git a/.gitignore b/.gitignore
index 2ab1a8b..edef086 100644
--- a/.gitignore
+++ b/.gitignore
@@ -41,7 +41,8 @@
 /GNUmakefile
 /gnupload
 /install-sh
-/lib
+/lib/*
+!/lib/Makefile.am
 /link-warning.h
 /m4-*
 /m4/.gitignore
@@ -54,4 +55,5 @@ Makefile
 /stamp-h
 /stamp-h1
 /stamp-h.in
-/tests
+/tests/*
+!/tests/Makefile.am
diff --git a/ChangeLog b/ChangeLog
index f97e31e..c77bae9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,59 @@
+2009-11-26  Eric Blake  <address@hidden>
+
+       Ignore write failures before stack overflow exit.
+       * m4/gnulib-cache.m4: Import ignore-value module.
+       * src/m4.h (includes): Use it.
+       (xfwrite): New wrapper.
+       * src/builtin.c (compile_pattern, m4_dumpdef, m4_errprint)
+       (m4_regexp, m4_patsubst, m4_errprint): Use it.
+       * src/debug.c (trace_flush): Likewise.
+       * src/freeze.c (dump_symbol_CB, produce_frozen_state): Likewise.
+       * src/stackovf.c (process_sigsegv): Ignore write failures prior to
+       a non-zero exit.
+
+       Allow use of compiler warnings.
+       * m4/gnulib-cache.m4: Import manywarnings module.
+       * configure.ac (WERROR_CFLAGS, WARN_CFLAGS): New variables.
+       * src/Makefile.am (AM_CFLAGS): Use them.
+       * Makefile.am (DISTCHECK_CONFIGURE_FLAGS): Turn on warnings during
+       distcheck.
+       * src/m4.h (M4_GNUC_NORETURN): New macro.
+       * src/m4.c (usage): Use it.
+       (m4_verror_at_line): Add gcc printf attribute.
+       (main): Use consistent type in ?:.  Mark potentially unused
+       parameter.
+       * src/format.c (arg_int, arg_long, arg_double): Avoid signed
+       vs. unsigned comparison.
+       * src/freeze.c (reload_frozen_state): Likewise.
+       * src/output.c (freeze_diversions): Likewise.
+       * src/builtin.c (bad_argc, numeric_arg, m4_eval, m4_index)
+       (substitute): Likewise.
+       (define_user_macro): Likewise.  Allow C++ compilation.
+       (m4_define, m4_undefine, m4_pushdef, m4_popdef, m4_syscmd)
+       (m4_sysval, m4_divert, m4_undivert, m4_dnl, m4_changequote)
+       (m4_changecom, m4_changeword, m4_include, m4_sinclude)
+       (m4_m4wrap, m4_traceoff, m4_debugmode, m4_debugfile)
+       (m4_placeholder): Mark unused parameters.
+       (m4_m4exit): Likewise.  Add gcc noreturn attribute.
+       (m4_esyscmd): Avoid shadowing a variable.
+       * src/input.c (input_eof): Add missing initializer.
+       (next_token): Avoid signed vs. unsigned comparison.
+       * src/macro.c (expand_macro, adjust_refcount, wrap_args):
+       Likewise.
+       (expand_input): Discard const.
+       * src/path.c (m4_fopen): Remove unused parameter.
+       (m4_path_search): Adjust caller.
+       * src/stackovf.c (process_sigsegv): Avoid cast warning.
+       (sigsegv_handler): Mark unused parameter.
+
+       Update from gnulib.
+       * gnulib: Update.
+       * m4/gnulib-cache.m4: Use --makefile-name.
+       * lib/Makefile.am: Wrap the gnulib-generated file.
+       * tests/Makefile.am: Likewise.
+       * .gitignore: Track our wrappers.
+       * doc/m4.texinfo (Improved capitalize): Fix typo.
+
 2009-10-05  Eric Blake  <address@hidden>
 
        Update from gnulib.
diff --git a/Makefile.am b/Makefile.am
index a579c86..875750f 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -34,7 +34,8 @@ MAINTAINERCLEANFILES = INSTALL Makefile.in aclocal.m4 \
 ACLOCAL_AMFLAGS = -I m4
 ## Enough users install GNU M4 as gm4 that we make sure 'make installcheck'
 ## will handle that, prior to making a release.
-DISTCHECK_CONFIGURE_FLAGS = --enable-changeword --program-prefix=g
+DISTCHECK_CONFIGURE_FLAGS = --enable-changeword --program-prefix=g \
+       --enable-gcc-warnings
 
 BUILT_SOURCES = $(top_srcdir)/.version
 $(top_srcdir)/.version:
diff --git a/configure.ac b/configure.ac
index f2b42b5..ea8d6ac 100644
--- a/configure.ac
+++ b/configure.ac
@@ -54,6 +54,55 @@ AC_TYPE_SIGNAL
 
 AC_CHECK_FUNCS_ONCE([sigaction sigaltstack sigstack sigvec strerror])
 
+AC_ARG_ENABLE([gcc-warnings],
+  [AS_HELP_STRING([--enable-gcc-warnings],
+                  [turn on lots of GCC warnings (for developers)])],
+  [case $enableval in
+     yes|no) ;;
+     *)      AC_MSG_ERROR([bad value $enableval for gcc-warnings option]) ;;
+   esac
+   gl_gcc_warnings=$enableval],
+  [gl_gcc_warnings=no]
+)
+
+if test "$gl_gcc_warnings" = yes; then
+  gl_WARN_ADD([-Werror], [WERROR_CFLAGS])
+  AC_SUBST([WERROR_CFLAGS])
+
+  nw=
+  nw="$nw -Waggregate-return"       # C90 is anachronistic
+  nw="$nw -Wlong-long"              # C90 is anachronistic
+  nw="$nw -Wundef"                  # Warns on '#if GNULIB_FOO' etc in gnulib
+  nw="$nw -Wtraditional"            # Warns on #elif which we use often
+  nw="$nw -Wsystem-headers"         # Don't let system headers trigger warnings
+  nw="$nw -Wpadded"                 # Our structs are not packed
+  nw="$nw -Wredundant-decls"        # Gnulib has multiple decls
+  nw="$nw -Wformat-nonliteral"      # Needed in builtin.c
+  nw="$nw -Wunreachable-code"       # Needed in output.c
+  nw="$nw -Wunsafe-loop-optimizations"  # Needed in builtin.c
+  nw="$nw -Wlogical-op"             # Needed in input.c
+  nw="$nw -Wconversion"             # Too many warnings for now
+  nw="$nw -Wsign-conversion"        # Too many warnings for now
+  nw="$nw -Wtraditional-conversion" # Too many warnings for now
+  nw="$nw -Wcast-qual"              # Too many warnings for now
+  nw="$nw -Wswitch-enum"            # Too many warnings for now
+  # This, $nw, is the list of warnings we disable.
+
+  gl_MANYWARN_ALL_GCC([ws])
+  gl_MANYWARN_COMPLEMENT([ws], [$ws], [$nw])
+  for w in $ws; do
+    gl_WARN_ADD([$w])
+  done
+
+  gl_WARN_ADD([-fdiagnostics-show-option])
+  gl_WARN_ADD([-funit-at-a-time])
+
+  AC_SUBST([WARN_CFLAGS])
+
+  AC_DEFINE([_FORTIFY_SOURCE], [2],
+    [enable compile-time and run-time bounds-checking, and some warnings])
+fi
+
 # Tandem/NSK is broken - it has 'long long int' but not
 # 'unsigned long long int', which confuses assumptions made by gnulib.
 # Simply pretend that neither type exists if both do not work.
diff --git a/doc/m4.texinfo b/doc/m4.texinfo
index 248bb57..770fe57 100644
--- a/doc/m4.texinfo
+++ b/doc/m4.texinfo
@@ -9434,7 +9434,7 @@ string.  In turn, that means the replacement text has 
unbalanced quotes,
 necessitating another round of @code{changequote}.
 
 In the fixed version below, (also shipped as
address@hidden@value{VERSION}/@/examples/@/capitalize.m4}), @code{capitalize}
address@hidden@value{VERSION}/@/examples/@/capitalize2.m4}), @code{capitalize}
 uses the alternate quotes of @samp{<<[} and @samp{]>>} (the longer
 strings are chosen so as to be less likely to appear in the text being
 converted).  The helpers @code{_to_alt} and @code{_from_alt} merely
diff --git a/gnulib b/gnulib
index c844d0c..9bb0a7e 160000
--- a/gnulib
+++ b/gnulib
@@ -1 +1 @@
-Subproject commit c844d0cacce3176e8ca09d890bfb21a77819243b
+Subproject commit 9bb0a7e5780f8cc02b234981fa17cad396a0244f
diff --git a/src/Makefile.am b/lib/Makefile.am
similarity index 63%
copy from src/Makefile.am
copy to lib/Makefile.am
index 7a0e1ac..eb04128 100644
--- a/src/Makefile.am
+++ b/lib/Makefile.am
@@ -1,6 +1,6 @@
 ## Makefile.am - template for generating Makefile via Automake
 ##
-## Copyright (C) 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+## Copyright (C) 2009 Free Software Foundation, Inc.
 ##
 ## This file is part of GNU M4.
 ##
@@ -16,15 +16,14 @@
 ##
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
-##
-## This file written by Eric Blake <address@hidden>
 
-AUTOMAKE_OPTIONS = nostdinc
-AM_CPPFLAGS = -I$(top_srcdir)/lib -I../lib
-bin_PROGRAMS = m4
-m4_SOURCES = m4.h m4.c builtin.c debug.c eval.c format.c freeze.c input.c \
-macro.c output.c path.c symtab.c
-if STACKOVF
-m4_SOURCES += stackovf.c
-endif
-m4_LDADD = ../lib/libm4.a $(LIBM4_LIBDEPS) $(POW_LIB)
+BUILT_SOURCES =
+CLEANFILES =
+EXTRA_DIST =
+MOSTLYCLEANDIRS =
+MOSTLYCLEANFILES =
+SUFFIXES =
+
+noinst_LIBRARIES = libm4.a
+
+include gnulib.mk
diff --git a/m4/gnulib-cache.m4 b/m4/gnulib-cache.m4
index 7930fde..d38c7ee 100644
--- a/m4/gnulib-cache.m4
+++ b/m4/gnulib-cache.m4
@@ -15,7 +15,7 @@
 
 
 # Specification in the form of a command-line invocation:
-#   gnulib-tool --import --dir=. --local-dir=local --lib=libm4 
--source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests 
--aux-dir=build-aux --with-tests --no-libtool --macro-prefix=M4 announce-gen 
assert autobuild avltree-oset binary-io bitrotate clean-temp cloexec 
close-stream closein config-h dirname error execute fdl-1.3 fflush filenamecat 
flexmember fopen fopen-safer freadptr freadseek fseeko gendocs getopt-gnu 
git-version-gen gnu-web-doc-update gnumakefile gnupload gpl-3.0 hash intprops 
maintainer-makefile memchr2 memcmp2 memmem mkstemp obstack obstack-printf-posix 
pipe progname quote regex rename snprintf-posix stdbool stdint stdlib-safer 
strtod strtol unlocked-io update-copyright vasnprintf-posix verror version-etc 
version-etc-fsf wait-process xalloc xmemdup0 xprintf xvasprintf-posix
+#   gnulib-tool --import --dir=. --local-dir=local --lib=libm4 
--source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests 
--aux-dir=build-aux --with-tests --makefile-name=gnulib.mk --no-libtool 
--macro-prefix=M4 announce-gen assert autobuild avltree-oset binary-io 
bitrotate clean-temp cloexec close-stream closein config-h dirname error 
execute fdl-1.3 fflush filenamecat flexmember fopen fopen-safer freadptr 
freadseek fseeko gendocs getopt-gnu git-version-gen gnu-web-doc-update 
gnumakefile gnupload gpl-3.0 hash ignore-value intprops maintainer-makefile 
manywarnings memchr2 memcmp2 memmem mkstemp obstack obstack-printf-posix pipe 
progname quote regex rename snprintf-posix stdbool stdint stdlib-safer strtod 
strtol unlocked-io update-copyright vasnprintf-posix verror version-etc 
version-etc-fsf wait-process xalloc xmemdup0 xprintf xvasprintf-posix
 
 # Specification in the form of a few gnulib-tool.m4 macro invocations:
 gl_LOCAL_DIR([local])
@@ -51,8 +51,10 @@ gl_MODULES([
   gnupload
   gpl-3.0
   hash
+  ignore-value
   intprops
   maintainer-makefile
+  manywarnings
   memchr2
   memcmp2
   memmem
@@ -90,6 +92,6 @@ gl_DOC_BASE([doc])
 gl_TESTS_BASE([tests])
 gl_WITH_TESTS
 gl_LIB([libm4])
-gl_MAKEFILE_NAME([])
+gl_MAKEFILE_NAME([gnulib.mk])
 gl_MACRO_PREFIX([M4])
 gl_PO_DOMAIN([])
diff --git a/src/Makefile.am b/src/Makefile.am
index 7a0e1ac..7477a16 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -21,6 +21,7 @@
 
 AUTOMAKE_OPTIONS = nostdinc
 AM_CPPFLAGS = -I$(top_srcdir)/lib -I../lib
+AM_CFLAGS = $(WARN_CFLAGS) $(WERROR_CFLAGS)
 bin_PROGRAMS = m4
 m4_SOURCES = m4.h m4.c builtin.c debug.c eval.c format.c freeze.c input.c \
 macro.c output.c path.c symtab.c
diff --git a/src/builtin.c b/src/builtin.c
index 0badfd8..ea27f74 100644
--- a/src/builtin.c
+++ b/src/builtin.c
@@ -314,7 +314,7 @@ compile_pattern (const char *str, size_t len, struct 
re_pattern_buffer **buf,
        if (trace_file)
          {
            fputs ("cached:{", trace_file);
-           fwrite (str, 1, len, trace_file);
+           xfwrite (str, 1, len, trace_file);
            fputs ("}\n", trace_file);
          }
 #endif /* DEBUG_REGEX */
@@ -328,7 +328,7 @@ compile_pattern (const char *str, size_t len, struct 
re_pattern_buffer **buf,
   if (trace_file)
     {
       fputs ("compile:{", trace_file);
-      fwrite (str, 1, len, trace_file);
+      xfwrite (str, 1, len, trace_file);
       fputs ("}\n", trace_file);
     }
 #endif /* DEBUG_REGEX */
@@ -367,7 +367,7 @@ compile_pattern (const char *str, size_t len, struct 
re_pattern_buffer **buf,
       if (trace_file)
        {
          fputs ("flush:{", trace_file);
-         fwrite (victim->str, 1, victim->len, trace_file);
+         xfwrite (victim->str, 1, victim->len, trace_file);
          fputs ("}\n", trace_file);
        }
 #endif /* DEBUG_REGEX */
@@ -460,7 +460,7 @@ define_user_macro (const char *name, size_t name_len, const 
char *text,
   assert (text);
   if (len == SIZE_MAX)
     len = strlen (text);
-  defn = xmemdup (text, len);
+  defn = (char *) xmemdup (text, len);
   s = lookup_symbol (name, name_len, mode);
   if (SYMBOL_TYPE (s) == TOKEN_TEXT)
     free (SYMBOL_TEXT (s));
@@ -476,7 +476,7 @@ define_user_macro (const char *name, size_t name_len, const 
char *text,
       regoff_t offset = 0;
       struct re_registers *regs = &macro_sequence_regs;
 
-      while (offset < len
+      while (offset < (regoff_t) len
             && (offset = re_search (&macro_sequence_buf, defn, len, offset,
                                     len - offset, regs)) >= 0)
        {
@@ -555,12 +555,12 @@ builtin_init (void)
 bool
 bad_argc (const call_info *name, int argc, unsigned int min, unsigned int max)
 {
-  if (argc - 1 < min)
+  if (argc - 1U < min)
     {
       m4_warn (0, name, _("too few arguments: %d < %d"), argc - 1, min);
       return true;
     }
-  if (argc - 1 > max)
+  if (argc - 1U > max)
     m4_warn (0, name, _("extra arguments ignored: %d > %d"), argc - 1, max);
   return false;
 }
@@ -585,7 +585,7 @@ numeric_arg (const call_info *name, const char *arg, size_t 
len, int *valuep)
     {
       errno = 0;
       *valuep = strtol (arg, &endp, 10);
-      if (endp - arg != len)
+      if (endp - arg - len)
        {
          m4_warn (0, name, _("non-numeric argument %s"),
                   quotearg_style_mem (locale_quoting_style, arg, len));
@@ -723,13 +723,14 @@ define_macro (int argc, macro_arguments *argv, 
symbol_lookup mode)
 }
 
 static void
-m4_define (struct obstack *obs, int argc, macro_arguments *argv)
+m4_define (struct obstack *obs M4_GNUC_UNUSED, int argc, macro_arguments *argv)
 {
   define_macro (argc, argv, SYMBOL_INSERT);
 }
 
 static void
-m4_undefine (struct obstack *obs, int argc, macro_arguments *argv)
+m4_undefine (struct obstack *obs M4_GNUC_UNUSED, int argc,
+            macro_arguments *argv)
 {
   const call_info *me = arg_info (argv);
   int i;
@@ -746,13 +747,14 @@ m4_undefine (struct obstack *obs, int argc, 
macro_arguments *argv)
 }
 
 static void
-m4_pushdef (struct obstack *obs, int argc, macro_arguments *argv)
+m4_pushdef (struct obstack *obs M4_GNUC_UNUSED, int argc,
+           macro_arguments *argv)
 {
   define_macro (argc, argv, SYMBOL_PUSHDEF);
 }
 
 static void
-m4_popdef (struct obstack *obs, int argc, macro_arguments *argv)
+m4_popdef (struct obstack *obs M4_GNUC_UNUSED, int argc, macro_arguments *argv)
 {
   const call_info *me = arg_info (argv);
   int i;
@@ -923,8 +925,8 @@ m4_dumpdef (struct obstack *obs, int argc, macro_arguments 
*argv)
   for (; data.size > 0; --data.size, data.base++)
     {
       /* TODO - add debugmode(b) option to control quoting style?  */
-      fwrite (SYMBOL_NAME (data.base[0]), 1, SYMBOL_NAME_LEN (data.base[0]),
-             output);
+      xfwrite (SYMBOL_NAME (data.base[0]), 1, SYMBOL_NAME_LEN (data.base[0]),
+              output);
       fputc (':', output);
       fputc ('\t', output);
 
@@ -932,11 +934,11 @@ m4_dumpdef (struct obstack *obs, int argc, 
macro_arguments *argv)
        {
        case TOKEN_TEXT:
          if (debug_level & DEBUG_TRACE_QUOTE)
-           fwrite (curr_quote.str1, 1, curr_quote.len1, output);
-         fwrite (SYMBOL_TEXT (data.base[0]), 1,
-                 SYMBOL_TEXT_LEN (data.base[0]), output);
+           xfwrite (curr_quote.str1, 1, curr_quote.len1, output);
+         xfwrite (SYMBOL_TEXT (data.base[0]), 1,
+                  SYMBOL_TEXT_LEN (data.base[0]), output);
          if (debug_level & DEBUG_TRACE_QUOTE)
-           fwrite (curr_quote.str2, 1, curr_quote.len2, output);
+           xfwrite (curr_quote.str2, 1, curr_quote.len2, output);
          break;
 
        case TOKEN_FUNC:
@@ -1107,7 +1109,7 @@ m4_defn (struct obstack *obs, int argc, macro_arguments 
*argv)
 static int sysval;
 
 static void
-m4_syscmd (struct obstack *obs, int argc, macro_arguments *argv)
+m4_syscmd (struct obstack *obs M4_GNUC_UNUSED, int argc, macro_arguments *argv)
 {
   const call_info *me = arg_info (argv);
   const char *cmd = ARG (1);
@@ -1219,7 +1221,7 @@ m4_esyscmd (struct obstack *obs, int argc, 
macro_arguments *argv)
        }
       else
        {
-         size_t len = fread (obstack_next_free (obs), 1, avail, pin);
+         len = fread (obstack_next_free (obs), 1, avail, pin);
          if (len <= 0)
            break;
          obstack_blank_fast (obs, len);
@@ -1246,7 +1248,8 @@ m4_esyscmd (struct obstack *obs, int argc, 
macro_arguments *argv)
 }
 
 static void
-m4_sysval (struct obstack *obs, int argc, macro_arguments *argv)
+m4_sysval (struct obstack *obs, int argc M4_GNUC_UNUSED,
+          macro_arguments *argv M4_GNUC_UNUSED)
 {
   shipout_int (obs, sysval);
 }
@@ -1296,7 +1299,7 @@ m4_eval (struct obstack *obs, int argc, macro_arguments 
*argv)
          obstack_1grow (obs, '-');
          value = -value;
        }
-      if ((uint32_t) value < min)
+      if (value + 0U < min + 0U)
        {
          obstack_blank (obs, min - value);
          memset ((char *) obstack_next_free (obs) - (min - value), '0',
@@ -1315,7 +1318,7 @@ m4_eval (struct obstack *obs, int argc, macro_arguments 
*argv)
       s++;
     }
   len = strlen (s);
-  if (len < min)
+  if (len < min + 0UL)
     {
       min -= len;
       obstack_blank (obs, min);
@@ -1363,7 +1366,7 @@ m4_decr (struct obstack *obs, int argc, macro_arguments 
*argv)
 `-----------------------------------------------------------------------*/
 
 static void
-m4_divert (struct obstack *obs, int argc, macro_arguments *argv)
+m4_divert (struct obstack *obs M4_GNUC_UNUSED, int argc, macro_arguments *argv)
 {
   const call_info *me = arg_info (argv);
   int i = 0;
@@ -1395,7 +1398,8 @@ m4_divnum (struct obstack *obs, int argc, macro_arguments 
*argv)
 `-----------------------------------------------------------------------*/
 
 static void
-m4_undivert (struct obstack *obs, int argc, macro_arguments *argv)
+m4_undivert (struct obstack *obs M4_GNUC_UNUSED, int argc,
+            macro_arguments *argv)
 {
   const call_info *me = arg_info (argv);
   int i;
@@ -1411,7 +1415,7 @@ m4_undivert (struct obstack *obs, int argc, 
macro_arguments *argv)
        const char *str = ARG (i);
        size_t len = ARG_LEN (i);
        file = strtol (str, &endp, 10);
-       if (endp - str == len && !isspace (to_uchar (*str)))
+       if (endp - str + 0UL == len && !isspace (to_uchar (*str)))
          insert_diversion (file);
        else if (no_gnu_extensions)
          m4_warn (0, me, _("non-numeric argument %s"),
@@ -1446,7 +1450,7 @@ m4_undivert (struct obstack *obs, int argc, 
macro_arguments *argv)
 `------------------------------------------------------------------------*/
 
 static void
-m4_dnl (struct obstack *obs, int argc, macro_arguments *argv)
+m4_dnl (struct obstack *obs M4_GNUC_UNUSED, int argc, macro_arguments *argv)
 {
   const call_info *me = arg_info (argv);
 
@@ -1472,7 +1476,8 @@ m4_shift (struct obstack *obs, int argc, macro_arguments 
*argv)
 `--------------------------------------------------------------------------*/
 
 static void
-m4_changequote (struct obstack *obs, int argc, macro_arguments *argv)
+m4_changequote (struct obstack *obs M4_GNUC_UNUSED, int argc,
+               macro_arguments *argv)
 {
   bad_argc (arg_info (argv), argc, 0, 2);
 
@@ -1487,7 +1492,8 @@ m4_changequote (struct obstack *obs, int argc, 
macro_arguments *argv)
 `--------------------------------------------------------------------*/
 
 static void
-m4_changecom (struct obstack *obs, int argc, macro_arguments *argv)
+m4_changecom (struct obstack *obs M4_GNUC_UNUSED, int argc,
+             macro_arguments *argv)
 {
   bad_argc (arg_info (argv), argc, 0, 2);
 
@@ -1504,7 +1510,8 @@ m4_changecom (struct obstack *obs, int argc, 
macro_arguments *argv)
 `-----------------------------------------------------------------------*/
 
 static void
-m4_changeword (struct obstack *obs, int argc, macro_arguments *argv)
+m4_changeword (struct obstack *obs M4_GNUC_UNUSED, int argc,
+              macro_arguments *argv)
 {
   const call_info *me = arg_info (argv);
 
@@ -1559,7 +1566,8 @@ include (int argc, macro_arguments *argv, bool silent)
 `------------------------------------------------*/
 
 static void
-m4_include (struct obstack *obs, int argc, macro_arguments *argv)
+m4_include (struct obstack *obs M4_GNUC_UNUSED, int argc,
+           macro_arguments *argv)
 {
   include (argc, argv, false);
 }
@@ -1569,7 +1577,8 @@ m4_include (struct obstack *obs, int argc, 
macro_arguments *argv)
 `----------------------------------*/
 
 static void
-m4_sinclude (struct obstack *obs, int argc, macro_arguments *argv)
+m4_sinclude (struct obstack *obs M4_GNUC_UNUSED, int argc,
+            macro_arguments *argv)
 {
   include (argc, argv, true);
 }
@@ -1694,7 +1703,7 @@ m4_errprint (struct obstack *obs, int argc, 
macro_arguments *argv)
   len = obstack_object_size (obs);
   /* The close_stdin module makes it safe to skip checking the return
      value here.  */
-  fwrite (obstack_finish (obs), 1, len, stderr);
+  xfwrite (obstack_finish (obs), 1, len, stderr);
   fflush (stderr);
 }
 
@@ -1732,8 +1741,8 @@ m4___program__ (struct obstack *obs, int argc, 
macro_arguments *argv)
 | arguments are present.                                                  |
 `-------------------------------------------------------------------------*/
 
-static void
-m4_m4exit (struct obstack *obs, int argc, macro_arguments *argv)
+static void M4_GNUC_NORETURN
+m4_m4exit (struct obstack *obs M4_GNUC_UNUSED, int argc, macro_arguments *argv)
 {
   const call_info *me = arg_info (argv);
   int exit_code = EXIT_SUCCESS;
@@ -1766,7 +1775,7 @@ m4_m4exit (struct obstack *obs, int argc, macro_arguments 
*argv)
 `-----------------------------------------------------------------*/
 
 static void
-m4_m4wrap (struct obstack *obs, int argc, macro_arguments *argv)
+m4_m4wrap (struct obstack *obs M4_GNUC_UNUSED, int argc, macro_arguments *argv)
 {
   if (bad_argc (arg_info (argv), argc, 1, -1))
     return;
@@ -1822,7 +1831,8 @@ m4_traceon (struct obstack *obs, int argc, 
macro_arguments *argv)
 `------------------------------------------------------------------------*/
 
 static void
-m4_traceoff (struct obstack *obs, int argc, macro_arguments *argv)
+m4_traceoff (struct obstack *obs M4_GNUC_UNUSED, int argc,
+            macro_arguments *argv)
 {
   const call_info *me = arg_info (argv);
   symbol *s;
@@ -1851,7 +1861,8 @@ m4_traceoff (struct obstack *obs, int argc, 
macro_arguments *argv)
 `----------------------------------------------------------------------*/
 
 static void
-m4_debugmode (struct obstack *obs, int argc, macro_arguments *argv)
+m4_debugmode (struct obstack *obs M4_GNUC_UNUSED, int argc,
+             macro_arguments *argv)
 {
   const call_info *me = arg_info (argv);
   const char *str = ARG (1);
@@ -1872,7 +1883,8 @@ m4_debugmode (struct obstack *obs, int argc, 
macro_arguments *argv)
 `-------------------------------------------------------------------------*/
 
 static void
-m4_debugfile (struct obstack *obs, int argc, macro_arguments *argv)
+m4_debugfile (struct obstack *obs M4_GNUC_UNUSED, int argc,
+             macro_arguments *argv)
 {
   const call_info *me = arg_info (argv);
 
@@ -1945,7 +1957,7 @@ m4_index (struct obstack *obs, int argc, macro_arguments 
*argv)
       if (offset < 0)
        offset = 0;
     }
-  else if (haystack_len < offset)
+  else if (haystack_len < offset + 0UL)
     {
       shipout_int (obs, -1);
       return;
@@ -2233,6 +2245,7 @@ substitute (struct obstack *obs, const call_info *me, 
const char *victim,
            const char *repl, size_t repl_len, struct re_registers *regs)
 {
   int ch;
+  __re_size_t ind;
   while (1)
     {
       const char *backslash = (char *) memchr (repl, '\\', repl_len);
@@ -2270,8 +2283,8 @@ substitute (struct obstack *obs, const call_info *me, 
const char *victim,
 
        case '1': case '2': case '3': case '4': case '5': case '6':
        case '7': case '8': case '9':
-         ch -= '0';
-         if (!regs || regs->num_regs - 1 <= ch)
+         ind = ch -= '0';
+         if (!regs || regs->num_regs - 1 <= ind)
            m4_warn (0, me, _("sub-expression %d not present"), ch);
          else if (regs->end[ch] > 0)
            obstack_grow (obs, victim + regs->start[ch],
@@ -2350,11 +2363,11 @@ m4_regexp (struct obstack *obs, int argc, 
macro_arguments *argv)
   if (trace_file)
     {
       fputs ("r:{", trace_file);
-      fwrite (regexp, 1, ARG_LEN (2), trace_file);
+      xfwrite (regexp, 1, ARG_LEN (2), trace_file);
       if (argc > 3)
        {
          fputs ("}:{", trace_file);
-         fwrite (repl, 1, ARG_LEN (3), trace_file);
+         xfwrite (repl, 1, ARG_LEN (3), trace_file);
        }
       fputs ("}\n", trace_file);
     }
@@ -2432,9 +2445,9 @@ m4_patsubst (struct obstack *obs, int argc, 
macro_arguments *argv)
   if (trace_file)
     {
       fputs ("p:{", trace_file);
-      fwrite (regexp, 1, ARG_LEN (2), trace_file);
+      xfwrite (regexp, 1, ARG_LEN (2), trace_file);
       fputs ("}:{", trace_file);
-      fwrite (repl, 1, repl_len, trace_file);
+      xfwrite (repl, 1, repl_len, trace_file);
       fputs ("}\n", trace_file);
     }
 #endif /* DEBUG_REGEX */
@@ -2511,7 +2524,8 @@ m4_patsubst (struct obstack *obs, int argc, 
macro_arguments *argv)
 `--------------------------------------------------------------------*/
 
 void
-m4_placeholder (struct obstack *obs, int argc, macro_arguments *argv)
+m4_placeholder (struct obstack *obs M4_GNUC_UNUSED, int argc M4_GNUC_UNUSED,
+               macro_arguments *argv)
 {
   m4_warn (0, NULL, _("builtin %s requested by frozen file not found"),
           quotearg_style_mem (locale_quoting_style, ARG (0), ARG_LEN (0)));
diff --git a/src/debug.c b/src/debug.c
index 8ed2d0d..24ddcc3 100644
--- a/src/debug.c
+++ b/src/debug.c
@@ -320,7 +320,7 @@ trace_flush (unsigned int start)
   if (debug)
     {
       /* TODO - quote nonprintable characters if debug is tty?  */
-      fwrite (&base[start], 1, len - start, debug);
+      xfwrite (&base[start], 1, len - start, debug);
       fputc ('\n', debug);
     }
   obstack_blank (&trace, start - len);
diff --git a/src/format.c b/src/format.c
index dde3a19..6b62629 100644
--- a/src/format.c
+++ b/src/format.c
@@ -44,7 +44,7 @@ arg_int (const call_info *me, const char *str, size_t len)
     }
   errno = 0;
   value = strtol (str, &endp, 10);
-  if (endp - str != len)
+  if (endp - str - len)
     m4_warn (0, me, _("non-numeric argument %s"),
             quotearg_style_mem (locale_quoting_style, str, len));
   else if (isspace (to_uchar (*str)))
@@ -71,7 +71,7 @@ arg_long (const call_info *me, const char *str, size_t len)
     }
   errno = 0;
   value = strtol (str, &endp, 10);
-  if (endp - str != len)
+  if (endp - str - len)
     m4_warn (0, me, _("non-numeric argument %s"),
             quotearg_style_mem (locale_quoting_style, str, len));
   else if (isspace (to_uchar (*str)))
@@ -107,7 +107,7 @@ arg_double (const call_info *me, const char *str, size_t 
len)
     }
   errno = 0;
   value = strtod (str, &endp);
-  if (endp - str != len)
+  if (endp - str - len)
     m4_warn (0, me, _("non-numeric argument %s"),
             quotearg_style_mem (locale_quoting_style, str, len));
   else if (isspace (to_uchar (*str)))
diff --git a/src/freeze.c b/src/freeze.c
index 1502532..8e790c1 100644
--- a/src/freeze.c
+++ b/src/freeze.c
@@ -76,8 +76,8 @@ dump_symbol_CB (symbol *sym, void *f)
          xfprintf (file, "T%d,%d\n",
                    (int) SYMBOL_NAME_LEN (sym),
                    (int) SYMBOL_TEXT_LEN (sym));
-         fwrite (SYMBOL_NAME (sym), 1, SYMBOL_NAME_LEN (sym), file);
-         fwrite (SYMBOL_TEXT (sym), 1, SYMBOL_TEXT_LEN (sym), file);
+         xfwrite (SYMBOL_NAME (sym), 1, SYMBOL_NAME_LEN (sym), file);
+         xfwrite (SYMBOL_TEXT (sym), 1, SYMBOL_TEXT_LEN (sym), file);
          fputc ('\n', file);
          break;
 
@@ -91,7 +91,7 @@ dump_symbol_CB (symbol *sym, void *f)
          xfprintf (file, "F%d,%d\n",
                    (int) SYMBOL_NAME_LEN (sym),
                    (int) strlen (bp->name));
-         fwrite (SYMBOL_NAME (sym), 1, SYMBOL_NAME_LEN (sym), file);
+         xfwrite (SYMBOL_NAME (sym), 1, SYMBOL_NAME_LEN (sym), file);
          fputs (bp->name, file);
          fputc ('\n', file);
          break;
@@ -142,8 +142,8 @@ produce_frozen_state (const char *name)
     {
       xfprintf (file, "Q%d,%d\n", (int) curr_quote.len1,
                (int) curr_quote.len2);
-      fwrite (curr_quote.str1, 1, curr_quote.len1, file);
-      fwrite (curr_quote.str2, 1, curr_quote.len2, file);
+      xfwrite (curr_quote.str1, 1, curr_quote.len1, file);
+      xfwrite (curr_quote.str2, 1, curr_quote.len2, file);
       fputc ('\n', file);
     }
 
@@ -154,8 +154,8 @@ produce_frozen_state (const char *name)
     {
       xfprintf (file, "C%d,%d\n", (int) curr_comm.len1,
                (int) curr_comm.len2);
-      fwrite (curr_comm.str1, 1, curr_comm.len1, file);
-      fwrite (curr_comm.str2, 1, curr_comm.len2, file);
+      xfwrite (curr_comm.str1, 1, curr_comm.len1, file);
+      xfwrite (curr_comm.str2, 1, curr_comm.len2, file);
       fputc ('\n', file);
     }
 
@@ -225,12 +225,12 @@ reload_frozen_state (const char *name)
   do                                                           \
     {                                                          \
       unsigned int n = 0;                                      \
-      while (isdigit (character) && n <= INT_MAX / 10)         \
+      while (isdigit (character) && n <= INT_MAX / 10U)                \
        {                                                       \
          n = 10 * n + character - '0';                         \
          GET_CHARACTER;                                        \
        }                                                       \
-      if (((AllowNeg) ? INT_MIN : INT_MAX) < n                 \
+      if (((AllowNeg) ? INT_MIN : INT_MAX) + 0U < n            \
          || isdigit (character))                               \
        m4_error (EXIT_FAILURE, 0, NULL,                        \
                  _("integer overflow in frozen file"));        \
@@ -373,7 +373,7 @@ reload_frozen_state (const char *name)
 
              /* Enter a macro having a builtin function as a
                 definition.  No builtin contains NUL in the name.  */
-             if (strlen (string[1]) < number[1])
+             if (strlen (string[1]) < number[1] + 0UL)
                m4_error (EXIT_FAILURE, 0, NULL, _("\
 ill-formed frozen file, invalid builtin %s encountered"),
                          quotearg_style_mem (locale_quoting_style, string[1],
diff --git a/src/input.c b/src/input.c
index 129a5f2..b5153eb 100644
--- a/src/input.c
+++ b/src/input.c
@@ -152,7 +152,7 @@ static input_block *wsp;
 static input_block *next;
 
 /* Marker at the end of the input stack.  */
-static input_block input_eof = { NULL, INPUT_EOF, "", 0 };
+static input_block input_eof = { NULL, INPUT_EOF, "", 0, { { NULL, 0 } } };
 
 /* Flag for next_char () to increment current_line.  */
 static bool start_of_input_line;
@@ -1915,7 +1915,7 @@ next_token (token_data *td, int *line, struct obstack 
*obs, bool allow_argv,
          obstack_1grow (&token_stack, ch);
          if (re_match (&word_regexp, (char *) obstack_base (&token_stack),
                        obstack_object_size (&token_stack), 0, &regs)
-             != obstack_object_size (&token_stack))
+             != (regoff_t) obstack_object_size (&token_stack))
            {
              obstack_blank (&token_stack, -1);
              break;
diff --git a/src/m4.c b/src/m4.c
index 0caf868..f9ac386 100644
--- a/src/m4.c
+++ b/src/m4.c
@@ -30,8 +30,6 @@
 
 #define AUTHORS "Rene' Seindal", "Eric Blake"
 
-static void usage (int);
-
 /* Enable sync output for /lib/cpp (-s).  */
 int sync_output = 0;
 
@@ -87,7 +85,7 @@ typedef struct macro_definition macro_definition;
 | prepend 'warning: '.                                             |
 `------------------------------------------------------------------*/
 
-static void
+static void M4_GNUC_PRINTF (5, 0)
 m4_verror_at_line (bool warn, int status, int errnum, const call_info *caller,
                   const char *format, va_list args)
 {
@@ -194,7 +192,7 @@ stackovf_handler (void)
 | Print a usage message and exit with STATUS.  |
 `---------------------------------------------*/
 
-static void
+static void M4_GNUC_NORETURN
 usage (int status)
 {
   if (status != EXIT_SUCCESS)
@@ -395,7 +393,7 @@ FILE *trace_file;
 #endif /* DEBUG_REGEX */
 
 int
-main (int argc, char *const *argv, char *const *envp)
+main (int argc, char *const *argv, char *const *envp M4_GNUC_UNUSED)
 {
   macro_definition *head;      /* head of deferred argument list */
   macro_definition *tail;
@@ -627,7 +625,7 @@ main (int argc, char *const *argv, char *const *envp)
        case 'D':
          {
            const char *value = strchr (arg, '=');
-           size_t len = value ? value - arg : strlen (arg);
+           size_t len = value ? (size_t) (value - arg) : strlen (arg);
            define_user_macro (arg, len, value ? value + 1 : "",
                               value ? SIZE_MAX : 0, SYMBOL_INSERT);
          }
diff --git a/src/m4.h b/src/m4.h
index 17184b2..b0e717d 100644
--- a/src/m4.h
+++ b/src/m4.h
@@ -43,6 +43,7 @@
 #include "error.h"
 #include "exitfail.h"
 #include "filenamecat.h"
+#include "ignore-value.h"
 #include "intprops.h"
 #include "obstack.h"
 #include "quotearg.h"
@@ -123,6 +124,7 @@ typedef unsigned int bool_bitfield;
 #define M4_GNUC_UNUSED         M4_GNUC_ATTRIBUTE ((__unused__))
 #define M4_GNUC_PRINTF(fmt, arg)                       \
   M4_GNUC_ATTRIBUTE ((__format__ (__printf__, fmt, arg)))
+#define M4_GNUC_NORETURN       M4_GNUC_ATTRIBUTE ((__noreturn__))
 
 /* File: m4.c  --- global definitions.  */
 
@@ -594,3 +596,15 @@ static inline unsigned char to_uchar (char ch) { return 
ch; }
 
 /* Avoid negative logic when comparing two strings.  */
 #define STREQ(a, b) (strcmp (a, b) == 0)
+
+/* Wrap fwrite.  No need to worry about the return value, since we
+   faithfully check ferror later on.  */
+#if HAVE_INLINE
+static inline void
+xfwrite (const void *buf, size_t size, size_t n, FILE *file)
+{
+  ignore_value (fwrite (buf, size, n, file));
+}
+#else
+# define xfwrite(B, S, N, F) (ignore_value (fwrite (B, S, N, F)))
+#endif
diff --git a/src/macro.c b/src/macro.c
index ef9d920..403a90d 100644
--- a/src/macro.c
+++ b/src/macro.c
@@ -215,7 +215,8 @@ expand_input (void)
 #endif /* DEBUG_MACRO */
 
   TOKEN_DATA_TYPE (&empty_token) = TOKEN_TEXT;
-  TOKEN_DATA_TEXT (&empty_token) = "";
+  /* Cast away const; safe since empty_token will never modify contents.  */
+  TOKEN_DATA_TEXT (&empty_token) = (char *) "";
   TOKEN_DATA_LEN (&empty_token) = 0;
 #ifdef ENABLE_CHANGEWORD
   TOKEN_DATA_ORIG_TEXT (&empty_token) = "";
@@ -632,7 +633,7 @@ expand_macro (symbol *sym)
   call_info my_call_info;      /* Context of this macro.  */
 
   /* Obstack preparation.  */
-  if (level >= stacks_count)
+  if (level + 0UL >= stacks_count)
     {
       size_t old_count = stacks_count;
       stacks = (macro_arg_stacks *) x2nrealloc (stacks, &stacks_count,
@@ -729,7 +730,7 @@ expand_macro (symbol *sym)
 size_t
 adjust_refcount (int level, bool increase)
 {
-  assert (level >= 0 && level < stacks_count && stacks[level].args);
+  assert (level >= 0 && level + 0UL < stacks_count && stacks[level].args);
   assert (increase || stacks[level].refcount);
   if (increase)
     stacks[level].refcount++;
@@ -1527,7 +1528,7 @@ push_args (struct obstack *obs, macro_arguments *argv, 
bool skip, bool quote)
 void
 wrap_args (macro_arguments *argv)
 {
-  int i;
+  size_t i;
   struct obstack *obs;
   token_data *token;
   token_chain *chain;
diff --git a/src/output.c b/src/output.c
index e31f94b..07473ce 100644
--- a/src/output.c
+++ b/src/output.c
@@ -1016,7 +1016,8 @@ freeze_diversions (FILE *file)
                m4_error (EXIT_FAILURE, errno, NULL,
                          _("cannot stat diversion"));
              if (file_stat.st_size < 0
-                 || file_stat.st_size != (unsigned long int) file_stat.st_size)
+                 || (file_stat.st_size + 0UL
+                     != (unsigned long int) file_stat.st_size))
                m4_error (EXIT_FAILURE, 0, NULL, _("diversion too large"));
              xfprintf (file, "%c%d,%lu\n", 'D', diversion->divnum,
                        (unsigned long int) file_stat.st_size);
diff --git a/src/path.c b/src/path.c
index 0ed674c..39aefaf 100644
--- a/src/path.c
+++ b/src/path.c
@@ -108,7 +108,7 @@ add_include_directory (const char *dir)
 /* Attempt to open FILE; if it opens, verify that it is not a
    directory, and ensure it does not leak across execs.  */
 static FILE *
-m4_fopen (const char *file, const char *mode)
+m4_fopen (const char *file)
 {
   FILE *fp = fopen (file, "r");
   if (fp)
@@ -151,7 +151,7 @@ m4_path_search (const char *file, char **result)
     }
 
   /* Look in current working directory first.  */
-  fp = m4_fopen (file, "r");
+  fp = m4_fopen (file);
   if (fp != NULL)
     {
       if (result)
@@ -172,7 +172,7 @@ m4_path_search (const char *file, char **result)
       xfprintf (stderr, "m4_path_search (%s) -- trying %s\n", file, name);
 #endif
 
-      fp = m4_fopen (name, "r");
+      fp = m4_fopen (name);
       if (fp != NULL)
        {
          if (debug_level & DEBUG_TRACE_PATH)
diff --git a/src/stackovf.c b/src/stackovf.c
index 47164a8..bcb5a00 100644
--- a/src/stackovf.c
+++ b/src/stackovf.c
@@ -163,13 +163,13 @@ process_sigsegv (int signo, const char *p)
 
   if (p != PARAM_NOSTACKOVF)
     {
-      if ((long) sbrk (8192) == (long) -1)
+      if (sbrk (8192) == (void *) -1)
        {
 
          /* sbrk failed.  Assume the RLIMIT_VMEM prevents expansion even
             if the stack limit has not been reached.  */
 
-         write (2, "VMEM limit exceeded?\n", 21);
+         ignore_value (write (2, "VMEM limit exceeded?\n", 21));
          p = PARAM_STACKOVF;
        }
       if (diff >= -STACKOVF_DETECT && diff <= STACKOVF_DETECT)
@@ -194,10 +194,10 @@ process_sigsegv (int signo, const char *p)
       cp = "\
 Memory bounds violation detected (SIGSEGV).  Either a stack overflow\n\
 occurred, or there is a bug in ";
-      write (2, cp, strlen (cp));
-      write (2, arg0, strlen (arg0));
+      ignore_value (write (2, cp, strlen (cp)));
+      ignore_value (write (2, arg0, strlen (arg0)));
       cp = ".  Check for possible infinite recursion.\n";
-      write (2, cp, strlen (cp));
+      ignore_value (write (2, cp, strlen (cp)));
     }
 
   /* Return to re-execute the instruction which caused the trap with
@@ -211,7 +211,7 @@ occurred, or there is a bug in ";
 /* POSIX.  */
 
 static void
-sigsegv_handler (int signo, siginfo_t *ip, void *context)
+sigsegv_handler (int signo, siginfo_t *ip, void *context M4_GNUC_UNUSED)
 {
   process_sigsegv
     (signo, (ip != NULL
diff --git a/src/Makefile.am b/tests/Makefile.am
similarity index 63%
copy from src/Makefile.am
copy to tests/Makefile.am
index 7a0e1ac..2cdfaf0 100644
--- a/src/Makefile.am
+++ b/tests/Makefile.am
@@ -1,6 +1,6 @@
 ## Makefile.am - template for generating Makefile via Automake
 ##
-## Copyright (C) 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+## Copyright (C) 2009 Free Software Foundation, Inc.
 ##
 ## This file is part of GNU M4.
 ##
@@ -16,15 +16,5 @@
 ##
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
-##
-## This file written by Eric Blake <address@hidden>
 
-AUTOMAKE_OPTIONS = nostdinc
-AM_CPPFLAGS = -I$(top_srcdir)/lib -I../lib
-bin_PROGRAMS = m4
-m4_SOURCES = m4.h m4.c builtin.c debug.c eval.c format.c freeze.c input.c \
-macro.c output.c path.c symtab.c
-if STACKOVF
-m4_SOURCES += stackovf.c
-endif
-m4_LDADD = ../lib/libm4.a $(LIBM4_LIBDEPS) $(POW_LIB)
+include gnulib.mk


hooks/post-receive
-- 
GNU M4 source repository




reply via email to

[Prev in Thread] Current Thread [Next in Thread]