From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1386) id D2D0C3858D39; Fri, 26 May 2023 10:45:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D2D0C3858D39 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Jan Beulich To: bfd-cvs@sourceware.org Subject: [binutils-gdb] x86: fix disassembler build after 1a3b4f90bc5f X-Act-Checkin: binutils-gdb X-Git-Author: Jan Beulich X-Git-Refname: refs/heads/master X-Git-Oldrev: a3b86780b6cc9d5915a781bef0d901dcc5d9c07f X-Git-Newrev: 93497bf9ab13a3d2aa06ff329155beca23e323fa Message-Id: <20230526104502.D2D0C3858D39@sourceware.org> Date: Fri, 26 May 2023 10:45:02 +0000 (GMT) X-BeenThere: binutils-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 May 2023 10:45:02 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D93497bf9ab13= a3d2aa06ff329155beca23e323fa commit 93497bf9ab13a3d2aa06ff329155beca23e323fa Author: Jan Beulich Date: Fri May 26 12:44:52 2023 +0200 x86: fix disassembler build after 1a3b4f90bc5f =20 In commit 1a3b4f90bc5f ("x86: convert two pointers to (indexing) integers") I neglected the fact that compilers may warn about comparing ptrdiff_t (signed long) with size_t (unsigned long) values. Since just before we've checked that the value is positive, simply add a cast (despite my dislike for casts). Diff: --- opcodes/i386-dis.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opcodes/i386-dis.c b/opcodes/i386-dis.c index 6f75abf57f3..6161bf72459 100644 --- a/opcodes/i386-dis.c +++ b/opcodes/i386-dis.c @@ -300,7 +300,7 @@ fetch_code (struct disassemble_info *info, const uint8_= t *until) if (needed <=3D 0) return true; =20 - if (priv->fetched + needed <=3D ARRAY_SIZE (priv->the_buffer)) + if (priv->fetched + (size_t) needed <=3D ARRAY_SIZE (priv->the_buffer)) status =3D (*info->read_memory_func) (start, fetch_end, needed, info); if (status !=3D 0) {