Mail archive
alpine-aports

[alpine-aports] [PATCH] main/gnats: fix build with gcc8 (-Werror too strict)

From: alpine-mips-patches <info_at_mobile-stream.com>
Date: Mon, 26 Nov 2018 22:05:43 +0000

gcc8 reports one meaningful -Wpointer-compare (mail.c) bug and
a pair of harmless -Wimplicit-fallthrough (misc.c, regex.c) cases.

The mail.c patch could be replaced with -Wno-error=pointer-compare
if the code behaviour change is too risky (upstream seems dead).
---
 main/gnats/APKBUILD         | 11 ++++++-----
 main/gnats/gnats-gcc8.patch | 31 +++++++++++++++++++++++++++++++
 2 files changed, 37 insertions(+), 5 deletions(-)
 create mode 100644 main/gnats/gnats-gcc8.patch
diff --git a/main/gnats/APKBUILD b/main/gnats/APKBUILD
index a0feb2d052..962db0e6eb 100644
--- a/main/gnats/APKBUILD
+++ b/main/gnats/APKBUILD
_at_@ -1,7 +1,7 @@
 # Maintainer: Natanael Copa <ncopa_at_alpinelinux.org>
 pkgname=gnats
 pkgver=4.2.0
-pkgrel=3
+pkgrel=4
 pkgdesc="The GNU Bug Tracking System"
 url="https://www.gnu.org/software/gnats/"
 arch="all"
_at_@ -9,7 +9,9 @@ license="GPL-3.0"
 depends="postfix"
 makedepends="texinfo"
 install=
-source="https://ftp.gnu.org/pub/gnu/$pkgname/$pkgname-$pkgver.tar.gz"
+source="https://ftp.gnu.org/pub/gnu/$pkgname/$pkgname-$pkgver.tar.gz
+	gnats-gcc8.patch
+	"
 subpackages="$pkgname-doc"
 pkgusers="gnats"
 pkggroups="gnats"
_at_@ -35,6 +37,5 @@ package() {
 	rm -f "$pkgdir"/gnats.el
 }
 
-md5sums="b2fb3bbaea6688b8341769569f4a6e70  gnats-4.2.0.tar.gz"
-sha256sums="54e3f4eb5e6ceaec3f9579332e5ff492ce743f763b9c9cdd7ad72fe9cc2b142d  gnats-4.2.0.tar.gz"
-sha512sums="650faa87206889912e27a27daba4c86292fac90250a88e7e6272cc8488fc19dfd6098bdd450553cd6c2c1d446072a8da9395f1ce7b1cd284596994ce53744152  gnats-4.2.0.tar.gz"
+sha512sums="650faa87206889912e27a27daba4c86292fac90250a88e7e6272cc8488fc19dfd6098bdd450553cd6c2c1d446072a8da9395f1ce7b1cd284596994ce53744152  gnats-4.2.0.tar.gz
+616882229b0b0bfb26ed23fcf63c8888c51575eb92b82c19fe9d25128e8f5a20e6b52ed80ecff2ec4405c1c37e24268bab7fa7c068d2df47641d8e5b06d2895a  gnats-gcc8.patch"
diff --git a/main/gnats/gnats-gcc8.patch b/main/gnats/gnats-gcc8.patch
new file mode 100644
index 0000000000..c832c72771
--- /dev/null
+++ b/main/gnats/gnats-gcc8.patch
_at_@ -0,0 +1,31 @@
+--- a/gnats/mail.c
++++ b/gnats/mail.c
+_at_@ -67,7 +67,7 @@
+   if (res != NULL)
+     {
+       if (res->admFields[ResponsibleAdmAlias] == NULL ||
+-	  res->admFields[ResponsibleAdmAlias] == '\0')
++	  *res->admFields[ResponsibleAdmAlias] == '\0')
+ 	{
+ 	  if (res->admFields[ResponsibleAdmAlias] != NULL)
+ 	    {
+--- a/gnats/misc.c
++++ b/gnats/misc.c
+_at_@ -108,6 +108,7 @@
+ 	      fprintf (gnats_logfile, "%s", buf);
+ 	      break;
+ 	    }
++	  /* fallthrough */
+ 	  /* No log file, log to stderr. */
+ 	case STDERR:
+ 	  fprintf (stderr, "%s", buf);
+--- a/gnats/regex.c
++++ b/gnats/regex.c
+_at_@ -2310,6 +2310,7 @@
+ 	  if ((syntax & RE_BK_PLUS_QM)
+ 	      || (syntax & RE_LIMITED_OPS))
+ 	    goto normal_char;
++	  /* fallthrough */
+ 	handle_plus:
+ 	case '*':
+ 	  /* If there is no previous pattern... */
-- 
2.19.1
---
Unsubscribe:  alpine-aports+unsubscribe_at_lists.alpinelinux.org
Help:         alpine-aports+help_at_lists.alpinelinux.org
---
Received on Mon Nov 26 2018 - 22:05:43 UTC