commit: 2a352b6ff5ddd3a2d25ff6d0e6a50bc9daab67d6
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Wed Nov 9 07:17:45 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=2a352b6f
install-qa-check.d/90gcc-warnings: add -Wcast-function-type-strict
New Clang flag which will warn on casts that'll break with CFI.
Signed-off-by: Sam James <sam <AT> gentoo.org>
NEWS | 1 +
bin/install-qa-check.d/90gcc-warnings | 2 ++
2 files changed, 3 insertions(+)
diff --git a/NEWS b/NEWS
index 6fe36cbe0..16552ea7d 100644
--- a/NEWS
+++ b/NEWS
@@ -30,6 +30,7 @@ Features:
* -Wint-to-pointer-cast
* -Wpointer-to-int-cast
* -Wint-to-void-pointer-cast
+ * -Wcast-function-type-strict (Clang, CFI)
* Further -Wformat matches for missing specifiers.
In future, we may warn on all -Wformat (in particular because of e.g.
time_t & LFS).
diff --git a/bin/install-qa-check.d/90gcc-warnings
b/bin/install-qa-check.d/90gcc-warnings
index d8322871b..7fd8502ef 100644
--- a/bin/install-qa-check.d/90gcc-warnings
+++ b/bin/install-qa-check.d/90gcc-warnings
@@ -92,6 +92,8 @@ gcc_warn_check() {
'warning: .*\[-Wincompatible-pointer-types\]'
# more specific form of -Wincompatible-pointer-types
(Clang)
'warning: .*\[-Wincompatible-function-pointer-types\]'
+ # these will fail with CFI
(https://reviews.llvm.org/D134831)
+ '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().
'warning: .*\[-Wmismatched-dealloc\]'