[libc][picolibc] fix llvm compling warning

/home/runner/work/rt-thread/rt-thread/components/libc/compilers/picolibc/syscall.c:24:16: warning: returning 'volatile int *' from a function with result type 'int *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
        return &__pico_errno;
               ^~~~~~~~~~~~~
/home/runner/work/rt-thread/rt-thread/components/libc/compilers/picolibc/syscall.c:30:16: warning: returning 'volatile int *' from a function with result type 'int *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
        return &__pico_errno;
               ^~~~~~~~~~~~~
/home/runner/work/rt-thread/rt-thread/components/libc/compilers/picolibc/syscall.c:33:12: warning: incompatible pointer types returning 'rt_err_t *' (aka 'long *') from a function with result type 'int *' [-Wincompatible-pointer-types]
    return &tid->error;
This commit is contained in:
Meco Man 2023-12-25 21:08:47 +08:00
parent 37fea9d549
commit f06b0894c4
1 changed files with 3 additions and 3 deletions

View File

@ -21,16 +21,16 @@ int *pico_get_errno(void)
if (rt_interrupt_get_nest() != 0)
{
/* it's in interrupt context */
return &__pico_errno;
return (int *)&__pico_errno;
}
tid = rt_thread_self();
if (tid == RT_NULL)
{
return &__pico_errno;
return (int *)&__pico_errno;
}
return &tid->error;
return (int *)&tid->error;
}
#ifdef RT_USING_HEAP