Hi Richard,
I got the riscv toolchain from - git clone --recursive https://github.com/riscv/riscv-gnu-toolchain
The conflict and redefinition errors seen when stdio.h was included in posix_demo.c :
for 1 and 2 by defining the below, we can skip the toolchain definition, but for the other cases 3,4 and 5 i did not see that option.
#define _CLOCKID_T_DECLARED
#define __clockid_t_defined
#define _CLOCK_T_DECLARED
#define __clock_t_defined
1
…/Source/lib/include/FreeRTOS_POSIX/sys/types.h:48:38: error: conflicting types for ‘clock_t’
48 | typedef uint32_t clock_t;
/opt/riscv64/riscv64-unknown-elf/include/sys/types.h:107:19: note: previous declaration of ‘clock_t’ was here
107 | typedef CLOCK_T clock_t;
2
…/Source/lib/include/FreeRTOS_POSIX/sys/types.h:57:38: error: conflicting types for ‘clockid_t’
57 | typedef int clockid_t;
/opt/riscv64/riscv64-unknown-elf/include/sys/types.h:199:21: note: previous declaration of ‘clockid_t’ was here
199 | typedef __clockid_t clockid_t;
3
…/Source/lib/include/FreeRTOS_POSIX/sys/types.h:152:38: error: conflicting types for ‘ssize_t’
152 | typedef int ssize_t;
| ^~~~~~~
/opt/riscv64/riscv64-unknown-elf/include/sys/types.h:184:18: note: previous declaration of ‘ssize_t’ was here
184 | typedef _ssize_t ssize_t;
| ^~~~~~~
4
…/Source/lib/include/FreeRTOS_POSIX/time.h:78:12: error: redefinition of ‘struct timespec’
78 | struct timespec
| ^~~~~~~~
In file included from /opt/riscv64/riscv64-unknown-elf/include/sys/timespec.h:38,
from /opt/riscv64/riscv64-unknown-elf/include/sys/select.h:16,
from /opt/riscv64/riscv64-unknown-elf/include/sys/types.h:50,
from /opt/riscv64/riscv64-unknown-elf/include/stdio.h:61,
from posix_demo.c:83:
/opt/riscv64/riscv64-unknown-elf/include/sys/_timespec.h:45:8: note: originally defined here
45 | struct timespec {
| ^~~~~~~~
5
…/Source/lib/include/FreeRTOS_POSIX/pthread.h:98:8: error: redefinition of ‘struct sched_param’
98 | struct sched_param
| ^~~~~~~~~~~
In file included from /opt/riscv64/riscv64-unknown-elf/include/sys/_pthreadtypes.h:23,
from /opt/riscv64/riscv64-unknown-elf/include/sys/types.h:223,
from /opt/riscv64/riscv64-unknown-elf/include/stdio.h:61,
from posix_demo.c:74:
/opt/riscv64/riscv64-unknown-elf/include/sys/sched.h:48:8: note: originally defined here
48 | struct sched_param {
| ^~~~~~~~~~~
Please see let me know, how to resolve these errors