Describe the bug
Compilation conflicts on socket API when compiling lwm2m library and CHIP (matter) library. The first uses SOCKET_POSIX_NAMES and the second seems to use BSD ones.
Redefinition of gethostname.
Please also mention any information which could help others to understand
the problem you're facing:
nRF5340DK
Zephyr v3.0.99
nRF Connect SDK 2.0.99
To Reproduce
Steps to reproduce the behavior:
Open light_bulb sample for nRF for exampe
Add CONFIG_LWM2M=y in prj.conf
compilation
Logs and console output
In file included from C:/Users/Romain/Soft/ncs/zephyr/include/zephyr/posix/pthread.h:13,
from C:/Users/Romain/Soft/ncs/zephyr/lib/posix/pthread.c:12:
C:/Users/Romain/Soft/ncs/zephyr/include/zephyr/posix/unistd.h:38:19: error: redefinition of 'gethostname'
38 | static inline int gethostname(char *buf, size_t len)
| ^~~~~~~~~~~
In file included from C:/Users/Romain/Soft/ncs/zephyr/include/zephyr/posix/unistd.h:13,
from C:/Users/Romain/Soft/ncs/zephyr/include/zephyr/posix/pthread.h:13,
from C:/Users/Romain/Soft/ncs/zephyr/lib/posix/pthread.c:12:
C:/Users/Romain/Soft/ncs/zephyr/include/zephyr/net/socket.h:809:19: note: previous definition of 'gethostname' was here
809 | static inline int gethostname(char *buf, size_t len)
Do you have an idea to solve it instead of renaming lwm2m client socket related functions with zsock_ prefix to remove SOCKET_POSIX_NAMES configuration?
Describe the bug Compilation conflicts on socket API when compiling lwm2m library and CHIP (matter) library. The first uses SOCKET_POSIX_NAMES and the second seems to use BSD ones. Redefinition of gethostname.
Please also mention any information which could help others to understand the problem you're facing:
To Reproduce Steps to reproduce the behavior:
Logs and console output
Do you have an idea to solve it instead of renaming lwm2m client socket related functions with zsock_ prefix to remove SOCKET_POSIX_NAMES configuration?