+2002-01-09 Akim Demaille <akim@epita.fr>
+
+ * 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 <akim@epita.fr>
* src/getargs.c (AS_FILE_NAME): New.
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)
BISON_WARNING(-Wshadow)
BISON_WARNING(-Wstrict-prototypes)
BISON_WARNING(-Wwrite-strings)
- BISON_WARNING(-Werror)
fi
# Checks for libraries.
-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/,
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)
/* 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");
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'.
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. */
# @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@"