aboutsummaryrefslogtreecommitdiff
path: root/nss/makedb.c
diff options
context:
space:
mode:
authorMartin Sebor <msebor@redhat.com>2021-05-10 14:26:42 -0600
committerMartin Sebor <msebor@redhat.com>2021-05-10 14:30:09 -0600
commit30685597a4f81c8dcd4dd7335debdb72ae450924 (patch)
tree4c596b95d5e644f3760a569de0e66d77e05d5134 /nss/makedb.c
parent3c38f694622cfccd2e922e6e10b5c124c34c1ed0 (diff)
downloadglibc-30685597a4f81c8dcd4dd7335debdb72ae450924.zip
glibc-30685597a4f81c8dcd4dd7335debdb72ae450924.tar.gz
glibc-30685597a4f81c8dcd4dd7335debdb72ae450924.tar.bz2
Use a #pragma to suppress a bogus GCC 10 warning instead of an assert [BZ 27832].
Reviewed-by: fweimer@redhat.com
Diffstat (limited to 'nss/makedb.c')
-rw-r--r--nss/makedb.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/nss/makedb.c b/nss/makedb.c
index 9389f6b..8690e11 100644
--- a/nss/makedb.c
+++ b/nss/makedb.c
@@ -792,7 +792,13 @@ write_output (int fd)
+ nhashentries_total * sizeof (stridx_t)));
header->allocate = file_offset;
- /* Help GCC 10 see iov_nelts doesn't overflow the writev argument. */
+#if __GNUC_PREREQ (10, 0) && !__GNUC_PREREQ (11, 0)
+ DIAG_PUSH_NEEDS_COMMENT;
+ /* Avoid GCC 10 false positive warning: specified size exceeds maximum
+ object size. */
+ DIAG_IGNORE_NEEDS_COMMENT (10, "-Wstringop-overflow");
+#endif
+
assert (iov_nelts <= INT_MAX);
if (writev (fd, iov, iov_nelts) != keydataoffset)
{
@@ -800,6 +806,10 @@ write_output (int fd)
return EXIT_FAILURE;
}
+#if __GNUC_PREREQ (10, 0) && !__GNUC_PREREQ (11, 0)
+ DIAG_POP_NEEDS_COMMENT;
+#endif
+
return EXIT_SUCCESS;
}