Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/lib/libc/sys Avoid GCC warning on NetBSD/i386



details:   https://anonhg.NetBSD.org/src/rev/cfa2d0b90f68
branches:  trunk
changeset: 457539:cfa2d0b90f68
user:      kamil <kamil%NetBSD.org@localhost>
date:      Mon Jul 01 02:04:37 2019 +0000

description:
Avoid GCC warning on NetBSD/i386

Cast note_hdr.n_namesz to ssize_t through size_t to avoid potential
signedness bit shifts.

diffstat:

 tests/lib/libc/sys/t_ptrace_wait.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 068522c653fa -r cfa2d0b90f68 tests/lib/libc/sys/t_ptrace_wait.c
--- a/tests/lib/libc/sys/t_ptrace_wait.c        Mon Jul 01 00:57:06 2019 +0000
+++ b/tests/lib/libc/sys/t_ptrace_wait.c        Mon Jul 01 02:04:37 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: t_ptrace_wait.c,v 1.130 2019/06/30 21:20:04 mgorny Exp $       */
+/*     $NetBSD: t_ptrace_wait.c,v 1.131 2019/07/01 02:04:37 kamil Exp $        */
 
 /*-
  * Copyright (c) 2016, 2017, 2018, 2019 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: t_ptrace_wait.c,v 1.130 2019/06/30 21:20:04 mgorny Exp $");
+__RCSID("$NetBSD: t_ptrace_wait.c,v 1.131 2019/07/01 02:04:37 kamil Exp $");
 
 #include <sys/param.h>
 #include <sys/types.h>
@@ -7706,7 +7706,7 @@
                            note_hdr.n_namesz <= sizeof(name_buf)) {
                                SYSCALL_REQUIRE(pread(core_fd, name_buf,
                                    note_hdr.n_namesz, offset)
-                                   == note_hdr.n_namesz);
+                                   == (ssize_t)(size_t)note_hdr.n_namesz);
 
                                if (!strncmp(note_name, name_buf, name_len) &&
                                    note_hdr.n_type == note_type)



Home | Main Index | Thread Index | Old Index