mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-27 11:43:34 +08:00
Use a #pragma to suppress a bogus GCC 10 warning instead of an assert [BZ 27832].
Reviewed-by: fweimer@redhat.com
This commit is contained in:
parent
3c38f69462
commit
30685597a4
12
nss/makedb.c
12
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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user