public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: mail-filter/mailfilter/files/, mail-filter/mailfilter/
Date: Sat, 17 Sep 2022 18:24:24 +0000 (UTC)	[thread overview]
Message-ID: <1663439018.88b87a76b60d50f6bd753ed5825e140ddd4bab20.sam@gentoo> (raw)

commit:     88b87a76b60d50f6bd753ed5825e140ddd4bab20
Author:     Holger Hoffstätte <holger <AT> applied-asynchrony <DOT> com>
AuthorDate: Sat Sep 17 09:00:19 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Sep 17 18:23:38 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=88b87a76

mail-filter/mailfilter: fix build with -Werror=strict-prototypes (Clang 15+)

Also fix configure bashisms as reported in:
https://github.com/gentoo/gentoo/pull/27134

Closes: https://bugs.gentoo.org/870625
Signed-off-by: Holger Hoffstätte <holger <AT> applied-asynchrony.com>
Closes: https://github.com/gentoo/gentoo/pull/27301
Signed-off-by: Sam James <sam <AT> gentoo.org>

 mail-filter/mailfilter/files/0.8.9-bashisms.patch  |  26 ++++
 .../mailfilter/files/0.8.9-prototypes.patch        | 132 +++++++++++++++++++++
 mail-filter/mailfilter/mailfilter-0.8.9.ebuild     |   5 +
 3 files changed, 163 insertions(+)

diff --git a/mail-filter/mailfilter/files/0.8.9-bashisms.patch b/mail-filter/mailfilter/files/0.8.9-bashisms.patch
new file mode 100644
index 000000000000..d3fcecb7b5f0
--- /dev/null
+++ b/mail-filter/mailfilter/files/0.8.9-bashisms.patch
@@ -0,0 +1,26 @@
+
+Fix configure bashisms with dash as /bin/sh as reported in
+https://github.com/gentoo/gentoo/pull/27134
+
+Signed-off-by: Holger Hoffstätte <holger@applied-asynchrony.com>
+
+--- mailfilter-0.8.9/configure	2022-09-04 12:23:29.000000000 +0200
++++ mailfilter-0.8.9-dash/configure	2022-09-17 19:12:32.174505949 +0200
+@@ -5322,7 +5322,7 @@ fi
+ done
+ test -n "$YACC" || YACC="yacc"
+ 
+-if test x"$YACC" == x"yacc"
++if test x"$YACC" = x"yacc"
+ then :
+   as_fn_error $? "Please install bison or byacc before configuring." "$LINENO" 5
+ fi
+@@ -5545,7 +5545,7 @@ fi
+ rm -f conftest.l $LEX_OUTPUT_ROOT.c
+ 
+ fi
+-if test x"$LEX" == x":"
++if test x"$LEX" = x":"
+ then :
+   as_fn_error $? "Please install flex before configuring." "$LINENO" 5
+ fi

