* [PATCH] libgloss: csky: fix pointer-to-integer warning
@ 2023-01-13 4:37 Mike Frysinger
2023-01-13 10:12 ` Corinna Vinschen
0 siblings, 1 reply; 2+ messages in thread
From: Mike Frysinger @ 2023-01-13 4:37 UTC (permalink / raw)
To: newlib
parameters is an array of integers, so assigning NULL (a pointer)
doesn't make sense. Use 0 instead which produces the same code.
---
libgloss/csky/io-gettimeofday.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libgloss/csky/io-gettimeofday.c b/libgloss/csky/io-gettimeofday.c
index 77f446fb800c..59b1abb8329e 100644
--- a/libgloss/csky/io-gettimeofday.c
+++ b/libgloss/csky/io-gettimeofday.c
@@ -43,7 +43,7 @@ int gettimeofday (struct timeval *tv, void *tzvp)
return -1;
}
parameters[0] = (uint32_t) >v;
- parameters[1] = NULL;
+ parameters[1] = 0;
ret = __hosted (HOSTED_GETTIMEOFDAY, parameters);
__hosted_from_gdb_timeval (>v, tv);
errno = __hosted_from_gdb_errno (parameters[0]);
--
2.39.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] libgloss: csky: fix pointer-to-integer warning
2023-01-13 4:37 [PATCH] libgloss: csky: fix pointer-to-integer warning Mike Frysinger
@ 2023-01-13 10:12 ` Corinna Vinschen
0 siblings, 0 replies; 2+ messages in thread
From: Corinna Vinschen @ 2023-01-13 10:12 UTC (permalink / raw)
To: newlib
On Jan 12 23:37, Mike Frysinger wrote:
> parameters is an array of integers, so assigning NULL (a pointer)
> doesn't make sense. Use 0 instead which produces the same code.
> ---
> libgloss/csky/io-gettimeofday.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libgloss/csky/io-gettimeofday.c b/libgloss/csky/io-gettimeofday.c
> index 77f446fb800c..59b1abb8329e 100644
> --- a/libgloss/csky/io-gettimeofday.c
> +++ b/libgloss/csky/io-gettimeofday.c
> @@ -43,7 +43,7 @@ int gettimeofday (struct timeval *tv, void *tzvp)
> return -1;
> }
> parameters[0] = (uint32_t) >v;
> - parameters[1] = NULL;
> + parameters[1] = 0;
> ret = __hosted (HOSTED_GETTIMEOFDAY, parameters);
> __hosted_from_gdb_timeval (>v, tv);
> errno = __hosted_from_gdb_errno (parameters[0]);
> --
> 2.39.0
Makes sense
Thanks,
Corinna
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-01-13 10:13 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-13 4:37 [PATCH] libgloss: csky: fix pointer-to-integer warning Mike Frysinger
2023-01-13 10:12 ` Corinna Vinschen
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).