Work around more gcc-11 false positive diagnostics

This commit is contained in:
Jeff Law 2020-12-10 15:41:00 -07:00
parent 50008c5457
commit e4ee13ea3d
2 changed files with 31 additions and 1 deletions

View File

@ -18,4 +18,25 @@ index e25e32a..d23715c 100644
+#pragma GCC diagnostic pop
}
static void
diff --git a/mmsghdr.c b/mmsghdr.c
index 3fede19..5db35d8 100644
--- a/mmsghdr.c
+++ b/mmsghdr.c
@@ -78,6 +78,8 @@ static void
save_mmsgvec_namelen(struct tcb *const tcp, kernel_ulong_t addr,
unsigned int len, const char *const timeout)
{
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Warray-bounds"
if (len > IOV_MAX)
len = IOV_MAX;
@@ -99,6 +101,7 @@ save_mmsgvec_namelen(struct tcb *const tcp, kernel_ulong_t addr,
data->count = i;
set_tcb_priv_data(tcp, data, free_mmsgvec_data);
+#pragma GCC diagnostic pop
}
static void

View File

@ -1,7 +1,7 @@
Summary: Tracks and displays system calls associated with a running process
Name: strace
Version: 5.9
Release: 2%{?dist}
Release: 3%{?dist}
# The test suite is GPLv2+, all the rest is LGPLv2.1+.
License: LGPL-2.1+ and GPL-2.0+
# Some distros require Group tag to be present,
@ -100,6 +100,12 @@ done
wait
%check
# The tests are riddled with an idiom that triggers a false positives
# from gcc-11. Out of bounds issues in the testsuite are not
# particularly important, so we just make them non-fatal
sed -i "s/-Werror$/-Werror -Wno-error=array-bounds -Wno-error=stringop-overread/" tests/Makefile
sed -i "s/-Werror$/-Werror -Wno-error=array-bounds -Wno-error=stringop-overread/" tests-m32/Makefile
sed -i "s/-Werror$/-Werror -Wno-error=array-bounds -Wno-error=stringop-overread/" tests-mx32/Makefile
%{buildroot}%{_bindir}/strace -V
%make_build -k check VERBOSE=1
echo 'BEGIN OF TEST SUITE INFORMATION'
@ -116,6 +122,9 @@ echo 'END OF TEST SUITE INFORMATION'
%{_mandir}/man1/*
%changelog
* Wed Oct 21 2020 Eugene Syromyatnikov <esyr@redhat.com> - 5.9-3
- Work around more gcc-11 false positive diagnostics
* Wed Oct 21 2020 Eugene Syromyatnikov <esyr@redhat.com> - 5.9-2
- Mark even more tests as XFAIL so the build succeedes
(references: #1886468, #1886480).