From 228ae2618cfeb84b8d4b189cc428fc55fac462e8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Niels=20M=C3=B6ller?= <nisse@lysator.liu.se>
Date: Mon, 27 Apr 2020 21:50:55 +0200
Subject: [PATCH] Tweak gcc command like flags

---
 ChangeLog    |  5 +++++
 configure.ac | 13 +------------
 2 files changed, 6 insertions(+), 12 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index ad9f52c1..a2b324df 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2020-04-27  Niels Möller  <nisse@lysator.liu.se>
 
+	* configure.ac: Tweak gcc command line options. Delete checks for
+	older gcc versions. Add -Wno-sign-compare, since warnings for
+	signed/unsigned comparisons adds a lot of noise, in particular
+	when building mini-gmp.
+
 	* mini-gmp.c: Updated mini-gmp from the gmp repository, latest
 	change from 2020-04-20.
 	* mini-gmp.h: Likewise.
diff --git a/configure.ac b/configure.ac
index dd7d6605..90ea1ea8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1006,18 +1006,7 @@ AC_SUBST(BENCH_LIBS)
 
 # Set these flags *last*, or else the test programs won't compile
 if test x$GCC = xyes ; then
-  # Using -ggdb3 makes (some versions of) Redhat's gcc-2.96 dump core
-  if $CC --version | grep '^2\.96$' 1>/dev/null 2>&1; then
-    true
-  else
-    CFLAGS="$CFLAGS -ggdb3"
-  fi
-  # FIXME: It would be better to actually test if this option works and/or is needed.
-  # Or perhaps use -funsigned-char.
-  if $CC --version | grep 'gcc.* 4\.' 1>/dev/null 2>&1; then
-    CFLAGS="$CFLAGS -Wno-pointer-sign"
-  fi
-  CFLAGS="$CFLAGS -Wall -W \
+  CFLAGS="$CFLAGS -ggdb3 -Wall -W -Wno-sign-compare \
   -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes \
   -Wpointer-arith -Wbad-function-cast -Wnested-externs"
 
-- 
GitLab