From nobody Tue Sep 3 16:29:59 2024 X-Original-To: dev-commits-src-branches@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 4Wyrgq5vYZz5TXCG; Tue, 03 Sep 2024 16:29:59 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wyrgq51Krz3yB3; Tue, 3 Sep 2024 16:29:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725380999; 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=wGsY7aP0QrsEiAhAMfENWpAnfRCFmJ1/bMp6Uk+sBSY=; b=OSdXk/irA9ihSuUc6wpkxmMEB7pJFwzjU7t7f4+bjFDW17VWpLRnz9mqaUC5QhTJ3ubxJb JHb3Fd3ORU7o1gCPH2t2LBuXSDb2aphai+wNwNj/1F56TsdPwbrq0+LSRsl2Got1AXFLAt NCHIa/+Y4Us087BUPFguate+9S9yNb0KVUxXDv/I/yXRsILGRFmM8l3Yk/tax9A1DsjTog rchA8bfG5Fm6P1KBijshGYGJqiesSjeLlKdHR+jO3h3RXHmVyNJr6CJuov6C3+BICyk2N2 NffboGHxg5INrXcKEgELQE7csgH/tcsTgb0SURGhh3idqYkMKbtpxhJzzGimWw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725380999; a=rsa-sha256; cv=none; b=wtTenjb9neKGzFyo+pQmfWARBfaLhoFryK/v/Vh/5jw4YtZzTeY0lB3+wk8xoQ3f08WFSh kip1XAFbvLwH/e/C1/yOWMXiyX1rVomF8koL7ksvGThJD7VF6gPuuhPQ59Mf7h7tAD3MZ+ 7a7nXEH/9SQXg+wTAbZIvirS1nxlWY4g0KD9AgBltpoQzF3QZYtTGYxYTpFiPyQXOGxNMA tiIHO+mtz6jGF+nmURJRN6NdmxGTpc02hOuwGDKyxnuv13iF5NlmGwPbyVBp5HgP645jNi 5qe7OCm3cp9lMsKIjlxhX/JfJ8WDTetQkxV5VEsmeShU8DzZcJrlfCGGxyfpsw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725380999; 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=wGsY7aP0QrsEiAhAMfENWpAnfRCFmJ1/bMp6Uk+sBSY=; b=xwUFw0aiepHabL6jhtElp6DfkYDtFfqcggzwPSVv2NduZ/16PIcyzlp1Otkf8YzjhtloH5 9HCer5pbL4ftV9+U62WgZEsRDUSOE4lzZllmFTb4klbVu8tJEFnqx5/FhHx+7XxRAPMDsz VCMDcapatjPvifSW8xKzyih7SbRqltMIri3cAgHN5PmjWZv4VCgT7pwH85o7FwvGEJ61FF cfVqwszmCu9GzpMYqBd/zgZboXTidgmPy3nCqZLnIV55zcT0xJG7syVuqQ9JoZ9GraeAC4 qjx0LjA3gI9nG4sDto5DB/YJ3yLyhnQWaNJy+/N8tfzU/yJZ6YgV4CsW5ANCWQ== 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 4Wyrgq4dm0znmS; Tue, 3 Sep 2024 16:29:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 483GTxK3024990; Tue, 3 Sep 2024 16:29:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 483GTxCf024987; Tue, 3 Sep 2024 16:29:59 GMT (envelope-from git) Date: Tue, 3 Sep 2024 16:29:59 GMT Message-Id: <202409031629.483GTxCf024987@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Stefan =?utf-8?Q?E=C3=9Fer?= Subject: git: 06bb8e1dab00 - stable/14 - contrib/bc: fix build with GCC List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: se X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 06bb8e1dab004ccb283f7a20fe84aa1326baf6b7 Auto-Submitted: auto-generated The branch stable/14 has been updated by se: URL: https://cgit.FreeBSD.org/src/commit/?id=06bb8e1dab004ccb283f7a20fe84aa1326baf6b7 commit 06bb8e1dab004ccb283f7a20fe84aa1326baf6b7 Author: Stefan Eßer AuthorDate: 2024-08-27 07:11:58 +0000 Commit: Stefan Eßer CommitDate: 2024-09-03 16:28:14 +0000 contrib/bc: fix build with GCC Building with GCC failed with the following error message: error: to be safe all intermediate pointers in cast from 'char **' to 'const char **' must be 'const' qualified [-Werror=cast-qual] This was caused by main() being declared with "char *argv[]" as the 3rd parameter, but argv later being passed cast to "const char**": 113 | if (BC_IS_BC) s = bc_main(argc, (const char**) argv); | ^ This is fixed by declaring the 3rd parameter of main() as "const char *argv[]". Reported by: CI MFC after: 3 days (cherry picked from commit ef5752762ba9ec54d5c02023167d24bcdbb45fd7) vendor/bc: upgrade to version 7.0.1 This update fixes building bc on FreeBSD with non-default compilers (GCC-12, GCC-13). GCC warned about casting argv from non-const to const and since warnings are treated as errors, the build failed. (cherry picked from commit 1e19146fc7692f59e8dfc5da7957e938cd0b81b8) (cherry picked from commit 5b0dc991093c82824f6fe566af947f64f5072264) --- contrib/bc/NEWS.md | 6 ++++++ contrib/bc/include/version.h | 2 +- contrib/bc/src/main.c | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/contrib/bc/NEWS.md b/contrib/bc/NEWS.md index 1775fa0b6533..8156b673ce04 100644 --- a/contrib/bc/NEWS.md +++ b/contrib/bc/NEWS.md @@ -1,5 +1,11 @@ # News +## 7.0.1 + +This is a production release that fixes a warning using GCC on FreeBSD. + +Other users do ***NOT*** need to upgrade. + ## 7.0.0 This is a production release to fix three bugs. diff --git a/contrib/bc/include/version.h b/contrib/bc/include/version.h index 897a19530e3f..4d2f6acfb433 100644 --- a/contrib/bc/include/version.h +++ b/contrib/bc/include/version.h @@ -37,6 +37,6 @@ #define BC_VERSION_H /// The current version. -#define VERSION 7.0.0 +#define VERSION 7.0.1 #endif // BC_VERSION_H diff --git a/contrib/bc/src/main.c b/contrib/bc/src/main.c index e4a1f7399bb4..da4c27156029 100644 --- a/contrib/bc/src/main.c +++ b/contrib/bc/src/main.c @@ -54,7 +54,7 @@ #include int -main(int argc, char* argv[]) +main(int argc, const char* argv[]) { BcStatus s; char* name;