From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2155) id 711743858C78; Mon, 4 Dec 2023 09:33:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 711743858C78 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1701682416; bh=kkgWYk8OJlMC/k8T44Ggf8Aps60SdcBl12AsV9gfF3k=; h=From:To:Subject:Date:From; b=MSB/eDhR+6W1XktG4x5E7Y2JNEeSAb3biPOUcId0yt2k2XN8EDSydgmU3cu18C4rz rF75aC40j6Cj7KACX8SPW0m/0R9a51eDOYxNm6N0J84ZZw7sqjLFWmkSOkDgfyMBu9 mM6Uq0JsuNFatoHrglqR2+rmnD8+MyNI7NiBdfKI= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Corinna Vinschen To: newlib-cvs@sourceware.org Subject: [newlib-cygwin/main] RISC-V: Fix -Wint-conversion warning X-Act-Checkin: newlib-cygwin X-Git-Author: Kito Cheng X-Git-Refname: refs/heads/main X-Git-Oldrev: c0d2f3874207e870ffb8a181b0a49637d77e5fdc X-Git-Newrev: bcd1883560b79b67f06fa1df6dea60d18fdd00c7 Message-Id: <20231204093336.711743858C78@sourceware.org> Date: Mon, 4 Dec 2023 09:33:36 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3Dbcd1883560b= 79b67f06fa1df6dea60d18fdd00c7 commit bcd1883560b79b67f06fa1df6dea60d18fdd00c7 Author: Kito Cheng AuthorDate: Mon Dec 4 15:41:28 2023 +0800 Commit: Corinna Vinschen CommitDate: Mon Dec 4 10:26:41 2023 +0100 RISC-V: Fix -Wint-conversion warning =20 Upstream GCC has change this warning into error by default, so...we need to explicitly convert the type from pointer from/to integer, generally it's unsafe, but we know what we are doing here. =20 However it's not safe for ilp32 on RV64, but we didn't support that yet= , so I think this fix is good enough now :) Diff: --- libgloss/riscv/internal_syscall.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libgloss/riscv/internal_syscall.h b/libgloss/riscv/internal_sy= scall.h index 1f1f42f5d6ca..080c8c847e04 100644 --- a/libgloss/riscv/internal_syscall.h +++ b/libgloss/riscv/internal_syscall.h @@ -63,7 +63,7 @@ __internal_syscall(long n, int argc, long _a0, long _a1, = long _a2, long _a3, lon } =20 static inline long -syscall_errno(long n, int argc, long _a0, long _a1, long _a2, long _a3, lo= ng _a4, long _a5) +_syscall_errno(long n, int argc, long _a0, long _a1, long _a2, long _a3, l= ong _a4, long _a5) { long a0 =3D __internal_syscall (n, argc, _a0, _a1, _a2, _a3, _a4, _a5); =20 @@ -73,4 +73,8 @@ syscall_errno(long n, int argc, long _a0, long _a1, long = _a2, long _a3, long _a4 return a0; } =20 +#define syscall_errno(N, ARGC, A0, A1, A2, A3, A4, A5) \ + _syscall_errno(N, ARGC, (long)A0, (long)A1, (long)A2, \ + (long)A3, (long)A4, (long)A5) + #endif