From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1791) id F3E2E385AF9E; Wed, 26 Jul 2023 14:22:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F3E2E385AF9E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1690381341; bh=exM5epbxca5jyIJ6+PMtMd5x//sVEb516x0whl1HKAc=; h=From:To:Subject:Date:From; b=YgucvJiIQqctmRmD/s2sRffCjmJqwB+Yj2uvz/IqDIjvQYpkFxfA0HX8aZoRJHjXi mmvvrz1y41GIk+ZA/FghbehOeK8TdJ7Y5duHWpMJnxB9KPxPWrFr/3q/c1qM9bT0xL YUsNglyAbllTxW6buyGt6zNpfOoiyWn1Fucm6Grc= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Adhemerval Zanella To: glibc-cvs@sourceware.org Subject: [glibc] linux: Fix i686 with gcc6 X-Act-Checkin: glibc X-Git-Author: Adhemerval Zanella Netto X-Git-Refname: refs/heads/master X-Git-Oldrev: 0b1a76c57782a03685f405ee53e6d5f691d69298 X-Git-Newrev: dbc4b032dc5c4ef0c46e9de23c46b1698bad4412 Message-Id: <20230726142220.F3E2E385AF9E@sourceware.org> Date: Wed, 26 Jul 2023 14:22:20 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=dbc4b032dc5c4ef0c46e9de23c46b1698bad4412 commit dbc4b032dc5c4ef0c46e9de23c46b1698bad4412 Author: Adhemerval Zanella Netto Date: Tue Jul 25 12:16:40 2023 -0300 linux: Fix i686 with gcc6 On __convert_scm_timestamps GCC 6 issues an warning that tvts[0]/tvts[1] maybe be used uninitialized, however it would be used if type is set to a value different than 0 (done by either COMPAT_SO_TIMESTAMP_OLD or COMPAT_SO_TIMESTAMPNS_OLD) which will fallthrough to 'common' label. It does not show with gcc 7 or more recent versions. Checked on i686-linux-gnu. Reviewed-by: Carlos O'Donell Diff: --- sysdeps/unix/sysv/linux/convert_scm_timestamps.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sysdeps/unix/sysv/linux/convert_scm_timestamps.c b/sysdeps/unix/sysv/linux/convert_scm_timestamps.c index 42f9613416..06c8adeee1 100644 --- a/sysdeps/unix/sysv/linux/convert_scm_timestamps.c +++ b/sysdeps/unix/sysv/linux/convert_scm_timestamps.c @@ -23,6 +23,7 @@ # include # include # include +# include /* It converts the first SO_TIMESTAMP or SO_TIMESTAMPNS with 32-bit time and appends it to the control buffer. The 32-bit time field is kept as-is. @@ -44,7 +45,15 @@ __convert_scm_timestamps (struct msghdr *msg, socklen_t msgsize) 'struct __kernel_sock_timeval' while for SO_TIMESTAMPNS_NEW is a 'struct __kernel_timespec'. In either case it is two uint64_t members. */ + + /* GCC 6 issues an warning that tvts[0]/tvts[1] maybe be used uninitialized, + however it would be used if type is set to a value different than 0 + (done by either COMPAT_SO_TIMESTAMP_OLD or COMPAT_SO_TIMESTAMPNS_OLD) + which will fallthrough to 'common' label. */ + DIAG_PUSH_NEEDS_COMMENT; + DIAG_IGNORE_NEEDS_COMMENT (6, "-Wmaybe-uninitialized"); int64_t tvts[2]; + DIAG_POP_NEEDS_COMMENT; int32_t tmp[2]; struct cmsghdr *cmsg, *last = NULL;