zephyr/lib
Stephanos Ioannidis 82a902e5ea 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.

Signed-off-by: Stephanos Ioannidis <stephanos.ioannidis@nordicsemi.no>
2022-12-05 11:02:36 +01:00
..
libc lib: newlib: Define _ANSI_SOURCE 2022-12-05 11:02:36 +01:00
open-amp includes: prefer <zephyr/kernel.h> over <zephyr/zephyr.h> 2022-09-05 16:31:47 +02:00
os posix: getopt: move declarations to unistd.h 2022-12-04 14:51:52 +01:00
posix posix: getopt: move declarations to unistd.h 2022-12-04 14:51:52 +01:00
smf lib: smf: fix include 2022-05-25 11:14:18 +09:00
util lib: getopt: rework and extend getopt library 2022-01-06 21:26:59 +01:00
CMakeLists.txt lvgl: move the lvgl glue out of the zephyr tree 2022-02-24 11:51:33 +01:00
Kconfig lvgl: move the lvgl glue out of the zephyr tree 2022-02-24 11:51:33 +01:00