From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 648EE1580EB for ; Fri, 30 May 2025 07:37:42 +0000 (UTC) Received: from lists.gentoo.org (bobolink.gentoo.org [140.211.166.189]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: relay-lists.gentoo.org@gentoo.org) by smtp.gentoo.org (Postfix) with ESMTPSA id 4DA023430BA for ; Fri, 30 May 2025 07:37:42 +0000 (UTC) Received: from bobolink.gentoo.org (localhost [127.0.0.1]) by bobolink.gentoo.org (Postfix) with ESMTP id 7616E11047E; Fri, 30 May 2025 07:37:39 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bobolink.gentoo.org (Postfix) with ESMTPS id 6B6CF11047E for ; Fri, 30 May 2025 07:37:39 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 1D273343082 for ; Fri, 30 May 2025 07:37:39 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id B28EDE9B for ; Fri, 30 May 2025 07:37:37 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1748590649.52f303047696be5abbdda0ec2fa027274c57fe7c.sam@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: bin/install-qa-check.d/ X-VCS-Repository: proj/portage X-VCS-Files: bin/install-qa-check.d/90gcc-warnings X-VCS-Directories: bin/install-qa-check.d/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: 52f303047696be5abbdda0ec2fa027274c57fe7c X-VCS-Branch: master Date: Fri, 30 May 2025 07:37:37 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: ca5746b6-cacc-46a5-a271-a55704b1ea95 X-Archives-Hash: e03417a37d50ee8c30b6085f924de084 commit: 52f303047696be5abbdda0ec2fa027274c57fe7c Author: Kerin Millar plushkava net> AuthorDate: Thu May 22 17:01:47 2025 +0000 Commit: Sam James gentoo org> CommitDate: Fri May 30 07:37:29 2025 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=52f30304 90gcc-warnings: hoist local declarations to top of function This precedes a re-factoring. However, I would add that locals are not lexically scoped in bash and that declaring them up-front tends to serve as an effective canary for undue complexity. As a case in point, drop the unused m variable. Signed-off-by: Kerin Millar plushkava.net> Signed-off-by: Sam James gentoo.org> bin/install-qa-check.d/90gcc-warnings | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/bin/install-qa-check.d/90gcc-warnings b/bin/install-qa-check.d/90gcc-warnings index 80ec98af93..42166a7bf4 100644 --- a/bin/install-qa-check.d/90gcc-warnings +++ b/bin/install-qa-check.d/90gcc-warnings @@ -3,18 +3,19 @@ # TODO: add -Wformat-security gcc_warn_check() { - local f + local abort always_overflow f gentoo_bug grep_cmd implicit_func_decl joined_msgs reset_debug + local -a msgs # Evaluate misc gcc warnings # In debug mode, this variable definition and corresponding grep calls # will produce false positives if they're shown in the trace. - local reset_debug=0 + reset_debug=0 if [[ $- == *x* ]] ; then set +x reset_debug=1 fi - local m msgs=( + msgs=( # only will and does, no might :) 'warning: .*will.*\[-Wstrict-aliasing\]' 'warning: .*does.*\[-Wstrict-aliasing\]' @@ -150,12 +151,11 @@ gcc_warn_check() { ) # join all messages into one grep-expression - local joined_msgs printf -v joined_msgs '%s|' "${msgs[@]}" joined_msgs=${joined_msgs%|} - local abort="no" - local grep_cmd=grep + abort="no" + grep_cmd=grep [[ ${PORTAGE_LOG_FILE} = *.gz ]] && grep_cmd=zgrep # Force C locale to work around slow multibyte locales, bug #160234