mirror of https://github.com/RT-Thread/rt-thread
[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:
parent
37fea9d549
commit
f06b0894c4
|
@ -21,16 +21,16 @@ int *pico_get_errno(void)
|
||||||
if (rt_interrupt_get_nest() != 0)
|
if (rt_interrupt_get_nest() != 0)
|
||||||
{
|
{
|
||||||
/* it's in interrupt context */
|
/* it's in interrupt context */
|
||||||
return &__pico_errno;
|
return (int *)&__pico_errno;
|
||||||
}
|
}
|
||||||
|
|
||||||
tid = rt_thread_self();
|
tid = rt_thread_self();
|
||||||
if (tid == RT_NULL)
|
if (tid == RT_NULL)
|
||||||
{
|
{
|
||||||
return &__pico_errno;
|
return (int *)&__pico_errno;
|
||||||
}
|
}
|
||||||
|
|
||||||
return &tid->error;
|
return (int *)&tid->error;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef RT_USING_HEAP
|
#ifdef RT_USING_HEAP
|
||||||
|
|
Loading…
Reference in New Issue