aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--string/tester.c3
-rw-r--r--string/tst-cmp.c8
2 files changed, 11 insertions, 0 deletions
diff --git a/string/tester.c b/string/tester.c
index bcd7148c2e..b7acf29c81 100644
--- a/string/tester.c
+++ b/string/tester.c
@@ -47,6 +47,9 @@ DIAG_IGNORE_NEEDS_COMMENT (7, "-Wstringop-overflow=");
#if __GNUC_PREREQ (8, 0)
DIAG_IGNORE_NEEDS_COMMENT (8, "-Wstringop-truncation");
#endif
+#if __GNUC_PREREQ (11, 0)
+DIAG_IGNORE_NEEDS_COMMENT (11, "-Wstringop-overread");
+#endif
#define STREQ(a, b) (strcmp((a), (b)) == 0)
diff --git a/string/tst-cmp.c b/string/tst-cmp.c
index 13af0fcb83..e73025cfdf 100644
--- a/string/tst-cmp.c
+++ b/string/tst-cmp.c
@@ -105,6 +105,10 @@ strncmp_max (const char *left, const char *right)
PTRDIFF_MAX; the use of SIZE_MAX is deliberate here. */
DIAG_IGNORE_NEEDS_COMMENT (9, "-Wstringop-overflow=");
#endif
+#if __GNUC_PREREQ (11, 0)
+ /* Likewise GCC 11, with a different warning option. */
+ DIAG_IGNORE_NEEDS_COMMENT (11, "-Wstringop-overread");
+#endif
return strncmp (left, right, SIZE_MAX);
DIAG_POP_NEEDS_COMMENT;
}
@@ -118,6 +122,10 @@ strncasecmp_max (const char *left, const char *right)
than PTRDIFF_MAX; the use of SIZE_MAX is deliberate here. */
DIAG_IGNORE_NEEDS_COMMENT (9, "-Wstringop-overflow=");
#endif
+#if __GNUC_PREREQ (11, 0)
+ /* Likewise GCC 11, with a different warning option. */
+ DIAG_IGNORE_NEEDS_COMMENT (11, "-Wstringop-overread");
+#endif
return strncasecmp (left, right, SIZE_MAX);
DIAG_POP_NEEDS_COMMENT;
}