In general these 2 functions are only exposed by the C library if _POSIX_C_SOURCE is set 200809L
But neither of these files (or their build scripts), are setting this macro, causing build warnings (Implicit declaration of function ‘strnlen’) which turn into failures in CI with some libCs.
Both zcbor_encode.c & zcbor_decode.c use
strnlen()
In general these 2 functions are only exposed by the C library if _POSIX_C_SOURCE is set 200809L But neither of these files (or their build scripts), are setting this macro, causing build warnings (
Implicit declaration of function ‘strnlen’
) which turn into failures in CI with some libCs.Setting these macros like for example here: https://github.com/aescolar/zephyr/commit/39537c345ef8c3bb3d21974af0f3f1d83857233c#diff-76744cde2b405317ce908f4f05396673f0728ee80bc90d08e14c346409668d67R10-R11 Is safe and solves this issue.
For failures see for example: https://github.com/zephyrproject-rtos/zephyr/actions/runs/7656771227/job/20865881130?pr=67052#step:12:1648