[3/4] linux: Fix i686 with gcc6
Checks
Context |
Check |
Description |
redhat-pt-bot/TryBot-apply_patch |
success
|
Patch applied to master at the time it was sent
|
linaro-tcwg-bot/tcwg_glibc_build--master-arm |
success
|
Testing passed
|
linaro-tcwg-bot/tcwg_glibc_check--master-arm |
warning
|
Patch failed to apply
|
linaro-tcwg-bot/tcwg_glibc_build--master-aarch64 |
warning
|
Patch failed to apply
|
linaro-tcwg-bot/tcwg_glibc_check--master-aarch64 |
success
|
Testing passed
|
Commit Message
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.
---
sysdeps/unix/sysv/linux/convert_scm_timestamps.c | 9 +++++++++
1 file changed, 9 insertions(+)
Comments
On 7/25/23 11:16, Adhemerval Zanella via Libc-alpha wrote:
> 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.
LGTM.
Andreas, As the RM is this OK to push?
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
> It does not show with gcc 7 or more recent versions.
>
> Checked on i686-linux-gnu.
> ---
> 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 <string.h>
> # include <sys/socket.h>
> # include <socket-constants-time64.h>
> +# include <libc-diag.h>
OK.
>
> /* 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");
OK.
> int64_t tvts[2];
> + DIAG_POP_NEEDS_COMMENT;
> int32_t tmp[2];
>
> struct cmsghdr *cmsg, *last = NULL;
Am Mittwoch, 26. Juli 2023, 03:51:41 CEST schrieb Carlos O'Donell:
> On 7/25/23 11:16, Adhemerval Zanella via Libc-alpha wrote:
> > 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.
>
> LGTM.
>
> Andreas, As the RM is this OK to push?
>
> Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Yes please go ahead.
>
>
> > It does not show with gcc 7 or more recent versions.
> >
> > Checked on i686-linux-gnu.
> > ---
> > 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 <string.h>
> > # include <sys/socket.h>
> > # include <socket-constants-time64.h>
> > +# include <libc-diag.h>
>
> OK.
>
> >
> > /* 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");
>
> OK.
>
> > int64_t tvts[2];
> > + DIAG_POP_NEEDS_COMMENT;
> > int32_t tmp[2];
> >
> > struct cmsghdr *cmsg, *last = NULL;
>
>
@@ -23,6 +23,7 @@
# include <string.h>
# include <sys/socket.h>
# include <socket-constants-time64.h>
+# include <libc-diag.h>
/* 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;