Reported by "Tom G. Christensen" <tgc@jupiterrise.com> in
<http://permalink.gmane.org/gmane.comp.encryption.gpg.gnutls.devel/3560>
+** Building with many warning flags now requires --enable-gcc-warnings.
+This avoids crying wolf for normal compiles.
+
** API and ABI modifications:
No changes since last version.
# along with this file; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-WFLAGS ?= WARN_CFLAGS=-Werror
+WFLAGS ?= --enable-gcc-warnings
ADDFLAGS ?=
-CFGFLAGS ?= --enable-gtk-doc $(ADDFLAGS)
+CFGFLAGS ?= --enable-gtk-doc $(ADDFLAGS) $(WFLAGS)
INDENT_SOURCES = `find . -name \*.c|grep -v -e ^./lgl -e ^./gl -e ^./src/cfg -e -gaa.c -e asn1_tab.c`
git commit -m "Sync with TP." $(PODIR)/LINGUAS $(PODIR)/*.po.in
bootstrap: autoreconf
- $(WFLAGS) ./configure $(CFGFLAGS)
+ ./configure $(CFGFLAGS)
glimport:
gnulib-tool --m4-base gl/m4 --import
gl_INIT
-# Add many warnings, except some...
-if test "$GCC" = "yes"; then
+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])
+
nw="$nw -Wsystem-headers" # Don't let system headers trigger warnings
nw="$nw -Wc++-compat" # We don't care about C++ compilers
nw="$nw -Wundef" # Warns on '#if GNULIB_FOO' etc in gnulib
nw="$nw -Wformat-nonliteral" # Incompatible with gettext _()
nw="$nw -Wunsafe-loop-optimizations"
nw="$nw -Wstrict-overflow"
+
gl_MANYWARN_ALL_GCC([ws])
gl_MANYWARN_COMPLEMENT(ws, [$ws], [$nw])
for w in $ws; do
gl_WARN_ADD([$w])
done
+
gl_WARN_ADD([-Wno-missing-field-initializers]) # We need this one
gl_WARN_ADD([-Wno-sign-compare]) # Too many warnings for now
gl_WARN_ADD([-Wno-pointer-sign]) # Too many warnings for now
fi
# Export things for */configure.ac.
+export WERROR_CFLAGS
export WARN_CFLAGS
export use_cxx
Host type: ${host}
Install prefix: ${prefix}
Compiler: ${CC}
- Warning flags: ${WARN_CFLAGS}
+ Warning flags: errors: ${WERROR_CFLAGS} warnings: ${WARN_CFLAGS}
Library types: Shared=${enable_shared}, Static=${enable_static}
Valgrind: ${VALGRIND}
Guile wrappers: $opt_guile_bindings
# along with this file; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-AM_CFLAGS = $(WARN_CFLAGS)
+AM_CFLAGS = $(WARN_CFLAGS) $(WERROR_CFLAGS)
AM_CPPFLAGS = \
-I$(top_srcdir)/lib/includes -I$(top_builddir)/lib/includes \
-I$(top_srcdir)/libextra/includes \
localedir = $(datadir)/locale
-AM_CFLAGS = $(WARN_CFLAGS)
+AM_CFLAGS = $(WARN_CFLAGS) $(WERROR_CFLAGS)
AM_CPPFLAGS = \
-DLOCALEDIR=\"$(localedir)\" \
-I$(srcdir)/gl \
# Finish things from ../configure.ac.
AC_SUBST([WARN_CFLAGS])
+AC_SUBST([WERROR_CFLAGS])
AC_PROG_CXX
AM_CONDITIONAL(ENABLE_CXX, test "$use_cxx" != "no")
# Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301, USA
-AM_CFLAGS = $(WARN_CFLAGS)
+AM_CFLAGS = $(WARN_CFLAGS) $(WERROR_CFLAGS)
AM_CPPFLAGS = \
-I$(srcdir)/../gl \
-I$(builddir)/../gl \
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
# USA
-AM_CFLAGS = $(WARN_CFLAGS)
+AM_CFLAGS = $(WARN_CFLAGS) $(WERROR_CFLAGS)
AM_CPPFLAGS = \
-I$(srcdir)/../gl \
-I$(builddir)/../gl \
ACLOCAL_AMFLAGS = -I m4 -I gl/m4 -I ../lib/m4
-AM_CFLAGS = $(WARN_CFLAGS)
+AM_CFLAGS = $(WARN_CFLAGS) $(WERROR_CFLAGS)
AM_CPPFLAGS = \
-I$(srcdir)/../lib/gl \
-I$(builddir)/../lib/gl \
# Finish things from ../configure.ac.
AC_SUBST([WARN_CFLAGS])
+AC_SUBST([WERROR_CFLAGS])
AC_CONFIG_FILES([
Makefile
SUBDIRS = cfg
-AM_CFLAGS = $(WARN_CFLAGS)
+AM_CFLAGS = $(WARN_CFLAGS) $(WERROR_CFLAGS)
AM_CPPFLAGS = \
-I$(srcdir)/../gl \
-I$(builddir)/../gl \
EXTRA_DIST = libgcrypt.supp hostname-check.README
-AM_CFLAGS = $(WARN_CFLAGS)
+AM_CFLAGS = $(WARN_CFLAGS) $(WERROR_CFLAGS)
AM_CPPFLAGS = \
-I$(top_srcdir)/gl \
-I$(top_builddir)/gl \