diff --git a/mail-filter/mailfilter/files/0.8.9-prototypes.patch b/mail-filter/mailfilter/files/0.8.9-prototypes.patch
new file mode 100644
index 000000000000..22cb739464af
--- /dev/null
+++ b/mail-filter/mailfilter/files/0.8.9-prototypes.patch
@@ -0,0 +1,132 @@
+
+Patch from: https://github.com/nondeterministic/mailfilter/pull/7
+Bug: https://bugs.gentoo.org/870625
+
+From c8ce051933c29561bdc57de782d0445f1513100d Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Holger=20Hoffst=C3=A4tte?= <holger@applied-asynchrony.com>
+Date: Wed, 14 Sep 2022 18:49:20 +0200
+Subject: [PATCH] Fix warnings about incorrect prototypes & use standard memcpy/memset
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Clang-15 rightfully complains about function definitions without proper
+prototypes. Also replace handrolled memcpy/memset with standard
+C library calls.
+
+Signed-off-by: Holger Hoffstätte <holger@applied-asynchrony.com>
+---
+ src/md5c.c | 47 +++++++++++------------------------------------
+ 1 file changed, 11 insertions(+), 36 deletions(-)
+
+diff --git a/src/md5c.c b/src/md5c.c
+index 2c2c564..ae5ec8d 100644
+--- a/src/md5c.c
++++ b/src/md5c.c
+@@ -24,6 +24,7 @@ documentation and/or software.
+  */
+ 
+ #include "md5.h"
++#include <string.h>
+ 
+ /* Constants for MD5Transform routine.
+  */
+@@ -94,8 +95,7 @@ Rotation is separate from addition to prevent recomputation.
+ 
+ /* MD5 initialization. Begins an MD5 operation, writing a new context.
+  */
+-void MD5Init (context)
+-MD5_CTX *context;                                        /* context */
++void MD5Init (MD5_CTX *context)
+ {
+   context->count[0] = context->count[1] = 0;
+   /* Load magic initialization constants.
+@@ -110,10 +110,7 @@ MD5_CTX *context;                                        /* context */
+   operation, processing another message block, and updating the
+   context.
+  */
+-void MD5Update (context, input, inputLen)
+-MD5_CTX *context;                                        /* context */
+-unsigned char *input;                                /* input block */
+-unsigned int inputLen;                     /* length of input block */
++void MD5Update (MD5_CTX *context, unsigned char *input, unsigned int inputLen)
+ {
+   unsigned int i, index, partLen;
+ 
+@@ -152,9 +149,7 @@ unsigned int inputLen;                     /* length of input block */
+ /* MD5 finalization. Ends an MD5 message-digest operation, writing the
+   the message digest and zeroizing the context.
+  */
+-void MD5Final (digest, context)
+-unsigned char digest[16];                         /* message digest */
+-MD5_CTX *context;                                       /* context */
++void MD5Final (unsigned char digest[16], MD5_CTX *context)
+ {
+   unsigned char bits[8];
+   unsigned int index, padLen;
+@@ -180,9 +175,7 @@ MD5_CTX *context;                                       /* context */
+ 
+ /* MD5 basic transformation. Transforms state based on block.
+  */
+-static void MD5Transform (state, block)
+-uint32_t state[4];
+-unsigned char block[64];
++static void MD5Transform (uint32_t state[4], unsigned char block[64])
+ {
+   uint32_t a = state[0], b = state[1], c = state[2], d = state[3], x[16];
+ 
+@@ -272,10 +265,7 @@ unsigned char block[64];
+ /* Encodes input (uint32_t) into output (unsigned char). Assumes len is
+   a multiple of 4.
+  */
+-static void Encode (output, input, len)
+-unsigned char *output;
+-uint32_t *input;
+-unsigned int len;
++static void Encode (unsigned char *output, uint32_t *input, unsigned int len)
+ {
+   unsigned int i, j;
+ 
+@@ -290,10 +280,7 @@ unsigned int len;
+ /* Decodes input (unsigned char) into output (uint32_t). Assumes len is
+   a multiple of 4.
+  */
+-static void Decode (output, input, len)
+-uint32_t *output;
+-unsigned char *input;
+-unsigned int len;
++static void Decode (uint32_t *output, unsigned char *input, unsigned int len)
+ {
+   unsigned int i, j;
+ 
+@@ -305,26 +292,14 @@ unsigned int len;
+ /* Note: Replace "for loop" with standard memcpy if possible.
+  */
+ 
+-static void MD5_memcpy (output, input, len)
+-POINTER output;
+-POINTER input;
+-unsigned int len;
++static void MD5_memcpy (POINTER output, POINTER input, unsigned int len)
+ {
+-  unsigned int i;
+-
+-  for (i = 0; i < len; i++)
+-  output[i] = input[i];
++  memcpy(output, input, len);
+ }
+ 
+ /* Note: Replace "for loop" with standard memset if possible.
+  */
+-static void MD5_memset (output, value, len)
+-POINTER output;
+-int value;
+-unsigned int len;
++static void MD5_memset (POINTER output, int value, unsigned int len)
+ {
+-  unsigned int i;
+-
+-  for (i = 0; i < len; i++)
+- ((char *)output)[i] = (char)value;
++  memset(output, value, len);
+ }

diff --git a/mail-filter/mailfilter/mailfilter-0.8.9.ebuild b/mail-filter/mailfilter/mailfilter-0.8.9.ebuild
index 15aa7763546b..9601b73d633a 100644
--- a/mail-filter/mailfilter/mailfilter-0.8.9.ebuild
+++ b/mail-filter/mailfilter/mailfilter-0.8.9.ebuild
@@ -12,6 +12,11 @@ SLOT="0"
 KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~sparc ~x86"
 IUSE="+ssl"
 
+PATCHES=(
+	"${FILESDIR}"/${PV}-bashisms.patch
+	"${FILESDIR}"/${PV}-prototypes.patch
+)
+
 DEPEND="sys-devel/flex
 	ssl? ( dev-libs/openssl:= )"
 RDEPEND="ssl? ( dev-libs/openssl:= )"


             reply	other threads:[~2022-09-17 18:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-17 18:24 Sam James [this message]
  -- strict thread matches above, loose matches on Subject: below --
2022-12-25 19:03 [gentoo-commits] repo/gentoo:master commit in: mail-filter/mailfilter/files/, mail-filter/mailfilter/ Andreas Sturmlechner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1663439018.88b87a76b60d50f6bd753ed5825e140ddd4bab20.sam@gentoo \
    --to=sam@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox