From nobody Tue Sep 03 16:34:42 2024 X-Original-To: dev-commits-src-all@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 4WyrnG47mGz5TXSl; Tue, 03 Sep 2024 16:34:42 +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 4WyrnG2N0Hz41Gl; Tue, 3 Sep 2024 16:34:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725381282; 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=SQv7krdW8H6QCAUBNFwTlCqdCh7iuHZ4UZvGyBWqu5Y=; b=YL1OcT+MKaPvCVBvkTSTpQaAKKl8HwqiokNJ1+420xiKSUJ1sKPcnjjor/1ym3PCtEx7j2 itjCk6Kpu64h0KoDA6g8s8nZbn9n7leejSN7Dx/axGsUQJ+ZIQgJiUCgV40izGcKygED7W ZW1rB7OLPE0Onpdh68WsrC1NYx9kiWjY36/llLtEirsKDd5MugtwsZgyo9/tYYNEq/9UeL mYh6L1kXb9V8jZ0uMwbW3xWguR1ZnBVLEZlFqdqk3AUKROre792385WtSGRbxdm6LXzFtX 6aEhkPh+fCTKXlUSZtbNHrmBOZCoj1b9lFh6gRN86LlQCs9NHYhfZqPZie35pQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725381282; a=rsa-sha256; cv=none; b=inJtzEOg4I2tf28cqp+EPcSBDWeN1Q47tPdp14OyacdGc0kVubvm0bEJ9gb386cKcPknlJ hPU692IQd9Woiv+FCJqbjsMHQpUkagTRj6bzQakGjOR8wNp6aFpwN565/74zM+DOSbz5ak ucUHFd24RPKTnKm9gHKaOW7C8DlXiln4qBZQ6oJBMWWB/EWORN4PYXOGhe+dpfnVH+hbmX Bq5EWZcudsXHwQPEoVgBP9dK9UEmtnylpHYBOhzdoZgRC/8BlC3LV+mvpYhGYW2NIRb5J9 rXqSBKiNP3e4OmMXz2VpjYUBFMKh5uDPYd4PjNYOFB9Tg/qqqn/4zuRW85Jh7Q== 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=1725381282; 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=SQv7krdW8H6QCAUBNFwTlCqdCh7iuHZ4UZvGyBWqu5Y=; b=P8tkLY/pd/wlLbD81UGsMkPJbavChvdD+MZeItiOXqrz+Fc+PSH6EStnZS+frxcTrqZakU YgEIhZW2x9Ad4zdrDeT7nmSKt8MwGLQ6afULguMI/JM0bUZGsBqyLzK0JFaGKF0KSsT6cw telrDq4YMzY9OUEvqZzYueTVqNIxvZfZ3JyXXULXTExcimzLPMFEd5vZKW7owsoljU/3IV Oglmq3AlNwkjI6pu664Y8isqW4pcYLDxws/fG0+TFxpdTTIAhzuFBm0wpRCKxLT8R78ewx ZZCt2ApobeTPOyQTZNcJMnxyvYzdNgW7I7q4j0Q5d4gS5AsvhdLysLIffszvRA== 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 4WyrnG1znKznnM; Tue, 3 Sep 2024 16:34:42 +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 483GYghf041047; Tue, 3 Sep 2024 16:34:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 483GYgRu041044; Tue, 3 Sep 2024 16:34:42 GMT (envelope-from git) Date: Tue, 3 Sep 2024 16:34:42 GMT Message-Id: <202409031634.483GYgRu041044@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: 69b23cb4b029 - stable/13 - contrib/bc: fix build with GCC List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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/13 X-Git-Reftype: branch X-Git-Commit: 69b23cb4b029d4e1e67a681ec0db76f42ebd6b64 Auto-Submitted: auto-generated The branch stable/13 has been updated by se: URL: https://cgit.FreeBSD.org/src/commit/?id=69b23cb4b029d4e1e67a681ec0db76f42ebd6b64 commit 69b23cb4b029d4e1e67a681ec0db76f42ebd6b64 Author: Stefan Eßer AuthorDate: 2024-08-27 07:11:58 +0000 Commit: Stefan Eßer CommitDate: 2024-09-03 16:33:48 +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 (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;