From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefano Brivio To: passt-dev@passt.top Subject: Re: [PATCH] tcp: Work around gcc 12 bogus warning in tcp_rtt_dst_check() Date: Wed, 25 May 2022 13:31:59 +0200 Message-ID: <20220525133159.35be89bc@elisabeth> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============8257292829938833822==" --===============8257292829938833822== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Tue, 24 May 2022 19:09:37 +1000 David Gibson wrote: > On Fri, May 20, 2022 at 11:01:11AM +0200, Stefano Brivio wrote: > > gcc 12.1.x (e.g. current OpenSUSE Tumbleweed, x86_64 only, > > gcc-12-1.4.x86_64) reports: > >=20 > > tcp.c: In function =E2=80=98tcp_send_flag=E2=80=99: > > tcp.c:1014:9: warning: writing 16 bytes into a region of size 0 [-Wstring= op-overflow=3D] > > 1014 | memcpy(low_rtt_dst + hole++, &conn->a.a6, sizeof(conn->a.= a6)); > > | ^ > > tcp.c:559:24: note: at offset -16 into destination object =E2=80=98low_rt= t_dst=E2=80=99 of size 128 > > 559 | static struct in6_addr low_rtt_dst[LOW_RTT_TABLE_SIZE]; > > | > >=20 > > but 'hole' can't be -1, because the low_rtt_dst table is guaranteed > > to have a hole: if we happened to write to the last entry, we'll go > > back to index 0 and clear that one. > >=20 > > Signed-off-by: Stefano Brivio =20 >=20 > Reviewed-by: David Gibson Thanks for the reviews! I pushed those two changes already on Friday, as they were both rather simple and blocking continuous integration. I guess it might make sense to set up Patchwork eventually, but it feels a bit overkill for the moment... --=20 Stefano --===============8257292829938833822==--