Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[nrf fromlist] lib: newlib: Define _ANSI_SOURCE
This commit updates the Newlib integration to define `_ANSI_SOURCE` in order to prevent Newlib from defining POSIX primitives in its headers when GNU dialect is used (`-std=gnu*`). Newlib `features.h` defines `_DEFAULT_SOURCE` when `__STRICT_ANSI__` is not defined by GCC (i.e. when `-std=gnu*`), which results in the Newlib headers defining POSIX primitives that are in conflict with the POSIX primitives defined by Zephyr. Newlib must not define POSIX primitives unless the feature test macros such as `_POSIX_SOURCE`, `_GNU_SOURCE` and `_DEFAULT_SOURCE` are explicitly defined. Note that `-std=gnu` does not imply `_GNU_SOURCE` or `_DEFAULT_SOURCE` because it is only supposed to instruct the compiler to use the GNU C language dialect (i.e. GNU C language extensions). Refer to the GitHub issue #52739 for more details. Upstream PR: zephyrproject-rtos/zephyr#52740 Signed-off-by: Stephanos Ioannidis <[email protected]>
- Loading branch information