Merge branch 'change/remove-sys_dirent_h-include' into 'master'

change(newlib): prepare dirent.h to remove

Closes IDF-10675 and LLVM-330

See merge request espressif/esp-idf!41608
This commit is contained in:
Alexey Lapshin
2025-09-02 13:42:18 +04:00
8 changed files with 67 additions and 87 deletions

View File

@@ -93,6 +93,39 @@ Warn when an explicitly defaulted function is deleted by the compiler. That can
C(const C&&) = default; /* Implicitly deleted. */
};
``sys/dirent.h`` No Longer Includes Function Prototypes
-------------------------------------------------------
Issue
^^^^^^
Compilation errors may occur in code that previously worked with the old toolchain. For example:
.. code-block:: c
#include <sys/dirent.h>
/* .... */
DIR* dir = opendir("test_dir");
/* .... */
/**
* Compile error:
* test.c: In function 'test_opendir':
* test.c:100:16: error: implicit declaration of function 'opendir' [-Werror=implicit-function-declaration]
* 100 | DIR* dir = opendir(path);
* | ^~~~~~~
*/
Solution
^^^^^^^^^
To resolve this issue, the correct header must be included. Refactor the code like this:
.. code-block:: c
#include <dirent.h>
/* .... */
DIR* dir = opendir("test_dir");
Picolibc
--------