From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id EE41E15ACB3 for ; Fri, 7 Apr 2023 10:41:58 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 2F03FE089A; Fri, 7 Apr 2023 10:41:58 +0000 (UTC) Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (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 pigeon.gentoo.org (Postfix) with ESMTPS id 1A689E089A for ; Fri, 7 Apr 2023 10:41:58 +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 4B614335CCF for ; Fri, 7 Apr 2023 10:41:57 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 2EF00A15 for ; Fri, 7 Apr 2023 10:41:53 +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: <1680864106.e9eb2f7b8b25559b555c0ec8806b602e486753de.sam@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: /, bin/install-qa-check.d/ X-VCS-Repository: proj/portage X-VCS-Files: NEWS 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: e9eb2f7b8b25559b555c0ec8806b602e486753de X-VCS-Branch: master Date: Fri, 7 Apr 2023 10:41:53 +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: 8d825d2c-bc71-40ab-9f47-0a7dedc2bd7f X-Archives-Hash: 3d3806912b97e1f09740fa03a059bd19 commit: e9eb2f7b8b25559b555c0ec8806b602e486753de Author: Sam James gentoo org> AuthorDate: Fri Apr 7 10:39:53 2023 +0000 Commit: Sam James gentoo org> CommitDate: Fri Apr 7 10:41:46 2023 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=e9eb2f7b bin/install-qa-check.d/90gcc-warnings: add more warnings These are all indicative of possible runtime issues. Signed-off-by: Sam James gentoo.org> NEWS | 15 +++++++++++++++ bin/install-qa-check.d/90gcc-warnings | 9 +++++++++ 2 files changed, 24 insertions(+) diff --git a/NEWS b/NEWS index 0361e6ac6..3dfaf2a09 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,18 @@ +portage-3.0.47 (UNRELEASED) +--------------- + +Features: +* install-qa-check.d: 90gcc-warnings: Add additional code quality warnings: + - -Wrestrict + - -Wstringop-overread + - -Wstringop-truncation + - -Wformat-truncation + - -Wcast-function-type + - -Wnull-dereference + - -Wmain + - -Wimplicit-int + - -Wstring-compare + portage-3.0.46 (2023-04-07) --------------- diff --git a/bin/install-qa-check.d/90gcc-warnings b/bin/install-qa-check.d/90gcc-warnings index dbfbc4a9a..449bf2362 100644 --- a/bin/install-qa-check.d/90gcc-warnings +++ b/bin/install-qa-check.d/90gcc-warnings @@ -19,6 +19,7 @@ gcc_warn_check() { # only will and does, no might :) 'warning: .*will.*\[-Wstrict-aliasing\]' 'warning: .*does.*\[-Wstrict-aliasing\]' + 'warning: .*\[-Wrestrict\]' # strict aliasing violation in C++ (Clang) 'warning: .*\[-Wundefined-reinterpret-cast\]' @@ -44,6 +45,8 @@ gcc_warn_check() { 'warning: .*will always overflow destination buffer' # compile-time part of FORTIFY_SOURCE 'warning: .*\[-Wstringop-overflow\]' + 'warning: .*\[-Wstringop-overread\]' + 'warning: .*\[-Wstringop-truncation\]' # clang-only, equivalent of -Wstringop-overflow 'warning: .*\[-Wfortify-source\]' 'warning: .*assuming pointer wraparound does not occur' @@ -86,6 +89,7 @@ gcc_warn_check() { # -Wformat variants 'warning: .*too few arguments for format' 'warning: .*missing sentinel in function call.*\[-Wformat=\]' + 'warning: .*\[-Wformat-truncation\]' # format ... expects a matching ... argument # (iow, too few arguments for format in new wording :)) 'warning: .*matching.*\[-Wformat=\]' @@ -104,6 +108,8 @@ gcc_warn_check() { # more specific form of -Wincompatible-pointer-types (Clang) 'warning: .*\[-Wincompatible-function-pointer-types\]' # these will fail with CFI (https://reviews.llvm.org/D134831) + # (gcc lacks -strict) + #'warning: .*\[-Wcast-function-type\]' 'warning: .*\[-Wcast-function-type-strict\]' # using wrong deallocator, e.g. using free() on object allocated using my_malloc() # when my_malloc() is annotated as needing my_free(). @@ -117,9 +123,12 @@ gcc_warn_check() { 'warning: .*\[-Wodr\]' # warning: argument value A will result in undefined behaviour (Clang) 'warning: .*\[-Wargument-undefined-behaviour\]' + 'warning: .*\[-Wnull-dereference\]' # general sensible warnings (will be rejected by modern compilers soon) + 'warning: .*\[-Wmain\]' 'warning: .*\[-Wimplicit-int\]' + 'warning: .*\[-Wstring-compare\]' # this may be valid code :/ #': warning: multi-character character constant'