git: 9a10eff03e91 - main - misc/rump: fix or suppress clang 13 warnings
Dimitry Andric
dim at FreeBSD.org
Wed Sep 15 07:55:12 UTC 2021
The branch main has been updated by dim (src committer):
URL: https://cgit.FreeBSD.org/ports/commit/?id=9a10eff03e919e71578cdb66d588b756a0cd1bb6
commit 9a10eff03e919e71578cdb66d588b756a0cd1bb6
Author: Dimitry Andric <dim at FreeBSD.org>
AuthorDate: 2021-09-14 21:30:40 +0000
Commit: Dimitry Andric <dim at FreeBSD.org>
CommitDate: 2021-09-15 07:54:56 +0000
misc/rump: fix or suppress clang 13 warnings
Fix a null pointer subtraction bug reported by clang 13, and suppress
the new clang 13 -Wunused-but-set-variable warning, as it triggers quite
often in the NetBSD src tree.
PR: 258508
Approved by: vanilla (maintainer)
MFH: 2021Q3
---
misc/rump/Makefile | 10 +++++++---
.../patch-src_sys_crypto_nist__ctr__drbg_nist__ctr__drbg.c | 11 +++++++++++
2 files changed, 18 insertions(+), 3 deletions(-)
diff --git a/misc/rump/Makefile b/misc/rump/Makefile
index 800233ef0741..3753ec20b7f6 100644
--- a/misc/rump/Makefile
+++ b/misc/rump/Makefile
@@ -2,7 +2,7 @@
PORTNAME= rump
PORTVERSION= 20170822
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= misc
MAINTAINER= vanilla at FreeBSD.org
@@ -19,6 +19,7 @@ GH_PROJECT= buildrump.sh
GH_TAGNAME= b914579
GH_TUPLE= rumpkernel:src-netbsd:82f3a69:netbsd/src
USE_LDCONFIG= yes
+USES= compiler
.include <bsd.port.pre.mk>
@@ -28,10 +29,13 @@ PLIST_SUB+= X8664=""
PLIST_SUB+= X8664="@comment "
.endif
-CFLAGS+= -Wno-address-of-packed-member
+CWARNFLAGS+= -Wno-address-of-packed-member
+.if ${COMPILER_TYPE} == clang && ${COMPILER_VERSION} >= 130
+CWARNFLAGS+= -Wno-unused-but-set-variable
+.endif
do-build:
- cd ${WRKSRC}; ${SETENV} CC=${CC} AR=${AR} NM=${NM} OBJCOPY=${OBJCOPY} ./buildrump.sh -F CFLAGS="${CFLAGS}" -r fullbuild
+ cd ${WRKSRC}; ${SETENV} CC=${CC} AR=${AR} NM=${NM} OBJCOPY=${OBJCOPY} ./buildrump.sh -F CFLAGS="${CFLAGS}" -F CWARNFLAGS="${CWARNFLAGS}" -r fullbuild
do-install:
cd ${WRKSRC}/rump; ${PAX} -wr lib include ${STAGEDIR}${PREFIX}/
diff --git a/misc/rump/files/patch-src_sys_crypto_nist__ctr__drbg_nist__ctr__drbg.c b/misc/rump/files/patch-src_sys_crypto_nist__ctr__drbg_nist__ctr__drbg.c
new file mode 100644
index 000000000000..197b981cebeb
--- /dev/null
+++ b/misc/rump/files/patch-src_sys_crypto_nist__ctr__drbg_nist__ctr__drbg.c
@@ -0,0 +1,11 @@
+--- src/sys/crypto/nist_ctr_drbg/nist_ctr_drbg.c.orig 2016-08-02 11:51:10 UTC
++++ src/sys/crypto/nist_ctr_drbg/nist_ctr_drbg.c
+@@ -153,7 +153,7 @@ typedef struct {
+ static inline int
+ check_int_alignment(const void *p)
+ {
+- intptr_t ip = (const char *)p - (const char *)0;
++ intptr_t ip = (intptr_t)p;
+
+ if (ip & (sizeof(int) - 1))
+ return 0;
More information about the dev-commits-ports-all
mailing list