fix multiple issues. Revert one of the checks which breaks processing of PE binaries. Removed the 'Group' line, not needed with modern Fedora/RPM.
125 lines
3.8 KiB
Diff
125 lines
3.8 KiB
Diff
From c7a3146a6c9c62a4103ec341bceccdb3c96d4019 Mon Sep 17 00:00:00 2001
|
|
From: "Richard W.M. Jones" <rjones@redhat.com>
|
|
Date: Thu, 9 Mar 2017 12:34:22 +0000
|
|
Subject: [PATCH 06/26] configure: Enable many more warnings and add
|
|
--enable-werror.
|
|
|
|
Using the gnulib manywarnings module, enable many more GCC warnings.
|
|
|
|
Add the ./configure --enable-werror flag so that these warnings can be
|
|
turned into hard errors. Only upstream developers should use this, it
|
|
should not be used for downstream, distro and production builds, and
|
|
it must not be the default.
|
|
|
|
Signed-off-by: Richard W.M. Jones <rjones@redhat.com>
|
|
---
|
|
bootstrap | 1 +
|
|
common/Makefile.am | 2 +-
|
|
configure.ac | 46 ++++++++++++++++++++++++++++++++++++++++++++++
|
|
icotool/Makefile.am | 2 +-
|
|
wrestool/Makefile.am | 2 +-
|
|
5 files changed, 50 insertions(+), 3 deletions(-)
|
|
|
|
diff --git a/bootstrap b/bootstrap
|
|
index dce9299..d7e4609 100755
|
|
--- a/bootstrap
|
|
+++ b/bootstrap
|
|
@@ -29,6 +29,7 @@ if $gnulib_tool --version >/dev/null 2>&1; then
|
|
gettimeofday \
|
|
lstat \
|
|
malloc-gnu \
|
|
+ manywarnings \
|
|
memchr \
|
|
minmax \
|
|
progname \
|
|
diff --git a/common/Makefile.am b/common/Makefile.am
|
|
index 82c6ea1..a5bea98 100644
|
|
--- a/common/Makefile.am
|
|
+++ b/common/Makefile.am
|
|
@@ -27,4 +27,4 @@ AM_CPPFLAGS = \
|
|
-I$(top_builddir)/lib \
|
|
-I$(top_srcdir)/lib
|
|
|
|
-AM_CFLAGS = -Wall
|
|
+AM_CFLAGS = $(WARN_CFLAGS) $(WERROR_CFLAGS)
|
|
diff --git a/configure.ac b/configure.ac
|
|
index d4b74ae..760ac2c 100644
|
|
--- a/configure.ac
|
|
+++ b/configure.ac
|
|
@@ -23,6 +23,52 @@ m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
|
|
# Gnulib
|
|
gl_INIT
|
|
|
|
+# --enable-werror option for developers.
|
|
+AC_ARG_ENABLE([werror],
|
|
+ [AS_HELP_STRING([--enable-werror],
|
|
+ [turn GCC warnings into errors (for developers)])],
|
|
+ [case $enableval in
|
|
+ yes|no) ;;
|
|
+ *) AC_MSG_ERROR([bad value $enableval for werror option]) ;;
|
|
+ esac
|
|
+ gcc_werror=$enableval],
|
|
+ [gcc_werror=no]
|
|
+)
|
|
+if test "$gcc_werror" = "yes"; then
|
|
+ gl_WARN_ADD([-Werror], [WERROR_CFLAGS])
|
|
+ AC_SUBST([WERROR_CFLAGS])
|
|
+fi
|
|
+
|
|
+# $nw is the list of warnings we want to *disable*. The nw warnings
|
|
+# are complemented below.
|
|
+nw=
|
|
+nw="$nw -Wvla" # Allow variable length arrays.
|
|
+nw="$nw -Wsuggest-attribute=pure" # Don't suggest function attributes.
|
|
+nw="$nw -Wsuggest-attribute=const"
|
|
+nw="$nw -Wsuggest-attribute=format"
|
|
+nw="$nw -Wstrict-prototypes" # Don't require prototypes for every function.
|
|
+nw="$nw -Wmissing-prototypes"
|
|
+nw="$nw -Wmissing-declarations"
|
|
+nw="$nw -Wpacked" # Don't warn about packed structs.
|
|
+nw="$nw -Wswitch-default" # This warning is actively dangerous.
|
|
+nw="$nw -Wunused-macros" # Don't warn about defined but unused macros.
|
|
+
|
|
+gl_MANYWARN_ALL_GCC([ws])
|
|
+gl_MANYWARN_COMPLEMENT([ws], [$ws], $[nw])
|
|
+for w in $ws; do
|
|
+ gl_WARN_ADD([$w])
|
|
+done
|
|
+
|
|
+# Normally we disable warnings in $nw above. However $nw only
|
|
+# filters out exact matching warning strings from a list inside
|
|
+# gnulib (see m4/manywarnings.m4). So we need to explicitly list a
|
|
+# few disabled warnings below.
|
|
+
|
|
+# Allow unused function parameters.
|
|
+gl_WARN_ADD([-Wno-unused-parameter])
|
|
+
|
|
+AC_SUBST([WARN_CFLAGS])
|
|
+
|
|
# Gettext
|
|
AM_GNU_GETTEXT([external])
|
|
# AM_GNU_GETTEXT_VERSION(0.14.1)
|
|
diff --git a/icotool/Makefile.am b/icotool/Makefile.am
|
|
index bd27fc8..8c42c9e 100644
|
|
--- a/icotool/Makefile.am
|
|
+++ b/icotool/Makefile.am
|
|
@@ -28,4 +28,4 @@ AM_CPPFLAGS = \
|
|
-I$(top_srcdir)/lib \
|
|
-I$(top_srcdir)
|
|
|
|
-AM_CFLAGS = -Wall
|
|
+AM_CFLAGS = $(WARN_CFLAGS) $(WERROR_CFLAGS)
|
|
diff --git a/wrestool/Makefile.am b/wrestool/Makefile.am
|
|
index e18b9c2..3b5f3d4 100644
|
|
--- a/wrestool/Makefile.am
|
|
+++ b/wrestool/Makefile.am
|
|
@@ -27,4 +27,4 @@ AM_CPPFLAGS = \
|
|
-I$(top_srcdir) \
|
|
-I$(srcdir)/../icotool
|
|
|
|
-AM_CFLAGS = -Wall
|
|
+AM_CFLAGS = $(WARN_CFLAGS) $(WERROR_CFLAGS)
|
|
--
|
|
2.10.2
|
|
|