bison-patches
[Top][All Lists]
Advanced

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

01-fyi-warnings.patch


From: Akim Demaille
Subject: 01-fyi-warnings.patch
Date: Wed, 09 Jan 2002 14:03:44 +0100

Index: ChangeLog
from  Akim Demaille  <address@hidden>

        * configure.in (WERROR_CFLAGS): Compute it.
        * src/Makefile.am (CFLAGS): Pass it.
        * tests/atlocal.in (CFLAGS): Idem.
        * src/files.c: Fix a few warnings.
        (get_extension_index): Remove, unused.

Index: configure.in
--- configure.in Mon, 07 Jan 2002 21:20:16 +0100 akim
+++ configure.in Tue, 08 Jan 2002 19:01:22 +0100 akim
@@ -51,6 +51,9 @@
  esac],
               [enableval=no])
 if test "${enableval}" = yes; then
+  BISON_WARNING(-Werror)
+  AC_SUBST([WERROR_CFLAGS], [$WARNING_CFLAGS])
+  WARNING_CFLAGS=
   BISON_WARNING(-Wall)
   BISON_WARNING(-W)
   BISON_WARNING(-Wbad-function-cast)
@@ -63,7 +66,6 @@
   BISON_WARNING(-Wshadow)
   BISON_WARNING(-Wstrict-prototypes)
   BISON_WARNING(-Wwrite-strings)
-  BISON_WARNING(-Werror)
 fi

 # Checks for libraries.
Index: src/Makefile.am
--- src/Makefile.am Sat, 05 Jan 2002 14:34:02 +0100 akim
+++ src/Makefile.am Tue, 08 Jan 2002 19:01:38 +0100 akim
@@ -22,7 +22,7 @@
   -DBISON_HAIRY=\"$(pkgdatadir)/bison.hairy\" \
   -DLOCALEDIR=\"$(datadir)/locale\"

-CFLAGS = @CFLAGS@ $(WARNING_CFLAGS)
+CFLAGS = @CFLAGS@ $(WARNING_CFLAGS) $(WERROR_CFLAGS)
 YFLAGS = "-dv"

 # libintl.h in is build/intl, intl/libgettext.h in src/,
Index: src/files.c
--- src/files.c Tue, 08 Jan 2002 18:58:09 +0100 akim
+++ src/files.c Tue, 08 Jan 2002 19:07:36 +0100 akim
@@ -253,27 +253,6 @@
   return (temp);
 }

-/* Gets the extension index in FILENAME. Returns 0 if fails to
-   find an extension.  */
-static int
-get_extension_index (const char *filename)
-{
-  int len;
-
-  len = strlen (filename);
-
-  if (filename[len-- - 1] == '.')
-    return (0);
-
-  while ((len > 0) && (filename[len - 1] != '.'))
-    if (filename[len - 1] == '/')
-      return (0);
-    else
-      len--;
-
-  return (len - 1);
-}
-
 /* Computes extensions from the grammar file extension. */
 static void
 compute_exts_from_gf (const char *ext)
@@ -338,7 +317,7 @@
   /* If there is an exentension, check if there is a `.tab' part right
      before.  */
   if (*ext
-      && (*ext - *base) > strlen (".tab")
+      && (*ext - *base) > (int) strlen (".tab")
       && (!strncmp (*ext - strlen (".tab"), ".tab", strlen (".tab"))
          || !strncmp (*ext - strlen ("_tab"), "_tab", strlen ("_tab"))))
     *tab = *ext - strlen (".tab");
@@ -351,9 +330,6 @@
 compute_base_names (void)
 {
   const char *base, *tab, *ext;
-  size_t base_length;
-  size_t short_base_length;
-  size_t ext_index;

   /* If --output=foo.c was specified (SPEC_OUTFILE == foo.c),
      BASE_NAME and SHORT_BASE_NAME are `foo'.
@@ -365,7 +341,6 @@
      files, remove the ".c" or ".tab.c" suffix.  */
   if (spec_outfile)
     {
-      const char *cp;
       filename_split (spec_outfile, &base, &tab, &ext);

       /* The full base name goes up the EXT, excluding it. */
Index: tests/atlocal.in
--- tests/atlocal.in Sat, 05 Jan 2002 14:26:46 +0100 akim
+++ tests/atlocal.in Tue, 08 Jan 2002 19:02:02 +0100 akim
@@ -1,10 +1,10 @@
 # @configure_input@                                    -*- shell-script -*-
 # Configurable variable values for Bison test suite.
-# Copyright 2000, 2001 Free Software Foundation, Inc.
+# Copyright 2000, 2001, 2002 Free Software Foundation, Inc.

 # We need a C compiler.
 CC='@CC@'
-CFLAGS='@CFLAGS@ @WARNING_CFLAGS@'
+CFLAGS='@CFLAGS@ @WARNING_CFLAGS@ @WERROR_CFLAGS@'

 # We need `config.h'.
 CPPFLAGS="-I$abs_top_builddir @CPPFLAGS@"



reply via email to

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