From nobody Mon Aug 21 17:13:21 2023 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4RTzZn4X2gz4r2cd; Mon, 21 Aug 2023 17:13:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RTzZn3Xlkz4Wpn; Mon, 21 Aug 2023 17:13:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1692638001; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pURobE/ux0qQizuk84mRFBzqStfYpqqYZsxdDviZ21U=; b=CBhretlk6ZgQAnKwsykfecVeKxciqvgQ70PVPgsKeQ/uOrhN6xa/Vb2foRCRp0VU9nWhq3 CG4DL8mFTHxLdWY3gNKKo6UkOkcgOpqJT2oXrWvj2yTnDjlSvia02aSOl0ICnrvCLuCLCN JBP7W4Ppa/9+Joj9qNlLIJbuKbfy5BwM4rM/PB4InXTpi5KOjN+sk9+b3lxI1+LzAV0bQf 9IvSw0olZLEhZJE90tfqMduAZ/Boo51++Q1tWe2C1F9h6Tc2FxYaDEPgxnXtWZGQAwlAEv SlsU6ra6r/095OA47vOXZBC6gnOUgHMmFVY2leMud32PVINi5pJ0iEtTzv1DTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1692638001; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pURobE/ux0qQizuk84mRFBzqStfYpqqYZsxdDviZ21U=; b=IwfZ8HwTYgaT2QGxKC8/kA3W6fiRWZDQu4zYWBNG5rdplYrs3ZZ7jgN2bgDFhea6Z/v1dv htYjTAYh3annMX7itXJsGdNZE4WO3XTP3wlusf10vBSgQoO0GdmBUXG4jSLLBdpoJm5199 kY0HH/rwaWzn7pUww5G17els6B+mlO1IlDBeuXg61g1myHAaIAqxzxLuP8GbDhKTgrTLmJ 3PMNpWeeZ59n9RLJDbyzHxkbBKRfyjz3ylKpzTvpT/I7x/+DHbLuFiVmyBJhU1oT0f/5VM S6I2RGWuQezdsfxuNncI+S3KFEQ+2Mrwx2bhIEN2Fzfl0Amy9g/r4byf4sgNnQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1692638001; a=rsa-sha256; cv=none; b=eUeVZgPd4GG233JcS+HoBi7U3aupYed65gTXaa6wKvq8rR/w4W9/0/oVKf6RprsUm/lCZp BF0ftUzDG7s9tkdf4dZRcaZBexEWBVBRTEQiuLU8zyPy1X7VAgKKzYW3jMKxE0eTZyGYq5 VL/busY5Qr8x/m27HCUecanE5cTlrkHrHcCRujuARRLV/T38guP5uvaipfSXO8EPrasAW0 z8KBrcybthDqCwoOHEYjiRBT5SgjoBrGLmoMbNPrM7O09htb9zg/uPK+hCqI2CsESRnaPD xMcxO5KNGTiUnud4g36Dh5pYWK9rnj5RXVljwLzNYH0fPlJiJ0Z0l5SUNlzGLA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4RTzZn2QB8zTtr; Mon, 21 Aug 2023 17:13:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 37LHDL9M098281; Mon, 21 Aug 2023 17:13:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 37LHDL39098278; Mon, 21 Aug 2023 17:13:21 GMT (envelope-from git) Date: Mon, 21 Aug 2023 17:13:21 GMT Message-Id: <202308211713.37LHDL39098278@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Po-Chuan Hsieh Subject: git: 29873d969e02 - main - net/xprobe: Fix build with Clang 16 and remove the workaround List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: sunpoet X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 29873d969e02af4315ba32ac52ae43c9d6597040 Auto-Submitted: auto-generated The branch main has been updated by sunpoet: URL: https://cgit.FreeBSD.org/ports/commit/?id=29873d969e02af4315ba32ac52ae43c9d6597040 commit 29873d969e02af4315ba32ac52ae43c9d6597040 Author: Po-Chuan Hsieh AuthorDate: 2023-08-21 17:03:00 +0000 Commit: Po-Chuan Hsieh CommitDate: 2023-08-21 17:03:00 +0000 net/xprobe: Fix build with Clang 16 and remove the workaround random_shuffle has bee deprecated in C++14 and removed since C++17. Use shuffle instead. target.cc:373:3: error: use of undeclared identifier 'random_shuffle' random_shuffle(ports.begin(), ports.end()); ^ 5 warnings and 1 error generated. Tested on: 14.0-CURRENT (1400093) --- net/xprobe/Makefile | 9 --------- net/xprobe/files/patch-src-target.cc | 29 +++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 9 deletions(-) diff --git a/net/xprobe/Makefile b/net/xprobe/Makefile index 8c4f775f0f1e..dbc8e5015808 100644 --- a/net/xprobe/Makefile +++ b/net/xprobe/Makefile @@ -14,15 +14,6 @@ LICENSE_FILE= ${WRKSRC}/COPYING CONFIGURE_ENV= INSTALL=${INSTALL} GNU_CONFIGURE= yes -.include - -.if ${OPSYS} == FreeBSD && ( ${OSVERSION} >= 1400091 || ( ${OSVERSION} >= 1302505 && ${OSVERSION} < 1400000 )) -USES+= llvm:max=15 -CC= clang${LLVM_VERSION} -CPP= clang-cpp${LLVM_VERSION} -CXX= clang++${LLVM_VERSION} -.endif - post-patch: @${REINPLACE_CMD} -e 's|-DBROKEN_BSD||' ${WRKSRC}/libs-external/USI++/src/configure diff --git a/net/xprobe/files/patch-src-target.cc b/net/xprobe/files/patch-src-target.cc new file mode 100644 index 000000000000..21f32bb807d4 --- /dev/null +++ b/net/xprobe/files/patch-src-target.cc @@ -0,0 +1,29 @@ +--- src/target.cc.orig 2005-07-27 08:38:17 UTC ++++ src/target.cc +@@ -28,6 +28,8 @@ + #include "os_matrix.h" + #include "xplib/xplib.h" + #include "log.h" ++#include ++#include + + extern Interface *ui; + extern Xprobe_Module_Hdlr *xmh; +@@ -363,6 +365,8 @@ void Port_Range::set_range(u_short a, u_short b) { + + int Port_Range::get_next(u_short *port) { + int k, sz=size(); ++ std::random_device rd; ++ std::mt19937 g(rd()); + + if (curr+low > high) + return 1; +@@ -370,7 +373,7 @@ int Port_Range::get_next(u_short *port) { + // initialize + for (k=0; k < sz; k++) + ports.push_back(low + k); +- random_shuffle(ports.begin(), ports.end()); ++ std::shuffle(ports.begin(), ports.end(), g); + *port = ports[curr++]; + } else + *port = ports[curr++];