Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
common/printf: Define _POSIX_C_SOURCE when using Newlib libc
Newlib's `string.h` declares `strnlen()` function only when _GNU_SOURCE, _DEFAULT_SOURCE or _POSIX_C_SOURCE is defined. Zephyr intentionally disables POSIX declarations by defining _ANSI_SOURCE to avoid conflicts with Zephyr POSIX library and networking subsystem [1]. It's still possible to use `strnlen()` from Newlib, we just need to define _POSIX_C_SOURCE to 200809. [1] zephyrproject-rtos/zephyr#52739 BUG=b:299924239 TEST=zmake build bloonchipper Change-Id: I8cd966cd0097dfc5bf72fb9db6db6e20d96f6dee Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4973835 Commit-Queue: Patryk Duda <[email protected]> Code-Coverage: Zoss <[email protected]> Tested-by: Patryk Duda <[email protected]> Reviewed-by: Sung-Chi Li <[email protected]>
- Loading branch information