commit:     73fccc7cee325874e7533e1c809dc26e45e604e0
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Wed Nov  9 07:29:54 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Nov  9 07:30:36 2022 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=73fccc7c

install-qa-check.d/90gcc-warnings: add more Clang warnings

All of these are either smells of something wrong or likely UB:
-Wstrlcpy-strlcat-size
-Wstrncat-size
-Wsuspicious-bzero
-Wvarargs

Signed-off-by: Sam James <sam <AT> gentoo.org>

 NEWS                                  | 4 ++++
 bin/install-qa-check.d/90gcc-warnings | 6 ++++++
 2 files changed, 10 insertions(+)

diff --git a/NEWS b/NEWS
index 16552ea7d..5ee6e3bd1 100644
--- a/NEWS
+++ b/NEWS
@@ -22,6 +22,10 @@ Features:
   * -Wreturn-type
   * -Wstringop-overflow (GCC, FORTIFY_SOURCE)
   * -Wfortify-source (Clang, FORTIFY_SOURCE)
+  * -Wstrlcpy-strlcat-size
+  * -Wstrncat-size
+  * -Wsuspicious-bzero
+  * -Wvarargs
   * -Wargument-undefined-behaviour (Clang)
   * -Wincompatible-function-pointer-types (Clang, becomes fatal in Clang 16)
     (note we already have -Wincompatible-pointer-types in the list for GCC)

diff --git a/bin/install-qa-check.d/90gcc-warnings 
b/bin/install-qa-check.d/90gcc-warnings
index 7fd8502ef..845a83b08 100644
--- a/bin/install-qa-check.d/90gcc-warnings
+++ b/bin/install-qa-check.d/90gcc-warnings
@@ -49,6 +49,12 @@ gcc_warn_check() {
                        'warning: .*assuming pointer wraparound does not occur'
                        'warning: .*escape sequence out of range'
 
+                       # all clang
+                       'warning: .*\[-Wstrlcpy-strlcat-size\]'
+                       'warning: .*\[-Wstrncat-size\]'
+                       'warning: .*\[-Wsuspicious-bzero\]'
+                       'warning: .*\[-Wvarargs\]'
+
                        # left-hand operand of comma expression has no effect
                        'warning: .*left.*comma.*\[-Wunused-value\]'
                        # converting to non-pointer type ... from NULL and likes

Reply via email to