public inbox for newlib-cvs@sourceware.org
help / color / mirror / Atom feed
From: Corinna Vinschen <corinna@sourceware.org>
To: newlib-cvs@sourceware.org
Subject: [newlib-cygwin/main] RISC-V: Fix -Wint-conversion warning
Date: Mon,  4 Dec 2023 09:33:36 +0000 (GMT)	[thread overview]
Message-ID: <20231204093336.711743858C78@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=bcd1883560b79b67f06fa1df6dea60d18fdd00c7

commit bcd1883560b79b67f06fa1df6dea60d18fdd00c7
Author:     Kito Cheng <kito.cheng@sifive.com>
AuthorDate: Mon Dec 4 15:41:28 2023 +0800
Commit:     Corinna Vinschen <corinna@vinschen.de>
CommitDate: Mon Dec 4 10:26:41 2023 +0100

    RISC-V: Fix -Wint-conversion warning
    
    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.
    
    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_syscall.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
 }
 
 static inline long
-syscall_errno(long n, int argc, long _a0, long _a1, long _a2, long _a3, long _a4, long _a5)
+_syscall_errno(long n, int argc, long _a0, long _a1, long _a2, long _a3, long _a4, long _a5)
 {
   long a0 = __internal_syscall (n, argc, _a0, _a1, _a2, _a3, _a4, _a5);
 
@@ -73,4 +73,8 @@ syscall_errno(long n, int argc, long _a0, long _a1, long _a2, long _a3, long _a4
     return a0;
 }
 
+#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

                 reply	other threads:[~2023-12-04  9:33 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231204093336.711743858C78@sourceware.org \
    --to=corinna@sourceware.org \
    --cc=newlib-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).