commit:     9d454e1ad76d4a6fcb0184854e9a65ad6929e972
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Tue Nov  8 23:47:51 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Nov  8 23:49:16 2022 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=9d454e1a

install-qa-check.d/90gcc-warnings: add further FORTIFY_SOURCE-related warnings

These are the compile-time parts of FORTIFY_SOURCE [0]:
* -Wstringop-overflow (GCC only)
* -Wfortify-source (Clang only)

[0] https://maskray.me/blog/2022-11-06-fortify-source

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

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

diff --git a/NEWS b/NEWS
index ac21358b2..5395d0cb2 100644
--- a/NEWS
+++ b/NEWS
@@ -20,6 +20,8 @@ Features:
   * -Wmismatched-dealloc
   * -Wodr (LTO esp.)
   * -Wreturn-type
+  * -Wstringop-overflow (GCC, FORTIFY_SOURCE)
+  * -Wfortify-source (Clang, FORTIFY_SOURCE)
 
 * ecompress, etc: Support additional compression suffixes for texinfo:
   .Z, .bz2, .lzma, .lz, .xz, .zst (bug #757525).

diff --git a/bin/install-qa-check.d/90gcc-warnings 
b/bin/install-qa-check.d/90gcc-warnings
index 3a57c0a3b..579cb4135 100644
--- a/bin/install-qa-check.d/90gcc-warnings
+++ b/bin/install-qa-check.d/90gcc-warnings
@@ -37,6 +37,10 @@ gcc_warn_check() {
                        'warning: .*\[-Wfree-nonheap-object\]'
                        # those three do not have matching -W flags, it seems
                        'warning: .*will always overflow destination buffer'
+                       # compile-time part of FORTIFY_SOURCE
+                       'warning: .*\[-Wstringop-overflow\]'
+                       # clang-only, equivalent of -Wstringop-overflow
+                       'warning: .*\[-Wfortify-source\]'
                        'warning: .*assuming pointer wraparound does not occur'
                        'warning: .*escape sequence out of range'
                        # left-hand operand of comma expression has no effect

Reply via email to