From 5cf517f60870e79837d0a0aeb4569d798c760d70 Mon Sep 17 00:00:00 2001 From: Jeff Law Date: Wed, 19 Aug 2020 14:14:02 -0600 Subject: [PATCH] Work around gcc-11 false positive diagnostic --- gcc-11.patch | 21 +++++++++++++++++++++ strace.spec | 7 ++++++- 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 gcc-11.patch diff --git a/gcc-11.patch b/gcc-11.patch new file mode 100644 index 0000000..bbd12a8 --- /dev/null +++ b/gcc-11.patch @@ -0,0 +1,21 @@ +diff --git a/tests/nlattr_tcamsg.c b/tests/nlattr_tcamsg.c +index e25e32a..d23715c 100644 +--- a/tests/nlattr_tcamsg.c ++++ b/tests/nlattr_tcamsg.c +@@ -33,6 +33,8 @@ enum { TCA_ACT_USED_HW_STATS = 9 }; + static void + init_tcamsg(struct nlmsghdr *const nlh, const unsigned int msg_len) + { ++#pragma GCC diagnostic push ++#pragma GCC diagnostic ignored "-Wstringop-overflow" + SET_STRUCT(struct nlmsghdr, nlh, + .nlmsg_len = msg_len, + .nlmsg_type = RTM_GETACTION, +@@ -43,6 +45,7 @@ init_tcamsg(struct nlmsghdr *const nlh, const unsigned int msg_len) + SET_STRUCT(struct tcamsg, msg, + .tca_family = AF_INET + ); ++#pragma GCC diagnostic pop + } + + static void diff --git a/strace.spec b/strace.spec index 8b739b5..1a4c440 100644 --- a/strace.spec +++ b/strace.spec @@ -1,7 +1,7 @@ Summary: Tracks and displays system calls associated with a running process Name: strace Version: 5.8 -Release: 1%{?dist} +Release: 2%{?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, @@ -18,6 +18,7 @@ BuildRequires: xz %else Source: strace-%{version}.tar.gz %endif +Patch0: gcc-11.patch BuildRequires: gcc gzip # Install Bluetooth headers for AF_BLUETOOTH sockets decoding. @@ -51,6 +52,7 @@ received by a process. %prep %setup -q +%patch0 -p1 echo -n %version-%release > .tarball-version echo -n 2020 > .year echo -n 2020-06-16 > .strace.1.in.date @@ -100,6 +102,9 @@ echo 'END OF TEST SUITE INFORMATION' %{_mandir}/man1/* %changelog +* Wed Aug 19 2020 Jeff Law - 5.8-2 +- Work around gcc-11 false positive diagnostic + * Thu Aug 06 2020 Dmitry V. Levin - 5.8-1 - v5.7 -> v5.8.