]> git.saurik.com Git - bison.git/commitdiff
# added --enable-gcc-warnings (not for user consumption).
authorJesse Thilo <jthilo@gnu.org>
Thu, 13 Apr 2000 18:03:25 +0000 (18:03 +0000)
committerJesse Thilo <jthilo@gnu.org>
Thu, 13 Apr 2000 18:03:25 +0000 (18:03 +0000)
configure.in
m4/warning.m4 [new file with mode: 0644]
src/Makefile.am

index de916f17b91ee9bc18e1d2b4f9af4ff83452c034..9e5da4c6ce278e9424e7f47f57a28a6e09351d6a 100644 (file)
@@ -16,6 +16,29 @@ AM_PROG_CC_STDC
 AC_PROG_INSTALL
 AC_PROG_RANLIB
 
 AC_PROG_INSTALL
 AC_PROG_RANLIB
 
+AC_ARG_ENABLE(gcc-warnings,
+[  --enable-gcc-warnings   turn on lots of GCC warnings (not recommended)],
+[case "${enableval}" in
+   yes|no) ;;
+   *)      AC_MSG_ERROR([bad value ${enableval} for gcc-warnings option]) ;;
+ esac
+],
+enableval=no
+)
+if test "${enableval}" = yes; then
+  BISON_WARNING(-Wall)
+  BISON_WARNING(-W)
+  BISON_WARNING(-Wbad-function-cast)
+  BISON_WARNING(-Wcast-align)
+  BISON_WARNING(-Wcast-qual)
+  BISON_WARNING(-Wmissing-declarations)
+  BISON_WARNING(-Wmissing-prototypes)
+  BISON_WARNING(-Wnested-externs)
+  BISON_WARNING(-Wno-char-subscripts)
+  BISON_WARNING(-Wstrict-prototypes)
+  BISON_WARNING(-Wwrite-strings)
+fi
+
 dnl Checks for libraries.
 
 dnl Checks for header files.
 dnl Checks for libraries.
 
 dnl Checks for header files.
diff --git a/m4/warning.m4 b/m4/warning.m4
new file mode 100644 (file)
index 0000000..d169d5a
--- /dev/null
@@ -0,0 +1,11 @@
+AC_DEFUN(BISON_WARNING,
+[AC_MSG_CHECKING(whether compiler accepts $1)
+AC_SUBST(WARNING_CFLAGS)
+ac_save_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS $1"
+AC_TRY_COMPILE(,
+[int x;],
+WARNING_CFLAGS="$WARNING_CFLAGS $1"
+AC_MSG_RESULT(yes),
+AC_MSG_RESULT(no))
+CFLAGS="$ac_save_CFLAGS"])
index fbf8aa5c55cc83e81d266a9c276c16e1b6fd02b6..42642db65f0137908d3810dde07719653720ad77 100644 (file)
@@ -5,7 +5,7 @@ DEFS = @DEFS@ \
   -DXPFILE=\"${datadir}/bison.simple\" \
   -DXPFILE1=\"${datadir}/bison.hairy\" \
   -DLOCALEDIR=\"${datadir}/locale\"
   -DXPFILE=\"${datadir}/bison.simple\" \
   -DXPFILE1=\"${datadir}/bison.hairy\" \
   -DLOCALEDIR=\"${datadir}/locale\"
-INCLUDES = -I../intl -I$(top_srcdir)/intl -I..
+INCLUDES = -I../intl -I$(top_srcdir)/intl -I.. $(WARNING_CFLAGS)
 LDADD = @INTLLIBS@ ../lib/libbison.a
 
 bin_PROGRAMS = bison
 LDADD = @INTLLIBS@ ../lib/libbison.a
 
 bin_PROGRAMS = bison