From: Akim Demaille Date: Wed, 9 Jan 2002 13:03:20 +0000 (+0000) Subject: * configure.in (WERROR_CFLAGS): Compute it. X-Git-Tag: before-m4-back-end~25 X-Git-Url: https://git.saurik.com/bison.git/commitdiff_plain/cae601224e356773fcd101dce0677f558e7c4357 * 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. --- diff --git a/ChangeLog b/ChangeLog index 4819fcff..1de0a987 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2002-01-09 Akim Demaille + + * 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. + 2002-01-08 Akim Demaille * src/getargs.c (AS_FILE_NAME): New. diff --git a/configure.in b/configure.in index 282356bf..be7bccda 100644 --- a/configure.in +++ b/configure.in @@ -51,6 +51,9 @@ AC_ARG_ENABLE(gcc-warnings, 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 @@ if test "${enableval}" = yes; then BISON_WARNING(-Wshadow) BISON_WARNING(-Wstrict-prototypes) BISON_WARNING(-Wwrite-strings) - BISON_WARNING(-Werror) fi # Checks for libraries. diff --git a/src/Makefile.am b/src/Makefile.am index 416e216c..04382ff7 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -22,7 +22,7 @@ DEFS = @DEFS@ \ -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/, diff --git a/src/files.c b/src/files.c index 5f94bd00..5240c410 100644 --- a/src/files.c +++ b/src/files.c @@ -253,27 +253,6 @@ tr (const char *in, char from, char to) 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 @@ filename_split (const char *filename, /* 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 @@ static void 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 @@ compute_base_names (void) 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. */ diff --git a/tests/atlocal.in b/tests/atlocal.in index 19c09262..a189b2d6 100644 --- a/tests/atlocal.in +++ b/tests/atlocal.in @@ -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@"