[PATCH] Fixes compile failure if REENTRANT_SYSCALLS_PROVIDED and MISSING_SYSCALL_NAMES defined

Markus Eisenmann markus.eisenmann@outlook.com
Thu Jan 16 15:00:35 GMT 2025


Hi!

The attached patch will fix some compiler issues if the macros REENTRANT_SYSCALLS_PROVIDED and  MISSING_SYSCALL_NAMES ...

In case of stdio/fopen.c and stdio64/fopen64.c compiling with a newer compiler like GCC 14.2 will
abort with an error like "implicit declaration of ...", because the open() - as replacement of _open_r (see reent.h) -
isn't declared; I.e., including <fcntl.h> unconditionaly fixes this compile-issue.
Note: Older GCC's are more "relaxed" and - for example GCC 11.3 - does not warn about this implicit declaration ?!

Another similar issue was replacing _rename_r by rename() in stdio/rename.c whitch caused a "forever-
loop" or stack-overflow by recursion - depending on the optimization level.

Best regards from Austria,
Markus
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://sourceware.org/pipermail/newlib/attachments/20250116/5e04f823/attachment.htm>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 0001-Fixes-compile-failure-if-REENTRANT_SYSCALLS_PROVIDED.patch
URL: <https://sourceware.org/pipermail/newlib/attachments/20250116/5e04f823/attachment.ksh>


More information about the Newlib mailing list